title: Impossible to execute a command by using su for another (system) user

text: I've created my user like this:   `sudo adduser --disabled-password --system --home /var/lib/deluge --gecos "Deluge server" --group deluge` The content of `/etc/passwd`:   `deluge:x:110:114:Deluge server,,,:/var/lib/deluge:/bin/false` The directory I'm in :               root@xxxxxx:/var/lib/deluge/.flexget# ls -al       drwxr-xr-x 2 deluge deluge 4096 15 mars  11:39 .       drwxr-xr-x 7 deluge deluge 4096 15 mars  11:40 ..       -rwxr-xr-x 1 deluge deluge 3881 15 mars  11:39 config.yml      What I'm trying to do :               su deluge -c "flexget --test execute"      But nothing happens, I've got no error shown, I also tried just `su deluge` but the same still root. How can I run a command using this user ? (I'm not using `sudo`)


title: Is there a command-line email client and auto-download attachment to a file?

text: Is there a linux email client that can run on command line and can be configured to fetch and automatically save attachments to the filesystem? Im currently using Thunderbird and it has a nice add-on called 'Attachment extractor' which automatically downloads attachments to the filesystem once the mail arrives. My problem is I want to run a custom php script the can process the attached file once it arrives. Thanks!


title: How to disable root account on openSUSE?

text: Is there a way to disable the root account completely on openSUSE so you can administer your system like the way you would do in Ubuntu?


title: Getting keyboard to work in debian 6.0 in order to unlock root partition

text: I just installed Debian 6.0, encrypted `/` and now I'm trying to boot. When GRUB comes up, I select Debian, it loads the initrd and asks for the root password, however I can't enter anything, because the system doesn't recognize my keyboard. It is a standard USB keyboard. What can I do to get my keyboard working?


title: How can I remove a stubborn docker image?

text: I was trying to remove a Docker image as follows and could not figure out how to do this. ### List of docker images               $ docker images     REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE     <none>              <none>              04251cf7a8b9        About a minute ago   356.1 MB     pg-image            latest              1060b3e656b6        5 minutes ago        323.9 MB     redis-image         latest              8df469463da3        14 minutes ago       137.7 MB     ubuntu              12.04               822a01ae9a15        2 weeks ago          108.1 MB      Docker image I'd like to remove:               $ docker rmi 042     Error response from daemon: Conflict, cannot delete 04251cf7a8b9 because      the container 4ac3a09ab4d3 is using it, use -f to force     2014/08/27 15:16:15 Error: failed to remove one or more images      When I attempted to remove it using `-f` it was unsuccessful. How do I properly remove this image, and why can I not remove it using `docker rmi -f 042`?


title: How to edit/fix a theme to make it support a newer version of gnome?

text: **What I have:**   1. gnome 3.12    2. the Faence theme, http://tiheum.deviantart.com/art/GTK3-Gnome-Shell-Faience-255097456 **Current issue:** The faence theme "only" supports gnome 3.10, I don't want to downgrade to gnome 3.10. As can be seen in the below image, the buttons on gtk popup windows and the buttons in nautilus are not rendering correctly: ![http://i.imgur.com/VjAIWuW.png](http://i.stack.imgur.com/wwa6U.png) **What I want to do:** I do not want to downgrade to gnome 3.10. I just want to edit this theme but the task seems daunting. I know that it is stored in `~/.themes` but tracking this bug down does not seem very productive. Does anyone have any idea where _start_ looking in order to edit/fix these render issues on the buttons?


title: Deny/allow a user's access to a port dynamically

text: I have stumbled upon this little tech dilemma yesterday, and know that there is a solution to it (IRC BNC resellers have it implemented already). However, the exact details and implementation elude me, and this is what I'd like to find out. I have a server running nginx to proxy a whole load of web services for a whole load of virtual hosts, all of them dynamically generated. I have a complete list of what each vhost should have in terms of ports, and more importantly, what they shouldn't have. A typical example: Host 1:   * port 9000: PHP-FPM   * port 9001: Node Host 2:   * Port 9002: PHP-FPM   * port 9003: Node   * port 9004: IIS (remote forward) Each server/forward is done as the user, and I know ahead of time which port is given to which user. My question is therefore pretty straightforward: is there a way to deny a user bind/listen rights on a port based on its UID? The reason I want to do this is to prevent Host 1 from subverting Host 2's ports or vice versa.


title: Files copied to flashdrive only on unmount

text: I use Debian wheezy with KDE4. Most of the time when I copy something to a flashdrive, the write does not actually take place until I unmount. This even happens with relatively large amounts of data (i think some music around 100MB was still buffered until unmount). Is there any way to tell the OS to write immediately when I tell it to write so I don't have to worry too much about removing my flashdrive without properly unmounting it?


title: Local, regular file causes `stat` or `ls -l` to hang

text: I've seen a few different questions about `ls` hanging. It's usually because they use the `-l` switch, which causes a `stat` on the file, which in turn is a bad symlink or pointing to an NFS mount or some such. I have a local file (in an old copy of the Git source that somebody else unpacked, of all things) that causes `stat` to hang, but responds to `CTRL-C`. It also causes `ls -l` to hang, hard, such that it does not respond to `kill` (but does terminate on a `kill -9`). It's not a symlink. The other files in the directory appear to `stat` without issue. I've recently rebooted the machine with forced `fsck`, which came out clean, and `dmesg` shows no disk-related messages. How can this be?


title: GPG Problems When Releasing With Leiningen

text: I'm trying to use `lein release` (default, not the plugin). Now, I've installed gpg-agent and pinentry-curses, and gotten to the point where a separate curses screen appears, asking me for my secret key. However, the screen does not respond to my key inputs and just hangs there. I have to interrupt (Ctrl-c) the dialog to get back keyboard responsiveness. Now, I've been following these guides, but haven't been able to solve this problem yet. Any insights?   * https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html   * How to configure gpg to enter passphrase only once per session   * http://fvue.nl/wiki/Debian_4.0:_Installing_gpg-agent


title: What should I set my locale to and what are the implications of doing so?

