title: how to write `fuser -k -n tcp 80` into a bash script?

text: Recently, my site's visitor-ship increased sharply. My Apaches' always crash. I'm seeing lines like these in the httpd/error_log:               [Sun Apr 13 08:57:18 2014] [warn] child process 7792 still did not exit, sending a SIGTERM     [Sun Apr 13 08:57:20 2014] [error] child process 7925 still did not exit, sending a SIGKILL     ...      I will be upgrading my server in the next month. Before that, I'm trying to write a Bash script to automatically restart Apache with a crond job, which checks every 5 minutes. If `curl`ing some page does not return a 200 code, then `fuser -k -n tcp 80` and `/etc/init.d/httpd restart`. I'm not good at Bash scripting. I've found some working code which will only restart Apache.               #!/bin/bash          curl -I http://www.mydomain.com/some-empty-page 2>/dev/null \         | head -1 | grep -q " 200 OK"          if [ $? -eq 0 ]; then        echo ""     else        /etc/init.d/httpd restart       echo "wrong $(date)" >> /home/myspace/restart_log.txt     fi      How can I modify this to kill all the jobs which use port 80 before restarting? I'm intending to insert some working line like:               else fuser -k -n tcp 80       /etc/init.d/httpd restart       echo "wrong $(date)" >> /home/myspace/restart_log.txt     fi       NOTE: first `else fuser -k -n tcp 80`, then do `/etc/init.d/httpd restart` in the else case.


title: How to create a custom Linux distribution?

text: Can any one tell me the easiest way to create a system with live cd with installing function. Which can install backtrack all tools?? I need to create a custom boot animation and everything!


title: Possible to configure Login TTY over Audio device (Morse code or similar)?

text: One of the most miserable aspects of my day job is the need to occasionally investigate problems with machines scattered in remote locations all over the world that don't have network access to the outside world. Sometimes its possible for local staff to tether over a 3G or similar modem to provide access, but often thats not possible due to lack of signal or lack of technical ability on site. In these cases I have to make due with a telephone whatever local technician (or sometimes janitor) is available to work with me, typing in the commands I recite to them and responding with the output, often someone with limited or no linux or even computer experience. Often getting a more qualified technician to the site would require chartering a flight. I can confirm that talking someone through editing a file in vi who doesn't know the difference between 'slash' and 'backslash', how to hold shift to generate a colon instead of a semicolon is excruciatingly painful. "Ok, now its showing a squiggly thing followed by a kind of weird looking line thing and then another squiggly thing". Oh, and it beeped on me with some sort of error message that I didn't read. Basically I'm using the person on site as a very slow phone->terminal converter with an amazingly high error rate. I had the idea to cut out the middle man and using a speaker and microphone on the computer and tell the tech to just hold their cellphone up to the machine and use it as a very old- school acoustically coupled 'modem', Where I would run a terminal program on my computer which would convert my lines to some sequence of tones that could be transmitted over the phone, into the Linux machine, and be converted back into commands, the output of which would then get converted to tones, back over the phone ,etc, providing me in effect with an extremely slow terminal. There are a few methods for tranmitting data which may survive cell phone transmission, such as Morse Code or OliviaMode. I was hoping for information on packages to accomplish this either in whole, or as various pieces that I could use to construct this solution, or provide other ideas about how I could accomplish this task. Google has turned out nothing of use, with the exception of the aforementioned 'OliviaMode' which could possibly be used as a transmission protocol.


title: rsyslog: how to bind rulesets to unix sockets (imuxsock)

