How to operate as root in GUI?

Following the standard recommendation I use my Linux system with a normal account and switch to root only in special cases. When browsing the file system using GUI sometimes an error pops up - `You do not have privelige to view the contents of this folder`. At this point what I have to do is open up the terminal, switch to root using `su`, navigate to that directory and then list the contents using `ls`. This is really tiresome and annoying. Wouldn't it be convenient if you could just right click on a directory or program in the GUI itself and have an option like `Open as Root` or `Run as Root`? Is this possible in Linux? I'm using GNOME 3.4. Edit: Please no answers like directories are unaccessible for a reason. I'm not talking about free access to any directory/program but about authenticating using GUI.


How to get the latest Flash in non-Chrome browsers?

Adobe have recently stopped updating their Flash distribution for Linux. So, version numbers are being frozen at 11.2(.212), and only security updates are being back-ported. I noticed here that Chrome has a "pepper-based Flash player", which has the same version number as the latest Windows and OSX flash players (11.5.31.2 at time of writing). In the last couple of weeks, my favourite watch on-demand TV player (4od - I think is UK only) has stopped working in Firefox and Rekonq; I suspect because of a Flash version check. Chrome plays the videos I want to see; Firefox, Opera and Rekonq do not. So, is it possible to install (and keep up-to-date) this pepper-based flash player in other web-browsers? Or, is there any other way to spoof the version check and play protected content in other web-browsers?


can't get gnome-session working over SSH