text: This question was stimulated by asking the question Chromium browser does not allow setting the default paper size for "Print to File", and also by a conversation with @Gilles on chat. As pointed out by @don_crissti, and as verified by me, changing the locale (at least `LC_PAPER`) makes a difference in what paper size is selected. I had never given much thought to what to select, and had always gone with `en_US.UTF-8` because it seemed like a reasonable default choice. However, per @Gilles on chat (see conversation starting at http://chat.stackexchange.com/transcript/message/17017095#17017095). Extracts: > Gilles: LC_PAPER defaults to $LANG > > Gilles: You must have LANG=en_US.UTF-8. That's a bad idea: it sets > LC_COLLATE and that's almost always a bad thing > > Gilles: LC_COLLATE doesn't describe correct collation, it's too restrictive > (it goes character by character) remove LANG and instead set LC_CTYPE and > LC_PAPER > > Gilles: plus LC_MESSAGES if you want messages in a language other than > English Clearly, there are issues here I am not aware of, and I am sure many others are as well. So, what issues should you consider when setting locales, and how should you set them? I've always just run `dpkg-reconfigure locales` in Debian, and not thought twice about it. Specific question: Should I set my locale to en_IN.UTF-8? Are there any drawbacks of doing so? See also: Does (should) LC_COLLATE affect character ranges?


title: wget - Considers download done after 1 second even though it isn't

text: I am trying to use wget to download the Raspbian image for the Raspberry Pi (http://downloads.raspberrypi.org/images/raspbian/2012-07-15-wheezy- raspbian/2012-07-15-wheezy-raspbian.zip). It starts downloading fine but then finished after a second without error but clearly not finished and leaves a tiny file instead of the full one:               kemra102@iacon:~/Downloads$ wget http://downloads.raspberrypi.org/images/raspbian/2012-07-15-wheezy-raspbian/2012-07-15-wheezy-raspbian.zip     --2012-08-13 20:26:57--  http://downloads.raspberrypi.org/images/raspbian/2012-07-15-wheezy-raspbian/2012-07-15-wheezy-raspbian.zip     Resolving downloads.raspberrypi.org (downloads.raspberrypi.org)... 94.136.44.110     Connecting to downloads.raspberrypi.org (downloads.raspberrypi.org)|94.136.44.110|:80... connected.     HTTP request sent, awaiting response... 301 Moved Permanently     Location: http://downloads.raspberrypi.org/download.php?file=/images/raspbian/2012-07-15-wheezy-raspbian/2012-07-15-wheezy-raspbian.zip [following]     --2012-08-13 20:26:57--  http://downloads.raspberrypi.org/download.php?file=/images/raspbian/2012-07-15-wheezy-raspbian/2012-07-15-wheezy-raspbian.zip     Reusing existing connection to downloads.raspberrypi.org:80.     HTTP request sent, awaiting response... 200 OK     Length: unspecified [text/html]     Saving to: `2012-07-15-wheezy-raspbian.zip'              [ <=>                                                                                ] 17,012      --.-K/s   in 0.04s             2012-08-13 20:26:57 (373 KB/s) - `2012-07-15-wheezy-raspbian.zip' saved [17012]          kemra102@iacon:~/Downloads$ ls -l 2012-07-15-wheezy-raspbian.zip      -rw-rw-r-- 1 kemra102 kemra102 17012 Aug 13 20:26 2012-07-15-wheezy-raspbian.zip     kemra102@iacon:~/Downloads$       I cannot find anything anywhere on the net to indicate what could possible be causing the issue.


title: postfix add single IPv6 address

text: I have my webserver set up to send out email as a smartserver using postfix and it does not allow any other machines on my network to send mail through it. I've been able to send email from my webserver to any address I like and it still works like that. But I want to change the fact that postfix refuses all clients on the local LAN. I want my desktop PC to be able to send out email through my webserver, but I can't get past these log messages:               Aug 13 21:58:01 localserver postfix/smtpd[21838]: connect from diablo[2001:980:1b7f:1:d568:1d76:bc9a:e356]     Aug 13 21:58:05 localserver postfix/smtpd[21838]: disconnect from diablo[2001:980:1b7f:1:d568:1d76:bc9a:e356]      I tried adding the IPv6 address to the `mynetworks` line in main.cf, but it doesn't solve the issue.               smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)     biff = no          append_dot_mydomain = no          readme_directory = no          # TLS parameters     smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem     smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key     smtpd_use_tls = yes     smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache     smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache          myhostname = localserver.local     alias_maps = hash:/etc/aliases     alias_database = hash:/etc/aliases     myorigin = /etc/mailname     mydestination = some.server.nl., localserver.local, localhost.local, localhost     relayhost =      mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104     mailbox_size_limit = 0     recipient_delimiter = +     inet_interfaces = all     home_mailbox = Maildir/     smtpd_sasl_auth_enable = yes     smtpd_sasl_type = dovecot     smtpd_sasl_path = private/dovecot-auth     smtpd_sasl_authenticated_header = yes     smtpd_sasl_security_options = noanonymous     smtpd_sasl_local_domain = $myhostname     broken_sasl_auth_clients = yes     smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination     smtpd_sender_restrictions = reject_unknown_sender_domain     mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -n -m "${EXTENSION}"     smtp_use_tls = yes     smtpd_tls_received_header = yes     smtpd_tls_mandatory_protocols = SSLv3, TLSv1     smtpd_tls_mandatory_ciphers = medium     smtpd_tls_auth_only = yes     tls_random_source = dev:/dev/urandom      Hints/tips anyone?


title: What are inodes good for?

text: I wonder if storing the information about files in inodes instead of directly in the directory is worth the additional overhead. It may be well that I'm overestimating the overhead or overlooking some important thing, but that's why I'm asking. I see that something like "inodes" is necessary for hardlinks, but in case the overhead is really as big as I think, I wonder if any of the reasons justifies it:   * using hardlinks for backups is clever, but efficiency of backups is not important enough when compared to the efficiency of normal operations   * having neither speed nor size penalty for hardlinks can really matter, as this advantage holds only _for the few files_ making use of hardlinks while the access to _all files_ suffers the overhead   * saving some space for a couple of equally named binaries like `bunzip2` and `bcat` is negligible I'm not saying that inodes/hardlinks are bad or useless, but can it justify the cost of the extra indirection (caching helps surely a lot, but it's no silver bullet)?


title: Sound messed up in Starcraft. What's the deal?

text: I'm trying to run Starcraft through Wine. The sound is all distorted, as if it were playing underwater. Then, about 10 minutes into the game the sound is perfect for 1-2 seconds. Then, there's no sound at all. I have another sound issue which might give a hint. If I'm playing a video on YouTube, and I open vlc to play a movie, the movie will have no sound. If I close Chrome, the sound then starts on the video. vlc often gives me this error when I do this: > Audio output failed: The audio device "sysdefault:CARD=SB" could not be > used: Device or resource busy. I have no idea where to start. I've looked through a bunch of forums where people have similar problems but, after pages of querying, no solution is found. If you need more info, please ask in the comments and I will update this question asap.


title: Ubuntu 13..04 reinstall Unity and gnome3

text: I remove unity and gnome 3 in my Ubuntu. I am using now just mate desktop. But I would like to restore Unity and Gnome3. So I tried this re-install solution, but now i get:               The following information may help to resolve the situation:          The following packages have unmet dependencies.      libunity-core-6.0-dev : Depends: libglib2.0-dev but it is not going to be installed                              Depends: libnux-4.0-dev (>= 4.0.0) but it is not going to be installed                              Depends: libunity-dev (>= 4.0.0~) but it is not going to be installed                              Depends: libdee-dev but it is not going to be installed      nautilus : Depends: nautilus-data (< 1:3.7) but 1:3.8.2-0ubuntu1~ubuntu13.04.1 is to be installed      nautilus-sendto-empathy : Depends: empathy (= 3.6.4-0ubuntu4.1) but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      What can I do to resolve this? EDIT: I already tried apt-get install -f but there is no list to repeare


title: Ubuntu + CISCO VPNC CLIENT for my new ubuntu version (32 bit )

text: I have newest Ubuntu Linux version 10.04.4 (32 bit ) I want to install Cisco VPNC client on this linux machines in order to connect to other customers I little confuse , which VPNC cisco version will fit for my Ubuntu Linux machine , I see in google allot of information But I can’t understand what the right instruction ( VPN Version ), in order to install VPN cisco client on Ubuntu Linux version 10.04.4 (32 bit ) ,


title: 'ls' not working, wrong PATH variable

text: `ls` is not working               [root@xilinx ~]# echo $PATH     /root/usr/bin:/root/usr/bin     [root@xilinx ~]# ls      bash: ls: command not found      Was trying to add;               > PATH=/root/CodeSourcery/Sourcery_G++/bin:$PATH     > export PATH      And when tried:               root@xilinx bin]# arm-none-linux-gnueabi-g++     bash: arm-none-linux-gnueabi-g++: command not found      I have checked `arm-none-linux-gnueabi-g++` is indeed located at `/root/CodeSourcery/Sourcery_G++/bin` And then every thing is messed up. What do I do to: 1- recover PATH so that ls starts working again 2- correctly set PATH for Codesourcery


title: Can I limit total cputime used by a cgroup?

text: Although cgroups seemingly allow to control the CFS bandwidth of a cgroup, I don't see a way of enforcing a cpu time limit on a cgroup. The use case is that I would like to catch student programs that e.g. go into an infinite loop.


title: How do I display a manpage with groff in/on msysgit?

text: I've been unable to correctly set up a `MANPATH` environment variable in `msysgit` (1.9.0; 20140217) on Windows 7 (which is not my main concern here). Every time I execute the `man` command, I recieve the following errors:   1. /usr/local/lib/man.config: No such file or directory.   2. Warning: Cannot open local configuration file /usr/local/lib/man.config.   3. No manual page for {command} As stated above, this is not a concern, merely an inconvenience as I know it's possible to use `groff [something] -T ascii /path/to/manpage` to display manpages. However, I am unable to find the command necessary to do so, having searched SE. (I know there was a question asking for it, but it doesn't show in my searches.) As a work-around, I've been using online manpages, but I'd prefer not to search the Web every time I want to view a manpage. So, first prize is the `groff` command for displaying man pages and the second is instructions on how to set up `man.config` (including file contents) for `msysgit`.


title: Using a make rule to call another

text: I am writing a LaTeX project that I am using a makefile for. I have a clean function to clean the excess LaTeX files:               .PHONY: clean     clean:         \rm *.aux *.blg *.out *.bbl *.log      But in some cases I need to get rid of the generated files as well as the PDF file. I have attempted this using:               .PHONY: clean_all     clean_all:             $(clean) \rm *.pdf      This does not work as it only removes the PDF file. My question is how do I invoke the `clean` rule inside the `clean_all` rule?


title: Jail only a specific user with vsftpd

text: I'm using both Redhat and CentOS. When I do followings:                # vi /etc/vsftpd/vsftpd.conf      chroot_local_user=YES      # service vsftpd restart      Then all users are jailed in their home directory. How can I jail a specific user only?


title: What is the advantage of using pthreads in Linux?

text: I read somewhere that Linux threads are really implemented as processes in the kernel since with today's hardware and on the Linux platform, the thread model is inefficient compared to the process model. If this is the case then why do we still use pthreads programming in our projects (other than for backward compatibility)? Why is there so much hesitation in deprecating the pthreads model in Linux?


title: tmux status-bar corrupted after catting a binary file, how to reset?

text: I accidentally screw up my tmux terminal after `cat`ing a binary file. Now my `tmux` is messed up. Detaching and re-attaching doesn't help, nor does a redraw (C-b r). Running `reset` only redraws the active pane, not the rest. Running `ssty sane` either in- or outside `tmux` doesn't help either. ![tmux messed up](http://i.stack.imgur.com/NrmBK.jpg) Within each pane, I have normal feedback from what I type (the initial call of `reset` immediately after the terminal got messed up solved this), but I can't seem to fix the status-bar. In `gnome-terminal`, every update to the status-bar leads to the status-bar to grow (see screenshot above). For example, this happens when I run a new application, when I switch panes, or when I resize a pane. Forcing a redraw (By `C-b r`, by running `reset` or via the gnome-terminal menu) shrinks back the status-bar to a single line, but it remains corrupted. In `xterm`, the status-bar does remain within one line, but it remains corrupted as pictured. I'm using tmux 1.5.   * How do I fix my `tmux`-terminal? This bug report from 2008 seems to describe the same issue, but it was marked as fixed. I don't know in what version it was fixed, but tmux 1.5 ought to include a fix from 2008.


title: How to make executable of all files excluding a few file types?

text: I have a folder containing many C source file and the same number of its compiled output files. I set executable bit to all this files but for some reason it was lost, making them not executable. _(I think that's because I moved that folder to a NTFS partition for a while)_. I would like to make them (but not the other files in my directory) executable again. One possible way is to move all source file from that folder to a temporary folder and do:               chmod +x *      Then move source files back to current folder. Is it possible to do the same without moving files around? ### Note: Compiled output files are extension-less _(in C)_.


title: Update Route Entry On another DD-WRT upon New IP address (WAN) SSH linux

text: I have two routers on two different gateways/ISPs but on the same local subnet (192.168.). If router A (192.168.1.1) gets IP address from the ISP (for example 24.64.10.15, non-static), I would like router A to login router B (192.168.1.2) (via ssh or telnet) and update the Routing Entry. ### Example: Router B (192.168.1.2)   Set number: 1   Route Name: routename   Metric: 0   Destination LAN Net: 24.64.10.15   Subnet Mask: 255.255.255.255   Gateway: 192.168.1.1   Inference: LAN & WLAN


title: What's the difference between <Directory /> and <Directory /var/www/> in apache?

text: I was playing with the apache configuration files after a system restore when I noticed something I have never really though about too much. Here are the first lines of the default `/etc/apache2/sites-available/default`:               DocumentRoot /var/www     <Directory />         Options FollowSymLinks         AllowOverride None     </Directory>     <Directory /var/www/>         Options Indexes FollowSymLinks MultiViews         AllowOverride None         Order allow,deny         allow from all      </Directory>      Since the root of a web server is usually `/var/www`, why is there the need to add a `<Directory />` in here?


title: FedUp, unable to upgrade to Fedora 20

text: I am upgrading my Fedora OS to the latest version 20 as the current one is nearing end of life. Fedora introduces a new upgrade method called FedUp that allows user to perform an upgrade over the network. I followed the instructions in there and everything went smoothly with no errors in the fedup log:               # fedup --network 20     setting up repos...     getting boot images...     .treeinfo.signed                                              | 2.0 kB  00:00:00     setting up update...     finding updates 100% [==========================================================]     verify local files 100% [=======================================================]     testing upgrade transaction     rpm transaction 100% [==========================================================]     rpm install 100% [==============================================================]     setting up system for upgrade     Finished. Reboot to start upgrade.     Packages without updates:       btparser-0.25-1.fc18.x86_64       firstboot-18.6-2.fc18.x86_64       google-chrome-stable-31.0.1650.63-1.x86_64       kernel-3.11.10-100.fc18.x86_64       kernel-3.11.7-100.fc18.x86_64       kernel-modules-extra-3.11.10-100.fc18.x86_64       kernel-modules-extra-3.11.7-100.fc18.x86_64       libgssglue-0.4-1.fc18.x86_64       mysql-connector-c++-1.1.2-1.fc18.x86_64       mysql-workbench-5.2.47-2.fc18.x86_64      Upon reboot, I encountered three errors: > Failed to start Load Kernel Modules.   >  Failed to start IPv6 firewall with ip6tables.   >  Failed to start IPv4 firewall with iptables. After logging in and upon further examination with lsmod, I notice that several modules are missing, preventing the network from working. The missing modules include:               ebtable_nat     ebtables     ip6table_filter     ip6_tables      microcode     nf_conntrack     nf_conntrack_ipv4     nf_conntrack_ipv6     rt2800lib     rt2800usb     snd     uinput     xt_conntrack     xt_limit      It appears there are many missing modules, preventing me from completing the upgrade to the latest OS version. Next I tried upgrading to version 19 by running the command `fedup --network 19`, but it seems to do an upgrade to the same version 20 instead. I also tried upgrading using the non-recommended way from DVD iso file and it generates warnings, advising me not to do so. I am really fedup. What should I do now?


title: how do i check if (manually) upgrading software will break existing software?

text: As an example, let's say I want to upgrade sqlite3. The version I have after (apt-get) updating and upgrading is 3.7.13. The most current version is 3.7.14. If I install the most current version from source, can I somehow know it won't break existing software on this computer? Is there some list of what software depends on what other software? It's not really necessary with sqlite3, but I still want to know in general. I'm running debian wheezy.


title: Sudo does not work in chroot

text: I would like to be able to use the sudo command in a chroot environment. I start the chroot as follows:               chroot /debian-squeeze /bin/bash      Now I'm logged in as root in the chroot. I can do `su user` to log in as a user named `user`. Now, `sudo` does not work:               user@HD:/$ sudo ls     sudo: must be setuid root      Some diagnostics:               user@HD:/$ which sudo     /usr/bin/sudo          user@HD:/$ ls -al /usr/bin/sudo     -rwsr-xr-x 2 root root 143884 May 23  2012 /usr/bin/sudo          user@HD:/$ ls -aln /usr/bin/sudo     -rwsr-xr-x 2 0 0 143884 May 23  2012 /usr/bin/sudo          root@HD:/# cat /etc/sudoers     Defaults    env_reset     root    ALL=(ALL) ALL     user ALL=(ALL) ALL     %sudo ALL=(ALL) ALL      As root, I can execute `sudo` without error. Can anyone explain me why `sudo` (or `setuid`) does not work like this?


title: Figure out the emitted keycode for Fn+F6

text: On my Lenovo IdeaPad Yoga 2 Pro on Windows, there is a function available `Fn`+`F6` that should **turn the touchpad on and off** (I would like to map the correct key to the script here on askubuntu). But on Linux, it doesn't work. How can I find out the event keycode that it emmits when I press this combination? I tried `showkey -a`, `showkey -k` and `xev` which both shows most keys codes when pressed, but at `Fn`+`F6` they stay quiet. The other `Fn`+`F1-F5` show output, only `F6` doesn't, although it works on Windows. What other **alternatives** are there to `xev` and `showkey`? The only hint i found so far is:               grep TOUCHPAD /usr/include/linux/input.h          #define KEY_TOUCHPAD_TOGGLE 0x212   /* Request switch touchpad on or off */     #define KEY_TOUCHPAD_ON     0x213     #define KEY_TOUCHPAD_OFF    0x214      _source: comment inhttp://askubuntu.com/a/270428/34298 with link to this article_ Maybe someone has an idea?


title: Unmet dependencies using apt-get on Ubuntu

text: I am working on a `Ubuntu 12.04.2 LTS (GNU/Linux 3.5.0-43-generic x86_64)` machine. It is a server running in production environment with other projects so I have to be quite careful. I have to install a certain list of programs, so first I run the usual `apt- get update` and then I proceeded to run the following command:               apt-get install python-dev libxslt1-dev libpq-dev git python-pip nginx supervisor wget libxml2-dev mongodb build-essential libxslt1-dev libxrender1 libxext6`      This is what I get:               root@SERVERLINUX:~# apt-get install python-dev libxslt1-dev libpq-dev git python-pip nginx supervisor wget libxml2-dev mongodb build-essential libxslt1-dev libxrender1 libxext6     Reading package lists... Done     Building dependency tree            Reading state information... Done     git is already the newest version.     python-pip is already the newest version.     build-essential is already the newest version.     libxext6 is already the newest version.     libxrender1 is already the newest version.     libxrender1 set to manually installed.     python-dev is already the newest version.     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      libpq-dev : Depends: libpq5 (= 9.1.14-0ubuntu0.12.04) but 9.1.9-0ubuntu12.04 is to be installed                  Depends: libkrb5-dev but it is not going to be installed                  Depends: comerr-dev but it is not going to be installed      libxml2-dev : Depends: libxml2 (= 2.7.8.dfsg-5.1ubuntu4.9) but 2.7.8.dfsg-5.1ubuntu4.6 is to be installed      linux-image-generic-lts-quantal : Depends: linux-image-3.5.0-44-generic but it is not going to be installed      mongodb : Depends: mongodb-server but it is not going to be installed                Depends: mongodb-dev but it is not going to be installed      nginx : Depends: nginx-full but it is not going to be installed or                       nginx-light but it is not going to be installed      supervisor : Depends: python-medusa (>= 0.5.4) but it is not going to be installed                   Depends: python-meld3 but it is not going to be installed                   Depends: python-support (>= 0.90.0) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      What should I do to manage to install the packages with "unmet dependencies"? HOw can I meet those dependencies? I am afraid to use the `-f` option as suggested because it might just mess everything up. Please bear with me, I just want to be extra cautious before taking any risk in this server.


title: Cannot connect CentOS on port 9200

text: ![enter image description here](http://i.stack.imgur.com/rMey5.png)Hello all, I cannot connect to my CentOS server on port 9200, the port ElasticSearch uses. This is my iptables file (see image above). As you can see I tried to open port 9200, but apparently without success. I can curl localhost:9200 on the CentOS server successfully. But when I try to curl 192.168.2.229:9200 (which is the ip address of eth0) I receive an error (curl:(7) couldn't connect to host). And ofcourse, when I try to connect the address 192.168.2.229:9200 form my windows machine I cannot connect either. Does someone no the problem? And the netstat results: ![enter image description here](http://i.stack.imgur.com/HMVKU.png)


title: Why is find looking in the current directory?

text: I have a bash script `/var/www/scripts/process_sounds.sh` that uses the command:               find /var/www/unprocessed_sounds/ * -type f      It's supposed to find all the files in the `unprocessed_sounds` directory, which it does, but it also find all the files in the scripts directory (and then processes them like sound files, which is not what I want). Why would `find` return things in the current directory?


title: Why are partion size and df output different?

text: I have a partition /dev/sda1.   Disk utility shows, it has capacity of 154 GB.   **df -h** shows                 Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1             123G  104G   14G  89% /     devtmpfs             1006M  280K 1006M   1% /dev     none                 1007M  276K 1006M   1% /dev/shm     none                 1007M  216K 1006M   1% /var/run     none                 1007M     0 1007M   0% /var/lock     none                 1007M     0 1007M   0% /lib/init/rw      Why are the results different? Where are the missing 31 GB? Thank you


title: Packages needed to get sound working

text: I just installed Ubuntu Server 12.10. I am using openbox and startx for my gui session. I decided not to post in the Ubuntu forum because I felt this issue might be relevant to other distros as well, especially Debian based ones. I installed `firefox` and `flashplugin-installer` so I could watch youtube videos. The videos seem like the work fine, however, I seem to be without sound. I also got `volumeicon-alsa` and `alsa-utils` but when I run `alsamixer` I get:               cannot open mixer: No such file or directory      when I try to run `volumeicon` I get               volumeicon: alsa_backend.c:86: asound_get_volume: Assertion `m_elem != ((void *))' failed.      I don't mind using something other than alsa if I need to. I would just like to know what packages I need to install to be able to get sound on youtube videos.


title: Mount changes directory time to 1970

text: We are developing an embedded Linux system using BusyBox v1.19.4. The system is working fine except for a strange mount issue with time and date. When we create a directory it has the correct time and date:               \$ ls -l     drwxrwxrwx    2 root     root            40 Jul 21 16:16 media_2e040     \$      However, once we mount a device, the time and date changes:               \$ mount /dev/sdb1 media_2e040     \$ ls -l     drwxr-xr-x    9 root     root         16384 Jan  1  1970 media_2e040     \$      Not knowing much about mounting, I can run `touch` on the directory, and the time/date updates to the correct time. Is there a reason for this operation of mount? Should we be running `touch` to keep the time and date? Thanks.


title: xrandr command not executed within shell command called from udev rule

text: I own a Thinkpad with an UltraBase (a docking station). My operating system is Ubuntu 10.10. Now, I would like to react on the "docking" event by setting the resolution of my external display correctly. Here is what I've done already:               $ udevadm info -a -p /sys/devices/platform/dock.0          Udevadm info starts with the device specified by the devpath and then     walks up the chain of parent devices. It prints for every device     found, all possible attributes in the udev rules key format.     A rule to match, can be composed by the attributes of the device     and the attributes from one single parent device.          looking at device '/devices/platform/dock.0':       KERNEL=="dock.0"       SUBSYSTEM=="platform"       DRIVER==""       ATTR{modalias}=="platform:dock"       ATTR{docked}=="0"       ATTR{flags}=="16"       ATTR{uid}=="0"       ATTR{type}=="dock_station"          looking at parent device '/devices/platform':       KERNELS=="platform"       SUBSYSTEMS==""       DRIVERS==""      Then, I've created a udev-rule:               $ cat /etc/udev/rules.d/99-docking.rules     KERNEL=="dock.0", ATTR{docked}=="1", RUN+="/usr/local/sbin/dock.sh"      The script /usr/local/sbin/dock.sh is as follows:               #!/bin/sh     # turn external display on, internal off     echo "hello world" >> "/home/hoppe/udev.out"     /usr/bin/xrandr --output LVDS1 --off     /usr/bin/xrandr --output DP2 --mode "1920x1080"     echo "hello world" >> "/home/hoppe/udev.out"     exit      Both echo-commands are execute without any problems. Also, while calling the script manually, the resolution is set correctly. What have I done wrong?


title: How can I tell bash valid tab-completions for arguments to my Python script

text: Say I have a program hello.py and one possible valid argument to it is:               ./hello.py autoawesomesauce      Is is possible to type in:               ./hello.py auto[tab]      at which point the partially completed argument is sent to hello, which recognizes it as such and then completes it on the shell to:               ./hello.py autoawesomesauce      I know git does something like this, but can it be done for a Python script + Bash?


title: In Arch Linux how can I find out which package to install that will contain file X?

text: I'm looking for a package that provides a specific binary, so I can install it. how can I search to find out what packages provide this binary? _(note: I know there's at least one tool that does this, but I have forgotten its name.)_


title: Inability to use IPv4-mapped IPv6 on debian squeeze

text: I have a squeeze box that I'm testing ipv6 on... eth3 is the interface... if I set up an 'normal' ipv6 address (`::101:c0a8:3132/120`), I see expected results in `ifconfig`...               eth3      Link encap:Ethernet  HWaddr 00:02:b3:9a:af:6d                 inet6 addr: fe80::202:b3ff:fe9a:af6d/64 Scope:Link               inet6 addr: ::101:c0a8:3132/120 Scope:Global      But if I configure an IPv4-mapped IPv6 address, I don't see part of the address...               [mpenning@hotcoffee EX4200_PC5448]$ sudo ip -6 addr del ::101:c0a8:3132/120 dev eth3     [mpenning@hotcoffee EX4200_PC5448]$ sudo ip -6 addr add ::ffff:192.168.13.236/120 dev eth3     [mpenning@hotcoffee EX4200_PC5448]$ ifconfig eth3     eth3      Link encap:Ethernet  HWaddr 00:02:b3:9a:af:6d                 inet6 addr: 192.168.13.236/120 Scope:Global               inet6 addr: fe80::202:b3ff:fe9a:af6d/64 Scope:Link      Shouldn't this address display as `::ffff:192.168.13.236/120` instead of `192.168.13.236/120`? I'm also having a problem pinging when the IPv4-mapped IPv6 address is assigned, so now I wonder whether this related to the unexpected display in ifconfig, or something wrong on the other side. EDIT: Using `ip addr show eth3`...               [mpenning@hotcoffee ~]$ ip addr show eth3     5: eth3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000         link/ether 00:02:b3:9a:af:6d brd ff:ff:ff:ff:ff:ff         inet6 ::ffff:192.168.13.236/120 scope global             valid_lft forever preferred_lft forever         inet6 fe80::202:b3ff:fe9a:af6d/64 scope link             valid_lft forever preferred_lft forever     [mpenning@hotcoffee ~]$


title: Why is this OR dependency not working as I expected

text: I tried to remove **`python2.6`** from my Debian system:               $ sudo apt-get purge python2.6     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages will be REMOVED:       fabric* python-nose* python-pip* python2.6*     0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.     After this operation, 11.0 MB disk space will be freed.     Do you want to continue [Y/n]? n     Abort.      I did not expect **`fabric`** to be removed because it has an OR dependency on **`python2.6`** and **`python2.7`** (and I got the latter installed):               $ apt-cache show fabric | grep Depends     Depends: python2.7 | python2.6, python (>= 2.6.6-7~), python (<< 2.8), python-paramiko (>= 1.6), python-pkg-resources, python-nose


title: How do I get non-anemic colours?

text: I've searched high and low for an answer to this. What I find odd is that the only person on the internet who seems to have had a similar issue (or even recognised this as an issue) was one photographer (who referred to the colour as "magenta"). Of course, as a photographer he had access to colour calibration equipment and was able to solve his problem that way: a luxury I don't have. What's puzzling is that no one else seems to recognise this as a problem. Other people's graphics card issues always seem much more serious i.e. nothing works, which isn't the case here. Yet it's the same for every Linux installation I do, with whatever distro and on two different computers. The problem is that the colours are sickly, slightly blueish, anemic etc. It's "useable" and some non-photo images e.g. icons look ok but as soon as I view something with humans in it or lots of colour, it just looks wrong and it makes using Linux a chore. Even the grey of the windows in Gnome 3 and Linux Mint looks wrong (cold/alienating) and no amount of fiddling with xgamma will get it anywhere close to the quality of images in Windows 7. I've even tried to adjust the colours via xgamma with a PC running Windows 7 next to it, so I can use the same photo with the right colours as a reference. The same distro always looks fine in VirtualBox. The main PC is using an ATI Radeon HD 5470 and the other is using something like an ATI R200 Express (no longer supported by ATI). However, even though a quick look at the internet reveals a huge quantity of ATI/Linux-related misery, none of it is of the kind I describe. The current distro is Linux Mint Debian. Previously I have had Ubuntu, Fedora 17 and Debian 6.0 installed, all with the same "sickly colours" problem. Am I being naïve to expect the colours of a PC running Linux to be anywhere near those of the same PC running Windows 7?


title: Why `.` is displayed by `ls`?

text: After reading the question When you type “ls -a”, what is the significance of “.” and “..”?, I have a similar one. Why to display `.`? I mean, is there any directory where `cd .` would not work? How is it helpful to a user to see this line every time?


title: How to poll existence of a background script correctly

text: I have a problem with the following kind of script:                 #!/bin/sh            long_running_script.sh &              while [ `pidof long_running_script.sh` ]       do         echo "."         sleep 1       done      The sript will start a new script to background, and it should print dots until the backgroud script will exit. It works when CPU load is not high. But, when there is high CPU load, it won't work: long_running_script.sh will start, but the 'parent' script will exit from while loop before the long_running_script.sh exits. Seems that `pidof` is executed before the long_running_script.sh is really started (execved). What is the best way to solve this problem? 1 seconds sleep before the while statement didn't help. So I don't want to use any magic delays, because it may be unreliable.


title: Debian: very low resolution and an "unknown monitor" problem

text: _Edit:_ I have installed CrunchBang (or #!, a Debian-based distro), and that seems to have solved all of my resolution problems. * * * I've just installed Debian after using Linux Mint for a few months. Everything went on smooth, however, when the installation was over I noticed that the resolution was set really low. I went to `System > Preferences > Monitors`, and that told me that the highest available resolution was 1024 * 768. It also did not recognize my monitor properly as it was listed as _"Unknown"_ , the only rotation option was _"Normal"_ and the refresh rate was _"0 Hz"_ (although I'm having no problems with the refresh rate at the moment). **How can I get an optimal resolution (the native one)?** `xrandr` says:               xrandr: Failed to get size of gamma for output default     Screen 0: minimum 800 x 600, current 1024 x 768, maximum 1024 x 768     default connected 1024x768+0+0 0mm x 0mm        1024x768        0.0*         800x600        61.0       `lspci -v | grep VGA` says:               00:02.0 VGA compatible controller: Intel Corporation Sandy Bridge Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])     01:00.0 VGA compatible controller: ATI Technologies Inc NI Seymour [AMD Radeon HD 6470M] (prog-if 00 [VGA controller])      I'm not sure why there seem to be two graphics cards. Currently I'm trying to install the non-free AMD/ATI r6xx r7xx drivers. Is this a good move? _< - this changed nothing_ I'm also missing the `Xorg.conf` file. _< - As suggested I've created one, but that only made my computer unable to start displaying anything after Grub. I'll have to delete it from Ubunto._ If there's any more potentially useful info please tell me so I could share it.


title: Why can't gnutls contact this site?

text: Why can't `gnutls` contact the site in question, even though wget gets the page just fine?               $ gnutls-cli https://site.com/login.php --insecure --print-cert < /dev/null > cert     WARNING: gnome-keyring:: couldn't connect to: /run/user/dotancohen/keyring-Ekufyf/pkcs11: No such file or directory     Cannot resolve https://site.com/login.php:443: Name or service not known     $ wget https://site.com/login.php     --2013-01-23 19:07:57--  https://site.com/login.php     Resolving site.com (site.com)... 72.1.2.3     Connecting to site.com (site.com)|72.1.2.3|:443... connected.     HTTP request sent, awaiting response... 200 OK     Length: 6581 (6.4K) [text/html]     Saving to: `login.php'          100%[=============================================>] 6,581       --.-K/s   in 0s          2013-01-23 19:07:58 (47.8 MB/s) - `login.php' saved [6581/6581]          $


title: Effect of $LANG on terminal

text: I'm trying to **learn** how the `$LANG` variable behaves with gnome-terminal (and its character encoding preference option). I've been using iso8859-1 (latin1) as my main character-set and all my filenames are encoded as such. For the following tests I'll do an `ls -l` of a directory with Spanish accented characters in their filenames: **Case #1:**   * gnome-terminal configured for ISO-8859-1   * `LANG` set to "en_US-iso8859-1"   * Result: I see all files correctly **Case #2:**   * gnome-terminal configured for UTF-8   * `LANG` set to "en_US-iso8859-1"   * Result: I see garbage characters for all spanish characters. This is expected as I changed the character-encoding for the terminal **Case #3:**   * gnome-terminal configured for ISO-8859-1   * `LANG` set to "en_US-UTF-8"   * Result: I see garbage characters for all spanish characters.  Why is that in this last case I see garbled characters? Shouldn't the output of **ls** send the filenames straight to gnome-terminal as they are? And since gnome-terminal is configured for ISO-8859-1, I would have expected them to look right. For a moment I thought that, perhaps, maybe bash is considering my `$LANG` variable and performing some conversion. Then I switched my terminal to UTF-8 but I still can't see the characters right. I even piped the output of ls to xxd and to my surprise I still see the files encoded as they are: ISO-8859-1. To wrap up: If my listing contains ISO-8859-1 characters and my terminal emulator is configured for the same character-encoding: Who's doing the conversion when `LANG` is set otherwise? Thanks for any help you can provide. Craconia


title: broken filesets after install VLC via RPMFusion

text: Needed a media player, followed the link on this site Here is the last part of the YUM output;               After following the link above, VLC installed and executed fine, but I was left with broken filesets and now my updates won't install.          Error: Package: libquicktime-1.2.4-1.el6.rf.i686 (@rpmforge)            Requires: libx264.so.107            Removing: x264-0.0.0-0.4.20101111.el6.rf.i686 (@rpmforge)                libx264.so.107            Updated By: x264-0.120-5.20120303.el6.i686 (rpmfusion-free-updates)                Not found      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest      All help is appreciated, I need this box to continue my job searching, I'm digging CentOS, Ubuntu worked ok untill 13.10 where the 3D played havoc with my NVIDIA card and desktop.


title: How to use `~/.ssh/config` setting for each server by `rsync`

text: I'm now using rsync with `-e 'ssh -p 10022'` option to specify the port. I have already ssh setting in `~/.ssh/config`.               Host myvps       HostName example.com       User ironsand       Port 10022      Can I use this config from rsync easily? Or Can I create `~/.rsync` and set a default port for specify server?


title: How do daemons work?

text: If a user wants to execute a command, he has to first log in into a system. But some users in the system have `/bin/false` or `/sbin/nologin` set as a default shell in the `/etc/password` file. If I change `/bin/bash` to `/bin/false` in case of my user, I won't be able to log in into the system, so I also won't be able to run commands. But the shellless users do it anyway:               # ps -eo "%mem,user,group,args" | grep -i dns      0.0 dnscrypt dnscrypt /usr/sbin/dnscrypt-proxy --daemonize --user dnscrypt --local-address=127.0.0.1:53 --resolver-address=208.67.222.222:443 --provider-name=2.dnscrypt-cert.opendns.com --provider-key=B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79          # cat /etc/passwd | grep -i dns     dnscrypt:x:113:121::/home/dnscrypt:/bin/false      How can a user without a shell execute a command?


title: MySQL max_open_files more than 1024

text: While starting MariaDB I got [Warning] Could not increase number of max_open_files to more than 1024 (request: 4607)               $ sudo systemctl status mysqld     ● mysqld.service - MariaDB database server       Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)       Active: activating (start-post) since Tue 2014-08-26 14:12:01 EST; 2s ago     Main PID: 8790 (mysqld);         : 8791 (mysqld-post)       CGroup: /system.slice/mysqld.service           ├─8790 /usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid           └─control         ├─8791 /bin/sh /usr/bin/mysqld-post         └─8841 sleep 1          Aug 26 14:12:01 acpfg mysqld[8790]: 140826 14:12:01 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4607)      I tried unsuccessfully to fix the problem with max_open_files inside this file:               $ sudo nano /etc/security/limits.conf      mysql           hard    nofile          8192     mysql           soft    nofile          1200      I even restarted the computer again, but I got the same problem. The /etc/mysql/my.cnf looks like this:               [mysql]          # CLIENT #     port                           = 3306     socket                         = /home/u/tmp/mysql/mysql.sock          [mysqld]          # GENERAL #     user                           = mysql     default-storage-engine         = InnoDB     socket                         = /home/u/tmp/mysql/mysql.sock     pid-file                       = /home/u/tmp/mysql/mysql.pid          # MyISAM #     key-buffer-size                = 32M     myisam-recover                 = FORCE,BACKUP          # SAFETY #     max-allowed-packet             = 16M     max-connect-errors             = 1000000     skip-name-resolve     sql-mode                       = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY     sysdate-is-now                 = 1     innodb                         = FORCE     innodb-strict-mode             = 1          # DATA STORAGE #     datadir                        = /home/u/tmp/mysql/          # BINARY LOGGING #     log-bin                        = /home/u/tmp/mysql/mysql-bin     expire-logs-days               = 14     sync-binlog                    = 1          # CACHES AND LIMITS #     tmp-table-size                 = 32M     max-heap-table-size            = 32M     query-cache-type               = 0     query-cache-size               = 0     max-connections                = 500     thread-cache-size              = 50     open-files-limit               = 65535     table-definition-cache         = 1024     table-open-cache               = 2048          # INNODB #     innodb-flush-method            = O_DIRECT     innodb-log-files-in-group      = 2     innodb-log-file-size           = 128M     innodb-flush-log-at-trx-commit = 1     innodb-file-per-table          = 1     innodb-buffer-pool-size        = 2G          # LOGGING #     log-error                      = /home/u/tmp/mysql/mysql-error.log     log-queries-not-using-indexes  = 1     slow-query-log                 = 1     slow-query-log-file            = /home/u/tmp/mysql/mysql-slow.log      How is it possible to fix the problem with max_open_files?


title: Bash eval array variable name

text: Here is my bash case: First case, this is what I want to do "aliasing" `var` with `myvarA`:               myvarA="variableA"     varname="A"     eval varAlias=\$"myvar"$varname     echo $varAlias      Second case for array variable and looping its members, which is trivial:               myvarA=( "variableA1" "variableA2" )     for varItem in ${myvarA[@]}     do         echo $varItem     done      Now somehow I need to use "aliasing" technique like example 1, but this time for array variable:               eval varAlias=\$"myvar"$varname     for varItem in ${varAlias[@]}     do         echo $varItem     done      But for last case, only first member of `myvarA` is printed, which is `eval` evaluate to value of the variable, how should I do var array variable so `eval` is evaluate to the **name of array variable** not the **value of the variable**.


title: Upstart - setuid inside post-start stanza

text: I have this **upstart** script that looks a bit like this:               setuid userA     setgid userB          script         # ... bunch of stuff run as userA     end script          post-start script         # ... command run as userA              # ... the following command needs to be run as root         setuid root                  # <---- this is not legal syntax         service myservice restart    # <---- I need to run this as root     end script      So, I've gone through the documentation and found out that setuid doesn't work inside `post-start`, and `userA` is not in the sudoer list, so I can't just do `sudo service myservice restart`. In fact, in the most ideal situation, I should actually be running `myservice` as another user instead. How do I get about this? I'm scratching my head without any solutions for a whole day now. * * * As suggested by the answer, a way is to create _another_ upstart job that runs when the previous upstart script runs. So instead of having `service myservice restart` in jobA, we create `/etc/init/myservice-hook.conf` and have it trigger when jobA is running (as per the answer). On my side, I managed to solve the problem by removing both `setuid` and `setgid` so that the script runs as root, and then selectively putting `sudo -u userA <command>` inside the script. I'll use the answer provided instead because I think it has better isolation of concerns.


title: Increment number in bash variable string

text: VERSION="4.0beta12"     NEXT_VERSION=?????      Writing an automatic release script, I have the current version in a variable $VERSION, and I would like to calculate the next version as $NEXT_VERSION. Rule: Increment the integer at the end of the string.   4.0beta12 → 4.0beta13   4.2alpha9 → 4.2alpha10 I have tried with sed/awk/eval but can't make it work. Ideas? Any tool is fine.


title: What is the difference between Non-preemptive, Preemptive and Selective Preemptive Kernel?

text: What is the difference between a "Non-preemptive", "Preemptive" and "Selective Preemptive" Kernel? Hope someone can shed some light into this.


title: How do I verify that the Linux kernel is not freezing when uploading or downloading large data over the ethernet interface?

text: How to verify if the Linux kernel is doing what it's saying for network interfaces? I have one network interface `eth0` which has hardware support to do 1GB full-duplex. I have prepared 2 box. Now when I do normal x11vnc from box to box after 1 or 2 minute later both system get frozen, unless I power off and power on. Now, how can I verify it's an issue of the Linux kernel and it's unable to do data upload and download of 1GB? Is there any way to test accurate 1GB packet transfer live from PC1 to PC2 over TCP or UDP and do a full-duplex test, if the kernel is not causing frozen or crash?


title: How cpu works in conky

text: I' m trying to setup conky and I saw that I can use from cpu0 to cpu4               CPU0 ${cpu cpu0}% ${cpubar cpu0}     CPU1 ${cpu cpu1}% ${cpubar cpu1}     CPU2 ${cpu cpu2}% ${cpubar cpu2}     CPU3 ${cpu cpu3}% ${cpubar cpu3}     CPU4 ${cpu cpu4}% ${cpubar cpu4}      Why I have 5 cpu % if I go over cpu4, example:               CPU5 ${cpu cpu5}% ${cpubar cpu5}      It doesn' t show any % ?? I have an Intel i5, so I suppose that is a quad-core, right? CPU0 what shows?


title: How to highlight a person in irssi?

text: I'd like irssi to highlight all messages from a specific nickname. How can I accomplish this?


title: What should interactive shells do in orphaned process groups?

text: (Re-posting in unix per the suggestion in http://stackoverflow.com/questions/13718394/what-should-interactive-shells-do- in-orphaned-process-groups) The short question is, what should a shell do if it is in an orphaned process group that doesn't own the tty? But I recommend reading the long question because it's amusing. Here is a fun and exciting way to turn your laptop into a portable space heater, using your favorite shell (unless you're one of those tcsh weirdos):               #include <unistd.h>        int main(void) {         if (fork() == 0) {             execl("/bin/bash", "/bin/bash", NULL);         }         return 0;     }      This causes bash to peg the CPU at 100%. zsh and fish do the same, while ksh and tcsh mumble something about job control and then keel over, which is a bit better, but not much. Oh, and it's a platform agnostic offender: OS X and Linux are both affected. My (potentially wrong) explanation is as follows: the child shell detects it is not in the foreground: `tcgetpgrp(0) != getpgrp()`. Therefore it tries to stop itself: `killpg(getpgrp(), SIGTTIN)`. But its process group is orphaned, because its parent (the C program) was the leader and died, and `SIGTTIN` sent to an orphaned process group is just dropped (otherwise nothing could start it again). Therefore, the child shell is not stopped, but it's still in the background, so it does it all again, right away. Rinse and repeat. My question is, how can a command line shell detect this scenario, and what is the right thing for it to do? I have two solutions, neither of which is ideal:   1. Try to signal the process whose pid matches our group ID. If that fails with `ESRCH`, it means we're probably orphaned.   2. Try a non-blocking read of one byte from `/dev/tty`. If that fails with `EIO`, it means we're probably orphaned. (Our issue tracking this is https://github.com/fish-shell/fish- shell/issues/422 ) Thanks for your thoughts!


title: Fedora Bluetooth

text: Which packets do I have to install for my bluetooth headset to work? I have installed:               rpm -qa |grep blue     bluez-alsa-4.99-2.fc17.i686     bluez-libs-4.99-2.fc17.i686     pulseaudio-module-bluetooth-1.1-9.fc17.i686     blueman-1.23-2.fc17.i686     bluez-4.99-2.fc17.i686     bluez-hcidump-2.2-2.fc17.i686     gnome-bluetooth-libs-3.4.2-1.fc17.i686     bluez-compat-4.99-2.fc17.i686     bluez-cups-4.99-2.fc17.i686     bluez-hid2hci-4.99-2.fc17.i686     bluez-gstreamer-4.99-2.fc17.i686      I can connect and pair to my headset but I haven't an option to select headset as sound device for sound output in sound applications when i get connected to headset my volume property where i could select output devices becomes unavailable, screen-shot below ![pulseaudio volume properties](http://i.stack.imgur.com/T8DHP.png)


title: Will updating KDE also update Qt?

text: Right now I'm using OpenSUSE 12.2 with KDE 4.9.4. If I upgrade that to KDE 4.10 in January, will it also bring in Qt 5 (or at least newer Qt packages)? Or are the Qt packages tied to the OS?


title: shorthand for feeding contents of multiple files to the stdin of a script

text: Hi good people of this community, Say I have a script called `script`, that reads from `stdin` and spits out some results to the screen. If I wanted to feed it contents of one file, I would have typed:               $ ./script < file1.txt      But what if I want to feed the contents of the multiple files to the script the same way, is it at all possible? The best I came up with so far was:               cat file1.txt file2.txt > combined.txt && ./script < combined.txt      Which uses two commands and creates a temp file. Is there a way to do the same thing but bypassing creating the combined file?


title: Should I be using 'sudo' in scripts that I write?

text: I'm setting up a new machine (well actually, an Ubuntu VM) and am trying to write a script to setup a few common things that I use when doing this (Git, curl, vim + janus). So my script looks a bit like this:               #setup     #!/bin/sh     sudo apt-get install git     sudo apt-get install curl     ...      It doesn't seem great to have 'sudo' mixed in with my command -- that is just my security-spidey-sense tingling. It seems like something like the following might also work:               sudo setup      Is there a better way to do this? What are your rules of thumb when you write scripts and need elevated permissions?


title: starts logging when the limits are hit

text: `/etc/security/limits.conf`. The file is responsible to limit resources of users/groups on a Linux server. Unfortunately, the file does not generate any logs (or the case could be that I do not really know of them). So how can I hack it (not necessary internally) so that it starts logging when the limits are hit. Preferrably if it can send an email


title: How can I install Moonlight in Chrome in Linux?

text: I am trying to just click on the appropriate link on the Moonlight download page, but after it downloads I get a support warning. The text seems to be designed for Windows, because I couldn't get it to work.


title: How to find the type of an img file so it can be mounted

text: I have a .img file and I want to see what's inside of it. I tried mounting it, but I don't know what filesystem type it is. Is there a way to detect what it is so I can mount it? I'm using Ubuntu. Essentially the command I think I need to do to browse it is:               mount -t <FS TYPE HERE> myimage.img /path/to/mount/dir/


title: FreeBSD 9 Sound Driver

text: I installed FreeBSD 9. I'm trying to make a sound to work but no luck. My Sound Card: `Realtek ALC898` Can someone help me how to make it to work (I'm creating custom kernel)? Base on FreeBSD handbook I `kldload snd_driver` and I got: `ppc0: cannot reserve I/O port range` and `cat /dev/sndstat`:               pcm0: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)     pcm1: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)     pcm2: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)     pcm3: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)     pcm4: <HDA Realtek (Unknown) PCM #0 Analog> (play/rec) default     pcm5: <HDA Realtek (Unknown) PCM #1 Digital> (play)