text: I'm using the imuxsock module to listen to additional local log sockets (i.e., with the `$AddUnixListenSocket` directive). After reading the awesome http://www.rsyslog.com/doc/multi_ruleset.html page, I'm interested in binding separate rulesets to each socket. That page gives the example of binding a ruleset to a particular tcp port (i.e., using the imtcp module & it's `$InputTCPServerBindRuleset` directive), but according to that page: > Note that the input module must support binding to non-standard rulesets, so > the functionality may not be available with all inputs. I haven't been able to find any documentation on how to do the same with imuxsock. Is the feature there, but undocumented? Or is there some _other_ way to accomplish the same (applying _X_ rules to messages from _X_ socket and _Y_ rules to messages from _Y_ socket)?


title: Make sed ask for confirmation before each replacement?

text: Is there a way to make sed ask me for confirmation before each replace? Something similar to 'c' when using replace inside vim. Does sed do this at all?


title: Winbind PAM.D AD Groups, CentOS 5, Allow Only?

text: I'm attempting to create a configuration, where users in specified AD groups can log in. I'm having trouble stopping every AD user from logging in. I've been doing this though `/etc/pam.d/sshd/` but is such a setup possible through `/etc/pam.d/login`? Wouldn't that be a safer option? I also really dislike `winbind`, and prefer the Kerberos+LDAP method, but unfortunately I'm not able to switch at this moment. I appreciate any help, as I've been reading for a while and have not found solid direction. These are the current pam.d configuration files, ### `/etc/pam.d/system-auth`               #%PAM-1.0     # This file is auto-generated.     # User changes will be destroyed the next time authconfig is run.     auth        required      pam_env.so     auth        sufficient    pam_unix.so nullok try_first_pass     auth        requisite     pam_succeed_if.so uid >= 500 quiet     auth        sufficient    pam_winbind.so use_first_pass     auth        required      pam_deny.so          account     required      pam_unix.so     account     sufficient    pam_succeed_if.so uid < 500 quiet     account     [default=bad success=ok user_unknown=ignore] pam_winbind.so     account     required      pam_permit.so          password    requisite     pam_cracklib.so try_first_pass retry=3     password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok     password    sufficient    pam_winbind.so use_authtok     password    required      pam_deny.so          session     optional      pam_keyinit.so revoke     session     required      pam_limits.so     session     optional      pam_oddjob_mkhomedir.so     session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid     session     required      pam_unix.so      ### `/etc/pam.d/login`               #%PAM-1.0     auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so     auth       include      system-auth     account    required     pam_nologin.so     account    include      system-auth     password   include      system-auth     # pam_selinux.so close should be the first session rule     session    required     pam_selinux.so close     session    optional     pam_keyinit.so force revoke     session    required     pam_loginuid.so     session    include      system-auth     session    optional     pam_console.so     # pam_selinux.so open should only be followed by sessions to be executed in the user context     session    required     pam_selinux.so open      ### `/etc/pam.d/sshd`               #%PAM-1.0     auth       include      system-auth     account    required     pam_nologin.so     account    include      system-auth     account    sufficient   pam_succeed_if.so user ingroup DOMAIN\Group_1     account    sufficient   pam_succeed_if.so user ingroup DOMAIN\Group_2     account    sufficient   pam_succeed_if.so user ingroup DOMAIN\Group_3     password   include      system-auth     session    optional     pam_keyinit.so force revoke     session    include      system-auth     session    required     pam_loginuid.so


title: Can't find smbfs package in Debian Wheezy

text: In squeeze there was a package `smbfs` for mounting samba filesystems. In wheezy this is no longer present. What is the new package name? Is there a general formula to solve problems like this?


title: How to skip vim message "Press Enter..." after running bash commands

text: After running bash commands(e.g `!mv file1 file2`) vim outputs result of that command and prints this message: _Press Enter or type command to continue_ Is there a way to skip this message and return to vim automatically?


title: Defining IPv6 chains in ip6tables-restore/iptables-restore files, is it possible?

text: The format for the files generated by `iptables-save`/`ip6tables-save` and loadable through `iptables-restore`/`ip6tables-restore` stipulates that one can prepend `-4` or `-6` respectively so as to maintain the rules for IPv4 and IPv6 in the same single file. The lines with `-4` are ignored by `ip6tables-restore` and the ones with `-6` are ignored by `iptables-restore`. Now, this seems only to apply to _rules_. How can I create a chain (`:CHAINNAME -`) only for **either** stack? That is, if I have something like (excerpt):               *filter     :ICMPv6 -     -6 -A INPUT -p icmpv6 -j ICMPv6      how can I make sure that the chain is only created for the IPv6 stack but not the IPv4 stack? Is this at all possible?


title: CentOS 4.8 and glibc 2.5

text: How would I go about installing glibc 2.5 on CentOS 4.8? I know CentOS 4.8 has been EOL'd, which is all good and well. However, the environment that I am working in is using this version, and will be for a while. So, it's what I am stuck with. I'm familiar with using `yum`, but not so familiar with using `rpm`.


title: Indirect return of all elements in an array

text: The Bash man page describes use of `${!a}` to return the contents of the variable whose name is the contents of `a` (a level of indirection). I'd like to know how to return all elements in an array using this, i.e.,               a=(one two three)     echo ${a[*]}      returns               one two three      I would like for:               b=a     echo ${!b[*]}      to return the same. Unfortunately, it doesn't, but returns `0` instead. **Update** Given the replies, I now realise that my example was too simple, since of course, something like:               b=("${a[@]}")      Will achieve exactly what I said I needed. So, here's what I was _trying_ to do:               LIST_lys=(lys1 lys2)     LIST_diaspar=(diaspar1 diaspar2)          whichone=$1   # 'lys' or 'diaspar'          _LIST=LIST_$whichone     LIST=${!_LIST[*]}      Of course, carefully reading the Bash man page shows that this won't work as expected because the last line simply returns the indices of the "array" `$_LIST` (not an array at all). In any case, the following should do the job (as pointed out):               LIST=($(eval echo \${$_LIST[*]}))      or ... (the route that I went, eventually):               LIST_lys="lys1 lys2"     ...     LIST=(${!_LIST})      Assuming, of course, that elements don't contain whitespace.


title: Rebooting makes me lose my password-less keys on other machines

text: When I reboot my machine (as I did today) I seem to lose some functionality, specifically my previous ssh keys that I had copied over to other machines that had allowed me to login without a password seem to have stopped functioning. I've tried replacing the key by generating a new key, destroying the old keys on both my current machine and in the ~/.ssh/authorized_keys on the remote but no luck. I also tried to copy the key back over using the command below but it still doesn't seem to function.               ssh-copy-id <myusername>@<remoteserver>      Any ideas would be helpful.


title: How to build-compile a .c file

text: I have little experience with LINUX . I am using Debian.   It has a library glibc which has several useful programs.   iconv is the program that i want to use to do several charset conversions...   However i want to create my charset to use it at a really old from 1978 dot matrix heavy duty printer which has a custom charset for my language... Capital latin /greek only 7 bit   So i should write my own module for iconv...   I found how to configure it and make it but i dont know how to do the compilation.. from source .c file to .so file.... If there is no solution i will try to build from source the libc libray and copy the .so file that it should generate (think so)...


title: How much disk space do I need to install Fedora?

text: I want to install Fedora 20 with GNOME 3. How much disk space do I need?


title: Implementing a Unix shell in C: Logging

text: I am currently working on implementing my own UNIX shell in C. The basis of the shell is working, you could find the source code here. Right now my next task is to implement a logging feature for the shell. So here's my question: What are the UNIX/Linux best practices to do that? The simple way would be to open a file and write to it every time. But I was wondering if there is a function that would take care of that for me, helping me produce ... "cleaner"... code. Thank you in advance for your help, I'm quite new to programming, but I want to do things right. PS: If you have any general remarks about the rest of the code, they'd be greatly appreciated :-)


title: Create an RPM to distrubute custom SELinux policy

text: I have created two custom SELinux Policy modules to allow rsyslog to parse audit.log. Can I create an RPM of these two policies to distribute to 300+ clients? Is there a better way to go about this? The clients are CentOS 5.10 machines.


title: Bash: Capture / Use last (or Nth) line in stdout

text: # Query I use Bash. When I'm looking for files, often I'll do the following: `find -name stackexchange.hs` And often the results will look like:               /youre/the/man/now/dog/stackexchange.hs     /you/are/no/longer/the/dog/dog/stackexchange.hs     /this/is/the/file/i/want/stackexchange.hs      Then I'll want to do one of the following:   * Option 1: Open the last item in the list of results in **vim**.   * Option 2: Open the Nth item in the list of results in **vim**. Currently, I cut-and-paste with the mouse. Which brings me to my **question** :   1. Is there an easy, one-liner to accomplish options 1&2? Note that this is occurring _after_ the `find` command.   2. Is there a way to capture N-lines from stdout in some kind of bash vector/array?  ## Ideal usage               $ find -name am_i_really_all_alone.txt     ./borges/library/you_are_not_alone.txt     ./borges/library/am_i_really_all_alone.txt     $ vim (N)      (syntax and semantics may differ, but you get the point) # Similaria There seem to be several similar questions. Here are my _perceived_ differences (I am open to enlightenment):   * "Open File Found with find Command" focuses on creating a one-line to pipe a file name from `find` into `vim` (or whatever). In my case, I want to `find` first, pipe later (so to speak). My capture / usage happens strictly _after_.   * "Reuse Last Output From Command Lind" seems bang-on, but seems to simply repeat the command and doesn't speak to capturing the **Nth** line of output. Quite frankly, it scares me.   * "Capture Multi-Line Output of a Bash Builtin" is close, but not quite there.    * "What is the exact difference between terminal, shell, tty, console, etc." this one is really just a good read.  Thank you for your help! Having used *nix/BSD when I was a teenager in the 90s and getting scared away by calling my burnout, acid-head neighbour to help me install drivers for my plug-and-play sound card, I'm relieved to discuss command-line minutiae with (perceivably) less frightening individuals. It feels good to be back.


title: How to install emacs using YUM without X11 libraries?

text: I have installed a minimal installation of CentOS 6.3 inside a VirtualBox VM. Now, I would like to install Emacs for use from the command line only. When I do a search for emacs using `yum search emacs` the only application level package seems to be "`emacs`" so I run `yum install emacs` and it shows me the list of dependencies it wants to download. These dependencies `libcairo`, `libasound`, and a ton of `libX*` packages that have no business being downloaded and installed for a copy of Emacs that will be used from the command line only (I am trying to keep this minimal since this will be cloned 10 times per developer machine for network simulation but a text editor really is necessary). So, are there some flags to set to prevent all the graphical related packages from installing? I remember Gentoo's emerge had paremeters like that, or am I just installing the wrong package?


title: Debian netinst with usb modem

text: Im trying to install 64-bit debian on machine with windows and I have no way to connect internet over ethernet at this moment. I have only ZTE USB modem and Nokia N900 linux mobile phone with wifi hotspot software. I have downloaded debian-7.6.0-amd64-netinst.iso and I thought that I can "give apt internet" with wifi, with internet shared on my phone, install packages I need. I used netinst because I pay for megabytes and I don't want to pay insane cell phone bill. However, after netinst setup:   1. My Intel 4965AG network card is not detected (no wlan0 devices, WLAN LED indicator is not glowing)   2. There is no ppp and wvdial, so I can't configure modem and proceed with network installation. Im afraid, that when I try to download ppp and wvdial manually - I will reboot my laptop forever into windows to download required dependencies. **What should I do to get my internet working?**


title: Mail cron output only when Git throws a real error

text: There exists a Git repo that is on one server, we want to generate doxygen output for it on a different server. The following command works for me but has the downside of sending a mail everytime the repo is updated because Git uses stderr for progress reporting (a quick search via the almighty oracle suggests they consider this behaviour a feature). `59 * * * * cd FQNameOfRepo; git pull 1>/dev/null; make doc-all 1>/dev/null; cp doc/latex/refman.pdf doc/html/` While I could `grep` through the stderr output of Git or compare it to a known string this seems wrong. Am I using the wrong Git command? How would this be done properly? For clarification I still want this command to send a mail if a real error occurs, so simply redirecting stderr won't help.


title: how to pipe the output of cut to the foreach command?

text: I have the cut command I want that grabs the first word in each line of a file. I then want to put each word from the cut command into a foreach. I then want to do a grep command inside the body of the foreach to grep for that word in another file. Something like this:               @array = (cut /tmp/10218.after -f1);      foreach $word (@lines) {         grep $word /tmp/10218.before;     }       Obviously the @array assignment doesn't work. How do I get around this? I'm sure there are many ways I just don't know what they are or which is best or good enough.


title: httpd running as apache.apache, but logs owned by root.root?

text: ps shows my httpd processes as               apache   29561 15186  0 15:30 ?        00:00:00 /usr/sbin/httpd      I'm running Centos 5.3 All the log files in /var/log/httpd are owned by root. Howcome?


title: Sending zip file containing plain txt file via email

text: How to send a plain txt file in a zip file via email in unix? The contents in the txt file should be word wrap.


title: what is the "System ID" of a LVM volume group

text: On my system, where I use LVM2, I have several volume groups. When I run `sudo vgdisplay`, I see that all of them have an empty `System ID` field. What is that field for? Is that correct to have it empty for a volume group? For information my system is Linux Fedora 20.


title: Why did my package get installed to /opt?

text: A while back I installed couchdb from source on my debian machine. It seemed to install okay and everything worked. A few weeks later I wanted to upgrade and installed from a .deb using dpkg. Everything now seems to have been installed under `/opt`. It all seems to work fine, but I don't really understand why it's all been installed under `/opt`. It doesn't feel as "smooth" as when things were installed directly into `/usr/local/bin` and `/etc` and `/var/log`. It's more cumbersome to configure than when I previously just edited the configuration files that were installed under /etc/couchdb Would someone mind explaining to me why installation to `/opt` is "a good thing" and why this is a better way of doing things than the previous installation which was from the source? I know this is a rather vague question but I'm only competent with Linux not an expert and don't understand the thinking behind installing to `/opt`


title: My computer beeps while copying files

text: Whenever I create disk activity on my memory stick, my headphones create very annoying beeps at various notes. It doesn't happen with my in built speakers, and it hasn't happened before. I'm on Ubuntu 13.10, how can I stop this happening


title: Blu-ray or DVD-Audio: How to rip an LPCM 2.0 (192kHz, 24-bit) track and encode it to FLAC?

text: Is it possible rip a Blu-ray Audio or a DVD-Audio disc containing an LPCM 2.0 (192kHz, 24-bit) track and encode it to FLAC? FLAC is certainly capable of encoding to such resolution, but I'm not sure about the ripping part. I've heard that this _might_ be supported by `cdparanoia`, but from their website I cannot confirm that. So, taking the TrondheimSolistene: Divertimenti Blu-ray disc as an example, how do you rip the LPCM 2.0 (192kHz, 24-bit) track?


title: How to add bootloader to ISO? Or, make ISO bootable?

text: How do I add a bootloader to a Linux ISO? When I `isoinfo -d -i ...` I do not see the bootloader on one of the ISO's that I have; but on another ISO there is a bootloader.


title: Problems reading files that have been written to the /tmp directory

text: I've recently started using Vagrant, running Debian for my dev environment. I love the way it just works... apart from 1 small thing... My apache server is able to write files to the /tmp directory, and I can see them while running XDebugger on my machine... but it would appear that once the server has written the file, it's not able to move them out again. I've Googled various searches around Debian, Vagrant, PuPHPet (which I've used to setup Vagrant), but can't find anyone mentioning having this problem, so was hoping someone here might be able to help.


title: Show who a file is chowned to?

text: To make things brief: I can chown a file with `chown me:mygroup /tmp/file`, but how can I see who a file is already chowned to? Something like `chown --show-who` mabey... Any clean way to see who is the user and the group for a file?


title: Load a background image or set the background color if Konsole/Shell is running SSH

text: I want to set my laptop to load an image in the shell's background or set the background color to red if I'm connected via SSH. How can this be done? With a bash function in `.bashrc`? I have: Set the prompt to different colors. My terminal emulator is Konsole, KDE's terminal. I tried this but it didn't load correctly, didn't see any change in the shell. EDIT: I've managed to do it in a test but it's not the behaviour I'm looking for. The behaviour I'm looking for is to set my local system so that, when I SSH to a remote the "shell environment/shell profile" is a different one from my default, and something flashy, like red background or an image. Here is how:   This will set the background to red and text to black. It's on Debian Wheezy and there was no .bash_profile file, so create that. And in it copy/paste this there:               if [ ! -z "$SSH_CONNECTION" ] ; then         source ~/Scripts/.shell_ssh_bashrc  ## This file contains the command to execute if it's an SSH session.     fi      * * * Create a custom bashrc file for use if this is SSH session(remote shell) And copy/paste this there:               setterm -term linux -back red -fore black -clear      This would mean that I would have to make this configuration on all the remote's.


title: Incompatible versions of libsqlite3-0 (i386 and amd64) block each other