I am new to using SSH, so sorry if this question is too rudimentary. To sign into my office computer from my home computer through ssh I go through these two steps: first I login to my office server: `ssh -X myOfficeServerID@myofficeServer` then I sign in to my computer using the local IP: `ssh -X myOfficeComputerID@myOfficeComputerIP`. I want to be able to view my desktop remotely and work with the GUI. This is result of running `gnome-session`:               [myOfficeComputerID@myOfficeComputer]$gnome-session     gnome-session[17491]: WARNING: Unable to determine session: Unable to lookup session information for process '17491'     GNOME_KEYRING_SOCKET=/tmp/keyring-TokklK/socket     SSH_AUTH_SOCK=/tmp/keyring-TokklK/socket.ssh     GNOME_KEYRING_PID=17507          ** (gnome-settings-daemon:17510): WARNING **: You can only run one xsettings manager at a time; exiting          ** (gnome-settings-daemon:17510): WARNING **: Unable to start xsettings manager: Could not initialize xsettings manager.          ** (gnome-settings-daemon:17510): WARNING **: Connection failed, reconnecting...          ** (gnome-settings-daemon:17510): WARNING **: Failed to connect context: Connection refused     Window manager warning: Screen 0 on display "localhost:10.0" already has a window manager; try using the --replace option to replace the current window manager.     Window manager warning: Screen 0 on display "localhost:10.0" already has a window manager; try using the --replace option to replace the current window manager.     Starting Dropbox...Connection failure: Connection refused     pa_context_connect() failed: Connection refused     Done!          (polkit-gnome-authentication-agent-1:17571): polkit-gnome-1-WARNING **: Unable to determine the session we are in: Remote Exception invoking org.freedesktop.ConsoleKit.Manager.GetSessionForUnixProcess() on /org/freedesktop/ConsoleKit/Manager at name org.freedesktop.ConsoleKit: org.freedesktop.ConsoleKit.Manager.GeneralError: Unable to lookup session information for process '17571' org.freedesktop.ConsoleKit.Manager.GeneralError Unable%20to%20lookup%20session%20information%20for%20process%20%2717571%27     system-config-printer-applet: failed to start NewPrinterNotification service          ** (gnome-panel:17538): CRITICAL **: panel_applet_frame_change_background: assertion `PANEL_IS_WIDGET (GTK_WIDGET (frame)->parent)' failed          ** (nm-applet:17578): WARNING **: <WARN>  request_name(): Could not acquire the NetworkManagerUserSettings service.       Error: (9) Connection ":1.261" is not allowed to own the service "org.freedesktop.NetworkManagerUserSettings" due to security policies in the configuration file          Failed to play sound: Not available          ** (gnome-volume-control-applet:17590): WARNING **: Connection failed, reconnecting...          ** (gnome-volume-control-applet:17590): WARNING **: Failed to connect context: Connection refused     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension          ** (gnome-volume-control-applet:17590): WARNING **: Connection failed, reconnecting...          ** (gnome-volume-control-applet:17590): WARNING **: Failed to connect context: Connection refused          ** (gnome-settings-daemon:17510): WARNING **: Grab failed for some keys, another application may already have access the them.          ** (gnome-settings-daemon:17510): WARNING **: Clipboard manager is already running.          ** (gnome-settings-daemon:17510): WARNING **: Connection failed, reconnecting...          ** (gnome-settings-daemon:17510): WARNING **: Failed to connect context: Connection refused     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     failed to create drawable     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension     ^CTraceback (most recent call last):       File "/usr/share/system-config-printer/applet.py", line 434, in <module>         waitloop.run()     KeyboardInterrupt     ** Message: Got disconnected from the session message bus; retrying to reconnect every 10 seconds          (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gtk' was not being monitored by GConfClient 0xda21e0          (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/interface' was not being monitored by GConfClient 0xda21e0          (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/apps/gnome_settings_daemon/gtk-modules' was not being monitored by GConfClient 0xda21e0          (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/font_rendering' was not being monitored by GConfClient 0xda21e0          (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/sound' was not being monitored by GConfClient 0xda21e0     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     [myOfficeComputerID@myOfficeComputer ~]$      (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/peripherals/mouse' was not being monitored by GConfClient 0xda21e0     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)     ^C      These commands keep on continuing non stop until I press ^C as you saw in the commands:               Initializing nautilus-gdu extension     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0     Shutting down dropbox extension     Shutting down nautilus-open-terminal extension     Shutting down nautilus-gdu extension      In the mean while things like `firefox` run from my office computer but the bottom panel won't stop loading things.


How to chroot into busybox environment?

i have a filesystem build with buildroot, to compile code for a device using a old kernel and uClibc. Now i want to `chroot` into the fs. The problem is, i dont have `/bin/bash`, just `/bin/busybox`.   How do i say chroot to use `busybox ash` instead?   I already tried to create a link to `busybox ash`, but chroot still says `failed to run command /bin/bash. no such file or directory`.


Can't install driver in Arch

I'm using Arch Linux, kernel 3.5.3 on a MacBook. I'm trying to get the keyboard backlight working. I found the driver in the AUR: http://aur.archlinux.org/packages.php?ID=25467, but I'm having trouble compiling it. When I run `makepkg` i get:               ==> Making package: nvidia-bl 0.16.7-1 (Sat Sep  1 03:23:25 UTC 2012)     ==> Checking runtime dependencies...     ==> Installing missing dependencies...     Password:      target not found: kernel26<2.6.34     ==> ERROR: 'pacman' failed to install missing dependencies.      I'm a new Linux user. Does this mean that I need to downgrade my Linux version to use this driver?


Would it be possible to not have the network link cycled on loading the kernel module?

Using some cheap hardware in a thin-client setup we use a diskless PXE booting a small Linux kernel. Currently, it takes a quite some time to boot it fully up and we're looking into some optimizations here. The biggest pain now is the network link initialization by the kernel. During the initialization of the PXE Option ROM it acquires a link, IP address and options which PXELinux uses to do do the TFTP action to load the kernel and a small initrd. While loading the kernel, or more specifically the ethernet kernel module, it recycles the link and does re-negotiation with the switch. We've timed this to be at least four seconds on the hardware we have here. In an enterprise environment this can take quite some additional time on the switch before it is able to talk to the rest of the network (e.g. Cisco without portfast). All this and has to be walked through twice from the point one hits the power button. Avoiding it the second time would be of great value here. Summarizing: would it be possible to have the Linux network (ethernet) driver to not touch the link state it acquired by the PXE boot subsystem? Also, if this is only valid for specific hardware, I would be quite interested to know about it. edit: The module `jme` involves just these three module parameters:               parm:  force_pseudohp:Enable pseudo hot-plug feature manually by driver            instead of BIOS. (int)     parm:  no_pseudohp:Disable pseudo hot-plug feature. (int)     parm:  no_extplug:Do not use external plug signal for pseudo hot-plug. (int)      Looking at the source code there's no condition for running the reset link function when initializing the hardware. (specifically, `.ndo_open` -> `jme_open` -> unconditional `jme_reset_link(jme);`)


In my secure log there is a new group added that Im unsure about after adding semanage

I installed `semanage` onto my `CentOS 6.2` box and I was going through my secure log after the install and noticed this entry:               Aug 31 22:12:17 xxxx groupadd[12929]: group added to /etc/group: name=cgred, GID=489     Aug 31 22:12:17 xxxx groupadd[12929]: group added to /etc/gshadow: name=cgred     Aug 31 22:12:17 xxxx groupadd[12929]: new group: name=cgred, GID=489      I couldn't find any info on the group `cgred` I did find this Arch Linux Wiki article about Control Groups, is that what this is? Just looking for info to make sure I know what is going on with my box.


virtualenv type tool for apt-get?

Is there anyway or any popular tool that can allow me to create an isolated package environment for apt-get similar to what virtualenv does for pip and python packages?


GCC compilation - where the __stack_chk_fail@GLIBC_2.4 symbol comes from?

I'm using GCC 4.7.2 from devtoolset package on CentOS 5 (CentOS 5 because we need compatibility with old Linuxes, and GCC 4.7 because it optimizes better than 4.4). There is one symbols that prevents my binaries from running on RHEL4: `__stack_chk_fail@GLIBC_2.4`. It is included only in some C++ programs and the `-fno-stack-protector` flag doesn't help. Here is minimal program that reproduces the problem (but the same using `stdio.h` works):               #include <iostream>     int main(int argc, char *argv[]) {         for(int i=0; i < argc; i++)             std::cout << " " << argv[i];         return 0;     }      When compiled with optimization (`-O`/`-O2`) it references `__stack_chk_fail`.               $ g++ -fno-stack-protector -O2 foo.cc     $ readelf -s a.out | grep chk         15: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@GLIBC_2.4 (5)        105: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@@GLIBC_2      Any idea why this symbol gets here and how to get rid of it? Just in case, full `readelf` output and `gcc -v` is here. Edit: This problem may be specific to Red Hat Developer Toolset 1.1. With default CentOS compiler `__stack_chk_fail` is not referenced.


Actively developed text browser

I am looking for "the modern" lynx/links/elinks fork or equivalent that's actively maintained and can be considered the most advanced of the genre, please. I have looked at this already: http://web- browsers.findthebest.com/compare/18-25-26/ELinks-Web-Browser-vs-Lynx-Web- Browser-vs-Links-Web-Browser This question is similar to this http://stackoverflow.com/questions/604666/elinks-or-lynx but allows consideration of other programs as well.


Renaming file in scripts

I want to rename `IGNORE_NAMES_20140606-2014-06-06.txt` file to `IGNORE_NAMES_20140606.txt`. I don't want to use the command below as I want to do it through a shell script.               cp -p IGNORE_NAMES_20140606-2014-06-06.txt IGNORE_NAMES_20140606.txt


Why can't root execute when executable bits are not set?

`root` user _can_ write to a file even if its `write` permissions are not set. `root` user _can_ read a file even if its `read` permissions are not set. `root` user _can_ `cd` into a directory even if its `execute` permissions are not set. `root` user _cannot_ execute a file when its `execute` permissions are not set. Why?               user$ echo '#!'$(which bash) > file     user$ chmod 000 file     user$ ls -l file     ---------- 1 user user 12 Jul 17 11:11 file     user$ cat file                      # Normal user cannot read     cat: file: Permission denied     user$ su     root$ echo 'echo hello' >> file     # root can write     root$ cat file                      # root can read     #!/bin/bash     echo hello     root$ ./file                        # root cannot execute     bash: ./file: Permission denied


What does "while test $# -gt 0" do?

I'm trying to create a function and believe I found a good working example but I don't understand all the logic behind it. More specifically, on the "while" line, could someone explain what test is and does? what is $# (isn't # a comment char?) and were does the -gt 0 parameter comes from? couldn't find it in the while man page. Here is the example:               function my_function()     {     while test $# -gt 0     do         $     echo "$1"         shift     done     }      Thank you.


Open file with default program and wait until the app is terminated

I want to open a text file from the command line with the default application. During that time the default app is opened, the terminal must be disabled (cannot execute another command). For example, I use KDE and the default `.txt` reader is Kate, then I want to execute `kate test.txt` and the terminal is disabled until I terminate Kate. What I want?   * execute a command that starts the default text editor   * meanwhile the c++ program is waiting at that specific point which executes the command described above   * when the user is ready, saves the document, exit the default text editor(terminates) and the the execution of the c++ program continues


Executing PHP with CronJobs in CentOS 6.4 not working?

So I've spent around 2-3 hours now and some times researching, I found several of the same responses online but none seem to work! I'm trying to execute a PHP script every minute (as a test), but it doesn't work. ![This is crontab in /etc/crontab](http://i.stack.imgur.com/uJNVs.png) I honestly don't see what's wrong with that script. So I've went to check the logs and I get this; > May 1 19:59:01 _namehere_ crond[1112]: ( _system_ ) RELOAD (/etc/crontab) > May 1 19:59:01 _namehere_ crond[1112]: (CRON) bad username (/etc/crontab) I am quite confused, any help would be greatly appreciated! I have LAMP installed and php-cli if that matters. EDIT: I finally made it execute! Thanks to the poster below! However, I now have another problem, I get emailed an error ![enter image description here](http://i.stack.imgur.com/sOpx3.png) My script includes other scripts, when I was on cPanel (shared hosting), it worked perfectly, but now it doesn't, what could be the problem?


Where is the input method configuration file?

My `ibus` input method was broken after an update. So I switched to `fcitx`. Actually, there are a handful IMs installed in my Fedora19 system, e.g. fcitx, ibus, yong, etc. However, I don't know how to configure them. My default IM for `gnome- terminal` is `yong`, `ibus` for `gmrun`. As for `firefox` or `chrome`, I guess they use `ibus` by default, because `GTK_IM_MODULE=ibus`. There are just-work solutions. I can switch IM by right-click-menu in some applications like `gnome-terminal` or `gmrun`. I can also specify IM with `GTK_IM_MODULE`. But how to do it automatically? I know the IM settings have something to do with configuration files like   * `~/.xinputrc`   * `/etc/X11/xinit/xinputrc`   * `/etc/X11/xinit/xinput.d/ibus.conf`   * `/etc/X11/xinit/xinput.d/fcitx.conf`   * `/etc/X11/xinit/xinitrc`   * `/etc/alternatives/xinputrc` The questions are   * How to configure IM properly?   * What configuration files really matter? In which execution order?


tmux, TERM and 256 colours support

# Introduction My question arises from the necessity of understanding **why** I have _now_ (after multiple trials) _Terminal_ and _tmux_ supporting 256 colours and `tput colors` telling me there are only 8 of them. * * * # Background Let's start from the beginning. I'm using a _Ubuntu_ box, _Guake_ , _tmux_ , _Vim_ and I love the theme _Solarized_. They were looking pretty awful, so I decided to enable the 256 colours support and play a bit around. Let's see what happens for my _Terminal_. `tput colors` says there are 8 colours. I personally set them to purple, on the left, and _of course_ on the right we have 2 different shades of blue. `$TERM` says `xterm`. (To have the coloured `ls` I `eval` this in my `.bashrc`.) ![enter image description here](http://i.stack.imgur.com/44TRA.png) _Vim_ also looks fine, despite the fact that I call it with the `256` flag in an environment where 256 colours are **not** supported.               set t_Co=256     let g:solarized_termcolors=256     colorscheme solarized      The only guy who complains about the reduced colour space is _tmux_. Calling `tmux` provides the "wrong" expected results. ![enter image description here](http://i.stack.imgur.com/kIY0Q.png) But calling `tmux` with the `-2` flag makes everything work fine, _magically_. ![enter image description here](http://i.stack.imgur.com/Gxts8.png) Now the only thing that I understand is that `-2` is equivalent of `export TERM=screen-256color` (source). _Guake_ behaves analogously to _Terminal_ and both of them answer `xterm` to the question `echo $TERM`. * * * # Question Basically, does anyone understand why everything works even if it shouldn't?   * _Am I sadistic that I complaining why things work? Maybe._   * _Is there a better reason? Sure: I'd like to fix the appearance of other Ubuntu boxes in my office, and I'd like to understand why things work or don't work._ * * * # Additional experiments Running this script (slightly modified) on my `xterm` provides the following result: 256 colours, but only 16 are displayed correctly. ![enter image description here](http://i.stack.imgur.com/ye7zi.png) Then, changing terminal's profile, also these 16 colours change. ![enter image description here](http://i.stack.imgur.com/qaxQJ.png) More tests are following. From left to right, top to bottom, we have _Solarized_ colour theme, `dircolor` `ansi-dark` and `256dark`, then default ( _Tango_ ) colour scheme, `dircolor` `ansi-dark` and `256dark`. ![enter image description here](http://i.stack.imgur.com/8MF1z.png) **Observation** : in theory the `dircolor` `ansi-dark` on _Solarized_ colour scheme should have match closely the `dircolor` `256dark`. This is not clearly happening for the specific listed files. Instead, this quite happens when in the working directory there are _folders_ , _text files_ and _symbolic links_. **Conclusion** : no much attention as been paid while encoding the `256dark` colours. * * * # Preliminary conclusions `xterm` supports 256 colours, despite what `tput colors` says. Programs can refer to the `ansi` palette (customisable by the user) or define their colours, picking from a total of 256 colours.


Is there any drawback to using "grep -E" instead of plain "grep"?

I understand that **GNU** `grep` without `-E` uses basic regex and that `grep -E` uses extended regex. Is there any harm in using `grep -E` even for situations that would work with plain `grep`?


what process is listening on a given port

I have several problems:   1. some process is attempting to send data and the firewall is rejecting it at the rate it is sending it out   2. firewall logs flood the system (may need to rate-limit the logging)   3. lsof -i :port does not list the process, but there has to be something causing the packets to keep being sent. netstat -patune lists it in the SYN_SENT state not listening The port that it is using does not make sense to me so that is one oddity and the other being how traffic continues to be sent.


How do you give a developer group access to apache, MySQL, php and the webroot?

We have 3 web designers that are currently logging in to our server via root to configure apache and setup websites. I have very basic linux knowledge (I'm a web designer) and have created users and groups via Webmin - but how do you give the group access to:   * Apache (/etc/apache2/)    * MySQL    * PHP   * SSH (rsync etc)   * The webroot They need to be able to transfer files via rsync, upload and dump databases and setup virtual hosts etc. Incase it makes a difference, Virtualmin is also installed on this server - which is a Debain 7 server. I'm obviously using the wrong search terms as I can't find easy, basic info so any pointers in the right direction would be much appreciated. Cheers Ben


Unable to download youtube video

I don't know what happened now but I'm unable to download any youtube video. Earlier it was working properly. I'm working on Ubuntu 13.04               ravbholua@ravbholua-Aspire-5315:~$ youtube-dl http://www.youtube.com/watch?v=ONWvX8ESrsk     [youtube] Setting language     [youtube] ONWvX8ESrsk: Downloading video webpage     [youtube] ONWvX8ESrsk: Downloading video info webpage     [youtube] ONWvX8ESrsk: Extracting video information     Traceback (most recent call last):       File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main         "__main__", fname, loader, pkg_name)       File "/usr/lib/python2.7/runpy.py", line 72, in _run_code         exec code in run_globals       File "/usr/bin/youtube-dl/__main__.py", line 7, in <module>       File "/usr/bin/youtube-dl/__init__.py", line 536, in main       File "/usr/bin/youtube-dl/__init__.py", line 520, in _real_main       File "/usr/bin/youtube-dl/FileDownloader.py", line 475, in download       File "/usr/bin/youtube-dl/InfoExtractors.py", line 80, in extract       File "/usr/bin/youtube-dl/InfoExtractors.py", line 405, in _real_extract       File "/usr/bin/youtube-dl/InfoExtractors.py", line 405, in <genexpr>     KeyError: 'sig'     ravbholua@ravbholua-Aspire-5315:~$


Finding session information about Firefox

I'm currently developing a piece of software whose functionality is dependent upon knowing the state of the current Firefox session running on the user's Ubuntu computer. The information it will need to know the following:   * How many Windows are open?   * How many tabs are there in each window?   * What is the URL currently opened in each tab?   * How far down each tab has the user scrolled? Upon receiving an explicit command from the user, the application will hunt down this information from wherever it resides on the system. The problem is I have no idea where I should program the application to look for this. My first guess was that inspection of the Firefox processes in the kernel would yield the desired information, but I've used the system monitor to watch for additional processes starting up when more windows and tabs are opened, but the only Firefox process it mentions is 'firefox-bin', leading me to conclude that this assumption is incorrect. I'm prepared to do some significant reading if someone could just point me in the right direction, it's just that my time is limited and I can't afford to start poking around inside the kernel in the hope that I stumble across what I'm looking for. Does anyone know how I can find the above information **without** resorting to installing a plugin on Firefox that exports it?


What do the symbols displayed by ls -F mean?

I noticed that if I run ls -F on a directory, some of the entries have a * or a @ after them.               spuder@ubuntu:~$ ls -F /sbin     acpi_available*   getpcaps*           lvmconf*                 ntfscp*        start-stop-daemon*     agetty*           getty*              lvmdiskscan@             ntfslabel*     status@     alsa*             halt@               lvmdump*                 ntfsresize*    stop@     alsactl*          hdparm*             lvmsadc@              spuder@ubuntu:~$ ls -F ~     daq-0.6.1/  examples.desktop       noname-cache.lib  snort-2.9.1/   Templates/     Desktop/    jpgraph-1.27.1/        noname.sch        snortfiles/    Ubuntu One/     Documents/        According to the ls man pages               spuder@ubuntu:~$ man ls     ...     -F, --classify       append indicator (one of */=>@|) to entries     ...      I'm guessing that `@` means symbolic link, What do these other indicators mean ( `*/=>@|` ) ?


Problem mounting my iRiver story HD on Ubuntu

I would like to connect my iRiver Story HD to my ubuntu 12.04 machine but as I connect it I get this error: > Unable to mount Story HD > > Error mounting: mount: wrong fs type, bad option, bad superblock on > /dev/sdb, missing codepage or helper program, or other error In some cases > useful info is found in syslog - try dmesg | tail or so This is what I get with `dmesg`               [58332.932515] usb 2-1.3: USB disconnect, device number 9     [58332.933056] sd 6:0:0:0: [sdb] Synchronizing SCSI cache     [58332.933132] sd 6:0:0:0: [sdb]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     [58349.254839] usb 2-1.3: new high-speed USB device number 10 using ehci_hcd     [58349.535804] scsi7 : usb-storage 2-1.3:1.0     [58350.535209] scsi 7:0:0:0: Direct-Access     iriver   Story EB07       0326 PQ: 0 ANSI: 2     [58350.537099] scsi 7:0:0:1: Direct-Access     iriver   Story SD         0326 PQ: 0 ANSI: 2     [58350.538773] sd 7:0:0:0: Attached scsi generic sg2 type 0     [58350.539178] sd 7:0:0:1: Attached scsi generic sg3 type 0     [58350.548997] sd 7:0:0:0: [sdb] 3243041 512-byte logical blocks: (1.66 GB/1.54 GiB)     [58350.657284] sd 7:0:0:0: [sdb] Write Protect is off     [58350.657291] sd 7:0:0:0: [sdb] Mode Sense: 0f 00 00 00     [58350.767369] sd 7:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     [58350.777168] sd 7:0:0:1: [sdc] Attached SCSI removable disk     [58351.004612]  sdb:     [58351.237097] sd 7:0:0:0: [sdb] Attached SCSI removable disk     [58351.503837] FAT-fs (sdb): codepage cp437 not found     [58362.792082] FAT-fs (sdb): codepage cp437 not found     [58388.066212] FAT-fs (sdb): codepage cp437 not found      and `fdisk -l`               Disk /dev/sdb: 1660 MB, 1660436992 bytes     52 heads, 61 sectors/track, 1022 cylinders, total 3243041 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System      **EDIT** I have already connected it in Windows and it works (just in case somebody assumes it's broken :) ) **EDIT2**               $ sudo file -s /dev/sdb              /dev/sdb: x86 boot sector, mkdosfs boot message display, code offset 0x58,      OEM-ID " mkdosfs", sectors/cluster 8, Media descriptor 0xf8, heads 4, sectors      3243040 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 3161, serial number 0x20,      label: "Story HD   "


Compile Linux Kernel w/ Dynamically (Un)loadable usbserial Module

I've attempted to install drivers for an FPGA device, but require that I remove the `usbserial` module. This happens to be impossible because `usbserial` is a built-in module. It was suggested that I compile a new kernel to make `usbserial` dynamically loadable and unloadable. I'm now trying to compile a custom kernel w/ Fedora. The guide being located here: http://fedoraproject.org/wiki/Building_a_custom_kernel At this moment I am using a GUI to set my kernel options, but I have no idea what options to select and deselect. ![enter image description here](http://i.stack.imgur.com/wcnyJ.png) Any advice would be greatly appreciated.


Why do directories need the executable (X) permission to be opened?

In my CMS, I noticed that directories need the executable bit (`+x`) set for the user to open them. Why is the execute permission required to read a directory?


What does "execute" permission on a folder means?

I have read this topic, which gave me some info but I feel I am not fully getting it. What does the execute permission actually means on a folder? I fully understand what it means on a file, but on a folder... Sorry if that is a RTFM question. I have looked into it, I swear. This is what I found there :               x : execute/search only if the file is a directory        or already has execute permission for some user (X)      Any clarification is much appreciated.


Rationale find command display . directory

I am wondering what the reason or rationale is for the find command to list the current directory ( . ) at some times but not others. When I use ".", I see the current directory in the outer directory but not the inner directory.               $ pwd     /home/me/a          $ find . -exec echo  {} \;     .     ./abc.txt     ./a.txt     ./d     ./d/da.txt      When I give the specific directory, I do not see the current directory.               $ find /home/me/a  -exec echo  {} \;     /home/me/a     /home/me/a/abc.txt     /home/me/a/a.txt     /home/me/a/d     /home/me/a/d/da.txt      Here is how ls sees the situation.               $ ls -lR     .:     total 4.0K     -rw-r--r--. 1 me    0 Oct 20 19:03 abc.txt     -rw-r--r--. 1 me    0 Oct 21 14:56 a.txt     drwxr-xr-x. 2 me 4.0K Oct 21 14:57 d/          ./d:     total 0     -rw-r--r--. 1 me 0 Oct 21 14:57 da.txt


Linux Mint SPDIF Out Not Working

I'm running Linux Mint 15 (Cinnamon) on a computer with a GA-Z68X-UD3H-B3 motherboard. The only issue that I have had is the sound. The analog outs work fine, but I cannot get any sound from the optical out. I have tried several fixes that I have seen, including editing the `alsa-base` modprobe file. Here is the output from `aplay -l`:               **** List of PLAYBACK Hardware Devices ****     card 0: PCH [HDA Intel PCH], device 0: ALC889 Analog [ALC889 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 1: ALC889 Digital [ALC889 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0      Anyone have any ideas?


How do you determine if AIX 5.3 has PERL installed?

Simply put, how do you determine if AIX 5.3 has PERL installed as non-root?


Is it fine to use tail -f on large log files

I would like monitor a large log file (close to 1 GB) for errors. I want this to be close to real time (few seconds delay is fine). My plan is to use `tail -f | grep`. Is there any performance issues with using such a method when running it over a long time, say from zero bytes to 1 GB? Are there any standards practices used for such a monitoring. Note that I would like to do this using standard unix commands available on Solaris 10. If that is possible, my file even rolls over and I have one more problem to sort out :). using `tail -F` (`-follow=name`) is not an option for me because `-F` is not supported in the server I want to run this on. My plan is to use a script which will start this tail and poll on to find if the file is rolled over. If yes, then kill the tail and restart it. Any better approach?


How do you display xterm colors with putty/bash?

Putty has this "allow terminal use xterm 256 colour mode" that I'd like to use, but I don't know how. I've been using a `color.sh` script to output echo statements and commands with colors, and I want to do something like that with xterm colors.               #!/bin/bash     ## Specify color to write in using arguments          function --help {     cat << EOF          ERROR: $0 requires a color argument.          USAGE: Changes the color of the text piped into it.          These color arguments are availabe:              ARGUMENT    SHORTCUT         white   ------  w         red ------  r         green   ------  g         yellow  ------  y         blue    ------  b         violet  ------  v         teal    ------  t              bold    ------  bb          The "bold" argument will modify any color.     Use a max of 2 arguments (one color and bold).          EOF     }          function bold {     # make the color bold     BOLD=1\;     }          function white {     COLOR=1     }          function red {     COLOR=31     }          function green {     COLOR=32     }          function yellow {     COLOR=33     }          function blue {     COLOR=34     }          function violet {     COLOR=35     }          function teal {     COLOR=36     }               ## shortcuts     function bb {     bold     }     function w {     white     }     function r {     red     }     function g {     green     }     function y {     yellow     }     function b {     blue     }     function v {     violet     }     function t {     teal     }     function o {     red     bold     }          ## Execution          if [ "$#" = 0 ]     then     --help     fi          while (($#));         do             $1             shift         done          echo -n "["$BOLD""$COLOR"m"     cat     echo -n "[0m"


Debian 7.0 (wheezy) change Keyboard Layout to German

I am struggling with changing the language to German, in the `locale` Settings there is only one available language (American English). I would like to have German and i am not a linux guru.


xargs and vi - "Input is not from a terminal"

I have about 10 `php.ini` files on my system, located all over the place, and I wanted to quickly browse through them. I tried this command:               locate php.ini | xargs vi      But `vi` warns me `Input is not from a terminal` and then the console starts getting really weird - after which I need to press `:q!` to quit `vi` and then disconnect from the ssh session and reconnect to have the console behave normally again. I think that I sort of understand what's happening here - basically the command hasn't finished when `vi` started so the command maybe hasn't finished and `vi` doesn't think that the terminal is in normal mode. I have no idea how to fix it. I have searched Google and also unix.stackexchange.com with poor luck.


emacs dedicated completion window

To prevent confusion, I only run one "window" of emacs and so I use window in the emacs sense. I'm looking to get a window split which, let's say 70 in width, contains the completions buffer on the new split when I start emacs. I think I need to have a dedicated window. What I'm basicly trying to achieve is the following.                +-----+---+      |     | A |      |     |---|      |  C  | B |      +-----+---+      C = where I normally work. A = the completion buffer (also I would like to have messages and everything that emacs throws at me there) B = a shell. I have now the following added for this purpose in my .emacs:               (split-window-horizontally)   ;; want two windows at startup      (other-window 1)              ;; move to other window     (shell)                       ;; start a shell     (other-window 1)              ;; move back to first window       I would like to split the right window another time vertically and I would like to be able to specify the dimensions of each window. Also, I would like to have the dedicated property of the completions, messages, ... window (A) to be true so that emacs doesn't replace it. I've heard that a lot of people use this setup but I can't seem to find it anywhere.


Where are the command-line options to perl documented?

On StackExchange I came across a command that looked like this:               perl -pe ...      Curious what the `-pe` options meant, I did `man perl`. This is the synopsis of that man page:               perl [ -sTtuUWX ]      [ -hv ] [ -V[:configvar] ]      [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]      [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]             [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]      [ -C [number/list] ]      [ -S ]      [ -x[dir] ]      [ -i[extension] ]             [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...      However, the man page does not explain what any of the options `sTtuUWXhvcwpnafS` do. Instead it refers you to `perldoc`. However, I can't seem to find any reference to the actual command line arguments in `perldoc`. Where are they actually documented? Is there some secret linux documentation information retrieval method I am unaware of here? On a side note/rant, is the fact that I can't find this information an indication of a failing in the perl documentation? I am happy to read the documentation rather than just ask questions online, but I swear finding my answer in the documentation can be near impossible at times! Graarh! /rant


Trailing slashes on symbolic links to directories

I'm trying to emulate the process of path resolution (see man page path_resolution) in unix-like systems. My OS is Linux with GNU coreutils 8.7. In order to clarify the meaning of extra trailing '/' in resolution, I did following things in a shell:               mkdir this_is_dir     ln -s this_is_dir this_is_link     rm this_is_link      Everything was fine, because this_is_link is a symlink, and I just removed it away. But while trying:               mkdir this_is_dir     ln -s this_is_dir this_is_link     rm this_is_link/      It echoed `rm: cannot remove 'this_is_link/': Is a directory` Well, the trailing '/' caused following of symlink, I thought. So, I tried another command: `rmdir this_is_link/` And a funny result came out: `rmdir: failed to remove 'this_is_link/': Not a directory` Not what I expected. So I asked my friend to confirm if the same result could be obtained on his system. He had a lower version of coreutils than I had. And the result was amazing, **no matter`rm` or `rmdir 'this_is_link/'`, the same error `Not a directory` occurs**. And another friend just tried it out on his Mac OS, the result is: **`rm` => 'Is a directory', `rmdir` => the directory is successfully deleted, the link remained**. Are there any spec about the **exact** behavior of path resolution?


portsentry and IPTables on constant reboot, but not sure why

I have been doing some hardening on a new server [ centos 5.7 final ] i also have logwatch and seem to be getting these strange logs               Commands Run:     User root:        /sbin/service portsentry restart >/dev/null && /sbin/service iptables restart >/dev/null: 72 Time(s)      Then the portsentry log is:               --------------------- PortSentry Begin ------------------------                 Ignored following ports     Advanced Stealth:        TCP: ports: 21-22 25 53 80 110-111 113 135 137-139 443 932          Excluded following ports     Advanced: ports: 21-22 25 53 80 110 113 135 137-139 443          **Unmached entries**     72 Time(s): adminalert: Advanced mode will monitor first 1024 ports     72 Time(s): adminalert: ERROR: Socket 111 is in use and will not be monitored. Attempting to continue     72 Time(s): adminalert: Going into stealth listen mode on UDP port: 1     72 Time(s): adminalert: Going into stealth listen mode on UDP port: 111     72 Time(s): adminalert: Going into stealth listen mode on UDP port: 137     72 Time(s): adminalert: Going into stealth listen mode on UDP port: 138     etc etc ......   then     144 Time(s): adminalert: PortSentry 1.2 is starting.     144 Time(s): adminalert: PortSentry is shutting down     144 Time(s): securityalert: PortSentry is shutting down           ---------------------- PortSentry End -------------------------       I am a little puzzled to say the least, if i log on and start portsentry manually i get an okay for the close and an okay for the start, so i can get it to run, just cant seem to stop it from starting and stopping after that. I have looked in crontab and there is no repeating entry for the first section [ commands run] this log is from cron. If anyone else has come accross this, or can give me a clue then that would be great. thanks


Can one PC be used by two users at the same time via dual-monitor?

Since modern PCs can use two screens at the same time I wonder if it is possible to plug in two keyboards and mouses as well to have the two screens run two (more or less) independent X-sessions at once?


How can I set up multiseat/separate X sessions with gnome 3?

With classic Gnome, if one had two monitors, one could set up "separate X sessions" for each monitor. In this configuration, each monitor had a separate user login session and application windows were captive to the X session they were launched from. Is something similar possible with Gnome 3? If so, how do you go about setting it up?


Error when building bfilter

I tried to build bfilter from source, but get the following error:               make  all-recursive     make[1]: Entering directory `/home/myuser/Downloads/bfilter-1.1.4'     Making all in binreloc     make[2]: Entering directory `/home/myuser/Downloads/bfilter-1.1.4/binreloc'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/myuser/Downloads/bfilter-1.1.4/binreloc'     Making all in foundation     make[2]: Entering directory `/home/myuser/Downloads/bfilter-1.1.4/foundation'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/myuser/Downloads/bfilter-1.1.4/foundation'     Making all in boost     make[2]: Entering directory `/home/myuser/Downloads/bfilter-1.1.4/boost'     Making all in libs     make[3]: Entering directory `/home/myuser/Downloads/bfilter-1.1.4/boost/libs'     Making all in regex     make[4]: Entering directory `/home/myuser/Downloads/bfilter-1.1.4/boost/libs/regex'     make[4]: Nothing to be done for `all'.     make[4]: Leaving directory `/home/myuser/Downloads/bfilter-1.1.4/boost/libs/regex'     Making all in program_options     make[4]: Entering directory `/home/myuser/Downloads/bfilter-1.1.4/boost/libs/program_options'     /bin/bash ../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../.. -I../../../boost -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DNDEBUG  -Os -Wall -Wno-unused -pthread -MT config_file.lo -MD -MP -MF .deps/config_file.Tpo -c -o config_file.lo `test -f 'src/config_file.cpp' || echo './'`src/config_file.cpp      g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../boost -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DNDEBUG -Os -Wall -Wno-unused -pthread -MT config_file.lo -MD -MP -MF .deps/config_file.Tpo -c src/config_file.cpp -o config_file.o     In file included from ../../../boost/boost/mpl/apply.hpp:23:0,                      from ../../../boost/boost/iterator/iterator_facade.hpp:34,                      from ../../../boost/boost/program_options/eof_iterator.hpp:9,                      from ../../../boost/boost/program_options/detail/config_file.hpp:17,                      from src/config_file.cpp:10:     ../../../boost/boost/mpl/apply_wrap.hpp:81:31: error: missing binary operator before token "("     ../../../boost/boost/mpl/apply_wrap.hpp:173:31: error: missing binary operator before token "("     In file included from ../../../boost/boost/mpl/bind.hpp:27:0,                      from ../../../boost/boost/mpl/lambda.hpp:18,                      from ../../../boost/boost/mpl/apply.hpp:25,                      from ../../../boost/boost/iterator/iterator_facade.hpp:34,                      from ../../../boost/boost/program_options/eof_iterator.hpp:9,                      from ../../../boost/boost/program_options/detail/config_file.hpp:17,                      from src/config_file.cpp:10:     ../../../boost/boost/mpl/apply_wrap.hpp:81:31: error: missing binary operator before token "("     ../../../boost/boost/mpl/apply_wrap.hpp:173:31: error: missing binary operator before token "("     In file included from ../../../boost/boost/mpl/lambda.hpp:18:0,                      from ../../../boost/boost/mpl/apply.hpp:25,                      from ../../../boost/boost/iterator/iterator_facade.hpp:34,                      from ../../../boost/boost/program_options/eof_iterator.hpp:9,                      from ../../../boost/boost/program_options/detail/config_file.hpp:17,                      from src/config_file.cpp:10:     ../../../boost/boost/mpl/bind.hpp:364:31: error: missing binary operator before token "("     ../../../boost/boost/mpl/bind.hpp:531:31: error: missing binary operator before token "("     In file included from ../../../boost/boost/mpl/lambda.hpp:22:0,                      from ../../../boost/boost/mpl/apply.hpp:25,                      from ../../../boost/boost/iterator/iterator_facade.hpp:34,                      from ../../../boost/boost/program_options/eof_iterator.hpp:9,                      from ../../../boost/boost/program_options/detail/config_file.hpp:17,                      from src/config_file.cpp:10:     ../../../boost/boost/mpl/aux_/full_lambda.hpp:230:31: error: missing binary operator before token "("     In file included from ../../../boost/boost/iterator/iterator_facade.hpp:34:0,                      from ../../../boost/boost/program_options/eof_iterator.hpp:9,                      from ../../../boost/boost/program_options/detail/config_file.hpp:17,                      from src/config_file.cpp:10:     ../../../boost/boost/mpl/apply.hpp:138:31: error: missing binary operator before token "("     make[4]: *** [config_file.lo] Error 1     make[4]: Leaving directory `/home/myuser/Downloads/bfilter-1.1.4/boost/libs/program_options'     make[3]: *** [all-recursive] Error 1     make[3]: Leaving directory `/home/myuser/Downloads/bfilter-1.1.4/boost/libs'     make[2]: *** [all-recursive] Error 1     make[2]: Leaving directory `/home/myuser/Downloads/bfilter-1.1.4/boost'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/home/myuser/Downloads/bfilter-1.1.4'     make: *** [all] Error 2      Any idea how to fix this?