title: What is .emacs? How do I edit it?

text: In this article, I don't understand step 7: > 7. Add `(load-library “init_python”)` in your .emacs How can I do this?


title: What could cause which to not show something in the path?

text: There is an executable in my path that I believe is a perl script.               >$scriptname     $outputofscript      but               >which $scriptname     which:  0652-141 There is no $scriptname in $path      and the path it prints is the same that `echo $PATH` gives (except space delimited rather than colon). Running ksh again does not appear to change my path, but now the script is not found. This is as a normal user running ksh on AIX 6.1 over telnet (yeah, I know).


title: Using word wrap with mc

text: According to the man page for `mc`, the internal editor (`mc -e`) has a word wrap option. How can I turn this on? I have found settings in "Options" --> "General", however, this seems to only change text as it is typed in, and I cannot determine how to apply word wrap to text which has already been typed.


title: Record every keystroke and store in a file

text: I need to record every keystroke and **store** in a file in the user directory ~, when using my account, I am not sudoer and I cannot install programs (like logKeys) in any way. How could I do so using terminal? **NOTE:** This question it's not a duplicate of the other mention question; in this question I'm asking about every keystroke, while in the other the asker asked about keystroke in terminal session.


title: Accessing Owncloud from the commandline

text: Is it possible to donwload all contacts from an owncloud instance into a local folder, make modifications and reupload the vcf files back to the server? By abusing the backup functionality I managed to download my contacts locally:               wget --auth-no-challenge --no-clobber --http-user=user --http- password=password      -O $HOME/pimdata_backup/contacts-$DATE.vcf "owncloud/?app=contacts&getfile=export.php?bookid=1"      But that is far from optimal, I want to download all contact files separately and reupload them after changing them locally (e.g. to convert them to org- contact). Is there a commandline toll available that already implements this workflow?