text: I'm trying to install the various i386 libraries required for skype on linux (debian 7.0 wheezy 64-bit), but I've run into a problem where apparently the two versions of libsqlite-3-0 are each blocking the other. Here's the output from aptitude:               libsqlite3-0 : Breaks: libsqlite3-0:i386 (!= 3.7.16.2-1~bpo60+1) but 3.7.13-1+deb7u1 is to be installed.     libsqlite3-0:i386 : Breaks: libsqlite3-0 (!= 3.7.13-1+deb7u1) but 3.7.16.2-1~bpo60+1 is installed.      I've done a bit of tracking, and here is what I know about those packages:   * libsqlite3-0:i86 is not yet installed.   * libsqlite3-0:amd64 (the normal one) is installed, but instead of the wheezy default of 3.7.13-1, I have a different version from squeeze-backports (from before I upgraded to wheezy): 3.7.16.2-1.   * A google search for libsqlite3-0 3.7.16.2-1 finds several pages about iceweasel. I've tried removing iceweasel, but that's not an option; gnome-core depends on it apparently. Any ideas for how to resolve this, or investigate further? * * * FYI: derobert's advice got this sorted. The command I needed was this one, to downgrade the libsqlite3-0 (amd64) package: `aptitude install` _package_`=` _version_ e.g. in this case `aptitude install` _libsqlite3-0_`=` _3.7.13-1+deb7u1_ in full:               root@hephaestus:/etc/apt# aptitude install libsqlite3-0=3.7.13-1+deb7u1     The following packages will be DOWNGRADED:       libsqlite3-0      0 packages upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.     Need to get 455 kB of archives. After unpacking 48.1 kB will be freed.     Get: 1 http://ftp.uk.debian.org/debian/ wheezy/main libsqlite3-0 amd64 3.7.13-1+deb7u1 [455 kB]     Fetched 455 kB in 1s (452 kB/s)            dpkg: warning: downgrading libsqlite3-0:amd64 from 3.7.16.2-1~bpo60+1 to 3.7.13-1+deb7u1     (Reading database ... 179321 files and directories currently installed.)     Preparing to replace libsqlite3-0:amd64 3.7.16.2-1~bpo60+1 (using .../libsqlite3-0_3.7.13-1+deb7u1_amd64.deb) ...     Unpacking replacement libsqlite3-0:amd64 ...     Setting up libsqlite3-0:amd64 (3.7.13-1+deb7u1) ...


title: When is it important to write portable scripts?

text: Most code I write is in PHP. I have recently started learning shell scripting. Most of the resources and tutorials that I've come across are specific to Bash. Some warn about bashisms and some don't. I've been reading a lot on here and Stack Overflow. Whenever an answer uses **bashisms** , someone will inevitably comment to say: > You shouldn't use <insert bashism here>. It's not portable. This happens even when the question was tagged with `bash`. To me, that's like telling a PHP programmer that they shouldn't use code that's new in PHP 5 because it can't be used with PHP 4. Or telling someone they shouldn't write something for Mac because it can't be used on Windows. When I write in PHP, I pick a minimum requirement and I write _forward_ -compatible code. I don't worry about making it _backward_ -compatible. If I use `#!/bin/bash` as the shebang, why shouldn't I use bashisms? I'm starting to get the impression that some people just like to _bash_ bashisms (pun intended) just for the sake of it. People often use `bash` and `shell` interchangeably - probably due to the fact that bash is the default shell on many systems. So I can understand adding a comment to warn that the code uses bashisms, but I don't understand the implication that it's _wrong_ to use them. Obviously, if I am writing a script strictly for personal use I can write it in whatever language I want. But I'd like to think some of the code I write could be useful to others. I tried searching for an answer to my question before posting. I found a lot of information about **_how** to test_ for portability, but couldn't find anything about **_when** it's important_ to do so. **So, when is it important to write portable scripts?** For example,   * what types of scripts should be as portable as possible?   * how common are systems that do not have Bash installed?   * if the system has Bash installed, will it also have the GNU version of _find_ and other utilities?


title: Is there any text editor that will show code highlighting for Visual Basic code?

text: I have some Visual Basic Application (VBA) code that I need to tweak. Note: I don't need any help in the coding aspect of it; this is not a programming question. When I opened the .vba file in Kate or Gedit, I saw that neither of them have highlighting/syntax knowledge of Visual Basic code. I understand that I cannot actually run vba code natively, but I would like to know if there exists a plugin that will run on some text editor to do basic code highlighting. Does anyone know of a text editor or custom written plugin that I can use?


title: Different rsync behavior for identical directory name

text: I want to synchronize 2 codebases. The below command is working great, except that it doesn't account for one use case that I have with 2 directories named **test** in different locations:   * /test/   * /start/test/ `$ rsync -avCz --delete-before --progress --exclude=test /tmp/codebase/ .` What I want to do is to exclude the **/test** directory completely from the rsync but I do want **/start/test** to be rsync'ed. I'd prefer not to have to come up with a static TXT file that I should pass as an argument to rsync. Is there any way to achieve this otherwise? Playing with **--include** VS **--exclude** and a trailing slash ( _--exclude=test/_ ) didn't work as anticipated for me.


title: how to extract pattern from pdf and save to text file

text: How can I extract some pattern contained in PDF file to text file using shell?


title: Installing Windows On PC with Linux Mint

text: I recently installed Linux Mint on my computer but have decided I would prefer to have a dual boot system. I wish to re-install my Windows 7 and create a dual boot afterwards but am having trouble i was hoping some of you guys could help me with When I put in the Windows CD, the computer boots from the CD but then doesn't expand the windows files onto the disk If I attempt to go to the BIOS, I get transferred to a black screen with a prompt for something called `grub`. Can anyone help?


title: TLP overrides auto-suspend configuration

text: On my ThinkPad x201, I've been having problems where the computer will shutdown once it has been suspended to RAM, so I disabled the auto-suspend when the lid is closed by editing `/etc/systemd/logind.conf`:               #HandleHibernateKey=hibernate     HandleLidSwitch=None     #PowerKeyIgnoreInhibited=no      This works fine, however, when running tlp, my computer starts to suspend again. I have looked through the arch wiki and the documentation, but still haven't found a flag that controls this. Is there any way to control tlp's override of the auto-suspend feature when laptop lids are closed?


title: Nginx listens at a port, only responds if set to port 80

text: OS: Funtoo. I have bound NGINX to port 81 (I want to run it alongside my Apache server for a short time for ease of transition), and it listens at the port (If I point at another port, using wget I get "Connection refused", but using port 81 I get "connected") but it never serves an HTML response of any kind! When running a wget on the port, from the localhost, I get:               # wget localhost:81     -2014-04-16 23:56:45- http://localhost:81/     Resolving localhost... 127.0.0.1     Connecting to localhost|127.0.0.1|:81... connected.     HTTP request sent, awaiting response...      On another computer...               $ wget 192.168.18.42:81     -2014-04-16 23:57:19- http://192.168.18.42:81/     Connecting to 192.168.18.42:81... connected.     HTTP request sent, awaiting response...      Nothing ever happens after that. The documents exist, it's the normal Funtoo nginx.conf. UPDATE: I can make it listen to port 80, but it still rattles me that I can't get it to work on any port....               netstat -aWn | grep 81 | grep LISTEN     tcp 60 0 0.0.0.0:81 0.0.0.0:* LISTEN      Edit: Configuration files:               user nginx nginx;     worker_rlimit_nofile 6400;          error_log /var/log/nginx/error_log info;          events {         worker_connections 1024;         use epoll;     }          http {         include /etc/nginx/mime.types;              # This causes files with an unknown MIME type to trigger a download action in the browser:         default_type application/octet-stream;              log_format main             '$remote_addr - $remote_user [$time_local] '             '"$request" $status $bytes_sent '             '"$http_referer" "$http_user_agent" '             '"$gzip_ratio"';              client_max_body_size 64m;              # Don't follow symlink if the symlink's owner is not the target owner.              disable_symlinks if_not_owner;         server_tokens off;         ignore_invalid_headers on;              gzip off;         gzip_vary on;         gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/x-icon image/bmp;              sendfile on;         tcp_nopush on;         tcp_nodelay on;              index index.html;         include /etc/nginx/sites-enabled/*;     }      Server block:               server {         listen  *:81;         root    /usr/share/nginx/html;         location / {             index   index.html;         }     }


title: System environment variables not appearing in sudo

text: I have the following line my /etc/environment file:               BROKER_URL=tcp://xxx.30.8.163:61616      I run this and get:               $ set|grep BROKER_URL     BROKER_URL=tcp://xxx.30.8.163:61616      Then, I run:               $ sudo bash     # set|grep BROKER_URL     #       This is supposed to be a system wide environment variable. Why doesn't it show up in my sudo shell?


title: sudoers: NOPASSWD in same line as PASSWD:ALL?

text: Is this combination legal:               username ALL=(ALL) NOPASSWD: /usr/bin/foo, PASSWD:ALL      or do they conflict or cancel each other out?


title: + or @ mark after running 'ls -al'

text: In Mac OS X, run 'ls -al' gives me something like this.               drwxrwxrwx+  4 smcho  staff     136 May  5 09:18 Public     drwxr-xr-x+  6 smcho  staff     204 Feb  1  2010 Sites     drwxrwxrwx   9 smcho  staff     306 Feb  2  2010 backup     drwxr-xr-x@ 36 smcho  staff    1224 Sep  4 22:51 bin        * What's the + or @ at the end of the first column means?   * Is this unique to Mac, or common in UNIX? ## ADDED After Michael Mrozek's answer, I ran 'ls -ale' to get the following.               drwx------+ 66 smcho  staff    2244 Aug 30 13:40 Library      0: group:com.apple.sharepoint.group.3 allow search      1: group:everyone deny delete     drwxr-xr-x   3 smcho  staff     102 Sep  4 15:01 Mail     drwx------+ 13 smcho  staff     442 Aug 28 17:55 Movies      0: group:everyone deny delete     drwx------+  6 smcho  staff     204 Jul  9 09:37 Music      0: group:everyone deny delete     drwx------+ 11 smcho  staff     374 Aug 28 16:55 Pictures      0: group:everyone deny delete     drwxr-xr-x   3 smcho  staff     102 Mar 18 15:43 Projects     drwxrwxrwx+  4 smcho  staff     136 May  5 09:18 Public      0: group:everyone deny delete     drwxr-xr-x+  6 smcho  staff     204 Feb  1  2010 Sites      0: group:everyone deny delete      What those appended messages mean? Why do I have them for some of the files? I don't remember doing anything particular for them.


