title: Are there any canned solutions for running sshd in the initrd?

text: This is mostly aimed at Debian/Ubuntu, but I feel savvy enough on a variety of distros to be able to adapt the solution for one distro to another. Here's my scenario. There are a few situations when the boot process will drop you to the shell (usually busybox) of the initrd. Most notably whenever you run a hardware RAID for which drivers have to be rebuilt for each and every new kernel revision. I'd like to be able to access the rescue system the same way as I would access the fully booted system. I reckon it'd be possible to put static builds of the shell(s) and `sshd` (OpenSSH or dropbear) into the initrd and have been looking for an existing solution that I can adjust to my needs. Assuming there is no existing solution (since I have searched for quite a while) what do I need to consider aside from using static builds where possible (or supply the libs)? Is it reasonable to simply cache a static build of dropbear and use `/etc/initramfs-tools/hooks` to embed that along with a "converted" OpenSSH `sshd_config` and the original host keys?


title: Swapping an unlimited number of columns

text: I have a file with columns. See below for an example:               a b c ... z       1 2 3 ... 26      I'd like to swap all columns where the 1st becomes the last, the second becomes the one before last...etc..               z y x ... a       26 25 24 ... 1      Is there a one liner (`awk` or `sed`) that does this?   I know one can use `awk` when there is only a couple columns, but I'd like to be able to do this on files with thousands of columns. `tac` does this perfectly for lines.   I guess I am looking for the equivalent for columns. `rev` hasn't worked for me, as it also swaps content in the column.


title: Finding all "Non-Binary" files

text: Is it possible to use the `find` command to find all the "non-binary" files in a directory? Here's the problem I'm trying to solve. I've getting an archive of files from a windows user. This archive contains source code and image files. Our build system doesn't play nice with files that have windows line endings. I have a command line program (`flip -u`) that will flip line endings between *nix and windows. So, I'd like to do something like this               find . -type f | xargs flip -u      However, if this command is run against an image file, or other binary media file, it will corrupt the file. I realize I could build a list of file extensions and filter with that, but I'd rather have something that's not reliant on me keeping that list up to date. So, is there a way to find all the non-binary files in a directory tree? Or is there an alternate solution I should consider?


title: What should look for in log files if I think limited memory or disk space is causing a crash?

text: Troubleshooting /var/log files for a recent series of crashes, what should I look for in the files if I believe low memory or disk space are to blame? Is there a _general term_ used in the Linux error-throwing lingo for hardware faults of this kind? And, what system processes would be effected, such as the kernel, by a critical shortage of memory? * * * Just as background, I was working on a Drupal site hosted on my Fedora 17 sandbox project laptop when I experienced these system crashes. Recently I've downloaded some rather large files (I've since moved to media) and was down to about 1.8G of HD space. I found some useful posts here about monitoring memory usage with `top` or current disk usage with `du`. This question, however, is specifically about log files. I found a similar post at Fedora Forums searching for an explanation of `FPrintObject` which lead me to do Memtest, but nothing is reported bad there.


title: A more readable ps

text: Are there any tools that improve the readability of `ps` in the same spirit as ack for `grep`? This would be especially on OS X where `ps` does not even have options such as `\--sort user`. So far the nicest formatting I could come up with is               alias p="ps -m -o pid,user,%mem,args"      and `pa="p -a"` `px="p -x"`, but I would like to, for example:   1. format the memory footprint better (e.g. KB, MB, ...)   2. sort by user name or filter with `p <user>`   3. only show {fore,back}ground processes with `p {fg,bg}`   4. draw the `pstree` hierarchy without being overwhelmed   5. color the output meaningfully


title: Mouse problems in OpenSuse