title: Logging ALL stderr output of crontab to file

text: For example, I can log `stderr` of one script in this way:               * * * * * run_script.sh > /var/log.txt 2>&1      But I want to log `stderr` of all scripts in my crontab. I can append `> /var/log.txt 2>&1` to all scripts, but it's not good if I have hundreds of scripts in `cron`. Is there another, more simple way to do this?


title: Which Linux distribution should I use for a Web server?

text: I'm going to set up a webserver at home, but I'm not sure what dist I should use. I have used Linux before but I'm not a proffesional. I've been reading about the differences between some of the distributions, but I'm still not convinced. GUI doesn't matter, I'll just be SSHing to it anyways. I need something powerful but still not too complex to set up. It's my first time configuring a Linux server, I'm just doing this to learn. I'm familiar with Ubuntu, but I want to try something else. I'm not sure what would fit me best, any suggestions? Side question: the server is using an Intel Core 2 Duo E8400 processor (if I did my research correctly), and according to Wikipedia it's based on the Intel Core microarchitecture (previously known as the Next-Generation Micro- Architecture, or NGMA). On the download page of debian.org (and other distros) I have to specify the processor architecture to get the correct file, but mine isn't listed there. Which one should I choose?


title: Beep when typing backslash in cvim normal mode

text: I installed the cvim plugin for vim. Almost all the cvim commands start with '`\`'. But I when enter this character in normal mode, all I hear is a beep. Nothing happens. What might be causing this problem?