title: How to change background color of side pane of Kate and Kile?

text: I am trying to customize the color scheme of Kile/Kate. I could do it, except I could not find any way to change the color of the side pane such as files, etc. I prefer dark background, and having dark background in editing space and white background in the left pane is not good for my eyes.


title: Dynamically trim stdout line width in Bash

text: Lately, I have been experimenting with the `ps` command, and sometimes long paths wrap to the next line (or two) and make it hard to read. I want to pipe the `ps` output into another program to limit the output to `x` number of characters. Here is what I have so far, but it doesn't work quite right:               ps aux | cut -c1-$(stty size | cut -d' ' -f2)      `$(stty size | cut -d' ' -f2)` evaluates to 167, but doesn't seem to be valid input for `cut`. Is there a way to get this type of syntax to work in bash?


title: How to remove kernel module if it's still in use?

text: [rootSERVER ~]# rmmod -f cifs     ERROR: Removing 'cifs': Resource temporarily unavailable     [rootSERVER ~]# modprobe -r cifs     FATAL: Module cifs is in use.     [root@SERVER ~]# lsb_release -a     LSB Version:    :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch     Distributor ID: Scientific     Description:    Scientific Linux release 6.1 (Carbon)     Release:    6.1     Codename:   Carbon     [root@SERVER ~]#       I tried               rmmod -fw cifs      but it just waited for ages... (and yes, all cifs shares are "umount -l"-ed before trying to remove cifs module..) **QUESTION** : how can I remove the cifs module??


title: Samba write permission problem

text: I use Samba to share printers, files, etc. But I have a problem. The place to share not writable. Writable is only user directory. I attach the smb.conf file. smb.conf               #     # Smb.conf file by PepinCZ on HOME-SERVER 192.168.1.13      #          #======================= Global Settings =======================          [global]        workgroup = WORKGROUP        server string = %h        netbios name = HOME-SERVER        security = user        dns proxy = no     ;  name resolve order = lmhosts host wins bcast          #### Networking ####          ;   interfaces = 127.0.0.0/8 eth0     ;   bind interfaces only = yes                    #### Debugging/Accounting ####             log file = /var/log/samba/log.%m        max log size = 1000        syslog = 0        panic action = /usr/share/samba/panic-action %d               ####### Authentication #######             encrypt passwords = true         passdb backend = tdbsam        obey pam restrictions = yes        unix password sync = yes        passwd program = /usr/bin/passwd %u        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully*        pam password change = yes        map to guest = bad user          ########## Domains ###########             domain logons = yes     ;   logon path = \\%N\profiles\%U)     ;   logon drive = H:     #   logon home = \\%N\%U     ;   logon script = logon.cmd     ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u     ; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u     ; add group script = /usr/sbin/addgroup --force-badname %g          ########## Printing ##########          #   load printers = yes     ;   printing = bsd     ;   printcap name = /etc/printcap     ;   printing = cups     ;   printcap name = cups          ############ Misc ############          ;   include = /home/samba/etc/smb.conf.%m     #         SO_RCVBUF=8192 SO_SNDBUF=8192     #   socket options = TCP_NODELAY     ;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &     #   domain master = auto     ;   idmap uid = 10000-20000     ;   idmap gid = 10000-20000     ;   template shell = /bin/bash     ;   winbind enum groups = yes     ;   winbind enum users = yes        usershare max shares = 100        usershare allow guests = yes          #======================= Share Definitions =======================          [homes]        comment = Složka uživatele %u        browseable = no        read only = no        create mask = 0700        directory mask = 0700        valid users = %S          [profiles]        comment = Uživatelské účty        path = /home/samba/profiles        guest ok = no        browseable = yes        read only = no        create mask = 0600        directory mask = 0700          [printers]        comment = Tiskárny        browseable = no        path = /var/spool/samba        printable = yes        guest ok = no        read only = yes        create mask = 0700          [print$]        comment = Ovladače k tiskárnám        path = /var/lib/samba/printers        browseable = yes        read only = yes        guest ok = no     ;   write list = root, @lpadmin          [Web Server]        comment = Web Server        path = /var/www        browseable = yes        guest ok = no        read only = no        public = yes        write list = root, user, pepincz          [Server System]        comment = Systém serveru HOME-SERVER        path = /        browseable = yes        guest ok = no        read only = yes          [Disk]        comment = Úložný prostor        path = /share        browseable = yes         guest ok = no        read only = no        public = yes        write list = root, user, pepincz, tata, lucka      getfacl /share:               getfacl: Removing leading '/' from absolute path names     # file: share     # owner: root     # group: root     user::rwx     group::r-x     other::r-x      ls -l /share:               0       Please help me. I do not know why it does not work. Thank you guys!


title: Processing multiple mails in a Postfix mailbox by making cronjob run per second-is that considered good practice?

text: I need to process at least three thousand incoming emails an hour that are received in a postfix mailbox. Processing involves extracting email attachments and sending the content of an email attachment to an external email address. For each email attachment I send one email. I think I could achieve this by writing a script to cronjob to sleep every second but I am not sure that this is good practice(doing this will easily give me approximate 3600 mails processed an hour). Please advise on the best way to approach this. I already have a script that extract emails and sends email, the only problem with the scripts is that it can only handle one email at a time. If I use per minute cronjob I can only process 60 mails per hour while the target is really at least 3000 mails per hour. Please advise.


title: Is it possible to limit  how much CPU power a process can take?

text: I'm wondering, is there way to tell a process how much processor power it can take? The problem is I'm converting video with _Arista_ (video converter) and I'm annoyed by the fan running like crazy, when I look at the task monitor, it's taking over 92% of CPU. Can I (somehow) tell it that it can take just 20%? Thanks


title: Combine LVM logical volumes?

text: It's a server with 128GB SSD. There are two LVs, / and /home. I want to combine them into one since the space is limited. I checked the HOW- TO but didn't found the tutorial for this task. How can I combine them?


title: Restore a Linux backup on virtual machine

text: I have made a backup of my Linux OS in a `bacukp.tgz`, the OS is Centos 6.4. Now I want to create a new VMWare virtual machine from it. Do I first need to install Centos from CD or ISO, and then overwrite all the files with backup or is there any way I can directly start with the backup? This is what I used to do the backup:               tar cvpzf /TEMP_BACKUPS/backup.tgz \       --exclude=/proc \       --exclude=/lost+found \       --exclude=/tmp \       --exclude=/TEMP_BACKUPS \       --exclude=/mnt \       --exclude=/sys \       / > /TEMP_BACKUPS/mylog.txt


title: How to make gnome 3's 'Type to search' search more places?