text: I just installed the latest version of opensuse on virtualbox just to learn some stuff and I'm having some strange problems with my mouse. Sometimes while I'm just moving my mouse around not clicking anything all my open windows do this sort of alt tab behavior where it shows all of the windows for a brief second aligned in a sort of tiled fashion. For instance, if I have 4 different apps open they will all resize to fit one in each corner top right, top left, bottom left, bottom right. Then almost as quickly as they came they disappear and sometimes my windows switch to a different app that I wasn't working in at that time. I'll try and grab a screenshot the next time it happens. On top of this, my scroll wheel doesn't work in most applications (it does in terminal and chrome but not firefox and other places I thought it'd work). Now this may be just how linux is, but it seems weird that it is. ![screenshot](http://i.imgur.com/lYa1P.png)


title: Permissions help?

text: So I've set up a Wordpress site on my server. The problem I'm having is that Wordpress creates new folders to sort content uploaded from the Dashboard by day. But, somehow the server doesn't have permission to create new folders. How can I set the permissions so that the server will have full creation/read/write permissions in the directory? Also, how can I set it so that the server will automatically have the same permissions over any future subdirectories created in Wordpresses's folder?


title: How can I find matches with sed (or similar) for configuration parameters?

text: I'm pretty good at using php's `preg_match` (and similar) commands, and I'm also pretty good with regular expressions, but I don't do very well with `sed`. I have two shell scripts I'm working on and I'd like to be able to pull some variables out of configuration files. ### First File The first file is an `.htaccess` file and I want to grab the web address, which is going to be in a block that looks like this:               RewriteCond %{HTTP_HOST} !^www\.mysite\.net$     RewriteRule (.*) http://www.mysite.net/$1 [R=301,L]      The syntax of the `.htaccess` file is going to be pretty regular so I feel like I should use a pattern similar to `#.*(http.*?)\$#is` which does:   * regular expression   * delimited by #   * 0 or more characters before http   * start capturing at the http with the non-greedy symbol ?   * continue capturing until you hit an actual dollar sign (escaped)   * match case insensitive   * ignore whitespace / newlines **How can I use that regular expressionwith a command like`sed` so that I get the part inside parenthesis if it matches, and nothing (empty string) if it does not match?** Would I be better off using another command besides `sed` if I am used to php's PCRE? ### Second File The second file is a little different because it is an `.ini` file and so I wonder if there might be some shell magic (I use `bash`) in order to parse it. The chunk I want looks like this:               [Database]     database          = mysql://user:password@localhost/database      If I was using PHP and regular expressions I would do something like this:               #\s+database\s*=\s*mysql://([\:]+):([\@]+)@([\/]+)/(.*?)\s+#is      In PHP there is an .ini parser, but I want this to be a shell/bash script, not a PHP script **How can I use that regular expression to get the database connect credentials?**


title: Is there something similar to SUSE Studio but geared toward Debian-based distros?

text: I am playing around with SUSE Studio and am finding it quite amazing, though (I imagine for sentimental reasons) I prefer Debian and the deb package manager. Is there something like SUSE Studio that is based on Debian? That is to say, is there something web-based like the SUSE Studio site with which you can build your own Debian image?


title: How can I prevent someone from gaining root access through the bootloader?

text: On Ubuntu 10.10 I can login as root without the root password by replacing `ro quiet splash` with `rw init=/bin/bash`. How can I secure my machine and disable this backdoor?


title: Is there a way to get the effect of combining grep -v with grep -A?

text: Is there a way, either with `grep` or something else, to (in effect) combine `grep -v` and `grep -A`? That is, rather than _include_ everything for x lines after a string, _exclude_ everything. Quick reminder for those who forget their grep switches:   `cat file.txt | grep -v blah` filters out 'blah', the opposite of normal grep   `cat file.txt | grep -A7 foo` will display 7 lines after each occurance of 'foo'   (Yes I'm aware that `cat` is unnecessary here. But I find it much more readable when you string together a lot of `grep` statements to do it this way.) Simply saying   `cat file.txt | grep -A100 bar | grep -vA100 foo`   will not work. "Working" would be defined as displaying everything (up to 100 lines) between the line matching 'bar' and the line matching 'foo'.


title: what is the meaning of 0.0.0.0 as a gateway?

text: Can anyone clarify gateway assignment for me? What is the difference between adding gateway as `0.0.0.0` and assigning a specific ip address as a gateway?


title: KDE desktop strange appearance

text: I installed Arch Linux with XFCE 4.10 on my old PC with Intel 3.0 GHz processor, 4 GB RAM and Nvidia GeForce 7300 LE with nouveau driver and everything is running fine. I recently installed KDE (kdebase), modified `.xinitrc` file and start it using `startx` and I get this screen: ![enter image description here](http://i.stack.imgur.com/1qE33.png) please help!


title: find and remove duplicates in a directory

text: I have a directory with multiple img files and some of them are identical but they all have different names. I need to remove duplicates but with no external tools only with a `bash` script. I'm a beginner in Linux. I tried nested for loop to compare `md5` sums and depending on the result remove but something is wrong with the syntax and it doesn't work. any help? what I've tried is...               for i in directory_path; do         sum1='find $i -type f -iname "*.jpg" -exec md5sum '{}' \;'         for j in directory_path; do             sum2='find $j -type f -iname "*.jpg" -exec md5sum '{}' \;'             if test $sum1=$sum2 ; then rm $j ; fi         done     done      I get: `test: too many arguments`


title: Search for a string in a line and append related lines

text: I have a file containing some `ID` (identifier) and `DS` (description) lines. I'd like to keep the rows containing the `string` value in their `ID` line, as well as all the following (related) `DS` lines before the following `ID` . For exemple:               ID  number1 string     DS  item11     DS  item12     ID  number2 not_string     DS  item21      DS  item22     ID  number3 string     DS  item31     DS  item32      Will return:               ID  number1 string     DS  item11     DS  item12     ID  number3 string     DS  item31     DS  item32


title: Creating debian version dependency in a .deb package

text: Is it possible to create a dependency for the debian version in a .deb package? I would like to put two versions of one package into the same repository. One is for debian 5 and one for debian 6. The version numbers are different (deb 6 version has a higher number), but I would like to avoid accidental installs of the deb 6 version on deb 5 systems.


title: Questions about extended attributes

text: I have a small question about extended file attributes. Assume I label my files with metadata in extended attributes (e.g. to account for the integrity - but this does not matter for my question). The questions that arise now:   * Where are these attributes stored? Surely not in the inode I guess, but in what location - or better: structure?   * How are these attributes connected to a file? Is there a link from the attribute structture to the inode or so?   * What happens when copying/moving around files? I just tested it, when moving a file, the file remains its attributes. When copying it, the copy does not have attributes. So I assume whe burning it to CD or emailing the file, it will also lose its attributes?


title: how much space to reserve on ext3 filesystem to prevent fragmentation issues?

text: I wondered about some missing space on my ext3 partition and, after some googling, found that debian based ubuntu reserves 5% of the size for root. I also found posts describing how to change that size via tune2fs utility. Now I've got 2 questions, that I didn't find clear answers for:   * should I unmount the partition before changing the reserved space. what could happen if I don't?   * how much space should I reserve for the filesystem, so that it can operate efficiently? Thank you!


title: Cron daemon error : Permission Denied

text: I am having trouble setting up a cron job. My set up is as follows:               crontab -e          */10 * * * * OTP_ProJect/PandaServerInfo/SVN/PandaQueueMonitoring/trunk/submit_cron_test.sh      the shell script has permissions:               -rwxr--r-- 1 submit_cron_test.sh      submit_cron_test.sh submits a python script:               python2.5 ProcessPlant.py --test      The error I am receiving is as follows:               /bin/sh: /OTP_ProJect/PandaServerInfo/SVN/PandaQueueMonitoring/trunk/submit_cron_test.sh: Permission denied      I have tried the command               /bin/sh /OTP_ProJect/PandaServerInfo/SVN/PandaQueueMonitoring/trunk/submit_cron_test.sh      and this works fine. Has anyone got any ideas, because I have ran out. :-(


title: Tracing RHEL system hack

text: I have an RHEL 5.7 installation in the lab and someone changed the root password (either by linux single or some other mode). I would like to identify how was it done and basically be able to identify the timelines as to how was this done.


title: Cannot execute binary file on Linux server

text: I'm currently trying to run Knime (a Java-based program) on a Linux server, and every time I try to execute the file (knime) it gives me a "cannot execute binary file" error. I've posted the relevant information below.                 uname -a          Linux safar 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux            ls -al knime_2.6.3          drwxrwxr-x 10 **** **** 4096 Nov 28 23:18 knime_2.6.3            ls -al /knime_2.6.3/knime          -rwxrwxrwx 1 **** ***** 71162 Oct 15 15:11 knime      For reference, the file's name is "knime" and it's within the "knime_2.6.3" folder. There are other files within that folder pertinent to Knime (which I can post information about if necessary) but the Readme simply says to execute knime. Here's the error:                 . knime            -bash: .: knime: cannot execute binary file      I'm not really experienced with Linux, so any help would be appreciated. Thank you!


title: Xorg increases cpu usage over time

text: I've had quite a strange phenomenon with Xorg for some time now: After logging in to my laptop (specifics below) the cpu consumption of Xorg increases monotonically, even if the computer is idle and nobody sits in front of it. I measured the phenomenon over night+morning and got the following result:               up/min  cpu%     14      3.4     29      3.4     44      3.6     59      3.9     74      4.2     89      4.5     [snip]     734     17.8     749     18.1     764     18.5     779     18.8     794     19.1     809     19.4      It actually continues like this regardless whether somebody (=me) uses the computer or not. If you approximate this, it is about `0.025 %/min`. Do you have any clue why this happens or how I could figure this out? Some specs:               CPU: Atom with 1.6 GHz max     Distro: Ubuntu 10.04 LTS     GUI: Gnome 2.30.2     WM: xmonad 0.9.1     X.Org X Server 1.7.6     Linux Kernel: 2.6.32-33


title: Exception of inheritance of environment variables

text: Quoted from Wikipedia: > By default, when a process is created it inherits a duplicate environment of > its parent process, **except for explicit changes made by the parent when it > creates the child**. At API level, these changes must be done between fork > and exec. Alternatively, from shells such as bash, you can change > environment variables for a particular command invocation by indirectly > invoking it via env or using the ENVIRONMENT_VARIABLE=VALUE notation. I understand that "when a process is created it inherits a duplicate environment of its parent process". But I was wondering what the exception "explicit changes made by the parent when it creates the child" really means? I don't understand how the examples in API and shells are examples of the exception.


title: S-M-* commands aren't recognized by Emacs

text: I've noticed commands like `M->` (end-of-buffer) and `M-S-<right arrow>` (org- meta-right) aren't being recognized by Emacs. This was confirmed by describing key bindings using `C-h k`, which showed function assigned to `M-.`. I'm using stock Emacs 24.3 (gui) on an up-to-date Arch Linux system running the latest version of Xorg (rootless). The issue is persistent across window managers, so I don't think it is a window manager issue. Also, the only modifications of made to my key map are:               setxkbmap -option ctrl:nocaps     setxkbmap -option terminate:ctrl_alt_bksp      I used key-mon to confirm that M-S- could be recognized by X. It appeared that it could. However, I also installed conkeror and found that it too wouldn't receive the key combination, so I think it must be a problem with my X server. What else can I try to resolve this issue? Typing `xmodmap -pke` reveals these NoSymbol regions of my keymap. Could they be the culprit?               keycode  36 = Return NoSymbol Return     keycode  37 = Control_L NoSymbol Control_L


title: System crashes during boot while mounting /lib/init/rw

text: After a nasty crash, my system keeps crashing during boot. After a little bit of investigation I have discovered that it crashes executing the following function (in `/lib/inin/mount_functions`):               mount -f -t tmpfs -onosuid,size=5242880,mode=755 tmpfs /lib/init/rw < /dev/null      called from `/etc/init.d/mountkernfs.sh`. Can anyone suggest what sort of system corruption might cause this problem?


title: Serial port's modem lights up, but can't communicate

text: My MB has builtin UARTs (Supermicro X10SAE). I've got an external modem hooked up to /dev/ttyS0. I'm running CentOS7.   * Without minicom running on /dev/ttyS0:     * The modem has CTS on.   * With minicom running on /dev/ttyS0:     * The modem lights up RTS and DTR along with CTS.     * Typing text into minicom does NOT light up the TX/RX lights     * AT does nothing     * +++ does nothing     * ATDT does nothing If I move the modem (on the same box!) to a usb/serial convertor, and connect minicom to /dev/ttyUSB0, the modem responds.               [root ~]#  setserial -a /dev/ttyS0     /dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4             Baud_base: 115200, close_delay: 50, divisor: 0             closing_wait: 3000             Flags: spd_normal skip_test          [root ~]# setserial -a /dev/ttyUSB0      /dev/ttyUSB0, Line 0, UART: 16654, Port: 0x0000, IRQ: 0             Baud_base: 460800, close_delay: 0, divisor: 0             closing_wait: infinte             Flags: spd_normal      I called the modem while on /dev/ttyS0 and saw a blip on TX for the RING, but it did not show on the screen. I assume I have the right port -- I even moved it to ttyS1 for comparison. No difference. I'm stumped! Ideas? I'm beginning to wonder if the MB header to serial jack ribbon cable -- both!? -- are defective somehow.


title: How can I fsck a partition when the device reads as busy (but has been confirmed otherwise)?

text: I'm attempting to run `fsck -p /dev/sda5` to repair errors on an ext4 partition, however the command outputs               fsck from util-linux-ng 2.17.2     fsck.ext4: Device or resource busy while trying to open /dev/sda5     Filesystem mounted or opened exclusively by another program?      I have confirmed using `/etc/mtab` and `lsof` that nothing is using the partition and it's not mounted. I also used `fuser -k /dev/sda5` to forcibly close anything using the file, and `umount` to attempt to unmount it to no avail. **How can I force`fsck` to at least check, and hopefully to repair, the partition despite the fact that it reads as busy?** Assuming I'm confident enough that it's neither mounted nor in use, and that the possibility of data corruption isn't an issue. _All commands were executed as root from an Ubuntu 10.04 32-bit liveCD. The partition is the system (non-home) portion of an Ubuntu 10.04 32-bit installation._


title: Only cat from specific line X (with a pattern) to other specific line Y (with a pattern)

text: A little extended problem from "cat line x to line y on a huge file": I have a huge file (2-3 GB). I'd like to cat/print only from the line having "foo:" to the line having "goo:". Assume that "foo:" and "goo:" only appear once in a file; "foo:" proceeds "goo:". So far this is my approach:   * First, find the line with "foo:" and "goo:": `grep -nr "foo:" bigfile`   * Returns `123456: foo: hello world!` and `654321: goo: good bye!`   * Once I know these starting and ending line numbers, and the difference (654321-123456=530865) I can do selective cat:   * `tail -n+123456 bigfile | head -n 530865` My question is that how can I effectively substitute the line number constants with expressions (e.g., grep ...)? I can write a simple Python script but want to achieve it using only combining commands.


title: How to merge 2 PDF files with interleaving pages order?

text: I've got a double-side-printed multipage document to scan with a linear bulk scanner. So, as the result I get 2 PDF files: one containing all odd pages and the second containing all even pages. I need to merge them the natural way:               1. <- 1.1. (odd.pdf page 1 to result.pdf page 1)     2. <- 2.1. (even.pdf page 1 to result.pdf page 2)     3. <- 1.2. (odd.pdf page 2 to result.pdf page 3)     4. <- 2.2. (even.pdf page 2 to result.pdf page 4)      etc.


title: Setup Cloudmin on Centos installed in LVM

text: I installed CentOS 6 with default LVM partition pattern. according to this pattern Can I use Cloudmin and store KVM Disks in LVM as Logical Volume? I think Cloudmin requires creating new logical volumes.


title: Long(est) security update support for stable GNU/Linux distributions?

text: Which _a)_ FLOSS _b)_ stable (= not rolling release) _c)_ desktop GNU/Linux distributions have a _long_ security update support? Of course it’s interesting which distro has the _longest_ support, but 2nd, 3rd etc. places should be considered, too. **Debian stable** versions get security updates for around 1 year after the new stable version is released. _In theory_ this could be a long time, but you can’t know for sure, can you? **Ubuntu LTS** versions get security updates for 5 years. Any distro offers more?


title: Reattach to Emacs session

text: I was trying to save in Emacs and pushed something wrong and Emacs closed. Judging by               ps aux | grep emacs      the `emacs` process is still running with the file I need to save running. (Opening the file in new `emacs` process complains that the file is used by another `emacs` process). How can I reattach to the running Emacs session or at least make it save its work before I kill it?


title: Need to improve urlencode function

text: I need a way to URL encode strings with a shell script on a OpenWRT device running old version of busybox. Right now I ended up with the following code:               urlencode() {     echo "$@" | awk -v ORS="" '{ gsub(/./,"&\n") ; print }' | while read l     do       c="`echo "$l" | grep '[^-._~0-9a-zA-Z]'`"       if [ "$l" == "" ]       then         echo -n "%20"       else         if [ -z "$c" ]         then           echo -n "$l"         else           printf %%%02X \'"$c"         fi       fi     done     echo ""     }      This works more or less fine but there're a few flaws:   1. Some characters are skipped, like "\", for example.   2. Result is return character by character so it's extremely slow. It takes about 20 seconds to url encode just a few strings inside a batch. I'm not very much into shell scripting in obscure shells (ash here) so I summon to collective wisdom to help me improve it so it works faster and doesn't skip any characters. I would appreciate an advice but please don't offer substitution algorithms as I'm looking to support all characters not just a few special ones. Also, my version of bash doesn't support substring like this ${var:x:y}. Thanks!


title: Run local scripts on multiple servers using sudo user through a script

text: I have about 100 remote servers. I want to manage all my servers using one terminal server to update , run commands with sudo privileges. I need to have one main script that takes another test script as an argument. The main script run through a with loop using a hosts file with remote server names. The test script has all the actual sudo commands to be run on the remote servers at once ./mainscript hostfile testscript for example, test script may have "sudo yum -y update" or a string of commands. This seems easy if I login as root user. But I want to run this as user 'admin' who has sudo privileges on all the remote servers. All these scripts are located locally on terminal server. Please suggest me any ideas you may have to achieve this?


title: When all hardware resources are free what would cause linux to run slowly

text: Sometimes, after a few hours, my system works slowly. I have checked status of these resources:   * Hard disk using `iotop`   * Ram usage using `free`   * CPU usage using `top` None of them are busy. `top` also shows that there is no process using too much memory or cpu. Slowness is in switching between windows, typing, etc... Is there anything else I should check?


title: Why didn't I get the same result after installing the OS as when using Debian Live?

text: Yesterday, I tested Debian Live 7.6 with non-free drivers using a USB stick. I used that because the completely-free version was not recognizing my wifi and video drivers out-of-the-box. Everything went fine, got everything working - audio, video, wifi, card reader, etc... so I decided to install. I restarted my laptop and began the installation process, which was successful. When starting the machine after the installation process had finished, the only thing I got was a black screen. The `tty`s where available and working, though. I was able to manage the issue upgrading to testing - that was my goal after installing the OS in the first place, so I didn't even take the time to properly troubleshoot the issue. So, I just changed the `sources.list` repositories to point to `testing` and issued an `aptitude safe-upgrade`. After that, everything was working. **Why the machine worked fine while using the Live USB stick, but then it failed to work when the OS was finally installed in my machine?** Does the Live distro use some other way to recognize the hardware, so it's able to handle more scenarios than usual? Does it do some kind of fail-safe run in order to ensure the system can load and be usable? I'm not trying to debug the problem here - I'm just trying to understand why the Live system have worked, but then when the OS was installed it's not. What have changed between the 2 runs?


title: KDE - Kmail: How to put message preview window on the right?

text: Kmail shows message preview window below the messages thread. It there a way to put it on the right, like outlook does? I.e. I would like to have three columns in KMail - folders, messages thread, preview window.


title: Google and Microsoft sign in problem in Puppy Linux

text: I'm running Slacko Puppy and for unknown reason this FF browser isn't loading Google Sign In page. I can perform a Google Search awesomely but when clicks Gmail or Google Drive which requires sign in, the browser starts loading the sign in page and never ends it resulting in a white screen with endless loading. Same problem with Microsoft. In MS services I can't perform a search nor can I go to OneDrive sign in page. To sum up all, some websites never loads (always) and some websites loads quickly (always). I'm tethering my Android phone (gingerbread) with this Linux and using the default FF browser. I have tried clearing all cookies, cache, history, everything but still no solution. I've also checked the status of Google Services. They are running fine. I can access all those websites in my phone but not on Puppy Linux


title: What's wrong with this autologin configuration?

text: I'm configuring TTY auto login, so I followed the official guide, created a file named autologin.conf in /etc/systemd/system/getty@tty1.service.d, containing the following lines:               [Service]     ExecStart=     ExecStart=-/usr/bin/agetty --autologin XX --noclear %I 38400 linux      I did this for both tty1 and tty3. Now when my system boots, I can see the bash prompt on tty1, but my autorun scripts for tty3 doesn't run at all. (The script is in ~/.bashrc, it runs if `$(tty)` equals to `/dev/tty3`) Any ideas? P.S If I modify getty@.service directly, adding the autologon, it works perfectly, the auto run scripts for tty3 executes. **EDIT** I also noticed if I press ALT + F3 manually, after switching to tty3, the script get executed as well.


title: How to sign end encrypt mail using openssl?

text: I am trying to send and encrypt mail using openssl. So far, I figure I should use theese commands:               cat ${content} | \         openssl smime -encrypt -inkey lib/me.crt  -aes256 -subject "$titre (cs)" -to someone@hotmail.com lib/MAQUETTE1-me.pem | \         openssl smime -sign -inkey lib/myroot.key -signer lib/MAQUETTE1-myroot.pem -passin pass:myroot1 | \         tee ~/tmp7/$T/mail-cs-$c |\         sendmail -t someone@hotmail.com      This work fine, except that I loose the first few line of ${content}, which is annoying for palin text content, and fatal when sending binary file. Have I missed something ? first lines of ~/tmp7/$T/mail-cs-$c (before being sent to sendmail)                   MIME-Version: 1.0         Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha1"; boun         dary="----396B3702CFDE34F2D44DF5C360D9F6FD"              This is an S/MIME signed message              ------396B3702CFDE34F2D44DF5C360D9F6FD         To: someone@hotmail.com         Subject: contenu du tex 17 (cs)         MIME-Version: 1.0         Content-Disposition: attachment; filename="smime.p7m"         Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name="smime.p7m"         Content-Transfer-Encoding: base64              MII5sgYJKoZIhvcNAQcDoII5ozCCOZ8CAQAxgfcwgfQCAQAwXTBQMQswCQYDVQQG         EwJGUjEPMA0GA1UECAwGRnJhbmNlMQ0wCwYDVQQHDARMeW9uMQ0wCwYDVQQKDARP


title: How does Linux verify the login password?

text: I would like to know how the password verification in Linux works. I know that the passwords are stored as a hash in `/etc/shadow` file and user information is in `/etc/passwd` file. My understanding is this:   1. Selecting what user you want to login as decides what user name the system should check.    2. When you enter the password and hit enter, the system goes to the `/etc/shadow` file and finds the line corresponding to the user name.    3. From step 2 it gets the hash of the actual password. It then generates the hash of the entered password and compares both of them. If a match is found, voilà. Else, error message.  Is my understanding correct?


title: Parsing arbitrary natural language dates under BSD

text: I'm using the GNU date command to parse arbitrary natural language dates - for example to detect if a certain epoch time stamp is from last week, I can do:               if [ "$timestamp" -lt "$(date +"%s" -d "last sunday")" ]; then ...      Now when I'm trying to port my script to FreeBSD, how do I achieve the same functionality? `man date` didn't show any promise, unless I missed something obvious.


title: Can't connect unsecured wifi from Wicd or terminal

text: I can connect without issue to `WPA` networks, but if I am somewhere like a hotel and try to connect to an unsecured WiFi, things hang at the `DHCP` part and I don't get an `IP` assigned. I'm running Ubuntu 12.04 and my Wifi is on `eth1` Wicd, hangs at the getting IP address part. I've tried also (as root)               ifconfig eth0 down     ifconfig eth1 down     dhclient -r eth1     iwconfig eth1 essid AP_Name     ifconfig eth1 up     dhclient eth1      this just hangs at the `dhclient eth1` request until I `Ctrl+C` it.


title: Why is this static route not taking effect?

text: # Original Question I am running Ubuntu and network manager. I have two different interfaces, `eth0` and `eth1`. Network manager has (as far as I can tell) correctly added this manual route:               ~$ ip route          default via 172.16.0.2 dev eth1  proto static      10.0.0.0/8 via 172.16.0.2 dev eth1  proto static      130.35.0.0/16 via 172.16.0.2 dev eth1  proto static      ...     172.16.0.0/12 dev eth1  proto kernel  scope link  src 172.16.0.15  metric 1      192.135.82.0/24 via 172.16.0.2 dev eth1  proto static       `eth0` appears down, but that seems to me to be a separate problem. Even given the above routes, the IP stack seems to be preferring `eth0`:               ~$ ping 130.35.249.52     PING 130.35.249.52 (130.35.249.52) 56(84) bytes of data.     ^C     --- 130.35.249.52 ping statistics ---     18 packets transmitted, 0 received, 100% packet loss, time 17132ms          ~$ ping -Ieth1 130.35.249.52     PING 130.35.249.52 (130.35.249.52) from 172.16.0.15 eth1: 56(84) bytes of data.     64 bytes from 130.35.249.52: icmp_seq=1 ttl=57 time=210 ms      Additionally,               ~$ ip rule     0:  from all lookup local      32766:  from all lookup main      32767:  from all lookup default           ~$ netstat -nr     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     0.0.0.0         172.16.0.2      0.0.0.0         UG        0 0          0 eth1     10.0.0.0        172.16.0.2      255.0.0.0       UG        0 0          0 eth1     130.35.0.0      172.16.0.2      255.255.0.0     UG        0 0          0 eth1     ...     172.16.0.0      0.0.0.0         255.240.0.0     U         0 0          0 eth1     192.135.82.0    172.16.0.2      255.255.255.0   UG        0 0          0 eth1          ~$ ip addr     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo            valid_lft forever preferred_lft forever         inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 08:00:27:01:b1:f6 brd ff:ff:ff:ff:ff:ff         inet6 fe80::a00:27ff:fe01:b1f6/64 scope link             valid_lft forever preferred_lft forever     3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 08:00:27:35:eb:24 brd ff:ff:ff:ff:ff:ff         inet 172.16.0.15/12 brd 172.31.255.255 scope global eth1            valid_lft forever preferred_lft forever         inet6 fe80::a00:27ff:fe35:eb24/64 scope link             valid_lft forever preferred_lft forever      How can I force the IP stack to obey those routes? # Routing Successful               ~$ ip route get 130.35.249.52     130.35.249.52 via 172.16.0.2 dev eth1  src 172.16.0.15         cache      This situation is getting a little bit more screwy. It seems that the failure in the first ping is _temporary_ , the second ping to `eth1` succeeds, and then subsequent pings to `eth0` route correctly. It's difficult for me to determine how the IP stack gets into this state, but for now I'm going to try to solve a different DNS-related problem.


title: ext3 Filesystem shows full to most apps, but only 77% full to DF

text: Var is showing as full to many apps like Nagios, Puppet, and the LVM tools (pvs, vgs, etc) **df -h output**               6.0G  4.3G  1.4G  77% /var      **vgs output**               /var/lock/lvm/V_rootvg:aux: open failed: No space left on device       Can't get lock for rootvg       Skipping volume group rootvg      `lsof +L1` shows nothing under var anymore, so I don't think there are unlinked files which have yet to be cleared from the `/var` filesystem. I don't understand why 1.4G free on a 6G filesystem is considered full. I know some space is reserved by the system on each filesystem but that can't be it, it's too much space. The filesystem is `ext3` on Red Hat 5.               dumpe2fs 1.41.12 (17-May-2010)     Filesystem volume name:   <none>     Last mounted on:          <not available>     Filesystem UUID:          c8f44510-e8f7-4e2e-950a-1410b069910e     Filesystem magic number:  0xEF53     Filesystem revision #:    1 (dynamic)     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file     Filesystem flags:         signed_directory_hash      Default mount options:    user_xattr acl     Filesystem state:         clean     Errors behavior:          Continue     Filesystem OS type:       Linux     Inode count:              393216     Block count:              1572864     Reserved block count:     78627     Free blocks:              1183083     Free inodes:              388144     First block:              0     Block size:               4096     Fragment size:            4096     Reserved GDT blocks:      63     Blocks per group:         32768     Fragments per group:      32768     Inodes per group:         8192     Inode blocks per group:   512     Filesystem created:       Mon Apr 29 13:12:02 2013     Last mount time:          Wed Oct 23 19:10:44 2013     Last write time:          Wed Oct 23 19:10:44 2013     Mount count:              6     Maximum mount count:      -1     Last checked:             Mon Apr 29 13:12:02 2013     Check interval:           0 (<none>)     Reserved blocks uid:      0 (user root)     Reserved blocks gid:      0 (group root)     First inode:              11     Inode size:           256     Required extra isize:     28     Desired extra isize:      28     Journal inode:            8     Default directory hash:   half_md4     Directory Hash Seed:      8766dfd5-c802-4bc3-81cc-21869e810656     Journal backup:           inode blocks     Journal features:         journal_incompat_revoke     Journal size:             32M     Journal length:           8192     Journal sequence:         0x0112568e     Journal start:            3334


title: Emacs on OpenBSD for DEC VAX?

text: I have managed to install OpenBSD 5.2 on my DEC VaxStation 4000 Model 90 but to my surprise have not found a binary for Emacs (any version) for the VAX architecture. As best as I can tell I do not see it in the ports collection either. Has anybody succeeded in installing any version of Emacs (or for that matter Zile) on the VAX architecture? Note that the VAX architecture distribution of OpenBSD uses a modified version of GCC 2.9.5 as it's compiler.


title: Disable automount-open in Ubuntu 12.10

text: How do I do that? In earlier versions I would run dconf-editor in my terminal, browse to org -> gnome -> desktop - media-handling, and uncheck automount-open. This is not working, with Unity and all.


title: get fn+volume control working in xfce

text: I'm running xubuntu 12.10 (xfce 4.10) (on a lenovo thinkpad X121e) and the function (fn) + volume control do not change the actual output volume. they do something and a volume change is displayed, but It seems to be changing the "HDMI / DisplayPort" (digital stereo, whatever that means...?) but all music seems to be output to "analogue stereo" (whatever that means...?). So what probably want is to remap fn+f1/f2 (the volume control keys) to the audio output (but any other ideas are very welcome too). how on earth do I do that? Several users seem to be facing a similar problem, but I have so far not found a sufficient solution, since they all seem to be referring to gnome and most of them address something like "system settings -> sound preferences" which doesn't exist in (my) xfce. the closest answer I could find I think could be this: No volume control in Nexuiz fullscreen mode does that mean I need to enable or install or whatever acpid and if yes, where and under what name do I save that script? nowhere can I find any such lines. help very welcome, thanks.


title: Why did removing iptables "break" my network access?

text: To remove iptables i used yum :               # yum remove iptables -y      But this removed a lot of packages :               Remove      262 Package(s)          Installed size: 710 M     Downloading Packages:     Running rpm_check_debug     Running Transaction Test     Transaction Test Succeeded     Running Transaction     Warning: RPMDB altered outside of yum.       Erasing    : xorg-x11-drivers-7.3-13.4.el6.x86_64                                                                                1/262        Erasing    : ipa-client-3.0.0-37.el6.x86_64                                                                                2/262        Erasing    : firstboot-1.110.15-1.el6.x86_64                                                                                3/262        Erasing    : system-config-date-docs-1.0.11-1.el6.noarch                                                                                4/262        Erasing    : system-config-date-1.9.60-2.el6.centos.noarch                                                                                5/262        Erasing    : system-config-kdump-2.0.5-15.el6.noarch                                                                                6/262        Erasing    : system-config-network-tui-1.6.0.el6.2-1.el6.noarch                                                                                7/262        Erasing    : dmraid-1.0.0.rc16-11.el6.x86_64                                                                                8/262        Erasing    : dmraid-events-1.0.0.rc16-11.el6.x86_64                                                                                9/262        Erasing    : compiz-gnome-0.8.2-24.el6.x86_64                                                                                10/262        Erasing    : gnome-disk-utility-2.30.1-2.el6.x86_64                                                                                11/262        Erasing    : compiz-0.8.2-24.el6.x86_64                                                                                12/262        Erasing    : xorg-x11-drv-ati-7.1.0-3.el6.x86_64                                                                                13/262        Erasing    : pulseaudio-module-bluetooth-0.9.21-14.el6_3.x86_64                                                                                14/262        Erasing    : gnome-bluetooth-2.28.6-8.el6.x86_64                                                                                15/262        Erasing    : bluez-4.66-1.el6.x86_64                                                                                16/262        Erasing    : gnome-power-manager-2.28.3-7.el6_4.x86_64                                                                                17/262        Erasing    : rhythmbox-0.12.8-1.el6.x86_64                                                                                18/262        Erasing    : xorg-x11-glamor-0.5.0-6.20130401git81aadb8.el6.x86_64                                                                                19/262        Erasing    : mesa-libEGL-9.2-0.5.el6.x86_64                                                                                20/262        Erasing    : kexec-tools-2.0.0-273.el6.x86_64                                                                                21/262        Erasing    : xorg-x11-drv-modesetting-0.5.0-1.el6.x86_64                                                                                22/262        Erasing    : 1:xorg-x11-drv-nouveau-1.0.1-4.el6.x86_64                                                                                23/262        Erasing    : xorg-x11-drv-synaptics-1.6.2-13.el6.x86_64                                                                                24/262      ...      A lot of packages are lost and i can no more connect to this system using `ssh` ! What was wrong in my command line?


title: Difference between 2>&1 > output.log and 2>&1 | tee output.log

text: I wanted to know the difference between the following two commands               2>&1 > output.log       and               2>&1 | tee output.log      I saw one of my colleague use second option to redirect. I know what 2>&1 does, my only question is what is the purpose of using tee where a simple redirection ">" operator can be used?


title: How to Throttle per process I/O to a max limit?

text: I'm looking for a way to limit a processes disk io to a set speed limit. Ideally the program would work similar to this:               $ limitio --pid 32423 --write-limit 1M      Limiting process 32423 to 1 megabyte per second hard drive writing speed.


title: Start window in specific size and location, is there a general tool can do that?

text: Is there a general program, that start my GUI program, and able to specify the size and location of this program ? Not just X programs, but also other GUI libs.


title: Linux command line that will fail if any standard out is produced

text: Is there a simple utility which I can pipe output to on Linux that will:   * Return a success code if there is no output on standard out (and / or standard error).   * Return a failure code if output is produced on standard out (and / or standard error). To provide some context, the command I'm running is:               svn mergeinfo --show-revs eligible     http://mysvnserver.example.com/SVF/repos/common/abc/branches/abc-1.7     http://mysvnserver.example.com/SVF/repos/common/abc/trunk      If there are any unmerged entries on the branch, the command will return a list of revision numbers on standard out. Ideally, the additional command that I'm talking about would:   * Detect entries on standard out and return an error condition to Linux.   * Pass on the standard out so that it does end up appearing on the terminal. I'd rather not suppress it.


title: Determining the Password Status of a User

text: I have a debian box that I connect to via SSH. I have removed the password from the users `root`, and my personal account using the instructions here, and set up a public/private key pair so I can log in, but only if I have the private key. I recently ran `cat /etc/passwd` in order to see what other users where on the system, and got a fair list back. So, how can I determine the password status for each user so that if I make the box public to the wider world (via ssh only), there are no other users that someone could use to authenticate with?


title: Linux Mint 15 - Unable to connect to wireless

text: I have been using Linux Mint 12 for some time and I remember I had faced similar problems back then but that had been fixed by doing some research. However, this time around with the upgrade to 15, I just cannot get it to work. I have the Asus u56e-BBL5. There are several people who get this problem on this model I can't find the solution. I have looked at this and this . The problem is that I can see all the available wifi networks and when I enter the password for my home network, it just tries to connect for a bit and then I get a notification that 'wireless disconnected'. I don't even get a connection when I do the wired connection. On trying this: `sudo modprobe -r iwlwifi` , I get `FATAL: Module iwlwifi is in use.`. Nothing has worked as of now. This is definitely not a hardware problem because everything works fine on my Mint 12 setup on the same machine.


title: Setting vim filetype with modeline not working as expected

text: As per the accepted answer to this question, I'm attempting to use modelines in vim to force filetype detection in some files. For example, at the top of a file named `gitconfig` (note there is no leading `.`), I have the following line:               # vim: set filetype=gitconfig :       `modeline` is enabled on my system. However, when I open the file in vim, `set filetype?` returns `conf`, rather than the expected `gitconfig`. Is it possible that other parts of my vim configuration (e.g. filetype.vim) are causing this strange behaviour? Edited in response to comments: `set compatible?` returns `nocompatible` `set modeline?` returns `modeline` `verbose set filetype?` returns:               filetype=conf           Last set from /usr/share/vim/vim73/filetype.vim      I don't understand why the system wide filetype plugin would be overriding what I have set in the file itself. One final note: this is the version of Vim 7.3 shipped with OSX. The latest version of MacVim running on the same system using the same `.vimrc` behaves as expected, with `set ft?` returning `filetype=gitconfig`.


title: Format drive and all partitions, start from scratch on chromebook

text: I have a chromebook which ... someone ... may have messed up some partitions using fdisk while ubuntu was installed. Now, after doing a recovery re-install for chromeOS I'm unable to install ubuntu again and have noticed strange issues. I have root access and would like to completely wipe this hard drive and start from as scratch as possible. First, is this possible since chromebooks have some physical hardware that does some mystery magic making it always recoverable? Can someone suggest where I can find instructions to do that plan, if it's possible?


title: Can I remount as readonly if there's a swap image in use?

text: When am playing with my Android phone (CyanogenMod 10.1 with kernel 3.0.78), I found this:   * A script in `/etc/init.d/99system.swap.sh`   * It remount /system as rw, and creates an image file in `/system/swap/swap.img` After the phone is started, I can find this swap.img file, and it is in use, by checking `/proc/swaps`. But the `/system` is mounted as ro. I tried to do the same thing, by manual, on another phone. But when I try to remount `/system` as **ro** , I got error message saying there are resources in use. ~~If I swapoff the image on`swap.img` file, I can immediately remount `/system` as **ro**.~~ I was wrong, I cannot remoutn `/system` as **ro** after I remount it as **rw**. _lsof_ shows tons of process are using `/system`.


title: Reasons for rsync NOT transfering all files?

text: Does anyone know common reasons for such a large deficit difference in the number of files transfered when backing up my LARGE home directory using rsync on a ubuntu 10.04 LTS setup.. machine is stable and all volumes are clean ext4 no errors from fsck.ext4               Number of files: 4857743     Number of files transferred: 4203266      **Thats a diff of 654,477 files!!!** I want to backup my FULL home folder to an external disk so I can fully WIPE and reformat my system and then restore my home from this rsync'd backup... but I am concerned I am missing significant data files. I was logged in as root and used rsync to backup my /home/hholtmann/* directory to a spare backup drive in /mnt/wd750/c51/home/ Here is the command line I used as root               root@c-00000051:~# pwd     /root     root@c-00000051:~# rsync -ah --progress --stats /home/hholtmann /mnt/wd750/c51/home/ -v      Captured summary output from rsync               Number of files: 4857743     Number of files transferred: 4203266     Total file size: 487.41G bytes     Total transferred file size: 487.41G bytes     Literal data: 487.41G bytes     Matched data: 0 bytes     File list size: 102.48M     File list generation time: 0.001 seconds     File list transfer time: 0.000 seconds     Total bytes sent: 487.75G     Total bytes received: 82.42M      Just to compare an important project sub-dir in my home after rsync: Byte difference between a source and destination sub-dir using `du`               root@c-00000051:~# du -cs /home/hholtmann/proj/     18992676    /home/hholtmann/proj/     18992676    total     root@c-00000051:~# du -cs /media/wd750/c51/home/hholtmann/proj/     19006768    /mnt/wd750/c51/home/hholtmann/proj/     19006768    total      **HOWEVER: NO FILE COUNT difference between the same source and destination sub-dirs**               root@c-00000051:~# find /home/hholtmann/proj/ -type f -follow | wc -l     945937     root@c-00000051:~# find /mnt/wd750/c51/home/hholtmann/proj/ -type f -follow | wc -l     945937      why such unexpected results??? a file is a file.. especially in a user's home dir!! What am I missing? or is this a sign i'm ready for management!?! **SOLUTION and ANSWERED:** The selected answer below explains for the byte count difference and my incorrect expectation of the rsync summary data..... I was just surprised by this byte difference given that both volumes are ext4 with default block sizes. I just assumed every file would take the same space in terms of du numbers. I DID find some files that **were NOT rsync'd** by adding more verbose output to rsync by adding `-vv` to rsync and running again. **what I saw was errors from rsync stating that it could NOT write any of my DROPBOX dir files to the destination due to the "extended attributes" on the files. rsync was skipping all my dropbox path files. ends up my /home volume was mounted with the `user_xattr` ext4 mount option in the /etc/fstab file:               /dev/mapper/vg1-lv_home /home   ext4 nobarrier,noatime,user_xattr 0 2     # I HAD to add the ,user_xattr option to match my home volume     /dev/sda1           /mnt/wd750  ext4 nobarrier,noatime,user_xattr 0 2      After performing another full rsync for the 3rd time.. I decided to let a file count run all night on my full home folder and rsync'd backup:               root@c-00000051:~# find /home/hholtmann/ -type f | wc -l     4203266     root@c-00000051:~# find /mnt/wd750/c51/home/hholtmann/ -type f | wc -l     4203266      ** A PERFECT MATCH OF FILES ** CONCLUSION: ** Always ensure your backup volumes are mounted with the exact same file system mount options as the source AND turn on full logging with rsync for later grep analysis to search for any errors in long file listings **


title: How do I decrypt a message using openssl's CLI?

text: I have a message, I know the password and the cipher that was used to encrypt it, but I can't figure out how to ask openssl to decrypt it. I see the cipher in the output from the `ciphers` command, and the man page lists a `enc` command for `Encoding with Ciphers`, but I can't find how I would do the opposite, decode a message.


title: Recommended Linux distribution or distributions for children

text: My kid wants to use Linux and wants to be a geek in Linux. I am really glad at my kid's wish. Now I want to introduce my kid to Linux. Which linux distribution or distributions should I suggest?


title: How to create an interactive bash script to collect arguments for a command in linux?

text: I'm trying to create an interactive bash script where I can collect user input variables to be used as arguments in another command. Can someone provide me an example of this? Currently i want to do:   1. what type of content you want to delete?   2. what is the status? then feed it into a mysql delete query command.


title: Backup to a synology NAS with bup

text: I am trying to make a remote backup to my Synology NAS (DSM 4.1) using `bup`. I compiled `bup` on my NAS from source, did there:                BUP_DIR=/volume1/public/Backups/bup bup init     Initialized empty Git repository in /volume1/public/Backups/bup/      Then I tried: `bup save --remote=root@192.168.1.90:/volume1/public/Backups/bup -n bubtest /home/user/BackupTest` on my laptop but got the following error message:               env: python: No such file or directory     Traceback (most recent call last):       File "/usr/lib/bup/cmd/bup-save", line 74, in <module>         cli = client.Client(opt.remote)       File "/usr/lib/bup/bup/client.py", line 91, in __init__         self.check_ok()       File "/usr/lib/bup/bup/client.py", line 132, in check_ok         return self.conn.check_ok()       File "/usr/lib/bup/bup/helpers.py", line 389, in check_ok         return self._check_ok(onempty)       File "/usr/lib/bup/bup/helpers.py", line 377, in _check_ok         raise Exception('server exited unexpectedly; see errors above')     bup.client.ClientError: server exited unexpectedly; see errors above      On my laptop `which python` tells me `/usr/bin/python`. On my NAS `which python` gives `/opt/bin/python`. Any idea to make it work?


title: After update of eOS video player Audience the player crash immediately

text: Looking in Synaptic I saw an update option and after updating to the new (0.1+r297-0+pkg11~ubuntu12.04.1) version it crashes a fraction of a sec after starting the video. It may be opened if nothing is playing. Maybe I should get a previous version of Audience?


title: Unable to connect to git.denx.de

text: I am trying to download U-boot for beaglebone black using Ubuntu 12.04, for this I am using this command               git clone git://git.denx.de/u-boot.git      Now, after typing this command in terminal, for about one minute I got this               Cloning into 'u-boot'...       then this               fatal: unable to connect to git.denx.de:     git.denx.de: Name or service not known      I have use this command in past , it works fine. I don't have any idea why it is behaving like this. so, please tell reason and solution of this problem.


title: What distro will use less resources for a laptop?

text: Currently I'm in doubt:   I'm getting a new Dell Vostro 2520 with 4 gigs of memory. The problem is that I'm Ruby/ ex-PHP developer and may have to work with quite big projects. Probably simultaneously. One option is upgrading a memory up, but I prefer the idea of getting to know available Linux distributions and selecting a more suitable one.   In the end there are two Linuxes on my list:   * Linux mint Xfce   * Xubuntu  What can you advice?


title: How to install TortoiseHG on RHEL 5.3 from source?

text: I have been trying to install TortoiseHG with the `yum` command on my RedHat system and have been struggling. I thought perhaps I should install it from the source. I used the instructions here and here. However, it still didn't work. I am afraid that I am missing something obvious. My system is:   * RHEL 5.3   * Mercurial 1.8.1   * Python 2.4.3 Commands I have run to install Nautilus extension are   * cd to a directory holding all my local repository CassieRep `cd CassieRep`   * clone the tortoisehg repository `hg clone http://bitbucket.org/tortoisehg/thg tortoisehg`   * create a symlink `ln -s /home/Cassie/CassieRep/tortoisehg/thg /usr/bin`   * deal with nautilus              mkdir -p ~/.nautilus/python-extensions     ln -s /home/Cassie/CassieRep/tortoisehg/contrib/nautilus-thg.py \           ~/.nautilus/python-extensions        * restart nautilus `nautilus -q` The items on my desktop disappeared. I actually logged out and log in again.I tried to type in `thg` on an terminal but system did not recognize it.


title: Ping multiple hosts and execute command

text: I'm very new in bash scripting and unix so I will need some help on this.I have 7-10 hosts which I want to ping from one of the servers via cronjobs. What I want is when host is up to execute command on it. When is down do nothing. I don't want logs or any messages. So far I have this and unfortunately don't have ability to try it right now. If you can just check it and point me.               #!/bin/bash     servers=( "1.1.1.1" "2.2.2.2" "3.3.3.3" "4.4.4.4" "5.5.5.5" "6.6.6.6" "7.7.7.7" )          for i in "${servers[@]}"     do       ping -c 1 $i > /dev/null       done          ping -c 1 $i > /dev/null     if [ $? -ne 0 ]; then              if [ $STATUS >= 2 ]; then             echo ""         fi     else         while [ $STATUS <= 1 ];         do             # command should be here where is status 1 ( i.e. Alive )            /usr/bin/snmptrap -v 2c -c public ...         done     fi      I'm not sure if this is right or no. I've used this from one tutorial and there is some things that I'm not sure what they exactly do. Am I on right way here or I'm totaly wrong?


title: Use ssh without trying ssh-keys

text: If I try to connect to a certain server with               ssh example.com      ssh aborts with `Too many authentication failures` because I have more than 5 ssh keys in my .ssh folder and it loops through all those keys with none of them fitting (detailed description here) How can I tell ssh not to look in my keys and just give me the password prompt?


title: Change user info on the command line

text: I have made a user in Mint 16 but want to change its first and last name without deleting it and starting from scratch. I know how to do it with a GUI but I want to know the terminal command alternative. I've checked the man pages of usermod but couldn't figure out how in sh.


title: store the command output in an array and print one by one

text: This is my command:               cat httpd.conf | grep ^LogFormat | awk -F\" '{print $(NF)}'      Output of this:               commonsess     common      or can be any number of values, I need to store these values in an array and print one by one...using their index number.


title: Interpreting output from iostat

text: I'm facing really slow speed serving just static files from 300 to 900 MB on a 1 GBps dedicated line. This is the output from `iostat` but I don't know if this is ok or not.               Linux 2.6.32-220.13.1.el6.x86_64 (zlin) 05/04/2012 _x86_64_ (4 CPU)          avg-cpu: %user %nice %system %iowait %steal %idle 0.36 0.00 2.70 35.74 0.00 61.19          Device:   rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sda          7.53    17.90   97.65    0.76 26641.93   149.18   272.25    22.72  230.85   7.46  73.39      Also:               netstat -an |grep :80 |wc -l     416      `iptraf` shows 165000 KB/s


title: How can I set these permissions?

text: I was so sure of myself, I thought I knew about permissions. Until someone asked me this. Having these users:               User   Group     ----   -----     juan   juan     pedro  pedro     maria  maria     jose   jose     miguel miguel     eric   eric     lola   lola     paola  paola             This directory: `/opt/privado` with Owner = `juan:juan` Permissions:               juan 111     pedro  110     maria and jose 101     miguel and eric 100     lola   000      There are no common permissions for creating a group `myGroup` and assigning, for example, 110 because I have different permissions for a different group of users. How can this be done on Unix? Really the issue is for Linux, but maybe it is the same solution.


title: iBus not working for firefox:i386 installed on amd64

text: I have a lubuntu-desktop:amd64 workstation. To save some memory, I installed firefox:i386 (which pulls other i386 packages of course). It works pretty well, except for ibus integration: firefox ignores the selected iBus input mode and interprets all keystrokes as plain English (US). Are there any :i386 packages that I should install to make iBus integration work?


title: Birthday reminder

text: write a bash shell script to get the alerts of friend's birthday Suppose                 Birthday Date       Friend's name        08-02-2014          : Prashant        08-15-2014          : prabhat        09 -16 -2014        : Aks       12-30-2014          : Bks      for the single birthday i can do it using `crontab`               Step 1: create a file vi birthday.sh           Step 2:           echo " Birthday alerts: today is Prashant 's Birthday Wish!! him " |mail -s "b-alert" abc@domain.com        step 3: give execute permission               chmod u+x birthday.sh       step 4: run the script birthday.sh using cron               00 00 02 08 *  /home/user/birthday.sh      But how to do it ? to get the alert of multiple birthday , i can create the script of each birthday , but i don't think it's best to do it . I want only one script to get the alerts of all birthday when birthday come


title: how to display I/O file on shell

text: I am writing shell script and I need to display my output at the same time however it doesn't work with `2> somefile.txt` and if I do `| tee -a somefile`l it will not overwrite which I need to . <> SO, i came up with ... `> newfile.txt | cat newfile.txt` , however doesn't work for a newfile and need to do chmod, but I have to run my script twice in order to get it work... so i need something more efficient than `> newfile.txt | chmod 755 newfile.txt |cat newfile.txt`... Basically I need a shell script I need to display my output at the same time is recording to a file without overwriting, if the file was already exist ... I hope it make sense :) Thank you


title: Diff head of files

text: I have two files. One file, I suspect, is a subset of the other. Is there a way to diff the files to identify (in a succinct manner) where in the first file the second file fits?


title: Auto-login to internet script

text: For me to connect to internet I need to login first. Normally I do this manually (by opening my browser then at the first URL I enter I am redirected to the ISP's login page). However there is a Perl script that does this automatically (each time the PC is booted). How do I make use of this script? (Where and how do I tell Debian to use this script) note: i use _network-manager_.


title: GUI not working in Ubuntu 11.04 after removing some packages

text: I accidentally removed `i32-libs` using the following command                     sudo apt-get remove ia32-libs      Now the GUI is not working properly: when I login, it just shows me a small terminal on one side of the screen, and nothing on the rest of the desktop. I ran               sudo apt-get install ubuntu-desktop      and I tried choosing a different session type on the login screen; if I select “Ubuntu classic mode” the desktop is fine but some applications still fail; for example when I start Skype, I see the message               skype: error while loading shared libraries: libXss.so.1: wrong ELF class: ELFCLASS64


title: wc - setting a terminating character

text: I've got that far: `wc --files0-from=FILE` lets one get the word count of a list of files. Each entry in this list mus be terminated with an ASCII NUL character. **Question** : A way to set a terminating character, such as NUL by hand, or something else? I found this here [quoted from the `info wc` output]: > … produce a list of ASCII NUL terminated file names is with GNU `find', > using its`-print0' predicate. I found somebody saying the each file name is being terminated by an ASCII NUL character. Is it right that this fits to, say the output of `ls`? I know, one shouldn't parse `ls`, but writing the output into a file to be read by `wc` another time would be nice.


title: Problem with pam_mount and sshfs

text: I'm trying to configure automounting of users home directories using `pam_mount` and sshfs (users are LDAP users on remote machine). I configured `pam_mount`:               <?xml version="1.0" encoding="utf-8" ?>     <!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">     <pam_mount>     <debug enable="1" />     <mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />     <mntoptions require="nosuid,nodev" />     <logout wait="0" hup="0" term="0" kill="0" />     <mkmountpoint enable="1" remove="true" />     <volume fstype="fuse" path="sshfs#%(USER)@HOSTNAME:" mountpoint="~" ssh="1" options="reconnect,idmap=user,password_stdin,nonempty" />     </pam_mount>      When I'm trying to `su` to user I'm asked about password:               root@debian:~# su - pszubert     pam_mount(pam_mount.c:553): pam_mount 2.5: entering session stage     reenter password for pam_mount:     pam_mount(misc.c:38): Session open: (ruid/rgid=0/20001, e=0/20001)     pam_mount(mount.c:213): Mount info: globalconf, user=pszubert <volume fstype="fuse" server="(null)" path="sshfs#pszubert@HOST:" mountpoint="/home/pszubert" cipher="(null)" fskeypath="(null)" fskeycipher="(null)" fskeyhash="(null)" options="reconnect,idmap=user,password_stdin,nonempty" /> fstab=0 ssh=1     command: 'pmt-fd0ssh' 'mount.fuse' 'sshfs#pszubert@HOST:' '/home/pszubert' '-oreconnect,idmap=user,password_stdin,nonempty'      pam_mount(spawn.c:108): setting uid to user pszubert     pam_mount(misc.c:38): set_myuid<post>: (ruid/rgid=20001/20001, e=20001/20001)     System plików  Typ bl.  1K B        użyte dostępne %uż. zamont. na     /dev/sda1     ext3     7867856    940236   6527956  13% /     tmpfs        tmpfs      192316         0    192316   0% /lib/init/rw     proc          proc           0         0         0   -  /proc     sysfs        sysfs           0         0         0   -  /sys     udev         tmpfs      187872       148    187724   1% /dev     tmpfs        tmpfs      192316         0    192316   0% /dev/shm     devpts      devpts           0         0         0   -  /dev/pts     fusectl    fusectl           0         0         0   -  /sys/fs/fuse/connections     pam_mount(pam_mount.c:521): mount of sshfs#pszubert@HOST: failed     command: 'pmvarrun' '-u' 'pszubert' '-o' '1'      pam_mount(misc.c:38): set_myuid<pre>: (ruid/rgid=0/20001, e=0/20001)     pam_mount(misc.c:38): set_myuid<post>: (ruid/rgid=0/20001, e=0/20001)     pmvarrun(pmvarrun.c:248): parsed count value 0     pam_mount(pam_mount.c:440): pmvarrun says login count is 1     pam_mount(pam_mount.c:643): done opening session (ret=0)      In HOST `auth.log` there is info:               Mar 17 22:13:42 student sshd[17889]: Accepted password for pszubert from 85.202.159.212 port 20264 ssh2     Mar 17 22:13:42 student sshd[17889]: pam_unix(sshd:session): session opened for user pszubert by (uid=0)     Mar 17 22:13:42 student sshd[17891]: subsystem request for sftp     Mar 17 22:13:42 student sshd[17891]: Received disconnect from XXXXXXXXXX: 11: disconnected by user     Mar 17 22:13:42 student sshd[17889]: pam_unix(sshd:session): session closed for user pszubert      What is weird when I'm logged in I can mount remote fs using `sshfs pszubert@HOST: a/`. Whats wrong? EDIT: I think that problem is with `~/.ssh` on local machine. First problem was about `known_hosts` file, so I created global `known_hosts` in `/etc/ssh/ssh_known_hosts`. Now `~/.ssh` is still created, but is empty even if I connect to remote host manually. I think that if I could prevent of creation `~/.ssh` it would solve problem. Is there a way to disable it?


title: How can I tell if sshd is running with ClientAliveInterval > 0?

text: The title pretty much says it all, I'm a user on a system, and I want to know if that system is running sshd with a ClientAliveInterval > 0, which would tell me if I need to worry about using ServerAliveInterval locally or not. I can't read `/etc/ssh/sshd_config`, but is there a way to query sshd or something similar?


title: Getting wmctrl to work with multiple Emacs windows

text: I'm trying to write a script that switches focus to Emacs. This is what I have:               #!/bin/bash     wmctrl -a 'emacs@pat-ubuntu-desktop'      It works fine when there is only one Emacs window (or "frame," in Emacs parlance) open, but it doesn't do anything when multiple Emacs windows are open. The problem seems to be that the window titles change when a second window is opened. When there's a single window open, its name is `emacs@pat- ubuntu-desktop`:               ➜  ~  wmctrl -l     0x05c000a3  0 pat-ubuntu-desktop emacs@pat-ubuntu-desktop      But when I open a second window, the window titles change:               ➜  ~  wmctrl -l     0x05c000a3  0 pat-ubuntu-desktop *scratch*     0x05c00921  0 pat-ubuntu-desktop *scratch*      **EDIT** : The following issue was illusory, the result of my web browser having "emacs" in its title (because I was searching information about my first problem). ~~Another issue (perhaps related, perhaps not), is that even when there is only a single Emacs window open, the command`wmctrl -a 'emacs'` doesn't work, but `wmctrl -a 'emacs@'` (or `wmctrl -a 'emacs@pat-ubuntu-desktop'`) does. Why must the `@` be included?~~


title: How to clean journals in ext3/ext4 filesystem?

text: Some preamble: I'm taking bitwise copy of disk devices (via `dd` command) from twin hosts (i.e. with the same virtualized hardware layout and software packages, but with different history of usage). To optimize image size I trailed all empty space on partitions with zeroes (e.g. from `/dev/zero`). I'm also aware of _reserved blocks_ per partition and temporarily downgraded that value to _0%_ before trailing. But I'm curious about discrepancy of the final compressed (by `bzip2`) images. All hosts have almost the same `tar-gziped` size of files, but compressed `dd` images have significant variety (up to 20%). So how could it be? Is there a reason in the filesystem journals data which I was unable to purge? There are over ten partitions on the host and each reported of 128Mb journal size. (I also checked defragmentation, it's all ok: _0_ or _1_ due to `e4defrag` tool report) So, my question is it possible somehow to clean `ext3/ext4` filesystem journals? (safely for stored data of course :) **CLARIFICATION**   I defenitely asked a question about _how to clean (purge/refresh) journals in`ext3/ext4` filesystem_ if possible or maybe I'm mistaken and there is no such feature as reclaiming disk space occupied by filesystem journals, so all solutions are welcome. An intention to ask the question I put as premise into the preamble and the answer to my question would help me to investigate the issue I encountered with.


title: Clicking on Gtk apps menu bar kills mouse

text: I'm using the following configuration:   * Ubuntu 11.10 x64   * Awesome Window Manager v3.4.10    * Gnome 3.2 ...and I got the following problem: ![Screenshot of the Problem](http://i.stack.imgur.com/6NmGd.png) **Every time I click on the empty space in a menubar or toolbar in a Gtk application (like Nautilus, GEdit), mouse clicks don't work any more.** Sometimes it also happens after clicking a resize grip (See this bug report). I'm still able to move the mouse cursor, but clicking and scrolling doesn't have any effect. All keyboard actions work as before, e.g. I can switch desktops with Mod4-Left / Mod4-Right, type in text boxes or switch the active window with Mod4-j/k. When I close the application where I did the killing click, everything works perfectly as before. This is especially annoying when it happened in Nautilus as I have to `killall nautilus` to make it work again, which kills the desktop as well. Does anybody have the same problem, and is there any bugfix around? * * * **EDIT** I found this item in the Ubuntu Bug tracker which describes exactly this misbehavior. As far as I understand, they want to release the bugfix in the next Ubuntu version, 12.04. Is there a chance to get the update earlier? Do I have to compile Gtk myself, if yes, how to do this? * * * _Note: I asked this, less specific,here_


title: IP address of a mounted network directory

text: I have mounted a network directory to `/mnt/svr` with the following `fstab` configuration:               # <file system> <mount point> <type> <options>       <dump> <pass>     //svr/folder    /mnt/svr      cifs   credentials=XXX   0      0      Is there a way to find in the logs what the ip address of `//svr` was the last time the directory was mounted? I have tried a `sudo grep -r "mnt" /var/log/*` but did not find anything interesting. The reason why I'm asking is that `svr` has been remapped to a different server and I need to access the previous location/IP that `svr` was pointing to.


title: I can't find a way to change the default browser to icedtea webstart

text: My OS is OpenSuse 64 bit and I run a java webapp, `.jnlp`. Everytime I click on a link on that app it opens a Firefox browser, yet I would like to change this to Google Chrome, but am unable to find out how yet. My DE is KDE 4.11


title: Linux: Use maildir instead of mbox

text: Is there a way to use Maildir instead of mbox on a Linux box? On some websites, it is suggested to add to `/etc/aliases`:               myuser: /var/mail/myuser/maildir      I've issued the `newaliases` command, but it didn't work.


title: Displaying ~ for $HOME in zsh prompt

text: I have my prompt set to the following:               PROMPT=%F{reset}[%F{blue}%2/%F{reset}]      which displays two parent directories as               [foo/bar]      However, when I'm in `$HOME` or one directory deep in `$HOME`, I'd like the prompt to be displayed as               [~]     [~/foo]      respectively, instead of               [/Users/me]     [me/foo]      I've tried approaches like Steve Losh's `collapse_pwd` (and the simpler version: `${PWD/#$HOME/~}` also mentioned in the article) and other similar ones, but I lose the flexibility of being able to show only the last two directories. How can I modify the above to handle `$HOME`? My zsh version is `zsh 5.0.0 (x86_64-apple-darwin12.0.0)` on OS X 10.8.2


title: kernel module function call

text: I write a kernel module which has initialize and end function. I want one more function and want to call it from the user space process at any time i want. Is it applicable ? If so, how ? I am working on CentOS 5.2 and custom kernel, patched from linux 2.6.18. EDIT: To make clear, I want to write a function into kernel module and call this function from the regular source.c file.


title: What would break if the C locale was UTF-8 instead of ASCII?

text: The C locale is defined to use the ASCII charset and POSIX does not provide a way to use a charset without changing the locale as well. What would happen if the encoding of C were switched to UTF-8 instead? The positive side would be that UTF-8 would become the default charset for any process, even system daemons. Obviously there would be applications that would break because they assume that C uses 7-bit ASCII. But do these applications really exist? Right now a lot of written code is locale- and charset-aware to a certain extent, I would be surprised to see code that can _only_ deal with 7-bit clean input and cannot be easily adapted to accept a UTF-8-enabled C.


title: obfsproxy fails to build because it can't find event2/util.h

text: I'm trying to build obfsproxy. These steps all work fine:               # git clone https://git.torproject.org/obfsproxy.git     # cd obfsproxy     # ./autogen.sh     # ./configure      But then I get to:               # make     make  all-am     make[1]: Entering directory `/root/obfsproxy'     gcc -DHAVE_CONFIG_H   -I. -I./src  -Wall -Wwrite-strings -Werror -l/usr/local/libevent/include/ -l/usr/local/libevent/include/ -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIE --param ssp-buffer-size=1 -fno-strict-aliasing -fno-strict-overflow -MT container.o -MD -MP -MF .deps/container.Tpo -c -o container.o `test -f 'src/container.c' || echo './'`src/container.c     In file included from src/container.c:14:     src/util.h:22:47: error: event2/util.h: No such file or directory     make[1]: *** [container.o] Error 1     make[1]: Leaving directory `/root/obfsproxy'     make: *** [all] Error 2      How do I fix this?


title: Finding Linux distribution with proper hardware driver support

text: To me it is a jungle to find what Linux distribution to choose... Of course one would like to use as much performance as possible from the machine. In my case I have a HP Pavilion dv6-6008eo - in particular I am a bit worried that the graphics card AMD Radeon HD 6490M (1 GB DDR5) will not work. Do you have any suggestion on how to proceed to find a Linux distribution that should support the hardware? (I would prefer to know that it works before installation).


title: rewrite existing file so that it gets replaced by new version atomically, only once fully written

text: I vaguely recall reading somewhere that there used to be, in some Unices a way to open an existing file for writing, with a flag that asked the kernel to use the old version (for other processes accessing it for reading), until the "new" version was fully written (fd closed), from which point the file appeared as the new version. In another words, other processes either saw the old version, or the new one, never an incompletely-written one. Can someone knowledgeable point me to a reference?


title: How to know if a text file is a subset of another

text: I am trying to find a way to predict if a text file is a subset of another.. For example:               foo     bar      is a subset of               foo     bar     pluto      While:               foo     pluto      and               foo     bar      are not one a subset of each other.. Is there a way to automatically predict this? This check must be a cross check, and it has to return:               file1 subset of file2 :    True     file2 subset of file1 :    True     otherwise             :    False


title: How to store Vim tabstop settings in the file?

text: I need different tab widths for different files when using Vim. Is there a way to store this information in the file, and let Vim apply the setting automatically?


My `ffmpeg` command gives error when I try to convert video format. I have installed `ffmpeg` manually following this guide. For above issue I checked ffmpeg: error while loading shared libraries: libtheoraenc.so.1 also but not able to resolve my issue. My command is : `/root/bin/ffmpeg -i /home/pulsebrk/public_html/beta/user_uploads/6/1148a008470721f06c8dc71efa70622f99799e91.avi -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 345k -s x /home/pulsebrk/public_html/beta/user_uploads/6/1148a008470721f06c8dc71efa70622f99799e91.ogv`   and error is:               /root/bin/ffmpeg: error while loading shared libraries: libtheoraenc.so.1:         cannot open shared object file: No such file or directory      libtheroa version is : 1.1.1 please anyone drive me for above issue.


title: How to filter group membership from the ldap server?

text: Context : We have a Ubuntu 12.04 with authentication done on a ldap server. Unfortunately, one (ldap) user belongs to a (ldap) group named "admin". I know there is the option nss_initgroups_ignoreusers to list the users I don't want to be looked for from the ldap. But couldn't find any equivalent for groups. How could I specify ldap groups not to be used on this installation?


title: Difference between 'man ls' and 'ls --help'?

text: I use both `man` and `\--help` in Bash programming to get help. For example, to get information about usage of `ls` command, I may use               man ls       Or               ls --help      Both give some what similar output. What is the difference between these two?


title: Passing values through pipes

text: I don't quite understand pipes in Linux command line. I noticed that:               ll - R | grep *.pdf      will list files ending with `.pdf` But               locate *.pdf | du -h      will not calculate the size of files ending with `.pdf`. Rather it will list the size of files in the current directory. What is going wrong here? What I have in mind is the output of the first command is the input of the next.


title: What live linux smaller 2GB and with pre-installed `wpa_supplicant` is suited best for Gentoo installation?

text: I have a mid-old laptop that I want to use for learning more details about Linux, so I decided for a first-time Gentoo installation. I can only connect via WLAN to internet with this laptop. My router only supports WPA(2). My biggest USB stick has 2GB for the live linux, so the full Gentoo live DVD (larger than 2GB) is no option. The minimalist Gentoo has no `wpa_supplicant` (which would be needed for WPA), however. What is the best option for me to follow the Gentoo manual as closely as possible?


title: How does grub2 load the kernel from an LVM volume?

text: Grub2 is able to load the kernel even if `/boot` is placed on an LVM volume. To use this feature one needs to add `insmod lvm` (the module can be on the grub bios partition that is not on an LVM volume) in the corresponding grub entry. But it doesn't explain to me how grub reads the kernel since the kernel should be loaded before anything can be inserted into it. How does it work?


title: Compile pdf file from multiple images scanned in by scanimage --batch

text: Say I'm scanning in images of documents with something like:               scanimage --mode Gray --resolution 300 -x 215 -y 280 --format=tiff \         --batch=document-p%d.tiff --batch-prompt      (In the example I've used `.tiff` format, but I'm open to anything that works.) What's the easiest way to compile the separate image files into a single PDF file?


title: find total ram memory and swap memory

text: I need to write a script to find total memory and total swap of several linux server (2000+). I have one trusted server from where I can login to all these 2000 servers without a password. When I run this script, it should give output like this:               Server         total memory        swap     redhat1        redhat2     redhat3     ...     redhat2000      How can I achieve this?


title: NFS configuration redhat6.3 64bit

text: I'm getting this error on the client:               [root@localhost /]# mount -t nfs 192.168.18.144:/linuxcast-nfs /mnt/     mount: wrong fs type, bad option, bad superblock on 192.168.18.144:/linuxcast-nfs,            missing codepage or helper program, or other error            (for several filesystems (e.g. nfs, cifs) you might            need a /sbin/mount.<type> helper program)            In some cases useful info is found in syslog - try            dmesg | tail  or so      I don't understand the error. Does the client need additional configuration?


title: Backup file with .bak _before_ filename extension

text: I commonly backup config files on servers without version control like so:               # cp httpd.conf{,.bak}     # ls     httpd.conf    httpd.conf.bak      However, for files in the web root I take the time to carefully put the `.bak` before the filename extension so that the `.php` will remain and Apache will still send the file through the PHP interpreter if someone manages to guess or probe the server for such files:               $ cp index.php index.bak.php     $ ls     index.php    index.bak.php      Is there any way to use tab-completion and muscle memory to put the `.bak` before the filename extension? I have `Tab{}←,.bak` burned into muscle memory and I cannot use this nice "meat macro" on files in the web root. Thanks.


title: How to modify rngd's default command line?

text: I need to perform the following... > `rngd`'s default command line should be modified to add `\--no-tpm=1` `rngd` is a daemon that feeds data from a random number generator to the kernel's random number entropy pool, after first checking the data to ensure that it is properly random. How do I modify its command line to add `\--no-tpm=1`? What file do I need to modify or what command should I run to accomplish the task? P.S. I need to do this to fix this bug on my system. Thank you.


title: dialog, trap and SIGTRAP

text: I've seen a lot of examples using dialog tools into scripts with lines as follows:               trap "rm $datafile" 0 1 2 5 15      What I don't understand is the meaning of SIGNAL 5, ok I know is SIGTRAP. But shame on me, still I don't understand its real significance... Thanks in advance!!


title: Replace a character except last x occurences

text: I have a file that has a bunch of hostnames correlated with IPs that looks like this:               x-cluster-front-1 192.168.1.2     x-cluster-front-2 192.158.1.10     y-cluster-back-1 10.1.11.99     y-cluster-back-2 10.1.157.38     int.test.example.com 59.2.86.3     super.awesome.machine 123.234.15.6      And i want it to look like this:               x-cluster-front-1 192.168.1.2     x-cluster-front-2 192.158.1.10     y-cluster-back-1 10.1.11.99     y-cluster-back-2 10.1.157.38     int-test-example-com 59.2.86.3     super-awesome-machine 123.234.15.6      My question is: How can i replace the . (dots) from the first column with - (line) in order to facilitate a sort by the second column. I was thinking of using sed to replace dots until first space or replacing every dot but the last three but i'm having trouble understanding regex and sed... i can perform simple replaces but this is way over my head :D. This is part of a larger script that i have been writing in bash. I am stuck at this part...


title: Can less load lines which were appended to a file after opening?

text: When I am viewing a log file in `less` is it possible to make less reload the file to get lines which were appended to that file since it was opened?


title: Using Sed with Regex

text: I would need to edit the values in a file delimited by colons (`:`) I would like to replace the contents of the file by using regular expression. After a grep to confirm that the item exist in the file system. I would like to edit the contents inside it by using sed. I am open to the use of others tools. That would help me. EDIT: So far i have been trying to use sed to modify the contents in the text file in test.txt. The current solution i could think of is sed.                sed -i "s/^\($newEvent:$newPerson:[^:]*\):[^:]*:/\1:$newQty:/" test.txt       echo "item Qty has been updated successfully!"      Is there a way i am able to edit the content after a string matching of event && person and modify the contents of that line which matches. Before any input content in text file               Birthday Party:John Harris:1:10:1          Enter Event: Birthday Party     Enter Person: John Harris               a)  Update Event     b)  Update Person     c)  Price     d)  Update Item brought     e)  Update Quantity Sold      f)  Back to main menu     Please enter your choice: d     New Qty Sold : 38     Qty Sold  has been updated successfully!          a)  Update Event     b)  Update Person     c)  Update Item brought     d)  Update Quantity Sold     e)  Back to main menu     Please enter your choice: f      After input content in text file                Birthday Party:John Harris:1:10:1


title: How do I change the Java Security level?

text: We've got an ancient (internal use only) self-signed app that refuses to run now with the changes to the JRE. Working on getting a code signing certificate and rebuilding it, but that's horribly slow going (been going back and forth with the certificate authority for over a week now and still don't have our cert). I need to get this app back up and running ASAP. On Windows we've been able to temporarily drop the security level to "medium" to get us by until the cert/rebuild happens. How do I go about doing the same on our Solaris machines? Preferably globally (since I'll want to kick the security back up to high as soon and as easily as possible when the program is updated), but per user would also be fine. Or, if there's a way to insert an exception for just our site for now?


title: How do I check that a filename conforms to a pattern?

text: I'm tasked with writing a shell script which checks that a filename conforms to a specific pattern and I'm not sure how to go about it. The filename should follow a pattern which looks like:               (Project-ID)_(Env)_(Source-System-ID)_(DataDescriptor)_(CCYYMMDD)_(Seq)_(Freeformat)_(codepage)        * Project_ID should be alphanumeric and between 3-8 characters.   * Env should consist of a 3 character code (DEV, SYT, SIT, UAT or PRD)   * Source-System-ID should be a variable number   * DataDescriptor should be alphanumeric such as CUST   * CCYYMMDD should be a date in the format CCYYMMDD   * Seq should be a number such as 01, 02, 03 etc   * Freeformat should be alphanumeric - used to give the filename additional description   * codepage should represent the file extension such as .ascii or .EBCDIC An example file might look like:               ABC_PRD_00227_ACC_20130128_01_LTSB.CP1252      If the file doesn't conform to the pattern it would be good if some sort of warning could be displayed.


title: Format USB drive

text: I have a USB drive which I format with               sudo mkfs.vfat -I /dev/sdb1      When I then look at the size of the USB drive with `df -h`, it reports its size to be 64 MB, though it should be 8 GB. What am I doing wrong? `fdisk -l /dev/sdb1` gives               Disk /dev/sdb1: 67 MB, 67108864 bytes     241 heads, 62 sectors/track, 8 cylinders, total 131072 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000               Device Boot      Start         End      Blocks   Id  System


title: CentOS 5: My Postgresql server version is different with my psql client. What should I do?

text: I installed PostgreSQL 9.1 in CentOS 5 x86_64 VPS, with these following commands: I specified which Postgresql version I'd like to install, so I choose 9.1 because I want to equate between development and production environment:               wget http://yum.pgrpms.org/9.1/redhat/rhel-5-x86_64/pgdg-centos91-9.1-4.noarch.rpm      and then               yum install postgresql91-server      Finally               service postgresql-9.1 initdb     chkconfig postgresql-9.1 on     service postgresql-9.1 start      After I finished all that and create my database, I run `psql myfirstdb` and I got this warning:               Welcome to psql 8.1.23 (server 9.1.11), the PostgreSQL interactive terminal.          Type:  \copyright for distribution terms            \h for help with SQL commands            \? for help with psql commands            \g or terminate with semicolon to execute query            \q to quit          WARNING:  You are connected to a server with major version 9.1,     but your psql client is major version 8.1.  Some backslash commands,     such as \d, might not work properly.      So, that said that I have 9.1 server and using psql client 8.1, and some commands like `\d` is not working. How do I fix them?


title: How can I install file-roller for CentOS 6 to use in Gnome?

text: I've just started messing about with Linux and trying to figure things out as I go using tutorials. I've installed Gnome desktop and have some .rar files I would like to open. I've found `file-roller` which looks really good but I can't find any simple guides on how to install it. Would anyone be able to point me in the right direction for getting file- roller to run on my gnome desktop ?


title: NTP symmetric mode

text: I'm configuring NTP symmetric modes.   Say I have Peer A (192.168.101.1) and Peer B(192.168.101.2) and configure their `ntp.conf` as follows:               # Peer A     peer 192.168.101.2     server 127.127.1.0     fudge 127.127.1.0 stratum 10      For Peer B, I set both its `server` and `peer` to A.               # Peer B     peer 192.168.101.1     server 127.127.1.0     fudge 127.127.1.0 stratum 14      If I set their time apart (like 10 minutes), they each will synchronize locally instead of with each other(may I should've waited longer). And I have to add A as B's server in B's `ntp.conf`:               # Peer B     peer 192.168.101.1     server 192.168.101.1     server 127.127.1.0     fudge 127.127.1.0 stratum 14      Then B will synchronize its time to A quickly. This leaves me in doubt about the symmetric mode's effectiveness. Why not just set A as B's server and both of them as clients' servers? If A is down, the cluster time can still fail over to B and stay in synchronism.


title: IPtables command shows libipt_random.so missing

text: When I run a command, it shows error. I searched on net, but no one give me the correct answer. Googling shows only wrong answers for this questions. So please help me to overcome this problem. **Command**               $ sudo iptables -A INPUT -p icmp --icmp-type echo-request -m random --average 50 -j DROP      **Error**               iptables v1.3.5: Couldn't load match `random':/lib64/iptables/libipt_random.so: cannot open shared object file: No such file or directory          Try `iptables -h' or 'iptables --help' for more information.      Tell me link of file or any necessary changes that I have to do , to solve this problem. Thanks in advance. Looking for your kind reply. **EDIT NO. 1** I followed the given link iptables - see random patch


title: How to setup RStudio Desktop verion on a CentOS 5 machine?

text: I have a problem of install RStudio Desktop verion on a CentOS 5 machine. Basically, RStudio Desktop needs QT4.8; however, I am not sure how to update my CentOS 5 QT4 to QT4.8. Otherwise, the Cmake can't go through.


title: how can I configure cups to be used from network machines with windows?

text: Ive been fighting with "CUPS" since many hours (too many) and I still cannot figure out whats wrong, I installed a printer on a Debian Machine, when I will add a printer I have two options "Local printers" and appear the printer that is connected (the one I want to use to print from my network) and "Other network printers", so, I thought maybe I should add local printer and I chosed my printer and I installed and all.. .and prints the tests and all... so, from windows I added my printer with the url `http://192.168.1.2/printers/myprinter` but doesnt work, I read more and I find out the IPP protocol, some use it but some use AppSocket/HP JetDirect, I am very confused, which is the way I should add this printer? do I have to add a printer in the section of network ptiners?? any idea??? I dont get the logic of add network printer, seriously(I might be dumb for this). I installed samba and I added this               <Location /printers>       Order allow,deny       Allow 192.168.0.*       Allow 192.168.1.*     </Location>      When I add printers on windows it asks for 3 options, first search (shows me computers on network, I cant choose the machine with debian, it asks me to login.. I dont know which user, its not Debian's OS , neither windows), second its "selected shared printer" I can not enter ipp:// , it only accepts http:// , and third one is printer throught TPC/IP, there I can add http:// ipp:// or socket:// but none of them are success... Thanks


title: are daemon tmpfs executables copied unencrypted to memory upon execution? (prevent if so?)

text: When a daemon is executed, is the executable copied to memory? If so, can it be copied encrypted? If not, is there a way to prevent the executable from being copied to memory? The executable is stored on an encrypted tmpfs.