title: Newly installed CentOS 6 shows squares instead of letters

text: I have a VPS which I've just reinstalled an OS on. The OS is CentOS 6 x32. I've exactly done the following:               yum install wget nano firefox     yum update     yum groupinstall Desktop          useradd wajed && passwd wajed     visudo          yum install nx freenx      nxserver --adduser wajed     cat /etc/passwd | grep ^nx     cat /var/lib/nxserver/home/.ssh/client.id_dsa.key      So,   1. I installed some software, updated the OS, installed Desktop.   2. Added a user and gave permissions.   3. Installed freenx. The result is that everything is good, and I could connect to the desktop, but there is no font... it's all boxes instead of letters. What could the problem be? Here is a screenshot: ![image](http://i.imgur.com/D0LbM.png)


title: Crontab with SVN and Git

text: I have some repos which are both in SVN and Git. My username is guyfawkes, and in my home directory I have folder www which contains all my repos. In this directory I also have file update.sh:               [guyfawkes@guyfawkes-desktop ~/www]$ cat update.sh     cd /home/guyfawkes/www     cd crm     echo "upd crm"     svn up     echo "update crm completed"     echo "-------"     cd ../crm_sql     echo "upd sql"     svn up     echo "update sql completed"     echo "-------"     cd ../crm_old     echo "upd old"     svn up     echo "update old completed"     echo "-------"     cd ../mysqldiff     echo "upd mysqldiff"     git pull sotmarket master     echo "update mysqlidff completed"     git push origin master     echo "push to github completed"     echo "-------"     cd ../mysql-migration-manager     echo "upd mmmm"     git pull     echo "mmm updated"     cd data     echo "upd data"     git pull     echo "data updated"      My crontab is:               [guyfawkes@guyfawkes-desktop ~/www]$ crontab -l     */5 * * * * /home/guyfawkes/www/update.sh      So, it works perfectly with svn repos, but I have this mails in /var/spool/mail/guyfawkes (from cron):               X-Cron-Env: <SHELL=/bin/sh>     X-Cron-Env: <HOME=/home/guyfawkes>     X-Cron-Env: <PATH=/usr/bin:/bin>     X-Cron-Env: <LOGNAME=guyfawkes>     X-Cron-Env: <USER=guyfawkes>          upd crm          Fetching external item into 'public/old'     External at revision 32674.          At revision 483.     update crm completed     -------     upd sql     At revision 29.     update sql completed     -------     upd old     At revision 32674.     update old completed     -------     upd mysqldiff     Permission denied (publickey,keyboard-interactive).     fatal: The remote end hung up unexpectedly     update mysqlidff completed     Permission denied (publickey).     fatal: The remote end hung up unexpectedly     push to github completed     -------     upd mmmm     Permission denied (publickey,keyboard-interactive).     fatal: The remote end hung up unexpectedly     mmm updated     upd data     Permission denied (publickey,keyboard-interactive).     fatal: The remote end hung up unexpectedly     data updated      How can I to fix it?