text: It seems it only returns object in /home/*my_username*, how can I make it return objects in symbolic links or another partition?


How to copy or move to folder in Nautilus 2.30.1 like in Windows Explorer? The only such options available in the context menu point to Home or Desktop, when I want to copy or move to another folder or drive.


title: How to install Gnome 3 on Debian Squeeze (Gnome 2)?

text: I would like to remove my Gnome 2 desktop to replace it with Gnome 3, because I do not want to update to Debian Wheezy. How can I do that?


title: What is the main problem someone migrating from bash to zsh should face?

text: A few times I have had problems in bash that other using zsh didn't have and they were gloating about how smart they are.   Also I have seen zsh users among people that I admire, and I have tried a couple of times half heartedly to move to zsh but every time returned because I didn't have time (and was lazy) to learn to do my routine jobs in zsh.   Is there a good practical migration tool around? or are there some important things you would recommend that I learn to make the transition easier, at least so that I can try it and see if it makes any difference "for me"?   by the way I spend most of my life on mac, ubuntu and RedHat variants.


title: Confused with awk! Getting: 'cannot open "" for output'

text: Hi I have 2 files in my working directory. One is a simple file given by:               $ cat file2      START      Unix      Linux      START      Solaris      Aix      SCO      And I have a 6000 line xml file called dblp_1_76007.xml. When I do               awk '/START/{x="F"++i;}{print > x;}' file2      it seems to work perfectly fine but if I change the filename to the xml that is when I change it to:               awk '/START/{x="F"++i;}{print > x;}' dblp_1_76007.xml      I get the following error message: > awk: cannot open "" for output (No such file or directory) I was originally trying to do               awk '/<www/{x="F"++i;}{print > x;}' dblp_1_76007.xml      to split each line starting with www in the xml and this also gives me the same error message. Why do I get this error?


title: Show status lines of vim and tmux on the same line

text: I would like to figure out a way to get my vim statusline and tmux statusline on the same line if such a thing is possible and not immensely difficult (ideally, the vim prompt, or whatever it's called where you type, as well). I am using Powerline and I like it a lot, and I feel like there might be a way to do so with that program, but I am really not sure. Does anyone have any ideas for how I might go about this? I was thinking maybe there is a way to put the vim items inside the tmux statusline, but this might require adding the vim "segments" (the .py files inside the segments directory, not the .json files) to the shell "segments". Any help/input would be greatly appreciated!


title: Set default application for particular file types in nautilus

text: I use nautilus as file manager and would like to use Vim instead of Gedit to edit my text files. Many files (log files, empty files, …) are already opened with Vim, however not all of them, e.g. tex files and XML files are still opened with Gedit. `update-alternatives --get-selections | grep edit` yields               editor                auto     /usr/bin/vim.gnome     gnome-text-editor     manual   /usr/bin/vim.gnome     readline-editor       auto     /usr/bin/rlwrap      and I have also set the `VISUAL` and `EDITOR` environment variables to point to vim. Although the questions is about changing the default applicatin for _any_ file type, it is fine to respond with a solution that just addresses the mentioned problem changing the default editor, since that is what bothers me at the moment. EDIT: The answer of “hesse” worked for most file types, but not for all. For instance Makefiles are still opened with Gedit. `file --mime-type Makefile` returns `text/plain`, which is already included in `~/.local/share/applications/defaults.list`. However `file --mime-type somefile` also returns `text/plain` but is opened with Vim. I use Debian unstable.


title: Source of LXDE panel menu available application categories and items?

text: Where does the list of "Available Applications" come from? How can items/categories be added/deleted? On LXPanel - "Add/Remove Panel Items":               Panel Preferences     ====================================     |Panel Applets|     ---------------     |Currently loaded plugins|     --------------------------     [Application Launch Bar]     <Edit>                    Application Launch Bar     ==============================================================     |Applications|          <Add>         |Available Applications|     .                       <Remove>        .     .                       <Up>            .        .                       <Down>          .     .                                       .      I am using lubuntu 11.10, LXPanel 0.5.8.


title: Printing failure at a network printer in linux

text: I added a network printer to my network by the RedHat Enterprise workstation 6 linux GUI. It seemed that the printer setting did find the network printer. However, whenever I tried to print, the job didn't go through. I typed command such as               lpstat -t        And the results showed as               scheduler is running     system default destination: HP-Color-LaserJet-cp2025dn     device for HP-Color-LaserJet-cp2025dn: lpd://10.242.25.238/10.242.15.238     HP-Color-LaserJet-cp2025dn accepting requests since Fri 08 Jun 2012 04:03:30 PM EDT     printer HP-Color-LaserJet-cp2025dn now printing HP-Color-LaserJet-cp2025dn-0.  enabled since Fri 08 Jun 2012 04:03:30 PM EDT         Connecting to printer...     HP-Color-LaserJet-cp2025dn-8 Cassie               1024   Fri 08 Jun 2012 04:03:30 PM EDT      Doesn't it mean the linux system detect the network printer already ? However, I still got some status message such as               Printer 'HP-Color-LaserJet-cp2025dn' may not be connected.      And all the printing jobs were pending and never went through at all. I have to cancel all printing jobs on my linux. I checked the physical connection of my network printer and it seemed fine. Any idea where to check if the network printer connection is good, if my linux detects it and why the printing jobs always fails ? Thank you very much,


title: Saving all incoming messages into a database with Postfix?

text: Is there some plugin for Postfix that can allow you to save all incoming messages into a relational database (PostgreSQL)?


title: How to add an iso image to grub2?

text: I read grub2 allows booting from an ISO image (at least for most live-cds). How can I add such an entry to my grub configuration? Please mention all files to modify and all commands to run since I haven't used grub2 before upgrading.


title: How to stop avahi-daemon

text: I'm trying to disable `avahi-daemon`. I tried to modify the file `/etc/default/avahi-daemon`, setting the `AVAHI_DAEMON_DETECT_LOCAL=0` instead of `1`, but when I connect to a network it starts anyway; is there no way to stop it? I am trying to stop it because every time I connect to a network it and `dhclient` starts it gives my NIC another address so I cannot access the network. I'm on a Debian machine.


title: KSH while loop causing issues

text: Hi guys I'm getting this error message when running my KSH script: ./file.sh: line 16: syntax error at line 22: `done' unexpected My code is as follows:               #!/bin/ksh     #          count=$#           #count is assigned num of parameters     num=$1             #assign parameter 1 to num          if test count -gt 9 #make sure theres only 9 numbers         then            echo "Only 9 parameters allowed"            exit     fi               echo "Number of Parameters you passed: $count"     printf  "$num + \c"     sum=$1          while test $count -ge 1          shift 1     #move numbers 1 to left          num=$1      #assign new value to num          printf "num + \c"     done          ((sum = sum + num))          echo "$num = $sum"


title: Network connection drops after a few seconds

text: I am on Debian. I configured my NIC with a static IP (192.168.1.56). When I try to connect to a network, initially with `ifconfig eth2` I get (correctly):               eth2 inet addr:192.168.1.56 ....      inet6 addr: fe80:221:ff:fe96:4598/64       but after a few seconds the `192.168.1.56` disappears and after some other seconds the inet6 address disappears too. When I press in the `nm-applet` it requires a password, but in the meantime it tries to connect. At my university, the connection is a DHCP one. It works for the first few seconds but after it doesn't. How do I go about fixing this? Here it is the relevant part of the syslog: (static ip configuration)               Jan  5 16:38:29 patina dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth2 for sub-path eth2.dbus.get.reason     Jan  5 16:38:29 patina NetworkManager: <debug> [1294245509.629163] nm_device_802_11_wireless_get_activation_ap(): Forcing AP 'Cagei2'     Jan  5 16:38:29 patina NetworkManager: <info>  User Switch: /org/freedesktop/NetworkManager/Devices/eth2 / Cagei2     Jan  5 16:38:29 patina NetworkManager: <info>  Deactivating device eth2.     Jan  5 16:38:29 patina NetworkManager: <WARN>  nm_device_802_11_wireless_set_wep_enc_key(): error setting key for device eth2: Invalid argument     Jan  5 16:38:29 patina NetworkManager: <info>  Device eth2 activation scheduled...     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) started...     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) scheduled...     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) started...     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) scheduled...     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) complete.     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) starting...     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2/wireless): access point 'Cagei2' is encrypted, but NO valid key exists.  New key needed.     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) New wireless user key requested for network 'Cagei2'.     Jan  5 16:38:29 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) complete.     Jan  5 16:40:15 patina dhclient: There is already a pid file /var/run/dhclient.eth0.pid with pid 2304     Jan  5 16:40:15 patina dhclient: killed old client process, removed PID file     Jan  5 16:40:15 patina dhclient: Internet Systems Consortium DHCP Client V3.1.1     Jan  5 16:40:15 patina dhclient: Copyright 2004-2008 Internet Systems Consortium.     Jan  5 16:40:15 patina dhclient: All rights reserved.     Jan  5 16:40:15 patina dhclient: For info, please visit http://www.isc.org/sw/dhcp/     Jan  5 16:40:15 patina dhclient:      Jan  5 16:40:15 patina dhclient: Listening on LPF/eth0/00:23:8b:54:96:5d     Jan  5 16:40:15 patina dhclient: Sending on   LPF/eth0/00:23:8b:54:96:5d     Jan  5 16:40:15 patina dhclient: Sending on   Socket/fallback     Jan  5 16:40:15 patina dhclient: DHCPRELEASE on eth0 to 192.168.1.1 port 67     Jan  5 16:40:15 patina avahi-autoipd(eth0)[2133]: Got SIGTERM, quitting.     Jan  5 16:40:15 patina avahi-autoipd(eth0)[2133]: Callout STOP, address 169.254.6.95 on interface eth0     Jan  5 16:40:48 patina dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth2 for sub-path eth2.dbus.get.reason     Jan  5 16:40:48 patina NetworkManager: <debug> [1294245648.742672] nm_device_802_11_wireless_get_activation_ap(): Forcing AP 'Cagei2'     Jan  5 16:40:48 patina NetworkManager: <info>  User Switch: /org/freedesktop/NetworkManager/Devices/eth2 / Cagei2     Jan  5 16:40:48 patina NetworkManager: <info>  Deactivating device eth2.     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2): cancelling...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) cancellation handler scheduled...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2): waiting for device to cancel activation.     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) cancellation handled.     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2): cancelled.     Jan  5 16:40:48 patina NetworkManager: <WARN>  nm_device_802_11_wireless_set_wep_enc_key(): error setting key for device eth2: Invalid argument     Jan  5 16:40:48 patina NetworkManager: <info>  Device eth2 activation scheduled...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) started...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) scheduled...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) started...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) scheduled...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) complete.     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) starting...     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2/wireless): access point 'Cagei2' is encrypted, but NO valid key exists.  New key needed.     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) New wireless user key requested for network 'Cagei2'.     Jan  5 16:40:48 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) complete.     Jan  5 16:40:54 patina kernel: [ 1397.945334] lo: Disabled Privacy Extensions     Jan  5 16:41:06 patina NetworkManager: <info>  Activation (eth2) New wireless user key for network 'Cagei2' received.     Jan  5 16:41:06 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) scheduled...     Jan  5 16:41:06 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) started...     Jan  5 16:41:06 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) scheduled...     Jan  5 16:41:06 patina NetworkManager: <info>  Activation (eth2) Stage 1 of 5 (Device Prepare) complete.     Jan  5 16:41:06 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) starting...     Jan  5 16:41:06 patina NetworkManager: <info>  Activation (eth2/wireless): access point 'Cagei2' is encrypted, and a key exists.  No new key needed.     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'INTERFACE_ADD eth2#011#011wext#011/var/run/wpa_supplicant#011'     Jan  5 16:41:08 patina kernel: [ 1411.596736] ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was 'OK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'AP_SCAN 1'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was 'OK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'ADD_NETWORK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was '0'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 ssid 436167656932'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was 'OK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 proto WPA2'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was 'OK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 key_mgmt WPA-PSK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was 'OK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 psk <key>'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was 'OK'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: sending command 'ENABLE_NETWORK 0'     Jan  5 16:41:08 patina NetworkManager: <info>  SUP: response was 'OK'     Jan  5 16:41:08 patina NetworkManager: <info>  Activation (eth2) Stage 2 of 5 (Device Configure) complete.     Jan  5 16:41:08 patina NetworkManager: <info>  Supplicant state changed: 1     Jan  5 16:41:08 patina NetworkManager: <info>  Activation (eth2/wireless) Stage 2 of 5 (Device Configure) successful.  Connected to access point 'Cagei2'.     Jan  5 16:41:08 patina NetworkManager: <info>  Activation (eth2) Stage 3 of 5 (IP Configure Start) scheduled.     Jan  5 16:41:08 patina NetworkManager: <info>  Activation (eth2) Stage 3 of 5 (IP Configure Start) started...     Jan  5 16:41:09 patina NetworkManager: <info>  Activation (eth2) Beginning DHCP transaction.     Jan  5 16:41:09 patina NetworkManager: <info>  Activation (eth2) Stage 3 of 5 (IP Configure Start) complete.     Jan  5 16:41:09 patina NetworkManager: <info>  DHCP daemon state is now 12 (successfully started) for interface eth2     Jan  5 16:41:09 patina dhclient: Internet Systems Consortium DHCP Client 4.1.1-P1     Jan  5 16:41:09 patina dhclient: Copyright 2004-2010 Internet Systems Consortium.     Jan  5 16:41:09 patina dhclient: All rights reserved.     Jan  5 16:41:09 patina dhclient: For info, please visit https://www.isc.org/software/dhcp/     Jan  5 16:41:09 patina dhclient:      Jan  5 16:41:09 patina dhclient: Listening on LPF/eth2/00:21:00:96:45:98     Jan  5 16:41:09 patina dhclient: Sending on   LPF/eth2/00:21:00:96:45:98     Jan  5 16:41:09 patina dhclient: Sending on   Socket/fallback     Jan  5 16:41:10 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 7     Jan  5 16:41:17 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 12     Jan  5 16:41:18 patina kernel: [ 1421.604521] eth2: no IPv6 routers present     Jan  5 16:41:29 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 19     Jan  5 16:41:48 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 14     Jan  5 16:41:54 patina NetworkManager: <info>  Device 'eth2' DHCP transaction took too long (>45s), stopping it.     Jan  5 16:41:54 patina dhclient: Internet Systems Consortium DHCP Client 4.1.1-P1     Jan  5 16:41:54 patina dhclient: Copyright 2004-2010 Internet Systems Consortium.     Jan  5 16:41:54 patina dhclient: All rights reserved.     Jan  5 16:41:54 patina dhclient: For info, please visit https://www.isc.org/software/dhcp/     Jan  5 16:41:54 patina dhclient:      Jan  5 16:41:54 patina dhclient: Listening on LPF/eth2/00:21:00:96:45:98     Jan  5 16:41:54 patina dhclient: Sending on   LPF/eth2/00:21:00:96:45:98     Jan  5 16:41:54 patina dhclient: Sending on   Socket/fallback     Jan  5 16:41:54 patina dhclient: DHCPRELEASE on eth2 to 137.222.253.66 port 67     Jan  5 16:41:54 patina dhclient: send_packet: Network is unreachable     Jan  5 16:41:54 patina dhclient: send_packet: please consult README file regarding broadcast address.     Jan  5 16:41:55 patina NetworkManager: <info>  Activation (eth2) Stage 4 of 5 (IP Configure Timeout) scheduled...     Jan  5 16:41:55 patina NetworkManager: <info>  DHCP daemon state is now 14 (normal exit) for interface eth2     Jan  5 16:41:55 patina NetworkManager: <info>  DHCP daemon state is now 14 (normal exit) for interface eth2     Jan  5 16:41:55 patina NetworkManager: <info>  Activation (eth2) Stage 4 of 5 (IP Configure Timeout) started...     Jan  5 16:41:55 patina NetworkManager: <info>  Activation (eth2) failure scheduled...     Jan  5 16:41:55 patina NetworkManager: <info>  Activation (eth2) Stage 4 of 5 (IP Configure Timeout) complete.     Jan  5 16:41:55 patina NetworkManager: <info>  Activation (eth2) failed for access point (Cagei2)     Jan  5 16:41:55 patina NetworkManager: <info>  Activation (eth2) failed.     Jan  5 16:41:55 patina NetworkManager: <info>  Deactivating device eth2.     Jan  5 16:41:55 patina NetworkManager: <WARN>  nm_device_802_11_wireless_set_wep_enc_key(): error setting key for device eth2: Invalid argument     Jan  5 16:41:56 patina kernel: [ 1460.455299] ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready     Jan  5 16:42:07 patina kernel: [ 1471.332129] eth2: no IPv6 routers present     Jan  5 16:46:00 patina kernel: [ 1703.976186] usb 1-3: new high speed USB device using ehci_hcd and address 2     Jan  5 16:46:00 patina kernel: [ 1704.120840] usb 1-3: New USB device found, idVendor=13fe, idProduct=1e00     Jan  5 16:46:00 patina kernel: [ 1704.120851] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3     Jan  5 16:46:00 patina kernel: [ 1704.120858] usb 1-3: Product: USB DISK 2.0         Jan  5 16:46:00 patina kernel: [ 1704.120863] usb 1-3: Manufacturer:              Jan  5 16:46:00 patina kernel: [ 1704.120868] usb 1-3: SerialNumber: 078203000F3C     Jan  5 16:46:00 patina kernel: [ 1704.121082] usb 1-3: configuration #1 chosen from 1 choice     Jan  5 16:46:00 patina NetworkManager: <debug> [1294245960.538897] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C').     Jan  5 16:46:00 patina kernel: [ 1704.328698] Initializing USB Mass Storage driver...     Jan  5 16:46:00 patina kernel: [ 1704.328913] scsi6 : SCSI emulation for USB Mass Storage devices     Jan  5 16:46:00 patina kernel: [ 1704.329254] usbcore: registered new interface driver usb-storage     Jan  5 16:46:00 patina kernel: [ 1704.329263] USB Mass Storage support registered.     Jan  5 16:46:00 patina kernel: [ 1704.331074] usb-storage: device found at 2     Jan  5 16:46:00 patina kernel: [ 1704.331080] usb-storage: waiting for device to settle before scanning     Jan  5 16:46:00 patina NetworkManager: <debug> [1294245960.740962] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0').     Jan  5 16:46:00 patina NetworkManager: <debug> [1294245960.742373] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host').     Jan  5 16:46:05 patina kernel: [ 1709.329094] usb-storage: device scan complete     Jan  5 16:46:05 patina kernel: [ 1709.379165] scsi 6:0:0:0: Direct-Access              USB DISK 2.0     PMAP PQ: 0 ANSI: 0 CCS     Jan  5 16:46:05 patina kernel: [ 1709.380922] sd 6:0:0:0: Attached scsi generic sg2 type 0     Jan  5 16:46:05 patina NetworkManager: <debug> [1294245965.792242] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host_0').     Jan  5 16:46:05 patina NetworkManager: <debug> [1294245965.795336] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host_0_scsi_device_lun0').     Jan  5 16:46:05 patina NetworkManager: <debug> [1294245965.799318] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host_0_scsi_device_lun0_scsi_generic').     Jan  5 16:46:06 patina kernel: [ 1710.042152] sd 6:0:0:0: [sdb] 8060928 512-byte logical blocks: (4.12 GB/3.84 GiB)     Jan  5 16:46:06 patina kernel: [ 1710.043009] sd 6:0:0:0: [sdb] Write Protect is off     Jan  5 16:46:06 patina kernel: [ 1710.043020] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00     Jan  5 16:46:06 patina kernel: [ 1710.043026] sd 6:0:0:0: [sdb] Assuming drive cache: write through     Jan  5 16:46:06 patina kernel: [ 1710.047632] sd 6:0:0:0: [sdb] Assuming drive cache: write through     Jan  5 16:46:06 patina kernel: [ 1710.047643]  sdb: sdb1     Jan  5 16:46:06 patina kernel: [ 1710.113494] sd 6:0:0:0: [sdb] Assuming drive cache: write through     Jan  5 16:46:06 patina kernel: [ 1710.113504] sd 6:0:0:0: [sdb] Attached SCSI removable disk     Jan  5 16:46:06 patina NetworkManager: <debug> [1294245966.835564] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/storage_serial__USB_DISK_2_0_078203000F3C_0_0').     Jan  5 16:46:07 patina NetworkManager: <debug> [1294245967.016379] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/volume_uuid_BCD8_97AF').     Jan  5 16:46:07 patina kernel: [ 1710.696802] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!


title: Set lightdm user picture

text: How can I set user pictures on Debian with lightdm? Xfce does not seem to have a GUI facility for user management at all. I have tried installing gnome-system tools that contains user management dialog (users-admin) but I can't find where to set picture there. I remember Gnome had "About me" dialog but that was GNOME 2. GNOME 3 probably also has something like that but I don't want to install GNOME if I can simply add PNG file and/or edit a config file somewhere for lightdm to look up.


title: Linux dependencies between packages

text: I have following error:               You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:     linux-kernel-generic : Depends: linux-image-3.11.0-12-generic but it is not going to be  installed                         Depends: linux-image-extra-3.11.0-12-generic but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      I tried to remove this using this commands but no effect. I'm getting the same error.               sudo apt-get purge --auto-remove linux-image-extra-3.11.0-12-generic     sudo apt-get purge linux-image-extra-3.11.0-12-generic      Thanks for all tips. Edit: I tried apt-get -f install but the same problem. Also synaptics can't remove this. Edit2:               $ apt-cache policy      Package files:     100 /var/lib/dpkg/status      release a=now     500 http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu/ saucy/main i386 Packages      release v=13.10,o=LP-PPA-xorg-edgers,a=saucy,n=saucy,l=xorg-edgers fresh X crack,c=main      origin ppa.launchpad.net     500 http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu/ saucy/main amd64 Packages      release v=13.10,o=LP-PPA-xorg-edgers,a=saucy,n=saucy,l=xorg-edgers fresh X crack,c=main      origin ppa.launchpad.net      500 http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu/ saucy/main i386 Packages      release v=13.10,o=LP-PPA-ubuntu-x-swat-x-updates,a=saucy,n=saucy,l=X Updates,c=main      origin ppa.launchpad.net      500 http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu/ saucy/main amd64 Packages      release v=13.10,o=LP-PPA-ubuntu-x-swat-x-updates,a=saucy,n=saucy,l=X Updates,c=main      origin ppa.launchpad.net      500 http://ppa.launchpad.net/rwky/redis/ubuntu/ saucy/main i386 Packages      release v=13.10,o=LP-PPA-rwky-redis,a=saucy,n=saucy,l=Redis,c=main      origin ppa.launchpad.net       500 http://ppa.launchpad.net/rwky/redis/ubuntu/ saucy/main amd64 Packages      release v=13.10,o=LP-PPA-rwky-redis,a=saucy,n=saucy,l=Redis,c=main      origin ppa.launchpad.net       500 http://apt.postgresql.org/pub/repos/apt/ precise-pgdg/main i386 Packages      release o=apt.postgresql.org,a=precise-pgdg,n=precise-pgdg,l=PostgreSQL for Debian/Ubuntu repository,c=main      origin apt.postgresql.org       500 http://apt.postgresql.org/pub/repos/apt/ precise-pgdg/main amd64 Packages      release o=apt.postgresql.org,a=precise-pgdg,n=precise-pgdg,l=PostgreSQL for Debian/Ubuntu repository,c=main      origin apt.postgresql.org       500 http://archive.canonical.com/ubuntu/ saucy/partner i386 Packages      release v=13.10,o=Canonical,a=saucy,n=saucy,l=Partner archive,c=partner      origin archive.canonical.com       500 http://archive.canonical.com/ubuntu/ saucy/partner amd64 Packages      release v=13.10,o=Canonical,a=saucy,n=saucy,l=Partner archive,c=partner      origin archive.canonical.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/universe Translation-en       500 http://security.ubuntu.com/ubuntu/ saucy-security/restricted Translation-en       500 http://security.ubuntu.com/ubuntu/ saucy-security/multiverse Translation-en       500 http://security.ubuntu.com/ubuntu/ saucy-security/main Translation-en       500 http://security.ubuntu.com/ubuntu/ saucy-security/multiverse i386 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=multiverse      origin security.ubuntu.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/universe i386 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=universe      origin security.ubuntu.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/restricted i386 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=restricted      origin security.ubuntu.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/main i386 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=main      origin security.ubuntu.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/multiverse amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=multiverse      origin security.ubuntu.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/universe amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=universe      origin security.ubuntu.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/restricted amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=restricted      origin security.ubuntu.com       500 http://security.ubuntu.com/ubuntu/ saucy-security/main amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-security,n=saucy,l=Ubuntu,c=main      origin security.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/universe Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/universe Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/restricted Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/restricted Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/multiverse Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/multiverse Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/main Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/main Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/multiverse i386 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=multiverse      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/universe i386 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=universe      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/restricted i386 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=restricted      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/main i386 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=main      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/multiverse amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=multiverse      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/universe amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=universe      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/restricted amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=restricted      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy-updates/main amd64 Packages      release v=13.10,o=Ubuntu,a=saucy-updates,n=saucy,l=Ubuntu,c=main      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/universe Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy/universe Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy/restricted Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy/restricted Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy/multiverse Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy/multiverse Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy/main Translation-pl       500 http://archive.ubuntu.com/ubuntu/ saucy/main Translation-en       500 http://archive.ubuntu.com/ubuntu/ saucy/multiverse i386 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=multiverse      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/universe i386 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=universe      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/restricted i386 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=restricted      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/main i386 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=main      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/multiverse amd64 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=multiverse      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=universe      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/restricted amd64 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=restricted      origin archive.ubuntu.com       500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages      release v=13.10,o=Ubuntu,a=saucy,n=saucy,l=Ubuntu,c=main      origin archive.ubuntu.com       700 http://extra.linuxmint.com/ petra/main i386 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=main      origin extra.linuxmint.com       700 http://extra.linuxmint.com/ petra/main amd64 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=main      origin extra.linuxmint.com       700 http://packages.linuxmint.com/ petra/import i386 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=import      origin packages.linuxmint.com       700 http://packages.linuxmint.com/ petra/upstream i386 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=upstream      origin packages.linuxmint.com       700 http://packages.linuxmint.com/ petra/main i386 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=main      origin packages.linuxmint.com       700 http://packages.linuxmint.com/ petra/import amd64 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=import      origin packages.linuxmint.com       700 http://packages.linuxmint.com/ petra/upstream amd64 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=upstream      origin packages.linuxmint.com       700 http://packages.linuxmint.com/ petra/main amd64 Packages      release v=16,o=linuxmint,a=petra,n=petra,l=linuxmint,c=main      origin packages.linuxmint.com       500 http://ppa.launchpad.net/nviennot/tmate/ubuntu/ saucy/main i386 Packages      release v=13.10,o=LP-PPA-nviennot-tmate,a=saucy,n=saucy,l=tmate,c=main      origin ppa.launchpad.net       500 http://ppa.launchpad.net/nviennot/tmate/ubuntu/ saucy/main amd64 Packages      release v=13.10,o=LP-PPA-nviennot-tmate,a=saucy,n=saucy,l=tmate,c=main      origin ppa.launchpad.net       500 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen i386 Packages      release v=dist,o=10gen,a=10gen,n=dist,l=10gen,c=10gen      origin downloads-distro.mongodb.org       500 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen amd64 Packages      release v=dist,o=10gen,a=10gen,n=dist,l=10gen,c=10gen      origin downloads-distro.mongodb.org       500 http://ppa.launchpad.net/bumblebee/stable/ubuntu/ saucy/main i386 Packages      release v=13.10,o=LP-PPA-bumblebee-stable,a=saucy,n=saucy,l=Stable Bumblebee releases,c=main      origin ppa.launchpad.net       500 http://ppa.launchpad.net/bumblebee/stable/ubuntu/ saucy/main amd64 Packages      release v=13.10,o=LP-PPA-bumblebee-stable,a=saucy,n=saucy,l=Stable Bumblebee releases,c=main      origin ppa.launchpad.net      Pinned packages:                $ apt-cache policy linux-kernel-generic linux-image-3.11.0-12-generic      linux-kernel-generic:        Installed: 3.11.0-12        Candidate: 3.11.0-12        Version table:       *** 3.11.0-12 0         700 http://packages.linuxmint.com/ petra/main amd64 Packages         100 /var/lib/dpkg/status      linux-image-3.11.0-12-generic:        Installed: (none)        Candidate: 3.11.0-12.19        Version table:           3.11.0-12.19 0         500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages


title: Making Chrome open md/markdown file instead of downloading them

text: I'm trying this google chrome plugin that previews `md` files in chrome. But when I open an `md` file from local filesystem, chrome downloads it instead of opening it. So the plugin cannot preview it. `md` files from the internet are opened as expected. But I want that to work for files on my local filesystem. My OS is ArchLinux with KDE.


title: Attach terminal to X desktop running in VM

text: At home I'm setting up a CentOS 5.5 server that will be running a bunch of KVM VMs. Normally pressing the `CTRL`-`SHIFT`-`Fn` combination on the attached keyboard switches to terminals on the host machine. What I'd like to do instead is have some number of `CTRL`-`SHIFT`-`Fn` combinations attach to the VMs that are running, in essence have the key combination behave like a KVM switch. So for example, pressing `CTRL`-`SHIFT`-`F1` displays a text terminal for the host machine, but pressing `CTRL`-`SHIFT`-`F2` displays an X session that is running on one VM and pressing `CTRL`-`SHIFT`-`F3` displays yet another VM terminal. Some of the VMs will have X installed, so I'd like the solution to behave just like a 'normal' X session: Presents an X login screen if I haven't already logged in. How can this be done?


title: Cannot Connect Using SSH: UseDNS terminating

text: When I attempt to login via ssh like so `ssh marc_mtpt0@m3pt0.com` I get this response:               /etc/ssh_config: line 51: Bad configuration option: UseDNS      /etc/ssh_config: terminating, 1 bad configuration options lost connection      I've done this plenty in the past but it's no longer working properly. Not sure where to go from here or how to fix it. Any help is greatly appreciated. Thanks!


title: Ignore or catch division by zero

text: How do I ignore the division by zero error in Bash? Example 1: (Doesn't work)               echo $((1/0)); echo "yay";     echo $((1/0)) || echo "yay";      Example 2:               echo -n $(echo -n $((1/0))) 2> /dev/null; echo "yay";      Is there an easier way than example 2, that would default to a specific value, when a division by zero is encountered.


title: Nvidia crash linux mint 16

text: I'm trying to install nvidia drivers but when I install it and reboot I'm getting popup with information about crash system. And I have excluded Cinnamon. I'm doing it by those commands:               sudo add-apt-repository ppa:bumblebee/stable     sudo apt-get update     sudo apt-get install nvidia-current     sudo apt-get install nvidia-settings     sudo nvidia-xconfig      Result of cinnamon --replace:               $ cinnamon --replace     Xlib:  extension "GLX" missing on display ":0.0".     libEGL warning: GLX/DRI2 is not supported     libEGL warning: DRI2: failed to authenticate          (cinnamon:2928): GLib-CRITICAL **: g_strsplit: assertion 'string != NULL' failed          (cinnamon:2928): Clutter-CRITICAL **: Unable to initialize Clutter: The OpenGL version could not be determined     Window manager error: Unable to initialize Clutter.      Thanks for all tips. Edit: When I was installing nvidia driver using apt-get I had this info:               (....)     update-initramfs: Generating /boot/initrd.img-3.13.3-031303-generic     W: Possible missing firmware /lib/firmware/radeon/HAWAII_smc.bin for module radeon     W: Possible missing firmware /lib/firmware/radeon/HAWAII_sdma.bin for module radeon     W: Possible missing firmware /lib/firmware/radeon/HAWAII_rlc.bin for module radeon     W: Possible missing firmware /lib/firmware/radeon/HAWAII_mc.bin for module radeon     W: Possible missing firmware /lib/firmware/radeon/HAWAII_mec.bin for module radeon     W: Possible missing firmware /lib/firmware/radeon/HAWAII_ce.bin for module radeon     W: Possible missing firmware /lib/firmware/radeon/HAWAII_me.bin for module radeon     W: Possible missing firmware /lib/firmware/radeon/HAWAII_pfp.bin for module radeon     Warning: No support for locale: en_US.utf8     (....)


title: Create an ASCII art table from tabular data

text: Given perhaps comma- or tab-delimited input, I'd like to present a series of appropriately padded columns to stdout, so I can easily scan columnar information which would otherwise present rather messily. I've tried `troff`-based solutions and while the simple demos have worked, feeding the command actual input has resulted in bizarre errors. I've currently resorted to using a `sed`-based ~~method~~ hack which is rather slow... **EDIT** : `column` is quite a useful tool, **_however_** it'd be really awesome if I the columns had, say, a pipe character (`|`) between them so they do not appear to "float" in space and I can easily distinguish where each starts. _PS. This post's title used to read 'ASCII "table"', not 'ASCII-art table'. Edited to try and remove confusion._


title: How to find the path of your current working directory?

text: How can you find what the is the path of the current working directory?


title: search for multiple condition and then redirect output

text: How can you search for all lines containing “55=MSFT” and not containing the string “OPEN” in a file, then redirect the output to a file named MSFTFILE?


title: USB passthrough for LXC containers

text: ### PROBLEM: So I've been trying to get a usb device (primesense - the OEM reference for the Kinect) to passthrough to an LXC container so I can develop without worrying about polluting my stable system with experimental libraries. I think I've done everything necessary, but applications running inside the container cannot access the device. I'm using Ubuntu 12.04 x64 host with LXC 1.0.0, container is created from the 12.04 template. (I am active over on askubuntu, but I believe the question fits here more) ### Question: How do you pass through usb to a (privileged) LXC container. ### Actions Taken: My udev rules for the host and the udev rules for the container are the same               SUBSYSTEM=="usb", ATTR{idProduct}=="0609", ATTR{idVendor}=="1d27",     MODE:="0666", OWNER:="root", GROUP:="video"      On the host the device node is visible as:               $ ls -l /dev/bus/usb/001/015     crw-rw-rw- 1 root video 189, 14 Jun 18 15:27 /dev/bus/usb/001/015      In the container the device node is visible as:               $ ls -l /dev/bus/usb/001/015      crw-rw-rw- 1 root video 189, 14 Jun 18 22:07 /dev/bus/usb/001/015      Additionally, I have passed               sudo lxc-cgroup  --n CN1 devices.allow "c 189:* rwm"      In order to whitelist usb devices for lxc Unfortunately, when I try to run an application on the Host, the device is recognized and works as expected. Running the same application in the container (with the same relevant libraries) causes the application to fail to find the device even when I explicitly pass the URI. I'm trying to narrow down the issue to either a library bug (which I could fix but I don't want to commit down that rabbit hole yet) or something I'm missing with the permissions for LXC containers.


title: Multi-file simultaneous downloader with live statistics for all files

text: _(I recently asked the question "Console download accelerator that downloads *multiple* files simultaneously" and learned about `lftp`, an excellent program which can download multiple files simultaneously, however it does this in the background - to the extent that it's impossible to know the status of the backgrounded downloads. Since I didn't clarify that I wanted live updating in that question, I'm starting a new one.)_ I frequently download batches of URLs at the console and a currently do this by launching several `wget` instances simultaneously. The subsequent console output is quite a mess, and what's more, it's difficult to know when the processes have finished (because the `wget` instances were started in the background and my shell prompt, which "returned back to me" instantly, was overwritten long ago). I'm looking for a program which can download more than one file, at the console, and show live download statistics for each file. It doesn't actually have to be an accelerator as such - just a "multi-downloader". (I kinda got the terminology confused before.)


title: Relocate file into subdirectory

text: I'm bit new to Unix. Please help with below question though it may sound very simple. How to relocate file1 into subdirectory dir1?


title: Need to configure network card manually after each reboot

text: I am using SUSE Linux Enterprise Server 11 (x86_64) as VM Ware virtual machine (that was cloned). Not sure why but network card cannot be configured via yast2. If I go to edit and hit enter Yast will go back to "Control Center". Also in yast2 I can see that the card is "not connected". No idea what it means though. But if I go command line and issue these two commands the network is up and running.               ifconfig eth1 10.0.0.xxx netmask 255.255.255.0 broadcast 10.0.0.255     route add default gw 10.0.0.1 eth1      From /var/log/messages               Jun 18 14:20:19 Edumate kernel: [  221.986998] e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None     Jun 18 14:20:19 Edumate kernel: [  221.988366] ADDRCONF(NETDEV_UP): eth1: link is not ready     Jun 18 14:20:19 Edumate kernel: [  221.988482] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready     Jun 18 14:20:29 Edumate kernel: [  232.399704] eth1: no IPv6 routers present        * Q1: Would anybody know how to fix the network configuration or   * Q2: What files I update with above two commands so I can have network up and running after each reboot? # EDITs   * removing `/etc/udev/rules.d/70-persistent-net.rules` and rebooting didn't help   * content of /etc/sysconfig/network Edu:/var/lib/edu/bdrs # cd /etc/sysconfig/network Edu:/etc/sysconfig/network # ll               total 108     -rw-r--r-- 1 root root 13192 Jun  5 16:30 config     -rw-rw-rw- 1 root root 13181 Jun  5 15:42 config.backup.by.convert_to_netconfig     -rw-r--r-- 1 root root  7482 Jun 18 14:10 dhcp     -rw-r--r-- 1 root root  7686 Jun  5 15:42 dhcp.backup.by.convert_to_netconfig     drwxr-xr-x 2 root root  4096 Jun  5 15:42 if-down.d     drwxr-xr-x 2 root root  4096 Jun  5 15:42 if-up.d     -rw------- 1 root root   172 Jan 31 23:45 ifcfg-lo     -rw-r--r-- 1 root root 29333 Jan 31 23:45 ifcfg.template     -rw-r--r-- 1 root root   239 Jan 31 23:45 ifroute-lo     drwx------ 2 root root  4096 May  6  2010 providers     -rw-r--r-- 1 root root    22 Jun 18 14:07 routes     -rw-r--r-- 1 root root     0 Jun 18 14:07 routes.YaST2save     drwxr-xr-x 2 root root  4096 Jun  5 15:42 scripts


title: How to forward libnotify to growl

text: I'm looking for a simple solution to forward `libnotify` notifications (from knotify4) to a remote growl servers (running on Windows and Android). So far I'm only able to send remote growl notifications from the command line (using `gntp-send` or this python lib) The Growl for linux implementation is only able to forward the opposite way (growl->libnotify), and does not allow remote notifications...


title: Relaunch application once finished

text: Is there a command that relaunch the application once it finishes from the command line? Letting you do something like:               > relaunch python myapp.py      If not, then what's my best option? I know I could cron it, but I'd be more interested in something I could just execute from the terminal and that restarts at once. I'm on Debian if that matters.


title: Cannot install ia32-libs-i386

text: I'm trying to install `ia32-libs-i386`, but it's giving me this error:               Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      ia32-libs-i386:i386 : Depends: libjack-jackd2-0:i386 (>= 1.9.5~dfsg-14) but it is not going to be installed or                                 libjack0:i386 (>= 1:0.118+svn3796-7) but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      When I `apt-cache search libjack`, I get this:               libjack-dev - JACK Audio Connection Kit (development files)     libjack0 - JACK Audio Connection Kit (libraries)     libjack-jackd2-0 - JACK Audio Connection Kit (libraries)     libjack-jackd2-dev - JACK Audio Connection Kit (development files)     libjackrabbit-java - content repository implementation (JCR API)     libjackson-json-java - streaming fast powerful standard conformant json processor in java     libjackson-json-java-doc - standard conformant json processor in java - API documentation     libjackson2-annotations-java - fast and powerful JSON library for Java -- annotations     libjackson2-annotations-java-doc - Documentation for Jackson-annotations      I tried installing `libjack-jackd2-0`, but I still get the error when I try to install `ia32-libs-i386` Output of `apt-cache policy ia32-libs-i386:i386`:               ia32-libs-i386:i386:       Installed: (none)       Candidate: 1:0.5       Version table:          1:0.5 0             500 http://ftp.debian.org/debian/ testing/main i386 Packages          1:0.4 0             500 http://http.debian.net/debian/ wheezy/main i386 Packages      Output of `apt-cache policy libjack-jackd2-0:i386`:               libjack-jackd2-0:i386:       Installed: (none)       Candidate: 1.9.9.5+20130622git7de15e7a-1       Version table:          1.9.9.5+20130622git7de15e7a-1 0             500 http://ftp.debian.org/debian/ testing/main i386 Packages          1.9.8~dfsg.4+20120529git007cdc37-5 0             500 http://http.debian.net/debian/ wheezy/main i386 Packages      Output of `apt-cache policy libjack0:i386`:               libjack0:i386:       Installed: (none)       Candidate: 1:0.121.3+20120418git75e3e20b-2.1       Version table:          1:0.121.3+20120418git75e3e20b-2.1 0             500 http://http.debian.net/debian/ wheezy/main i386 Packages             500 http://ftp.debian.org/debian/ testing/main i386 Packages      APT sources:               ## CRUNCHBANG     ## Compatible with Debian Wheezy, but use at your own risk.     deb http://packages.crunchbang.org/waldorf waldorf main     #deb-src http://packages.crunchbang.org/waldorf waldorf main          ## DEBIAN     deb http://http.debian.net/debian wheezy main contrib non-free     #deb-src http://http.debian.net/debian wheezy main contrib non-free          ## DEBIAN SECURITY     deb http://security.debian.org/ wheezy/updates main     #deb-src http://security.debian.org/ wheezy/updates main          deb http://ftp.debian.org/debian experimental main          deb http://ftp.debian.org/debian testing main


title: Byobu - send command to byobu tmux session from commandline (or bash/sh)

text: I run a script which I would like to print the status to a byobu tmux session. So for example `print backup finished \n`. Is it possible to do this with the name of the byobu tmux window, which you can give/rename with `F8` ? With screen (before) I did it like this: `screen -S $SCREEN_NAME -p 0 -X stuff "print backup finished.$(printf \\\r)"`


title: Which is the safest way to get root privileges: sudo, su or login?

text: I would like to have the root account in safety even if my unprivileged user is compromised. On Ubuntu you can only use sudo for "security reasons" by default. However I am not sure it is any safer than just using login on a text-mode console. There are too many things that can go wrong if an attacker can run code as my normal user. For example adding aliases, adding stuff to my PATH, setting LD_PRELOAD and X11 keyloggers just to mention a few. The only advantage I can see is the timeout so I never forget to log out. I have the same doubts about su but it doesn't even have time limit. Some operations (especially IO redirection) are more convinient with su but security-wise this seems to be worse. Login on a text-mode console seems to be the safest. Since it is started by init if an attacker can control PATH or LD_PRELOAD he is already root. The keypress events can't be intercepted by programs running on X. I don't know if programs running on X can intercept [ctrl]+[alt]+[f1] (and open a fullscreen window that looks like a console) or it is safe like [ctrl]+[alt]+[del] on Windows. Besides that the only problem I see is the lack of timeout. So am I missing something? Why did the Ubuntu guys decide to only allow sudo? What can I do to improve the security of any of the methods? What about SSH? Traditionally root can't log in through SSH. But using the above logic wouldn't this be the safest thing to do:   * allow root through SSH   * switch to text-mode   * log in as root   * ssh to the other machine   * log in as root?


title: enable ssh with autoyast

text: I'm installing a fresh openSUSE 13.1 with an autoyast xml file. I can't find the correct way to enable ssh and open the port in the firewall; the "Confirmation" screen shows that `SSH service will be disabled, SSH port will be blocked`. I already tried:               <runlevel>         <services config:type="list">             <service>                 <service_name>sshd</service_name>                 <service_status>enable</service_status>             </service>         </services>     </runlevel>      without success...


title: What client for DECwindows?

text: I have inherited a VAX system that was just migrated onto CHARON-VAX (VMS emulated on Windows) I can access it via ssh, but not with X. Anyone here familiar with DECwindows? is it X compliant? Or do I need a specific client to access it?


title: AIX's sed - in place editing

text: Is there any non-documented flag on AIX's sed implementation that allows in place editing? The man page shows no flag to this operation, which is one of the most usefull ones in other UNIX flavours.