How does connlimit in iptables supposed to work?

I wanted to set a limit to the number of concurrent connections allowed on my web server. I tried the following rules on an iptables (v1.4.19.1) kernel 3.14.4-200.fc20.x86_64 with a default DROP policy for the INPUT chain under `filter` table:               -A INPUT -p tcp --dport 80 -m connlimit --connlimit-upto 10 -j WEB     -A WEB -j ACCEPT      Then, I hit the server with 50 concurrent connections using apache benchmark:               $ ab -kc 50 -t 10 http://mysite.com/      But, when I look at my server access log, I can still see a few hundred lines of successful requests. I am expecting the `connlimit` rule to kick in and drop all connections. Is there something wrong with my rules or my interpretation of concurrent connections?


Booting using initramfs instead of uramdisk

I am working on Zynq Microzed board. It is booting perfectly with uramdisk.image.gz but I trying to boot it with initramfs.cpio. In this regard I have made following changes in header files of u-boot: **zynq_common.h** and **zynq_common.h.save** changes are as follows **"ramdisk_image=uramdisk.image.gz\0"** to **"ramdisk_image=initramfs.cpio\0"** in both the header files I am getting following log messages![enter image description here](http://i.stack.imgur.com/JGXD0.png) It is still looking for uramdisk.image.gz and giving an error **Wrong Ramdisk Image Format** **Ramdisk image is corrupt or invalid** I am unable sought out where I am getting wrong and how to resolve it.


Which steps I have to follow to configure Ubuntu server with Mac and Windows workstations?

I've recently installed Ubuntu Server 10.04. I already have configured the basics and now I want to associate Windows and Mac OSX machines with the users created on Ubuntu so that when I login in one of these machines, the network be configured automatically with user home directory and permissions. Currently the network is working with Samba, and the login is typed when a try to access the server. So, what I need now is the login associated with workstations initial login prompt. Also, in Mac machines I want to automatically mount the network when I login. I will appreciate if someone provide me some resources and best practices to do such a thing.


How to configure a catch-all CNAME on Ubuntu Linux using BIND 9

I'm trying to set up APE server on my local system. I'm using Ubuntu and BIND and I need to set up a catch-all `CNAME` record. What would be required for this?


Debian - Stripped down Automated Install Disc

I want to create a debian install disc that only installs the minimum software to get a web browser such as ice weasel to run in an x-windows environment. **Question: How can I make an stripped down automated install disc for Debian?** The other option is to use the automated install option and script removing unneeded software after install, but that seems like the wrong way to go.


How to run Abinit via MPI?

I'm trying to run Abinit in parallel, since in sequential mode it takes too much time. I have followed all steps in the abinit tutorials to run it in parallel, and they say to use OpenMPI, but I couldn't manage to get it working (it just runs on one of my 8 cores). I also followed this tutorial, but it stills run on 1 core only Looking at the logs, I finally found something that could be the problem: > Your architecture is not able to handle 16, 8, 4 or 2-bytes FORTRAN file > record markers!   >  You cannot use ABINIT and MPI/IO.   >  MPI_ERROR_STRING: Unknown error. Please file a bug report.   >  ABINIT   >  application called MPI_Abort(MPI_COMM_WORLD, 13) - process 0 Googling doesn't help; my architecture should be able to run in parallel because I can run in parallel with the Windows version of abinit. What can I do to make it work?


Download using wget to a different directory than current directory

I need to use `wget` to download a file to the directory `/var/cache/foobar/` (so, as an example, if I download `stackexchange-site-list.txt`, it'd be downloaded to `/var/cache/foobar/stackexchange-site-list.txt`) Is this possible? `curl` would also be an option, but I'd prefer to not use `curl`, since it's not installed by default.


Sometimes no sound in flash videos after boot?

Sometimes after I boot up the machine, I get no sound in flash videos. First I didn't know why it was happening, but as I read a few articles here and there, I found out it was because of my USB webcam (logitech) - ALSA was messing something up and didn't know how to handle sound drivers well (so they say). So one of the suggestions I found was to force the (in my case) `snd_hda_intel` module load before `snd_usb_audio` module during the boot process. I thought it worked, but after a while the same problem appeared again. If I just unplug the webcam from my computer, sound works perfectly on each boot, but I don't want to get down and insart the cam everytime I need it... Anyone have any suggestions what I should try to fix this?


Half of my software is gone; any way to recover?

I saw a nice program for managing pictures called gThumb. I decided to install it, but it uninstalled half of my programs and my theme altogether. I used Software Center to install it. Why would installing gThumb through Software Center mess up my PC? I'm using Debian 6.0.3 with Gnome. Even Software Center disappeared from the System menu in gnome panel. I retrieved it by `apt-get install software-center`, and I think it installed it completely, not by updating or installing missing packages. * * * **Edit** : I tried `apt-get -f install` and it didn't work. I checked for programs in package manager but they are not there. They are UNINSTALLED for sure. I reinstalled my system yesterday, so it's fresh now, but I would still like to know what happened.


Where should I place a downloaded tarball?

I have downloaded the ChromePlus tarball and extracted it to my home directory. The extracted folder contains an executable that I can double-click to launch ChromePlus. So I assume I do not need to any extra things to install it. I'm new to Linux. Where should I place the ChromePlus directory? It's currently sitting on my home directory, and it does not look neat. After googling, I thought about `/bin/`, `/usr/bin`, `/usr/lib`. Where is the best place?


Upgrade a 32-bit RHEL installation to 64-bit

I recently encountered an issue where I had installed a 32-bit RHEL 6 server on a system with a 64-bit processor. I did some research and found that RHEL 6.0 has PAE enabled on 32-bit machines, which allows the user to use up to 64 GB of RAM in a 32-bit OS. However, RHEL 6 server 32-bit with PAE still has the limitation that a single process can only have a maximum address space of up to 4 GB. These details could be seen from here and here. So, I wish to upgrade my 32-bit installation of RHEL 6 server to a 64-bit installation. How could I do it without losing any of the data that is already present on the 32-bit machine?


Suse nVidia Driver Problems on 650M + Intel i915

Has anyone succesfully gotten the proprietary nVidia drivers to work on a system with a GT650M and an integrated Intel GPU? I don't need graphics switching, just the discrete GPU. (This is on a mid-2012 Retina MacBook Pro.) I've succesfully gotten the nVidia drivers working on a desktop with two GTX580s, but have had nothing but problems with the laptop. After installing, Suse boots do a tty interface with no desktop. lsmod shows the nvidia driver. rcxdm says that X is running, but that the displays died after ~0.3 seconds. I can roll back to nouveau, but that's the only thing that works. The only thing I've come up with is that the Intel GPU is interfering with the discrete GPU, though that is just a guess. Suggestions?


Oh-My-Zsh overriding my function?

I use ZSH with Oh My Zsh and I am trying to define a function called `git`, as such:               function git() { echo "I'm happy because I am executed!" }      I have placed the function definition in `$ZSH/custom/general.zsh`. Everything else in this file works (I have a bunch of aliases there) except this function. Running `which git` outputs:               git () {         case $1 in             (commit|blame|add|log|rebase|merge) exec_scmb_expand_args "$_git_cmd" "$@" ;;             (checkout|diff|rm|reset) exec_scmb_expand_args --relative "$_git_cmd" "$@" ;;             (branch) _scmb_git_branch_shortcuts "${@:2}" ;;             (*) "$_git_cmd" "$@" ;;         esac     }      Removing `git` from `plugins=( ... )` didn't work. Trying to find this function in Oh My Zsh yielded no results. I read the source code of `oh-my-zsh.sh`, and it seems the `custom` directory is loaded after all of OMZ's files, so it didn't make any sense to me, that when I placed my function **at the bottom of** `.zshrc` it worked. Any Ideas on how to keep the function in the `custom` folder? I would like to keep things organized.


What does "${-#*i}" != "$-" mean?

In `/etc/profile` I see this:               for i in /etc/profile.d/*.sh ; do     if [ -r "$i" ]; then             if [ "${-#*i}" != "$-" ]; then                 . "$i"             else                 . "$i" >/dev/null 2>&1             fi         fi     done      What does `${-#*i}` mean. I cannot find a definition of a parameter expansion starting `${-`.


AppArmor: make it ask me for decision to allow/disallow

I'm having fun writing AppArmor profile for firefox. I like to open downloaded files directly from firefox (by double-click on it), it is really convenient. But then firefox should have permissions to execute applications. Say, for opening pdf files, I should write:               /usr/bin/evince rmix,      And similar rule for opening images, archives, etc. But, I can't predict everything, so, one day firefox will be failed to open some file. I can write something like               /usr/bin/* rmix,      but I don't like that. The best solution to me is to explicitly allow most often used applications (such as `evince`, etc), but for all the rest let AppArmor to ask me interactively. It is better than just denying or allowing. Is that possible?


Systemd fails to start after removal of encrypted swap partition on Fedora 20

In order to resize my boot partition I had to recreate my swap partition. After this systemd does not seem to be able to start. ![screenshot of boot](http://i.stack.imgur.com/lx5Hg.jpg) I am new to Fedora/systemd and don't quite understand where I could tell systemd to ignore the now different UUID of the partition. What I already did is booting a RescueCD, chrooting into my system, commenting the appropriate line in /etc/crypttab and then recreating the initrd with `dracut --force --kver 3.14.3-200.fc20.x86_64` The screenshot shows the situation after these steps. **How do I get my system to boot properly again**?


Change date after SSH login in shell script

I have to change the date after an SSH login into machine, but I am not able to change it. Here is the script I have written:               #!/bin/bash     ENVIRONMENT_LIST=environment_ip_list     USERNAME=root     declare ENVIRONMENT_ARRAY          mdate="$#"          readIp()     {     while read IP         do             ENVIRONMENT_ARRAY[$env_count]="$IP"             let env_count++         done < $ENVIRONMENT_LIST     }     change_date()     {         for ((i = 0; i < env_count; i++))         do             ssh -t -t -o StrictHostKeyChecking=no $USERNAME@${ENVIRONMENT_ARRAY[i]} "'date -s "$1 $2 $3 $4"'"         done     }     readIp     change_date      In a terminal, I get this output:               ~/Desktop/changedate_script $ ./change.sh 04 SEP 2012 10:36:00     root@192.168.12.160's password:      bash: date -s  : command not found     Connection to 192.168.12.160 closed.


NFS Mounting Error

From ServerA I shared directory `/u001/app/oracle/FolderA` and trying to mount this on SeverB under `/media` Contents of ServerA `/etc/exports` file               /u001/app/oracle/FolderA      ServerB(rw,sync)      When I try to mount it on ServerB I receive this message on ServerB               mount: mount to NFS server 'ServerA' failed: timed out (retrying).     mount: mount to NFS server 'ServerA' failed: timed out (retrying).     mount: mount to NFS server 'ServerA' failed: timed out (retrying).     mount: mount to NFS server 'ServerA' failed: timed out (retrying).     mount: mount to NFS server 'ServerA' failed: timed out (giving up).      `rpcinfo -P` output:               program vers proto   port         100000    2   tcp    111  portmapper         100000    2   udp    111  portmapper         100024    1   udp    953  status         100024    1   tcp    956  status         100011    1   udp    924  rquotad         100011    2   udp    924  rquotad         100011    1   tcp    927  rquotad         100011    2   tcp    927  rquotad         100003    2   udp   2049  nfs         100003    3   udp   2049  nfs         100003    4   udp   2049  nfs         100021    1   udp  13495  nlockmgr         100021    3   udp  13495  nlockmgr         100021    4   udp  13495  nlockmgr         100003    2   tcp   2049  nfs         100003    3   tcp   2049  nfs         100003    4   tcp   2049  nfs         100021    1   tcp  15597  nlockmgr         100021    3   tcp  15597  nlockmgr         100021    4   tcp  15597  nlockmgr         100005    1   udp    938  mountd         100005    1   tcp    941  mountd         100005    2   udp    938  mountd         100005    2   tcp    941  mountd         100005    3   udp    938  mountd         100005    3   tcp    941  mountd      `/var/log/messages`:               Oct 28 17:16:21 kernel: nfsd: last server has exited     Oct 28 17:16:21 kernel: nfsd: unexporting all filesystems     Oct 28 17:16:22 kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory     Oct 28 17:16:22 kernel: NFSD: starting 90-second grace period     Oct 28 17:17:28 mountd[4143]: Caught signal 15, un-registering and exiting.     Oct 28 17:17:29 kernel: nfsd: last server has exited     Oct 28 17:17:29 kernel: nfsd: unexporting all filesystems     Oct 28 17:17:29 kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory     Oct 28 17:17:29 kernel: NFSD: starting 90-second grace period     Oct 28 17:21:15 kernel: FS-Cache: Loaded      Any help will be awesome......


How to remove all default gateways

I'm running a custom built linux machine, so **not all linux commands are available**.   I execute network related commands, so I need to **set a default gateway** right before I run my command, then remove that gateway immediately afterward. To do that I run all my commands in one line:               /sbin/route add default gw 10.10.10.10;my command;/sbin/route del default gw 10.10.10.10;      The problem is, for some reason I once found 2 default gateways on the same machine which caused all my commands to fail because even if I set my default gateway before running my test, it is still messed up and can't run my test. So is there a way to **remove ALL default gateways in one command** ? I have a large amount of machines that are increasing and it won't be practical to plant a script on every machine. I need a command as **simple** as the following:               /sbin/route del all default;set my default gw;mycommand;/sbin/route del all default;      All I have found so far is a command to remove **a** default gateway but not all of them `/sbin/route del default` which won't work for me. `/sbin/route` help displays the following               /sbin/route --help          Usage: route [{add|del|delete}]          Edit the kernel's routing tables          Options:             -n      Dont resolve names             -e      Display other/more information             -A inet Select address family      Thank you.


how to add a description in footer

I enjoy learning how to modify files with `awk`, `sed`, and bash. However, I know it could cause issues down the road and I would like to be prepared with a log _inside the file_. I was thinking about how I could create a log in the footer after I modify an `.html` file but I am unsure how or what the process is called. I would like to be able to do as follows:               line break after the very last line of code     comment tag       **Example:**
This is before script


the difference between /var/adm/btmp, /etc/btmp and var/log/btmp

I need to know that users are correctly managing their bad login attempts. But I don't know which of these files is keeping track of this information.


ssh-agent defunct from the start

140 root      4029  3997  0 09:01 ?        00:00:00  \_ /usr/sbin/gdm-binary -nodaemon     141 root      4034  4029  1 09:01 tty7     00:00:01      \_ /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7     142 myusername  4052  4029  0 09:01 ?        00:00:00      \_ /usr/bin/gnome-session       143 myusername  4116  4052  0 09:01 ?        00:00:00          \_ [ssh-agent] <defunct>      This is how it starts up; I've tried killing and restarting the gnome session and box, but this continues to happen, and the zombie process is blocking further connections on my auth. agent. I've got no clue what is causing this nor how to fix it. Any suggestions are welcome. This is on RHEL6.


What exactly is POSIX?

I see POSIX mentioned often and everywhere, and I had assumed it to be the baseline UNIX standard.. until I noticed the following excerpt on a Wikipedia page: _The Open Group_ > The Open Group is most famous as the certifying body for the UNIX trademark, > and its publication of the _Single UNIX Specification technical standard_ , > **_which extends the POSIX standards and is the official definition of a > UNIX system_**. If the official definition of a UNIX system is an extension of POSIX, then what exactly is POSIX? ,,, It surely seems to be a touchstone of the UNIX world, but I don't know how it fits into the overall picture.


What is Unix now?

As I read in Wikipedia, Unix started as a revolutionary operating system written mostly in C allowing it to be ported and used on different hardware. Descendants of Unix is mentioned next, mostly BSD. Clones of Unix, Minix/Linux are discussed as well. But what happened to the original Unix operating system? Does it exist as an operating system any more or is it nothing more than a standard like POSIX nowadays? Do note that I am aware of this answer but it has no mention of the fate of the original Unix beyond the derived works.


Which Unix is considered the vanilla Unix and which Unix's are just Unix rather than Unix-like?

> **Possible Duplicate:**   >  What exactly is POSIX?   >  What is Unix now? Are they only the Unix’s developed by Bell Labs or do the SCO ones count too? Are there others?


setfacl incorrectly changes group permissions

To backup the "/home" directory tree of a server, I've created a 'backup' account and used setfacl to make the whole directory readable by it. My cron job runs this command as root each night:               setfacl -R -m u:backup:rx,d:u:backup:rx /home      Great, except for one problem: whenever I run this command, it changes the group permissions of my ssh key.               me@myserver:~/.ssh$ ls /home/me/.ssh/id_rsa -l     -rw-r-x---+ 1 me me 1679 Jan  8 18:35 /home/me/.ssh/id_rsa      Well, this causes my ssh program to barf because it is now group readable. Strangely, getfacl disagrees with the permissions.               me@myserver:~/.ssh$ getfacl /home/me/.ssh/id_rsa     getfacl: Removing leading '/' from absolute path names     # file: home/me/.ssh/id_rsa     # owner: me     # group: me     user::r--     user:backup:r-x     group::---     mask::r-x     other::---      getfacl thinks the file is not group readable. If I run the obvious command               chmod 400 id_rsa      the permission is fixed, but reverts every time I re-run the original command (setfacl -R -m u:backup:rx,d:u:backup:rx /home). What's going on? Note: I do want my id_rsa to backup up, so let's not worry about those security implications.


How do I get rid of horizontal split in dwm

I started using `dwm` today and am trying to wrap my head around it, as `OpenBox` is my only other exposure to window managers. As suggested in the official tutorial, I first opened couple of terminals and they all got tiled, with the first terminal being pushed to left, which I understand is the master. I played with the default keybindings and opened and closed many windows and programs. I spent quite a bit of time trying to get what tags are and how to use them. After a while came back to tag 1 and see that the windows, though in tiled mode, somehow changed to a horizontal split like this: ![image showing dwm](http://i.stack.imgur.com/c6k5H.png) Any and all new windows are added horizontally. ![image showing dwm](http://i.stack.imgur.com/ahA1l.png) I don't see any specific keybinding for changing layout of existing windows (like in `tmux`). So, how can I get back the default tiling mode where master is on left and stacks are on right?


Making tcsh history isearch case-insensitive

How do I make tcsh's history isearch (ctrl-r) case insensitive? I tried "set complete=igncase" but that affects file completion, not history isearch.


install rtorrent failed using yum install rtorrent in CentOS

I want to install `rtorrent` as a client (NOT SeedBox). I tried the following command:               yum install rtorrent      I get following message:               Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: centos.mirror.iweb.ca      * extras: centos.mirror.iweb.ca      * updates: centos.mirror.netelligent.ca     Excluding Packages in global exclude list     Finished     Setting up Install Process     No package rtorrent available.     Nothing to do      I think it's because I do not have rtorrent at my repository. What should I do to add rtorrent to my repository? I tried `yum update` without any success.


mint 14 mate: window manager doesn't work after reinstall mate-panel & mate-applets

After doing a               sudo apt-get --purge remove mate-panel mate-applets      and a               sudo apt-get install mate-panel mate-applets      for trying to get rid of a trayicon issue on my system, the mate window manager seems to be not working anymore. after login, I still get a gui, but only a terminal is running in there. Also no panel and menus are available. for this terminal and any other application I'll start, except chromium-browser (brings its own decoration), no window borders shown at all. when I start `mate-control-center`, following errors shown in term               ** (mate-control-center:2116): WARNING **: error raised: [libslab_get_mateconf_value: error getting /desktop/mate/applications/main-menu/lock-down/user_modifiable_apps]          ** (mate-control-center:2116): WARNING **: error raised: [load_xbel_store: couldn't load bookmark file [NULL]          ** (mate-control-center:2116): WARNING **: get_actions_list() - PROBLEM - Can't load gtk-theme-selector.desktop          ** (mate-control-center:2116): WARNING **: get_actions_list() - PROBLEM - Can't load mate-cups-manager.desktop      temporary, a manual start of `mate-panel` & `marco` via console is my workaround to have the system used as good as normal. but I'd like to get the default windowmanager works as expected. I don't know which additional information I should provide at this point.


Wireless in Debian Squeeze

I am trying to get wireless working a lenovo g560. I tried following the instructions on the debian site here http://wiki.debian.org/wl but it is not working. At step 7 I get an error that modprobe does not exist. Anybody know of a straightforward tutorial or got any tips?


Linux on pendrive? Which distro to use?

Terms regarding the OS:   * Must be installed on pendrive   * It must contain software for office use   * Need to save files, GUI settings on it (auto) So I'm not searching for a LiveCD. What could be the best choice?


memory buffering in virtual machines

Is there any point to doing disk buffer caching in a virtual machine, if the hypervisor OS is doing it? I wonder if buffering in the VM will just waste memory that could be better allocated to VM use, or if data read will be buffered both in the hypervisor and in the guest OS. Or is there some system that automatically handles coordination of buffer cache between hypervisor and guest? Should I turn it off in the host machine, or in the VMs?


How can I change the umask for one command only?

How can I interactively execute a command in Linux (zsh, if it matters) with a different umask from the default, for one command only? Perhaps a combination of commands combined in a single line? The new umask should apply only to that command and return to its default value for the next command entered. Ideally the command would be agnostic to the default umask in force before its entered (in other words, the default umask doesn't have to specified).


apache symlinks and dokuwiki

I am running a dokuwiki on an apache webserver. Usually I put media files into the directory /var/lib/dokuwiki/data/media. However, to be more flexible and to save disk space, it would be nice to use symbolic links instead of copying files to that directory. Now my question is: How to make apache to follow symlinks in the directory /var/lib/dokuwiki/data/media.


How to backup dir structure ignoring files & dirs without read permission

Any ideas how to back up a directory structure for which there are some files and/or directories for which you do not have permission to read? I'd like to just ignore those, without backup (tar? jar?) crashing.


find is missing a result -- how is that possible?

What conditions explain this output:               root@ip:/# find / -name "server.xml" -print     /etc/tomcat7/server.xml     root@ip:/# ls /var/lib/tomcat7/conf/server.xml      /var/lib/tomcat7/conf/server.xml      I am running this as root, and starting the find from the root directory. I don't understand why the file I show with the "ls" command isn't coming up in the results. ### Edit output of `mount`:               /dev/xvda1 on / type ext4 (rw)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)      And:               root@ip:/# ls -la /var/lib/tomcat7/conf/     total 196     drwxr-xr-x  4 root root      4096 Apr 29 03:22 .     drwxr-xr-x 95 root root      4096 Apr 29 04:23 ..     drwxrwxr-x  3 root tomcat7   4096 Apr 29 03:22 Catalina     -rw-r--r--  1 root tomcat7   5586 Apr  1 20:32 catalina.properties     -rw-r--r--  1 root tomcat7   1394 Feb 25  2012 context.xml     -rw-r--r--  1 root tomcat7   2370 Jul 12  2012 logging.properties     drwxr-xr-x  2 root tomcat7   4096 Apr 29 03:22 policy.d     -rw-r--r--  1 root tomcat7   6500 Apr  1 20:32 server.xml     -rw-r-----  1 root tomcat7   1530 Feb 25  2012 tomcat-users.xml     -rw-r--r--  1 root tomcat7 152716 Feb 25  2012 web.xml      And:               root@ip-:/# ls -la /var/lib/tomcat7     total 24     drwxr-xr-x  6 root    root    4096 Apr 29 03:22 .     drwxr-xr-x 40 root    root    4096 Apr 29 01:26 ..     drwxr-xr-x  3 tomcat7 tomcat7 4096 Apr 29 03:22 common     lrwxrwxrwx  1 root    root      12 Apr  1 20:32 conf -> /etc/tomcat7     lrwxrwxrwx  1 root    root      17 Apr  1 20:32 logs -> ../../log/tomcat7     drwxr-xr-x  3 tomcat7 tomcat7 4096 Apr 29 03:22 server     drwxr-xr-x  3 tomcat7 tomcat7 4096 Apr 29 03:22 shared     drwxrwxr-x  4 tomcat7 tomcat7 4096 Apr 29 04:20 webapps     lrwxrwxrwx  1 root    root      19 Apr  1 20:32 work -> ../../cache/tomcat7


Programmatically partition disk

I am attempting to create a bash script which will create a new partition with a file system on a disk with existing partition(s). It looks like it's easy to create partitions programmatically with parted, however it requires you to know where to start and stop the new partition, and this is where I am having trouble. I don't want to rely on the disk having partitions in particular position/size. That is, I want to create a new partition starting immediately after the last existing one. I want to be able to then create the partition either of a fixed size, or to fill remaining space. In Bash, is there a reliable way of determining a) the end position of the last partition, and   b) the remaining unpartitioned space after the last partition?


How can I disable selection highlight auto-copying?

I've finally found myself at home in Linux, but there is still one thing that has bothered me since the start, and I have not found a realistic solution:      **How do I disable the automatic copying of highlighted text in Linux's desktop environment**      My Desktop Environment is XFCE, Window Manager is Openbox and it's all held together by Archlinux, I do however have these issues in other distributions. Every time I go to replace a section of text I:   Highlight the source then press the usual Control-C   I then select the text I want to replace and since highlighting text automatically copies it to the clipboard, manually reselect from clipman the selection I just copied, and paste it that way. This is very inefficient.   I have resorted, out of desperation to using Windows for heavy editing of Source / Documents.    I would prefer to have copy paste routine identical to that which Windows uses   Select-Control+C-Select-Control+V. **edit**   The problem was _my fault all along_!   I had ignorantly pasted **autocutsel -selection PRIMARY -fork &** into my .xprofile, causing autocutsel to sync all my selections into the PRIMARY clipboard.      For more info


Why -t release don't downgrade the package while package/release does?

When upgrading a package, `-t` or `\--default-release` works wonder:               ➜  ~  sudo apt-get install -t unstable libpam-gnome-keyring     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages will be upgraded:       libpam-gnome-keyring     1 upgraded, 0 newly installed, 0 to remove and 376 not upgraded.     Need to get 284 kB of archives.     After this operation, 22.5 kB disk space will be freed.     (Reading database ... 268717 files and directories currently installed.)     Preparing to unpack .../libpam-gnome-keyring_3.12.0-2_i386.deb ...     Unpacking libpam-gnome-keyring (3.12.0-2) over (3.8.2-2+b1) ...     Setting up libpam-gnome-keyring (3.12.0-2) ...      But when I try to use it to downgrade it doesn't at all:               ➜  ~  sudo apt-get install -t testing libpam-gnome-keyring     Reading package lists... Done     Building dependency tree            Reading state information... Done     libpam-gnome-keyring is already the newest version. ## Why???     libpam-gnome-keyring set to manually installed.     0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.      The only way is to do it is using the `package/target_release` method:               ➜  ~  sudo apt-get install libpam-gnome-keyring/testing     Reading package lists... Done     Building dependency tree            Reading state information... Done     Selected version '3.8.2-2+b1' (Debian:testing [i386]) for 'libpam-gnome-keyring'     The following packages will be DOWNGRADED:       libpam-gnome-keyring     0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.     Need to get 272 kB of archives.     After this operation, 22.5 kB of additional disk space will be used.     Do you want to continue? [Y/n] y     dpkg: warning: downgrading libpam-gnome-keyring from 3.12.0-2 to 3.8.2-2+b1     (Reading database ... 268716 files and directories currently installed.)     Preparing to unpack .../libpam-gnome-keyring_3.8.2-2+b1_i386.deb ...     Unpacking libpam-gnome-keyring (3.8.2-2+b1) over (3.12.0-2) ...     Setting up libpam-gnome-keyring (3.8.2-2+b1) ...      Why doesn't `-t` downgrade packages?


How to print find match as well as run an -exec

I was wanting to run a `find` and then execute a script on each match; however, I was wanting to print the name of the matched file above the output from each `exec`. How can I produce the following output:               $ find . -name 'something' -exec sh script.sh {} \;     ./something_1     output from      script.sh something_1     ./something_2     output from     script.sh something_2      I am currently only getting the output from `script.sh`. I tried `-exec echo {} && sh script.sh {} \;` with no success. I would prefer a solution using `-exec` or `xargs -print0`, i.e., not prone to problems with white space.


Read target of symlink and increment target by one

I have a folder structure that looks like this               /some/folder/1     /some/folder/2     ...      and a symlink `current` that links to one of the folders. Is it possible and when how to read the target of the link, increment the name of the last folder and create a folder with that number, e.g. read the link that points to `/some/folder/2` so I know the last number is `2` and increment this number to create a new folder `/some/folder/3` to store new files? I already have a script that reads the target of the link, but I have no clue how to get the last part of the path (the number) and increment it by one.


Linux: set date through command line

How to change the system date in Linux ? I want to change:   * Only Year   * Only Month   * Only Date   * Any combination of above three


lxc networking quesion

I have a similar requirement to the OP of this thread. I want the following configuration: > -Physical host (PhyHost) reachable from the network at IP 10.1.101.89   >  -LXC container (LxcHost) reachable from the network at IP 10.1.101.95   >  Each contactable from the other. OS = Ubuntu Server 12.04LTS PhyHost /etc/network/interfaces               auto br0     iface br0 inet static         address 10.1.101.89         netmask 255.255.255.0         broadcast 10.0.0.255         gateway 10.1.101.111         pre-up ifconfig eth0 down         pre-up ifconfig eth0 0.0.0.0 promisc up         pre-up brctl addbr br0         pre-up brctl addif br0 eth0         bridge_fd 9         bridge_hello 2         bridge_maxpage 12         bridge_stp off          auto br0:1         address 10.1.101.95         netmask 255.255.255.0         gateway 10.1.101.111          iface eth0 inet manual         pre-up ifconfig eth0 0.0.0.0 promisc up         pre-up brctl addif br0 eth0         pre-down brctl delif br0 eth0         pre-down ifconfig eth0 down      LxcHost /etc/network/interfaces               auto eth0     iface eth0 inet static         address 10.1.101.95         netmask 255.255.255.0         gateway 10.1.101.111     *I added some pre-up route add command here, being away from the system, I have forgotten what I used here*      As it is here the LxcHost was completely isolated and couldn't contact any other host. I added some pre-up route add and post-down commands (hence the note above) that completely escape me right now, but these brought connectivity from LxcHost out to the network. Normally I'd wait till I had all the information correct before posting, but I'm pretty keen to get some suggestions and tips on best practice. lxc.conf used to create container               lxc.network.type=veth     lxc.network.link=br0:1     lxc.network.flags=up     lxc.network.hwaddr=     lxc.network.ipv4=10.1.101.95/24      The behaviour I get from this set up is that PhyHost is contactable from the network (ping, ssh etc) on 10.1.101.89. When I ssh to 10.1.101.95, I find myself logging into PhyHost also. LxcHost can reach the internet, and the network including PhyHost, all hosts (including PhyHost) communicate only with PhyHost at the address 10.1.101.95. Other issues that I've had to address:   * No response to the second IP addess - solved by setting eth0 to promiscuous   * No network connectivity from LxcHost to any - solved with pre-up route commands on LxcHost eth0.


How to build a personnal cluster?

I have a debian server running some services (mail, web, git, mysql...). But it is alone, meaning that if it breaks, I have to repair it to access my services. I'd like to put a second server so that if the first one dies the second one is automatically ready to work. I don't want any of this servers to be a master and the other one a slave. The idea is to prevent hardware failure from any of the two servers. I found lots of info about how to create some big clusters, but I haven't found any thing that imply only two servers.


How does gcc handle file permissions?

The executable files that `gcc` creates have execution permissions               -rwxrwxr-x      which are different than the permissions that the source file has.               -rw-rw-r--      How does `gcc` set these permissions ?


Change currency format to generic number using sed

I am working on a large csv file with all coma separated entries. The entire document is composed of plain numbers, except for a few columns reflecting currencies that are formatted as text. For example, one such entry may look like `"$12,345.67"` and another one like `"$1,234,567.89"` (double quote symbols are also included as part of the entries). Here is an example of a full record (one single line) of data:               123,7,11,"$343,700.14","$34,928.63","$377,000.00","$15,421.92",19,2      I would like to do some processing on this data file and therefore, I want to reformat such text fields to become plain numbers (i.e., getting rid of double quotes and comas). I think a regex pattern replacement with `sed` should do the job for me, but I am not sure what that regular expression looks like at all. Any idea would be much appreciated.


How to change ssh log location from /var/log/secure to custom location in rhel 6?

By default in RHEL 6, SSH server logs are sent to `/var/log/secure`. I want to change this location to a custom one. Is it possible to do that? I have tried modifying the `rsyslog.conf` file, but it does not work.


Is reading a youtube video only for sound possible in command line?

I would like to connect to YouTube and read a video only for audio with commands. Is that possible?


How can I change my username?

My current username is `mpatil`, how can I change that to `algo` without losing data or causing problems?


How do I remove Java from Mint 17?

I got a version of Java 7 lying in `/opt/java/jdk1.7.0_60/` That I don't seem to remember having installed myself. I want to replace it with OpenJDK 8, but I'm afraid I'll break something if I just `rm -rf` the path. What's the proper procedure to remove it? Note that it has `java` and `javac` etc. in `/usr/bin` which makes me even more cautious about the removal procedure.


A unix command to truncate each line of a file

I have a CSV file and I want to truncate it from the third semicolon. For example, if I have this file:               1;foo;bar;baz;x;y;z     2;foo;bar;baz;x;y;z     3;foo;bar;baz;x;y;z      I want to get the following output:               1;foo;bar     2;foo;bar     3;foo;bar      I don't know what kind of Unix command I can use for that. What do you suggest? Note that this manipulation will be done on a KSH script.


Limit stdout from a continuously running process

I haven't had much luck finding an answer to my problem, but maybe I'm not asking for it correctly. I have a process I startup like the following: `nohup ping 127.0.0.1 > log.txt >2>&1 &` Pretty simple command, send all the stdout to log.txt. Only problem is that the command I'm running sends data every nth second to log.txt. I'd like to output just one line to my log.txt file instead of appending it and running the risk of filling my drive up. Is there a way to just output one line to log.txt that continuously gets overwritten?


How simulate a Windows like admin password prompt in Linux?

I use `mint install` application a lot but don't think it is safe if I allow the normal user I use to have full privileges over it. I was wondering if there is a way to gain access to this application only when root password is entered. Basically be able to use something like the admin password prompt of windows when installing a new application in terminal. I know I can log into root with su but I know that's definitely not safe. Any Ideas? Edit: Again, I don't want to give privileges to the normal user using sudo or chmod or anything else.


Flattening a nested directory

This is probably very simple, but I can't figure it out. I have a directory structure like this (dir2 is inside dir1):               /dir1         /dir2             |             --- file1            |             --- file2      What is the best way to 'flatten' this director structure in such a way to get file1 and file2 in dir1 not dir2.


What is the effect of deleting utility manufacturer partitions?

I am about to erase everything off of my hard drive and install Linux Mint I'm doing this on a Dell laptop, there is a Dell utility partition that I have never used... I have seen these on other laptops by other manufacturers as well. What are they used for and what are the consequences for overwriting them?


what is awk '{print $1+0.45 " " $2 " " $3 }' file1> file2?

What does `awk '{print $1+0.45 " " $2 " " $3 }' positionXYZ > positionX0.45YZ` mean? Does it mean changing a row in the first file and put the new data into the second one?


Deleted /tmp accidently

Accidently, I ran `sudo rm -r /tmp`, is that a problem ?   I recreated it using `sudo mkdir /tmp`, does that fix the problem ? After I recreated the directory, In the **places** section in the sidebar in nautilus in Ubuntu 14.04 I can see /tmp , which wasn't there before .. Is that a problem ? One last thing, do I have to run `sudo chown $USER:$USER /tmp` to make it accessible as it was before .. Would there be any side-effects after this ? By the way, I get this seemingly-related error whenI try to use bash autocompletion > bash: cannot create temp file for here-document: Permission denied


How to delete the oldest directory in a given directory?

> **Possible Duplicate:**   >  Shell script for moving oldest files? I have a backup directory that stores `x` other directories that require backuping. I need something that will run before another directory is moved to the backup, that will check if the number of directories reached `x` and if it has, it will delete the oldest directory. It should be done in a `bash` script.