title: Choose kernel for specific hardware

text: I have old system with an AMD Athlon 1,2 GHz processor and [SiS] 65x/M650/740 graphics (output from lspci). Recently I discovered on a german ubuntu page that since version 10.10 some older processors are not longer supported, since ubuntu version 12.04 there are further restrictions. I guess this is completely related to the used kernel version. This leads me to the following questions:   * How can I find out which kernel versions support the processor and graphics card mentioned above? Which versions provide optimal support (concerning performance and stability)?   * When updating a system (for example between two ubuntu versions or more interesting, when running a rolling release like debian testing or archlinux), there seems to be the danger of loosing (optimal) hardware support when the kernel version is updated. Do I have to check the hardware support manually before each update or is it checked automatically in the three distros mentioned above (ubuntu, debian testing, archlinux)?


title: NTP Problems - sntp: too many bad or lost packets

text: I need some help from you guys regarding NTP on Suse. I have a server, whose IP is 192.168.100.52, which is based on Suse Linux and here is my NTP conf file:               server 192.168.100.11  iburst     restrict 192.168.100.11     logfile /var/log/ntp      192.168.100.11 is another NTP server in the network. Now, when other linux systems have their ntp server as 192.168.100.52, the NTP service starts, but time does not sync. In the NTP clients, on `ntpdate <IP>` or `sntp <IP>`, the error I get is: "sntp: too many bad or lost packets". On the NTP server (192.168.100.52), I get this error in the log file (`/var/log/ntp`):               15 Jan 16:38:21 ntpd[15262]: ntpd exiting on signal 15      Also when I do `ntpdate <IP>` or `sntp <IP>` on the NTP Server, I get: "sntp: too many bad or lost packets". The server is plain installation of OpenSuse along with MySQL installed. SuseFirewall is disabled and there is no other antivirus or firewall in place. All ports are open, still not able to sync from server (also the NTP server is not able to sync with any other machine). How can I get it working?


title: How to update gnome keyring password?

text: Last weak I updated my password on my laptop. Then every time when I logged in, it would prompt for my old password to open the keyring for network manager. To fix this in a terminal I use               rm ~/.gnome2/keyrings/default.keyring      Is there a different or better way of doing this?


title: How can I get a count of files in a directory using the command line?

text: I have a directory with a large number of files. I don't see a `ls` switch to provide the count. Is there some command line magic to get a count of files?


title: How can I make Ubuntu UI uniformly use bash keyboard shortcuts?

text: On my default 10.04 Ubuntu install I am consistently tripped up by the fact that some UI text areas/input boxes treat `Ctrl``A` as "select all" vs. "move my cursor to the beginning of the line." Is there some sort of global conf file that exists for these sorts of things? I would really like to unify all text input areas to use bash conventions.


title: Trying to Add Oracle Solaris (SunOS) OS 11.2 as a Dual Boot under Grub2

text: I was Trying to install Oracle Solaris (SunOS) 11.2 as a Dual Boot under Grub2. I followed the Grub2 instructions for Adding an ISO and I get the following Grub Entry for the Solaris ISO --               menuentry "Grml Rescue System (sol-11_2-text-x86.iso)" {         insmod part_msdos         insmod ext2         set root='hd0,msdos6'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  fa099154-932d-47e2-a529-bf050aa7d62e         else           search --no-floppy --fs-uuid --set=root fa099154-932d-47e2-a529-bf050aa7d62e         fi         iso_path="/boot/grml/sol-11_2-text-x86.iso"         export iso_path         kernelopts="   "         export kernelopts         loopback loop "/boot/grml/sol-11_2-text-x86.iso"         set root=(loop)         configfile /boot/grub/loopback.cfg      } But When I try booting up this Grub Entry Does "Nothing" -- This Grub is shown in the Grub Boot-up menu ... but when I select it -- it just spins back to the Grub menu with nothing done to the ISO image .... Please any one who has managed to install the Solaris ISO point me to how to get about it ....


title: Enabling GPIO in kernel not working

text: I have tried to enable the GPIO pins for my system through the Kernel but I am not able to get them to work. When I try this:               echo 1 > /sys/class/gpio/export      The terminal window just closes. When using a different number such as 30, the terminal just hangs and I cannot ctrl-C it. According to everything I read, if GPIO is enabled through the kernel correctly, you should be able to export a GPIO port in sysfs and then you will see each GPIO port in /sys/class/gpio. Example /sys/class/gpio/gpio0 and then you should be able to send it values. I am using Debian 3.11.4.


title: Ubuntu 12.04 32 bit is slow on Virtual machine

text: I have installed Ubuntu 12.04 32 bit os on my Virtual machine. I have allocated 2GB ram to it. But the VM is running very slow, and left side taskbar is not visible. When I place my cursor on the taskbar a black colored square is getting highlighted. How can I resolve this issue and speed up my VM?


title: LFTP mirror upload only non existing files to remote directory

text: Every 5 minutes some new files are downloaded via lftp to a local directory. I need to upload to another ftp only the non existing files. My script so far is:               #! /bin/bash     today=$(date +%Y%m%d)     today_files="rec."$today"_"     programa_dir="/home/user/local-dir"          # Download files, that do not exist in the local directory     lftp <<EOF     open -u user,pass ftp1     mget "$today_files*" -O $programa_dir     bye     EOF          # Upload the files          lftp <<EOF     open -u user,pass ftp2     lcd $programa_dir     mirror -R     bye     EOF      The mirror -R command doesn't recognize that only few files do not exist on the remote directory of the second ftp. Is there a way to fix that? I need only to check the filename's , not the creation or the modification time of the files. For the second ftp I tried               lftp <<EOF     open -u user,pass ftp2     mput $programa_dir/* -O /     bye     EOF      The result was the same - lftp upload all the files, no only the non existing.


title: Installing packages from LMDE on debian wheezy

text: I downloaded thunderbird from LMDE repo and tried to install it on my debian wheezy machine, using apt-get install I get a ton of this garbage output;               Note, selecting 'iceape-l10n-cs' for regex '.'     Note, selecting 'libhugs-time' for regex '.'     Note, selecting 'libghc-comonads-fd-prof-2.1.1.2-02108' for regex '.'     Note, selecting 'libglobus-gram-protocol-dev' for regex '.'     Note, selecting 'libgeomview-dev' for regex '.'     Note, selecting 'python-flufl.enum-doc' for regex '.'     Note, selecting 'libpath-utils-dev' for regex '.'     Note, selecting 'composite-data' for regex '.'     Note, selecting 'gimp-svg' for regex '.'     Note, selecting 'libgudev1.0-cil' for regex '.'     Note, selecting 'libfile-sharedir-perl' for regex '.'     Note, selecting 'python-reportlab' for regex '.'      and when I use dpkg -i I get this;               root@A215:/home/steven/Downloads# dpkg -i      thunderbird_24.2.0~linuxmint2+lmde_amd64.deb      dpkg: regarding thunderbird_24.2.0~linuxmint2+lmde_amd64.deb containing     thunderbird:     hunspell-en-us conflicts with thunderbird     thunderbird (version 24.2.0~linuxmint2+lmde) is to be installed.          dpkg: error processing thunderbird_24.2.0~linuxmint2+lmde_amd64.deb (--    install):     conflicting packages - not installing thunderbird     Errors were encountered while processing:     thunderbird_24.2.0~linuxmint2+lmde_amd64.deb      According to Linux Mint there binary packages are 100% compatible with debian... Any Ideas?


title: Linux Mint (Cinnamon, Muffin) set a keyboard shortcut where one of the keys is a mouse

text: Linux Mint 17 Cinnamon Edition. I want to create a keyboard shortcut involving the mouse. Specifically, I want to make it so clicking Alt, right-click, and dragging my mouse allows me to resize the current window. I've gone to Keyboard > Keyboard shortcuts > Windows > Resize window > Keyboard bindings, and clicked on the default "Alt-F8" entry so that I can set a new entry, and tried to use my mouse while setting one, but it is not captured. So I opened up `dconf-editor` and tried setting `org.cinnamon.muffin.keybindings.begin-resize` to `<Alt>Mouse2`, `<Alt>Mouse_2`, `<Alt><Mouse2>`, `<Alt><Mouse_2>`, `<Alt>Secondary`, `<Alt><Secondary>`, and none of these worked. What is the "code" for the right mouse button for these keybindings? Where is the documentation for these keybinding "codes"? Thanks!


title: Why is sed giving me an error about an unterminated `s'?

text: I have a set of sed replacements in a bash script and am getting an error about an unterminated `s' command. Here's what the sed line looks like:               sed -n -e "s/TMPFOO1/$FOO1/" -e "s/TMPFOO2/$FOO2/" -e "s/TMPFOO3/$FOO3/" -e "s/TMPFOO4/$FOO4/" -e "s/TMPFOO5/$FOO5/" /home/foo/template > /home/foo/template/finishedresult      For some reason though, bash doesn't like this and I get an error about               sed: -e expression #4, char 69: unterminated `s' command      What am I missing here? How can I have SED input the variable? It looks to me like they are all terminated.


title: Do parentheses really put the command in a subshell?

text: From what I've read, putting a command in parentheses should run it in a subshell, similar to running a script. If this is true, how does it see the variable x if x isn't exported?               x=1      Running `(echo $x)` on the command line results in 1 Running `echo $x` in a script results in nothing, as expected


title: Assign Special Records for specific remote clients DNSmasq

text: I'd like to make DNSmasq serve special records for specific remote clients (Clients from the public internet) So for example if remote host 111.111.111.111 requests www.example.com it returns 3.3.3.3 but if anyone else does it then it will return 4.4.4.4. Is there any way I can do this using DNSmasq configuration? I'd prefer not to have to run multiple instances of DNSmasq on my server and use iptables to forward everything to the right one.


title: Sharing Linux Printer to windows

text: I want to share the printer connected to Linux with Windows machine, so that windows-user can print to this Linux printer. How can I do this ? P.S. I followed the http://tldp.org/HOWTO/SMB-HOWTO-9.html, but it did not worked. I am using LFS-6.0 and windows machine is XP.


title: Converting text into ASCII/ISO-8859-1

text: I'm looking for some tool that can convert text, ideally from UTF-8 (but ISO-8859-2 and WINDOWS-1250 would be fine) into ASCII/ISO-8859-1? I have seen some online transliteration tools but I need something for the command line (and iconv is refusing to convert the file).


title: mdadm Raid5 gives spares missing events

text: I succesfully builded up a raid5 array on debian testing (Wheezy). As the manpages and further tell, the array would be created as an out of sync array with just a new spare injected to be repaired. That worked fine. But after the rebuild process, I get daily messages on missing spares - but the array should be raid5 over 3 discs without spare. I think, I only need to tell mdadm, that there is and should be no spare - but how to? `mdadm -D`gives               Active Devices:  3     Working Devices: 3     Failed Devices:  0     Spare Devices:   0      and `/proc/mdstat` reads               md1: active raid5 sda3[0] sdc3[3] sdb3[1]     ##### blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]      Any ideas? Thanks in advance


title: "Debugging" with bashdb: why do I lose command echo after stepping into a simple script?

text: I heard about the _bash debugger_ ( `bashdb` ) after reading a comment so I thought I should try it out and see if it can help me analyze bash scripts or more generally the execution of commands. There are facilities which can be leveraged independently of any external program but there is the question of convenience and bashdb runs in the shell and can be called directly or with `bash --debugger command` when properly configured. So I tried something trivial in a script:               #!/usr/bin/env bash          { echo 'abc'; echo 'def'; } | cat      Which is just two `echo` commands in a _list_ uselessly piped into the `cat` command. Using `bashdb scriptname` I get:               (/home/user/bin/scriptname:3):     3:  { echo 'abc'; echo 'def'; } | cat     (/home/user/bin/scriptname:3):     3:  { echo 'abc'; echo 'def'; } | cat     bashdb<0> bashdb<(0)> step      So there is a pipe operator and a subshell is created - the parentheses around the 0 are tribute to that. I try to `step` in right away. A newline is output but I don't get back the debugger prompt... until I press enter again. By that point I have lost the output of what I type in the debugger and performance seems highly degraded. Doing `q` and pressing enter, I exit the debugger and now my terminal no longer outputs my commands either. Commands get executed but I need to exit a start a new terminal window to regain any command echo. In some cases, both in the tool and after quitting in bash, not only the commands are no longer echoed but the newline following commands is gone too. So obviously I have very little experience with that sort of software but this seems to be the desired behavior as I get similar results both on Gentoo and Archbang?? So what happened here and what did I step into?


title: Terminator: Shortcuts for Prev and Next?

text: In terminator, the keyboard shortcut `Ctrl+Shift+F` opens up a small bar at the bottom of the window to let the user search a text string within the terminal scrollback. Are there any keyboard shortcuts for moving to the **next** or **previous** matched item in this search? The most complete documentation I found for Terminator is included in the Ubuntu documentation, but it doesn't cover this topic in detail.


title: How to pop up "hidden" X application

text: This is on a RHEL6 system using GNOME (but it happens on Debian as well). I use an application called `xchat` and if you hide it using the icon in the notification area (as opposed to minimizing using window button) of the panel it will hide and only show an icon in the notification area. You can then re- activate it and pop up the window clicking that same icon. This all works fine and keeps the panel area where most apps have a button less cluttered. However if you restart the panel, either by hand using `kill -1` or it restarts as a result of an update the icon in the notification area disappears and there is no way to pop up the `xchat` window, but the process is still running fine. I was wondering if there is a way to display or "pop up" this application's window using some commands or some special tool. Right now I am forced to kill and restart it.


title: Is there a way to stop having to write 'sudo' for every little thing in Linux?

text: I'm a newbie when it comes to Linux. I do most of my development in a Windows environment. That said, I'm going to be doing a fair amount of PHP work shortly, and I'm interested in learning RoR, so I installed Linux Mint 12 in my VirtualBox. The most frustrating aspect of the switch, so far, has been dealing with Linux permissions. It seems like I can't do anything useful (like, say, copy the Symfony2 tarball from my Downloads directory to my document root and extract it) without posing as the root via sudo. Is there an easy way to tell linux to give me unfettered access to certain directories without simply blowing open all of their permissions?


title: What distro for this task?

text: Requirements:   * firewall   * internet connection sharing   * DHCP server   * Freenet (Sun Java)   * torrent   * Samba   * SSH server   * Take up as little RAM as possible.   * Must be 100% usable in console (remotely over ssh).   * **While I'm not a complete noob, I don't have a beard! I already failed trying to set up Arch Linux.**


title: bash scripting - read tarball from stdin

text: I have a task I need to script that I feel should be stupidly simple, but I'm actually having a rather tough time. I have a short bash script that takes a specific type of application in tarball form and builds it. Currently it just takes two command-line arguments: the name of the application and the location of the tarball. But I'm getting ready to deploy the build script on a multi-host system, and instead I would like this script to take the application tarball on stdin, which would be piped over ssh. For instance, here is how I would like to call the script:               ssh build-host "/usr/local/bin/build-app.sh myapp" < /tmp/myapp.tar.gz      When invoked like this, the build script would attempt to build an app called "myapp". I want the build script to perform some sanity checks before it reads in the tarball. In addition, it should exit gracefully if the sanity checks fail. So here is the gist of my first attempt at the build script:               #!/bin/bash          appname=$1          # example sanity check     if [ ! -d "/apps/$appname" ]; then         mkdir "/apps/$appname"     else         echo "Error! The app already has been built."         exit 1     fi          # more sanity checks...          # if passed all tests, then read stdin into tarfile     cat > "/apps/$appname/app.tar.gz"          # build app ...      This almost works. The problem is that I can't figure out how to read from stdin halfway through a bash script. The `cat > file` trick only works if I place it at the very first line of the script. But I don't want to do that. At the very first line of the script, none of the sanity checks have been run and there's no way to determine where to even put the tarfile. I might have multiple instances of the script running at once, and there wouldn't be a good way to avoid collisions. (In addition to `cat > file`, I've also tried tricks like `< /dev/stdin > file` with very similar results.) So I also tried the following:               #!/bin/bash          tarball="$(cat)"     appname="$1"          # example sanity check     if [ ! -d "/apps/$appname" ]; then         mkdir "/apps/$appname"     else         echo "Error! The app already has been built."         exit 1     fi          # more sanity checks...          # if passed all tests, then read stdin into tarfile     echo -n "$tarball" > "/apps/$appname/app.tar.gz"          # build app ...      But this was also quite problematic, for two reasons. First, it didn't work. `echo`, even with the `-n` flag, doesn't seem to be designed for binary data, and the resulting tarfile was corrupted. Second, this requires storing the entire tarball in as a variable as the very first step. Not only was this slower than desired, even for the 5MB test tarball, but it could also mean high memory consumption, especially for the larger applications that I will likely be dealing with. I like the idea of reading the tarfile from stdin. This would mean that the bash script can simply close the pipe if it feels it needs to abort, and it can allow the bash script to decide where to put all the application tarballs, as opposed to the original version of invoking the build script, which looked like this:               scp /tmp/myapp.tar.gz build-host:/tmp/     ssh build-host /usr/local/bin/build-app.sh myapp /tmp/myapp.tar.gz      This method of invocation is problematic for (hopefully) obvious reasons. I'm really hoping I can get this bash script to work by reading stdin or some other form of pipe or buffer. Are there any ideas for how to get this to work?


title: sed regexp for: [111]

text: INPUT                 RANDOMSTRING BLA-BLA [111] RANDOMSTRING BLA-BLA      OUTPUT                 RANDOMSTRING BLA-BLA [200] RANDOMSTRING BLA-BLA      [111] could contain various numbers with 3 digits: 120 or 300 or 400 or 101, etc.   So all I want ~this:                 sed "s/Howtos<\/a> \[111] \//`grep '^<a href="' list.txt | wc -l`/" original.txt      "Regexp'ing the 111" that's the only thing I can't figure out      The output of:               grep '^<a href="' list.txt | wc -l      would be e.g.: 200 in the example


title: Convenient way to upload a file to a server's application directory?

text: I very often need to upload some kind of file to a server, to put some application directory somewhere. Since my user account is of course unprivileged, I generally have to do this:               scp file.txt myserver:     ssh myserver     $ sudo cp file.txt /etc/app/config     $ sudo chown app:app /etc/app/config/file.txt      Four steps. I didn't go through sysadmin school, so I'm just wondering if I missed something. Is there a better way? What do other people do?   * Write local scripts for this kind of task?   * Add your user account to the same group as every application, and hope that group perms are enough?   * Log in as root?   * Make app accounts login-able?


title: how to get info. about different versions of a binary package which are not in /etc/apt/sources.list?

text: I am running Debian testing/jessie with a few packages (I can count on my fingers) from unstable/sid and a couple from experimental (browsers). As asked by Faheem, here's the output of apt-cache policy .               $ apt-cache policy     Package files:      100 /var/lib/dpkg/status          release a=now      500 http://debian.ec.as6453.net/debian/ experimental/main Translation-en      500 http://debian.ec.as6453.net/debian/ experimental/contrib Translation-en        1 http://debian.ec.as6453.net/debian/ experimental/contrib amd64 Packages          release o=Debian,a=experimental,n=experimental,l=Debian,c=contrib          origin debian.ec.as6453.net        1 http://debian.ec.as6453.net/debian/ experimental/main amd64 Packages          release o=Debian,a=experimental,n=experimental,l=Debian,c=main          origin debian.ec.as6453.net      500 http://debian.ec.as6453.net/debian/ unstable/non-free Translation-en      500 http://debian.ec.as6453.net/debian/ unstable/main Translation-en      500 http://debian.ec.as6453.net/debian/ unstable/contrib Translation-en        1 http://debian.ec.as6453.net/debian/ unstable/non-free amd64 Packages          release o=Debian,a=unstable,n=sid,l=Debian,c=non-free          origin debian.ec.as6453.net        1 http://debian.ec.as6453.net/debian/ unstable/contrib amd64 Packages          release o=Debian,a=unstable,n=sid,l=Debian,c=contrib          origin debian.ec.as6453.net        1 http://debian.ec.as6453.net/debian/ unstable/main amd64 Packages          release o=Debian,a=unstable,n=sid,l=Debian,c=main          origin debian.ec.as6453.net      500 http://security.debian.org/ jessie/updates/main Translation-en      600 http://security.debian.org/ jessie/updates/main amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian-Security,c=main          origin security.debian.org      500 http://debian.ec.as6453.net/debian/ jessie-updates/non-free Translation-en      500 http://debian.ec.as6453.net/debian/ jessie-updates/main Translation-en      500 http://debian.ec.as6453.net/debian/ jessie-updates/contrib Translation-en      500 http://debian.ec.as6453.net/debian/ jessie-updates/non-free amd64 Packages          release o=Debian,a=testing-updates,n=jessie-updates,l=Debian,c=non-free          origin debian.ec.as6453.net      500 http://debian.ec.as6453.net/debian/ jessie-updates/contrib amd64 Packages          release o=Debian,a=testing-updates,n=jessie-updates,l=Debian,c=contrib          origin debian.ec.as6453.net      500 http://debian.ec.as6453.net/debian/ jessie-updates/main amd64 Packages          release o=Debian,a=testing-updates,n=jessie-updates,l=Debian,c=main          origin debian.ec.as6453.net      500 http://debian.ec.as6453.net/debian/ jessie/non-free Translation-en      500 http://debian.ec.as6453.net/debian/ jessie/main Translation-en      500 http://debian.ec.as6453.net/debian/ jessie/contrib Translation-en      600 http://debian.ec.as6453.net/debian/ jessie/non-free amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=non-free          origin debian.ec.as6453.net      600 http://debian.ec.as6453.net/debian/ jessie/contrib amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=contrib          origin debian.ec.as6453.net      600 http://debian.ec.as6453.net/debian/ jessie/main amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=main          origin debian.ec.as6453.net     Pinned packages:      I know three commands to find versions of a package but both these commands take cognizance of the fact of what is there in my `/etc/apt/sources.list` and then tells/shares it. I am taking wordpress as an example to share and show:               $ aptitude versions wordpress     Package python-wordpresslib:                   p   1.1-1                                      testing,unstable           600           Package ruby-omniauth-wordpress:     p   0.2.1-1                                    testing,unstable           600           Package wordpress:     p   3.9.2+dfsg-1                               testing                    600      p   4.0+dfsg-1                                 unstable                   1             Package wordpress-l10n:     p   3.9.2+dfsg-1                               testing                    600      p   4.0+dfsg-1                                 unstable                   1             Package wordpress-openid:     p   3.3.4-1                                    testing,unstable           600           Package wordpress-shibboleth:     p   1.4-2                                      testing,unstable           600           Package wordpress-theme-twentyfourteen:     p   3.9.2+dfsg-1                               testing                    600      p   4.0+dfsg-1                                 unstable                   1             Package wordpress-theme-twentythirteen:     p   3.9.2+dfsg-1                               testing                    600      p   4.0+dfsg-1                                 unstable                   1             Package wordpress-theme-twentytwelve:     p   3.9.2+dfsg-1                               testing                    600      p   4.0+dfsg-1                                 unstable                   1             Package wordpress-xrds-simple:     p   1.1-1                               As can be seen this is not so accurate, so we go to the other command :-               $ apt-show-versions -a wordpress     wordpress not installed (available for: all)      yes it's not installed so it doesn't show me everything. Let me do a stand-in example instead which is installed to show the info. it has :-               $ apt-show-versions -a iceweasel     iceweasel:amd64 31.0-3 install ok installed     iceweasel:amd64 31.0-3      jessie       debian.ec.as6453.net     No testing-updates version     iceweasel:amd64 31.1.0esr-1 unstable     debian.ec.as6453.net     iceweasel:amd64 32.0-1      experimental debian.ec.as6453.net     iceweasel:amd64/jessie 31.0-3 uptodate      and lastly apt-cache policy.               $ apt-cache policy wordpress     wordpress:       Installed: (none)       Candidate: 3.9.2+dfsg-1       Version table:          4.0+dfsg-1 0               1 http://debian.ec.as6453.net/debian/ unstable/main amd64 Packages          3.9.2+dfsg-1 0             600 http://debian.ec.as6453.net/debian/ jessie/main amd64 Packages      Now this misses out on listing from stable. Does anybody know of a utility which does the same work, takes few seconds to a minute to figure out what versions of a package are listed in the PTS against which release and share that info. If there is no utility but instead a shell script is needed to do the same, how the shell script would look/be needed. It basically would need to grab the versions info. and which track (stable,testing, unstable, experimental) they follow and give the answer to user. I tried to find either a utility or a shell script but failed miserably. If anybody has any idea, please let me know.


title: Does Android break GPL?

text: Just got curious. If Android is based on a modified Linux Kernel and its source code is closed, doesn't it violate the terms of GPL2, that GPL- derivatives must also supply their source code, "Liberty or Death"? :)