title: File has bytes - appears to be empty

text: I'm having the following problem: Some text files (also some binary files) on my system are listed with the correct file size but when I open them, they appear empty.               >ls -la     -rw-rw-r--  1 user user   652 Mar 12 16:17 summary.txt     >cat summary.txt     >      If I display them in midnight commander I get a list of dots (`......`) and in `vi` a list of `^@`. I'm not sure when it happened, but I guess since the last reboot. System:   * Linux ubuntu 3.8.0-37-generic #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux   * ext4 Is there a way to fix it? Edit: I guess it most be somehow correlated with a system reboot. Can I somehow find out by looking at the log files what happened? Thanks.


title: Why do I have to cd out of a deleted directory?

text: On my server I have a directory structure looking something like this:               /myproject/code      I normally have an ssh connection to the server and 'stand' in that directory:               root@machine:/myproject/code#      When I deploy a new version of my code, the code directory is removed so I'm left with:               root@machine:/myproject/code# ./run     -bash: ./run: No such file or directory      And the only solution I've found is to cd out and back in:               root@machine:/myproject/code# cd ../code     root@machine:/myproject/code# ./run     Running...      Can I avoid this? It's a somewhat strange behavior. If you have a nice explanation why this happens I would appreciate it.


title: When executing a command, it is automatically suspended

text: The problem happened on one of my local machines with CentOS 6. I ssh to it from my MacBook trying to test a script, which is in /usr/local/bin. However, whenever I tried to execute the command, it is immediately suspended, displaying "[1]+ Stopped". I had to use `fg` to make it the foreground. Since it's 3 a.m. in the morning, I was wondering if it is related to nice. But I tried some command with nice and renice, it didn't work. As the script calls an I/O-bound Perl script, I also tried ionice but it didn't work either. It seems difficult to reproduce the problem, since after a reboot the problem is gone. Does anyone know the reason?


title: How to kill a process giving it a number of seconds before a doing the forced kill?

text: I do have the PID of the process to be killed but I do want to give it the chance to die peacefully, without doing a -9. Expected behaviour: check if PID is still running for up to ten seconds and do a kill -9 on it. Extra bonus if you could do this in a single line.


title: What mode of memory at the time linux kernel was loaded?

text: Can anyone tell me what the memory mode is at the time linux kernel is loaded (by bootloader)? As this link says, the memory mode is real mode then the linux kernel will ask user to choose video mode and then switch to protected mode, but I do not seen it ask me to choose any thing, so is it right?


title: Is it possible to attach `kinit` to the first attempt to `ssh` without a Kerberos ticket?

text: My university uses Kerberos-based authentication for login to our unix servers. One way to get passwordless login is to run `kinit`, type my password, and then run `ssh@host`. For this setup, I do the following inside my `.ssh/config`:               Host SchoolHost1 SchoolHost2         GSSAPIKeyExchange yes         GSSAPIAuthentication yes         GSSAPIDelegateCredentials yes      My question is, can I skip the `kinit` step and run `ssh` directly , in such a way that the first attempt to `ssh` will automatically grab a kerberos ticket so that subsequent attempts to `ssh` will have the ticket and not require a password? Update: Public Key login is **not** supported by the University's system, because the server cannot read `authorized_keys` file before the login. This is a property of the `Kerberos / AFS` system for which there is really no workaround.


title: How to list backup files missing corresponding real files?

text: I accidentally deleted some files spread across my home directory, but I do not know exactly which ones were removed. How can I get a list of all backup files missing their corresponding file? (equivalently, files having names ending with a tilde, without there being another file in the same directory with the same name sans trailing tilde?) I tried a few things so far; although I don't remember the exact flags, it was something like:               grep -Rlv '(.*)\n\\1~|.*(?!~)'      That didn't work, and neither did:               ls -R | grep -v '(.*)\n\\1~|.*(?!~)'      How can I find these files?


title: Why is 8 numbers considered a "strong" password?

text: Just curious as to why 8 numbers are accepted as a password in linux (CentOS if it matters) and not 8 characters on a non-dictionary word. It's 10 vs 26 per digit after all. (52 counting CaSe SeNsItIvE)


title: Anyone know the meaning of yy?

text: Since history questions are considered on topic, I figured I'd ask one that's been bugging me for quite some time and no one I know seems to know the answer. Does anyone know what the historical significance is of the prefix yy? Most of the variables and functions generated by lex start with it, such as `yylval`, and `yylex()`. I also remember seeing a utility named `yyrsa` somewhere, but can't find references to it anywhere now. Inquiring minds want to know!


title: Constant reading using ext4

text: I had a disk with a full size NTFS partition. I just deleted it and created an EXT4 one. When it was NTFS, if it wasn't in use (mount but no in use) it was quiet. However now, using EXT4, it is constant reading and I don't know why. Using EXT3 is fine also. Any idea?


title: What code runs when I type "sudo service nginx start"

text: I am having this problem: http://stackoverflow.com/questions/10939072/add- nginx-as-a-ubuntu-service-stop-and-reload-doesnt-work I am trying to understand if my code to start nginx is point to the same PID file as my nginx.conf file. How do I know what code runs when I type "sudo service nginx start" ?


title: What does it mean to have a $"dollarsign-prefixed string" in a script?

text: I just saw this in an init script:               echo $"Stopping Apache"      What is that dollar-sign for? ### My research so far: I found this in the bash manual: > _extquote_ > >> If set, `$'string'` and `$"string"` quoting is performed within `${parameter}` expansions enclosed in double quotes. This option is enabled by default. ...but I'm not finding any difference between strings with and without the `$` prefix:               $ echo "I am in $PWD"     I am in /var/shared/home/southworth/qed     $ echo $"I am in $PWD"     I am in /var/shared/home/southworth/qed     $ echo $"I am in ${PWD}"     I am in /var/shared/home/southworth/qed     $ echo "I am in ${PWD}"     I am in /var/shared/home/southworth/qed     $ echo 'I am in ${PWD}'     I am in ${PWD}     $ echo $'I am in ${PWD}'     I am in ${PWD}     $ echo $'I am in $PWD'     I am in $PWD


title: cifs write errors in cron job

text: EDIT: THE SOLUTION With Tim's help I determined that larger writes of data were failing versus smaller ones. Why they didn't fail when I ran the script interactively, I don't know...But here was the fix (new mount option of wsize=4096):               if mount -t cifs -o guest,wsize=4096 //drobonas/public /mnt/drobonas-public; then     ...      `wsize=4096` is a pretty small write (the default is 14x that), so I might experiment to find the limit. But for now I'm just happy it works. ORIGINAL QUESTION I've got a shell script that backs up our svn repositories. I back them up by tar'ing them over to a NAS (a Drobo). The script takes care of mounting and unmounting the network share itself. The script itself works fine when I run it directly, but when run via cron it appears to fail with a few CIFS-related errors appearing in the syslog. First, here's the script:               #!/bin/sh     # This script tars up a backup of the needed svn repo directories.     # It expects to be run as root so that it can mount the drobo's drive.     # There are probably ways to allow user mounting (via additions to /etc/fstab) but I'm trying to minimize setup steps.     # I personally placed it in a directory for root (/root/bin or /home/root/bin depending on your distro), then used crontab -e (again as root) to schedule it.     # My crontab looked like this (runs at 1:01 AM, on Mon-Fri, as root user):     # 01 01 * * 1-5 /root/bin/svn-backup.sh          # mount our backup drive     if mount -t cifs -o guest //drobonas/public /mnt/drobonas-public; then              # perform the actual backup - went with tar so we can preserve permissions, etc         if tar cvpf /mnt/drobonas-public/SvnBackup/svn-backup-temp.tar /home/svnserver/svnconf/ /home/svnserver/svncreaterepo.sh /home/svnserver/svnrepositories/; then                  # if everything worked out, we can do some cleanup                  # remove our oldest backup in the rotation             rm /mnt/drobonas-public/SvnBackup/svn-backup-3.tar                  # rename the existing backups to reflect the new order             #mv /mnt/drobonas-public/SvnBackup/svn-backup-4.tar /mnt/drobonas-public/SvnBackup/svn-backup-5.tar             #mv /mnt/drobonas-public/SvnBackup/svn-backup-3.tar /mnt/drobonas-public/SvnBackup/svn-backup-4.tar             mv /mnt/drobonas-public/SvnBackup/svn-backup-2.tar /mnt/drobonas-public/SvnBackup/svn-backup-3.tar             mv /mnt/drobonas-public/SvnBackup/svn-backup-latest.tar /mnt/drobonas-public/SvnBackup/svn-backup-2.tar             mv /mnt/drobonas-public/SvnBackup/svn-backup-temp.tar /mnt/drobonas-public/SvnBackup/svn-backup-latest.tar                  # do svnadmin dumps as well - helps future-proof things             /bin/bash /root/bin/svn-dump.sh                  # we're done, so unmount our drive             umount /mnt/drobonas-public              else             # something went wrong, unmount the drive and then exit signalling failure             umount /mnt/drobonas-public                  exit 1         fi          else         # mount wasn't successful, exit signalling failure         exit 1     fi      Now here are the log entries (one note: it appears to create the "svn-backup- temp.tar" file successfully, the errors start to happen after that):               Jan  5 07:52:01 giantpenguin CRON[2759]: (root) CMD (/root/bin/svn-backup.sh)     Jan  5 07:52:02 giantpenguin kernel: [21139655.823930]  CIFS VFS: Error -4 sending data on socket to server     Jan  5 07:52:02 giantpenguin kernel: [21139655.823961]  CIFS VFS: Write2 ret -4, wrote 0     Jan  5 07:52:02 giantpenguin kernel: [21139655.824007]  CIFS VFS: Write2 ret -112, wrote 0      The last error line then appears multiple times before the script presumably finishes out. Any insight? Thanks!


title: Zombie process cannot be removed or killed

text: I have a zombie process that refuses to be removed, have tried killall -9 1913 and pkill with no effect. Any help would be very much appreciated.Running Ubuntu 12.04.2 LTS. Thank you.               aruna@aruna-desktop:~$ ps -aux | grep Z     Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html     USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     aruna     1913  0.0  0.0      0     0 ?        Z    12:07   0:00 [lightdm-session] <defunct>


title: Howto read SMS stored on a SIM card?

text: I have an old phone with a telephone card (SIM card) inside. The telephone has an infrared interface on the side. I want to read out my contacts and stored SMS messages from the phone, either via infrared, or by connecting the SIM to the computer by means of some kind of card reader. I once managed to read the data via infrared, but I cannot recreate the needed setup because I have no computer with irda interface anymore. So I've bought a card reader, which unfortunately only works on Windows. The application that comes with it is absolute trash and does not allow saving of data (WTF?!?! Who designed THIS?). Whatever, this reader has a credit-card sized plastic card where you can plug in the SIM card, so I plug the SIM into any kindo f card reader. So my question:   * How can I get the stored data from the SIM using this Adapter? I have access to a computer that contains an integrated card reader, but I would have to check how to do it beforehand.   * If I get hold of an infrared interface somehow, which program is the best choice to read out stored SMS messages and pohonebooks? How is this done? (cmd-lines/link to howto preferred). I hope someone can help, since the phone starts to die, and I want to save all my SMS which don't all fit on the SIM (I would have to copy them from phone memory to the SIM, delete them and copy the next batch, since the SIM can only store 10 messages ...).


title: How to make a folder request root password to view execute?

text: I am running Ubuntu 10.04 LTS. I want to use my laptop to play music in a party. MY screensaver does not need a password to deactivate. I would like to allow people to use my computer to play the music they like, but I would like to prevent them to have access to certain directories in the same manner or similar that linux prevents people unauthorized to install programs from the synaptic package manager. I would like this to be at the level of the command line and the file browser. But with the root password to be able to have access. Is this done by changing the permissions of the directory? If so how, which is the command from the terminal? Will that also prevent people from executing the files in the directory as well? Can I also block their searching of the directory and contents?


title: How to resolve "your browser does not allow access to your computer's clipboard" on Google Docs?

text: I'm trying to copy or paste some text, in Chrome, on Google Docs, and getting this error:               your browser does not allow access to your computer's clipboard      How to resolve it for Chrome (this seems to be a resolution for Firefox)? (The reason I posted here is that this only happens to me on my linux/ubuntu - not on Windows)


title: What is this Bash line supposed to mean?

text: find . -name "*.html" -exec grep -l somethingtobefound {} \;      I was just wondering what the keywords "-name" "-exec" "-l" "{}" "\" and ";" were supposed to signify. Also, I commonly see double-dashes "--" being used instead of single-dashes "-" in a lot of cases. I was wondering if they were interchangeable, and what they signify as well. Thank you!


title: puppet mount a loopback device

text: I was taking **truability** test to assess my skills. I got the below question. Create a puppet manifest in _/root/puppet/lad.pp_ to mount the filesystem located in _/root/files/LAD/disk.ext2_ that:   * will mount the device at "/mnt/LAD"   * sets fstab to prevent the filesystem from being fsck'd and will prevent dump from running on it   * mounts the filesystem as ext2 via loopback device   * mounts the filesystem as read-writable I just started with puppet and I am not pretty sure if what I have is correct. I have the below file.               mount { "/mnt/LAD":             device  => "/root/files/LAD/disk.ext2",             fstype  => "ext2",             ensure  => "mounted",             options => "-o loop",         }      When I run the above puppet configuration, I get the error as,               err: /Stage[main]//Mount[/mnt/LAD]: Could not evaluate: Execution of '/bin/mount -o -o      loop /mnt/LAD' returned 1: [mntent]: line 13 in /etc/fstab is bad     mount: can't find /mnt/LAD in /etc/fstab or /etc/mtab      The following option works perfectly fine.               mount -o loop /root/files/LAD/disk.ext2 /mnt/LAD      Can someone point me where am doing wrong regarding the settings from puppet?


title: Terminal and web browser combination

text: I often use only two applications, **terminal** and **web browser**. I like the `tmux` application which enables to split a terminal window into more regions. I noticed that I can open `lynx` in another region and have a browser and terminal displayed at the same time. But command-line browsers aren't very nice for viewing web pages. **Konqueror** is able to split a web page into more regions. It would be great if there was a browser which could display a web page in one region and a terminal in another region. Is there already a program combining web browser and terminal?


title: netatalk virtual users using ftppasswd (not found) on Debian wheezy

text: I configured my ProFTP server for using virtual users using the ftp.passwd file. Then I used the following command to add a user:               ftpasswd --passwd --name developer --uid {www-datas uid} --gid {www-datas gid}      Now I wanted to do the same for AFP. So I edited the netatalk config as follows:               - -uampath /usr/lib/netatalk -uamlist uams_dhx_passwd.so,uams_dhx2_passwd.so -passwdfile /etc/netatalk/afppasswd      I can still log in using the unix user on the system. After further reading I came across a command named `ftppasswd`, but when I try to run it, I get `command not found`. I couldn't find any good informations, except solutions like "afppasswd should be installed".   * Why is `afppasswd` not installed?   * How do I configure virtual users for netatalk correctly?


title: Why does chroot get ENOENT on an existing file?

text: ;TL-DR - **Answer:** because the dynamic linker ld-linux-x86-64.so.2 was missing. I have mounted a squashfs (shouldn't matter) filesystem `-ro,loop` at `/mnt/foo`. It contains among other things the following (`/mnt/foo` is the mount point):               -rwxr-xr-x 1 root    root     110088 jan 17  2013 /mnt/foo/bin/ls     -rw-r--r-- 1 root    root       5212 jul 23 09:35 /mnt/foo/etc/ld.so.cache     -rw-r--r-- 1 root    root          5 jul 23 09:35 /mnt/foo/etc/ld.so.conf     -rw-r--r-- 1 root    root      31168 maj 23  2013 /mnt/foo/lib/libacl.so.1     -rw-r--r-- 1 root    root      18624 maj 20  2013 /mnt/foo/lib/libattr.so.1     -rwxr-xr-x 1 root    root    1853400 okt 12  2013 /mnt/foo/lib/libc.so.6     -rw-r--r-- 1 root    root      14664 okt 12  2013 /mnt/foo/lib/libdl.so.2     -rw-r--r-- 1 root    root     256224 mar 11  2013 /mnt/foo/lib/libpcre.so.3     -rwxr-xr-x 1 root    root     135757 okt 12  2013 /mnt/foo/lib/libpthread.so.0     -rw-r--r-- 1 root    root      31760 okt 12  2013 /mnt/foo/lib/librt.so.1     -rw-r--r-- 1 root    root     134224 maj 23  2013 /mnt/foo/lib/libselinux.so.1      `/mnt/foo/etc/ld.so.conf` contains a single row (including newline) with just `/lib` on it. Before creating the file system, I ran `ldconfig -r ${TOPDIR}` where `${TOPDIR}` resolved to the place that is now mounted at `/mnt/foo`. A `strings` on `/mnt/foo/etc/ld.so.cache` shows it contains strings like `/lib/libpcre.so.3` and so on, so I don't think it is a problem with the shared libraries. I figure it must be something silly I'm overlooking, but **I cannot figure out myself why a simple`chroot /mnt/foo /bin/ls` doesn't work.** `readelf -d /mnt/foo/bin/ls | grep NEEDED` shows these libraries as needed:                0x0000000000000001 (NEEDED)             Shared library: [libselinux.so.1]      0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]      0x0000000000000001 (NEEDED)             Shared library: [libacl.so.1]      0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]      Finally, `strace` shows this:               chroot("/mnt/foo")                      = 0     chdir("/")                              = 0     execve("/bin/ls", ["/bin/ls"], [/* 32 vars */]) = -1 ENOENT (No such file or directory)      **This is the full strace chroot:**               # strace -f chroot /mnt/foo /bin/ls     execve("/usr/sbin/chroot", ["chroot", "/mnt/foo", "/bin/ls"], [/* 32 vars */]) = 0     brk(0)                                  = 0x1985000     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc115ac8000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=96457, ...}) = 0     mmap(NULL, 96457, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc115ab0000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3     read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\36\2\0\0\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=1853400, ...}) = 0     mmap(NULL, 3961912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc1154e0000     mprotect(0x7fc11569d000, 2097152, PROT_NONE) = 0     mmap(0x7fc11589d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bd000) = 0x7fc11589d000     mmap(0x7fc1158a3000, 17464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc1158a3000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc115aaf000     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc115aad000     arch_prctl(ARCH_SET_FS, 0x7fc115aad740) = 0     mprotect(0x7fc11589d000, 16384, PROT_READ) = 0     mprotect(0x606000, 4096, PROT_READ)     = 0     mprotect(0x7fc115aca000, 4096, PROT_READ) = 0     munmap(0x7fc115ab0000, 96457)           = 0     brk(0)                                  = 0x1985000     brk(0x19a6000)                          = 0x19a6000     open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=8463952, ...}) = 0     mmap(NULL, 8463952, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc114ccd000     close(3)                                = 0     chroot("/mnt/foo")                      = 0     chdir("/")                              = 0     execve("/bin/ls", ["/bin/ls"], [/* 32 vars */]) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/lib/charset.alias", O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file or directory)     write(2, "chroot: ", 8chroot: )                 = 8     write(2, "failed to run command \342\200\230/bin/ls"..., 35failed to run command ‘/bin/ls’) = 35     open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     write(2, ": No such file or directory", 27: No such file or directory) = 27     write(2, "\n", 1     )                       = 1     close(1)                                = 0     close(2)                                = 0     exit_group(127)                         = ?     +++ exited with 127 +++      So, is this `ENOENT` misleading? **YES - ENOENT is a bit misleading. To me it has always meant "file not found".** When the dynamic linker cannot be found, execve() gets ENOENT. When the booting kernel tries to load `init` (or linuxrc or whatever), the error I get is " **Failed to execute /linuxrc (error -2). Attempting defaults...** ". The problem happened due to a bug in my script that created this initial ramdisk. (it omitted libraries not pointed out by "=>" by `ldd`). Two bonus questions to ponder for extra credits:   * what is `linux-vdso.so.1` that `ldd` shows without a path?   * why does `ldd` show ld-linux.so without a "`=>`"?


title: Why does "sudo ./foo" return "./foo Command not found"?

text: I'm having trouble with my new Raspberry Pi. Any time I try to run `./foo`, it returns   `-bash: ./foo: Permission denied` But if I try to run `sudo ./bar`, then it returns   `sudo: ./bar: command not found` Using `sudo` with other things (for example: `ifdown` and `ifup`) works fine, but any script that I've downloaded or written, it refuses to execute. I'm pretty familiar with bash, but mostly in the context of Mac OS X. It just seems to me that this should be working.


title: Heavy write activity on SSD nukes system performance

text: I've noticed that when I do heavy write applications, the whole system slows down. To test this further I ran this to do a (relatively) low-CPU, high disk activity:               john -incremental > file_on_SSD      This pumps out tens of thousands of strings per second to a file on my system disk. When it's doing this, the mouse lags, TTYs become unresponsive, applications "fade" and generally the whole computer becomes unusable. When I can eventually Control+C `john`, the system comes back to full strength after a few seconds. This is an extreme example but I have similar issues with slightly less write- intensive activities like copying big files from fast sources or transcoding. My main OS disk is a quite fast SSD ( **OCZ Agility 60GB** ) with EXT4. If I write `john`'s output to a mechanical disk with EXT4, I don't experience the same slow-downs though the rate is a lot slower (SSD does ~42,000 words per second, mechanical does 8,000 w/s). The throughput may be relevant. The mechanical disk also has nothing to do with the system. It's just data. And I'm using kernel 2.6.35-2 but I've noticed this issue since I got this SSD when I was probably using .31 or something from around that time. **So what's causing the slowdown? EXT4 issue? Kernel issue? SSD issue? All of the above? Something else?** If you think I need to run an additional test, just drop a comment telling me what to do and I'll append the result to the question.


title: How to yank a particular line without moving the cursor in vim?

text: For example ![alt text](http://i.stack.imgur.com/5p1DH.png) How can I yank and paste Line 4 only to Line 12 **without having to move the cursor** to Line 4? ![alt text](http://i.stack.imgur.com/1Xj0L.png)


title: What should I basically expect from access to an OpenVZ based VPS?

text: I'm going to buy access to an OpenVZ based VPS for the first time. I want to run common software, like apache, irc server, znc, a mail server etc. I'd like to get an idea of how the system will be setup initially? Am I given ssh access or some other remote access facilities? Is it a pre-configured minimal system? What else should I expect?


title: How to get background color in Emacs?

text: In Emacs no window mode, the background is automatically the same as the terminal (gnome-terminal). When I look at `(frame-parameters)` I see that `(background-color . "unspecified-bg")`. Well, for me, the background happens to be black. Is there a way to find out what the actual background color is for an Emacs session?


title: How do I install libgnomeprint in Debian testing?

text: I installed Debian testing (jessie) and put this in my `/etc/apt/sources.list`:               deb http://http.debian.net/debian testing main contrib non-free     deb-src http://http.debian.net/debian testing main contrib non-free          deb http://security.debian.org/ testing/updates main contrib non-free     deb-src http://security.debian.org/ testing/updates main contrib non-free      I want to install a third-party piece of software that requires `libgnomeprint`, but I can't seem to find it in the repository. I used `apt- cache search libgnomeprint` and `apt-cache search gnome | grep print`, but no luck. I searched the repositories online , but no luck. According to a changelog it was removed from Debian testing (I think), so if I'm interpreting that correctly, it's not available in testing at all? Is there any way to install it? I don't want to just add a repository for another version of Debian, like stable, because I'll get package conflicts that way. Is it dangerous if I just find a deb of v2.2 somewhere and install it? I don't want that to put me in dependency hell, or will it not? If it's relevant, I'm not actually using _gnome_ as my DE; I just need this one package.


title: Create a virtual file that is actually a command

text: Is there any way to create a virtual file, such that reading from the file actually reads from the `stdout` of a command; writing to the file is acually writing to the `stdin` of a command? So far I have kludged this with an `inotifywait` on a file, which calls a command when the file is modified, taking it's input from the file and writing back to it. I don't like that the `inotifywait` has to be constantly restarted though (and I have to ensure that it is always running). I only use this file perhaps twice a week.


title: Arch Linux Encrypt entire drive

text: My Raspberry Pi is set up as a PHP MySQL (Percona) server and I think that I have managed to make it quite resilient against online attacks but it is still very vulnerable against someone just taking out the SD card and reading all my data. I guess I could encrypt the important stuff in MySql but the encryption keys would still be in plain text PHP files and I guess that I could encrypt the PHP and/or MySQL folders but that would all just get complex and there would still be cache and logs etc. to worry about. Someone could probably also see the hashed password and use a rainbow table to crack them. Correct me if I am wrong but as I see it the simplest to manage and most secure solution would be to just encrypt the entire drive (excluding boot and kernel obviously). Now the only problem is that I cannot really figure out how to do that. The best link I could find was this one https://wiki.archlinux.org/index.php/Dm- crypt/Encrypting_an_Entire_System but as far as I can determine this only explains what you should do for a fresh installation but unfortunately I have already installed a lot of packages and have made a lot of configurations which I would like to keep. Could someone please explain to me (or provide a link I guess) in simple terms what exactly I should do to fully encrypt my existing Arch Linux installation. PS. I can understand that for full encryption a key needs to be entered at boot but I could not determine if that requires a physical terminal (screen + keyboard) on the device (which I don't really have but I can get if needed) or if I will be able to do it over the network? EDIT: I have found a sort of tutorial for setting up this on Arch here https://gist.github.com/pezz/5310082. My only problem is that I cannot get the remote unlock to work. I have tried copying my public key into /etc/dropbear/root_key but when I try to ssh in with my private key I am still asked for the password of root and neither the actual password of root nor the password used to unlock the drive gets accepted. As mentioned by the tutorials for Debian in one of the answers here I tried copying the private key generated by Dropbear which in my case I think is /etc/dropbear/dropbear_rsa_host_key to my client but then when I try to ssh in with this key I am asked for a pass phrase for the key, any idea?


title: FreeBSD 10 on VirtualBox not booting into GDM

text: Instead, I get a plain shell prompt log-in. After logging in, I try `gdm start` but get this:               # gdm start     ** (gdm-binary:977): WARNING **: Failed to acquire org.gnome.DisplayManager      ** (gdm-binary:977): WARNING **: Could not acquire name; bailing out     #      I have installed via `pkg install gnome2`, added the root user and a non-root user to the `wheel` group, and set up rc.conf, fstab, and .xinitrc - all as specified in the basic gnome2 instructions for setting up to start via gdm.


title: cc1 not in the PATH

text: I 'm trying to configure kernel via `make menuconfig` [Angstrom distribution] on BeagleBoard-xM, but I get these errors:               make: Warning: File `/usr/src/linux-2.6.32.61/arch/arm/Makefile' has modification time 11647 s in the future     make[1]: Warning: File `scripts/Makefile.host' has modification time 11529 s in the future       HOSTCC  scripts/basic/fixdep     gcc: error trying to exec 'cc1': execvp: No such file or directory     make[1]: *** [scripts/basic/fixdep] Error 1     make: *** [scripts_basic] Error 2      As far I know, this is because cc1 is not in the PATH. I have no Linux experience and I can't figure out what my next steps should be. Any help would really be appreciated.


title: Using /proc/stat for the number of processes running on the system

text: How does one find out the true number of processes that is running on your system. A number of articles mention using `ps` in order to count the number of processes. But recently I looked at `cat /proc/sys`, and it outputted:               cpu  972 0 1894 189609 236 26 490 0 0 0     cpu0 972 0 1894 189609 236 26 490 0 0 0     intr 101595 157 10 0 0 0 0 0 0 3 0 0 0 136 0 0 0 1406 0 0 14936 934 19133 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0     ctxt 244344     btime 1405754990     processes 3912     procs_running 3     procs_blocked 0     softirq 122778 0 48263 439 15599 19037 0 1 0 7405 32034      It shows the number of processes as 3912. Using something like `ps -A --no- headers | wc -l` only shows 173 processes. Why does `/proc/stat` show so many more processes? (an increase of 3739 processes) Who is giving the right number?


title: Unmet dependencies after using a backports repository

text: I have added a backport repository to apt's `sources.list` to get an application:               deb http://ftp.uk.debian.org/debian/ wheezy-backports main      Long story short: I did not manage to install the application properly so I gave up and removed that line from my `sources.list`. But since then apt is a mess. For some reasons, gnome has been partially uninstalled in the process (I played with synaptic and aptitude and apparently made a mistake) but I can't reinstall it:               sudo apt-get install gnome          ....          The following packages have unmet dependencies:     gnome : Depends: gnome-core (= 1:3.4+7+deb7u1) but it is not going to be installed          Depends: nautilus-sendto (>= 3.0) but it is not going to be installed          Depends: gimp (>= 2.8) but it is not going to be installed          Depends: hamster-applet (>= 2.91.3) but it is not going to be installed          Depends: gnome-applets (>= 3.4) but it is not going to be installed          Recommends: browser-plugin-gnash but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      I have tried (in many different orders):               apt-get update     apt-get upgrade     apt-get dist-upgrade     apt-get clean     apt-get -f install gnome     apt-get install -f     dpkg --configure -a      but none of these worked. I have also run `sudo dpkg --get-selections | awk '{if ($2 == "hold") print $0;}'` to find out more about the held packages but it returns nothing. * * * EDIT 1 - additional information               $ sudo apt-get -f install          Reading package lists... Done     Building dependency tree     Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.          $ sudo apt-cache policy gnome-core nautilus-sendto gimp hamster-applet gnome-applets gnome          gnome-core:       Installed: (none)       Candidate: 1:3.4+7+deb7u1       Version table:          1:3.4+7+deb7u1 0             500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages     nautilus-sendto:       Installed: (none)       Candidate: 3.0.3-2+b1       Version table:          3.0.3-2+b1 0             500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages     gimp:       Installed: (none)       Candidate: 2.8.2-2+deb7u1       Version table:          2.8.2-2+deb7u1 0             500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages             500 http://security.debian.org/ wheezy/updates/main amd64 Packages             100 /var/lib/dpkg/status     hamster-applet:       Installed: (none)       Candidate: 2.91.3+git20120514.b9fec3e1-1       Version table:          2.91.3+git20120514.b9fec3e1-1 0             500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages     gnome-applets:       Installed: (none)       Candidate: 3.4.1-3       Version table:          3.4.1-3 0             500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages     gnome:       Installed: (none)       Candidate: 1:3.4+7+deb7u1       Version table:          1:3.4+7+deb7u1 0             500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages      * * * EDIT 2 - dpkg-l               ~$ sudo dpkg -l gnome-core nautilus-sendto gimp hamster-applet gnome-applets gnome     Desired=Unknown/Install/Remove/Purge/Hold     | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend     |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)     ||/ Name                                              Version                       Architecture                  Description     +++-=================================================-=============================-=============================-=======================================================================================================     rc  gimp                                              2.8.2-2+deb7u1                amd64                         The GNU Image Manipulation Program     un  gnome                                             <none>                                                      (no description available)     un  gnome-applets                                     <none>                                                      (no description available)     un  nautilus-sendto                                   <none>                                                      (no description available)     dpkg-query: no packages found matching gnome-core     dpkg-query: no packages found matching hamster-applet      * * * EDIT 3 - `apt-get policy`               $ sudo apt-cache policy     Package files:      100 /var/lib/dpkg/status          release a=now      500 http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg/main amd64 Packages          release o=apt.postgresql.org,a=wheezy-pgdg,n=wheezy-pgdg,l=PostgreSQL for Debian/Ubuntu repository,c=main          origin apt.postgresql.org      500 http://www.deb-multimedia.org/ testing/non-free amd64 Packages          release v=None,o=Unofficial Multimedia Packages,a=testing,n=jessie,l=Unofficial Multimedia Packages,c=non-free          origin www.deb-multimedia.org      500 http://www.deb-multimedia.org/ testing/main amd64 Packages          release v=None,o=Unofficial Multimedia Packages,a=testing,n=jessie,l=Unofficial Multimedia Packages,c=main          origin www.deb-multimedia.org      500 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen amd64 Packages          release v=dist,o=10gen,a=10gen,n=dist,l=10gen,c=10gen          origin downloads-distro.mongodb.org      500 http://security.debian.org/ wheezy/updates/main Translation-en      500 http://security.debian.org/ wheezy/updates/main amd64 Packages          release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=main          origin security.debian.org      500 http://ftp.uk.debian.org/debian/ wheezy/main Translation-en      500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages          release v=7.4,o=Debian,a=stable,n=wheezy,l=Debian,c=main          origin ftp.uk.debian.org     Pinned packages:


title: Setting up HotSpot with two outbound interfaces

text: I want to configure my HotSpot when having 2 outbound interfaces.   * wlan0 - HotSpot interface   * usb0 - outbound interface for wlan0   * eth0 - outbound interface for any other connections. Is it possible to set it up?


Here is the virtualbox-4.3.prerm script. apt-cache policy virtualbox-guest-additions-iso virtualbox virtualbox-4.3. I was trying to install virtualbox-guess-additions-iso, and got the following error:               sudo aptitude install virtualbox-guest-additions-iso          The following NEW packages will be installed:     libgsoap1{a} virtualbox{a} virtualbox-dkms{a} virtualbox-guest-additions-iso       virtualbox-qt{a}      0 packages upgraded, 5 newly installed, 0 to remove and 1 not upgraded.     Need to get 0 B/64.0 MB of archives. After unpacking 121 MB will be used.     The following packages have unmet dependencies:     virtualbox-4.3 : Conflicts: virtualbox but 4.1.12-dfsg-2ubuntu0.5 is to be       installed.                   Conflicts: virtualbox-guest-additions-iso but 4.1.12-1 is to be      installed.     The following actions will resolve these dependencies:        Remove the following packages:     1)     virtualbox-4.3                    Accept this solution? [Y/n/q/?] y     The following NEW packages will be installed:        libgsoap1{a} virtualbox{a} virtualbox-dkms{a} virtualbox-guest-additions-iso           virtualbox-qt{a}      The following packages will be REMOVED:        virtualbox-4.3{a}      0 packages upgraded, 5 newly installed, 1 to remove and 0 not upgraded.     Need to get 0 B/64.0 MB of archives. After unpacking 33.0 MB will be freed.     Do you want to continue? [Y/n/?] y     (Reading database ... 484051 files and directories currently installed.)     Removing virtualbox-4.3 ...     dpkg: error processing virtualbox-4.3 (--remove):       subprocess installed pre-removal script returned error exit status 1     No apport report written because MaxReports is reached already                                                               Errors were encountered        while processing:       virtualbox-4.3     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:


title: Linux software-RAID and bootloader

text: How is it ensured that Linux software-RAID superblock(for example version 1.2) can be created at 4KiB from the beginning of the drive? According to manual of `mdadm` it is. I mean isn't there a hazard that this area on the disk is already occupied for example by the GRUB2 stage 1.5? In addition, if software-RAID is created using partitions for example like this:               mdadm --create --verbose --level=1 --metadata=1.2 --chunk=64 --raid-devices=2 /dev/md0 /dev/sdb1 /dev/sdc1      ..then how should one ensure that for example MBR/GPT is mirrored or bootloader data is mirrored which both are located outside of partitions?


title: Alias in cygwin bash doesn't seem to run in the right order

text: I am trying to create an alias to use in my Cygwin shell to determine if the Mercurial-managed directory I'm currently in has outstanding changes. The command "hg st -m" lists all modified files. Unfortunately it doesn't set an exit value based on whether there are changes or not. So I have tried capturing the output and seeing if it's not empty, piping it through "wc -l" and checking if that's -gt 0, but I seem to have a larger problem in that lines are clearly not executing in the order I would expect them to. Here is what I've boiled it down to:               alias hgfoo='     pwd     echo L1     localChanges="NOT SET YET"     hasLocal="NOT SET YET"     echo "Before: A${localChanges}Z A${hasLocal}Z"     localChanges=`hg st -m`     echo L2     echo "localChanges: A${localChanges}Z"     echo L3     if [ -n "${localChanges}" ] ; then         echo L3         hasLocal="YES"     else         echo L4         hasLocal="NO"     fi     echo L5     echo "RESULTS: A${hasLocal}Z"     echo L6     '      I put in the "Ln" echo statements for debugging. When I run it by typing in "hgfoo" in a directory that has changes, I see the following output:               /d/hg/succession > hgfoo     /d/hg/succession     L1     Before: ANOT SET YETZ ANOT SET YETZ     L2     localChanges: AL2     localChanges: ANOT SET YETZ     L3     L3     L5     RESULTS: AYESZ     L6     M succession-lib\.actionScriptProperties     M succession-lib\src\main\flex\com\workscape\SuccessionConstants.as     M succession-lib\src\main\flex\com\workscape\succession\nomination\tabmodules\BenchStrengthTab.mxml     M succession-lib\src\main\flex\com\workscape\succession\nomination\tabmodules\BenchStrengthTabMediator.as     M succession-lib\src\main\flex\com\workscape\succession\puremvc\controller\StartupSuccession.asZ     L3     L3     L5     RESULTS: AYESZ     L6      When I run it in a directory without changes, I see:               /d/hg/employee-profile > hgfoo     /d/hg/employee-profile     L1     Before: ANOT SET YETZ ANOT SET YETZ     L2     localChanges: AL2     localChanges: ANOT SET YETZ     L3     L3     L5     RESULTS: AYESZ     L6Z     L3     L3     L5     RESULTS: AYESZ     L6      Even forgetting about the fact that the comparison is not working right, in both cases it seems to be running lines multiple times and in the wrong place. This is driving me crazy. Any clues? Thanks.


title: How to cache or otherwise speed up `du` summaries?

text: We have a large file system on which a full `du` (disk usage) summary takes over two minutes. I'd like to find a way to speed up a disk usage summary for arbitrary directories on that file system. For small branches I've noticed that `du` results seem to be cached somehow, as repeat requests are much faster, but on large branches the speed up become negligible. Is there a simple way of speeding up `du`, or more aggressively caching results for branches that haven't been modified since the previous search? Or is there an alternative command that can deliver disk usage summaries faster?


title: backup MSSQL database to a client's local disk over network

text: I'm trying to backup a MSSQL server from linux. I'm able to connect to the server using tsql (from the freetds project), and I'm even able to backup the database on the server using the backup database command, but I haven't been able to download this backup onto the machine I'm using to connect to the MSSQL server. If this was a mySQL server, I could download a backup of the database using mysqldump. Is there something similar I can do for an MSSQL server in linux?


title: OpenSSH hangs after login without showing login prompt

text: I ran across an issue with **ssh** after fresh Ubuntu 13.10 installation on Lenovo T420. I tried `git pull` (which failed) and this led me to more general **ssh** failing. After spending some 2-3 hrs of beautiful Sunday morning I have established:   1. ssh is able to authenticate. see the log below. Also `telnet google.com 80` hangs on connecting.   2. I can connect using `putty` - it shows motd and prompt   3. It doesn't work on both wired and wireless connections, also I tried cellular network.   4. I can successfully login to localhost here be the log:               debug1: Authentication succeeded (keyboard-interactive).     Authenticated to web1.mydevil.net (via proxy).     debug1: channel 0: new [client-session]     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     debug1: Sending environment.     debug1: Sending env LC_PAPER = pl_PL.UTF-8      and then just keeps sending               debug1: client_input_channel_req: channel 0 rtype keepalive@openssh.com reply 1      without showing me the prompt and eventually disconnects. I found out that `telnet google.com 80` hangs on `Connecting <IP-addr>...` as well.


title: How to install memusg tool

text: I've tried with `yum install memusg` but returned:               Loaded plugins: fastestmirror, security     Setting up Install Process     No package memusg available     Error: nothing to do      Any solution


title: How to set environment variables under MATE?

text: I have just installed MATE under Ubuntu Saucy. No problems. Except I am trying to setup Texmaker, the LaTeX IDE, and cannot figure out how to set the paths to the LaTeX tools (`pdflatex`, etc.) which Texmaker spawns. Now I have used Texmaker for several years under Ubuntu Precise with Gnome fallback, and I know to set the path in `~/.gnomerc`. But I cannot find the equivalent of `~/.gnomerc` under Mate. (You would have thought `.materc` but it appears not.) So how do I set environment variables under Mate?


title: Can't Install ImageMagick on Centos using Yum

text: I am trying to install ImageMagick on my dedicated-virtual Centos server for use with PHP.   1. I first ran the following commands successfully:              # yum install gcc php-devel php-pear     # yum install ImageMagick ImageMagick-devel        2. Then, I ran this command:              # pecl install imagick        3. After I ran it, I got this error: > downloading imagick-3.1.2.tgz ... Starting to download imagick-3.1.2.tgz > (94,657 bytes) .....................done: 94,657 bytes 15 source files, > building running: phpize Configuring for: PHP Api Version: 20100412 Zend > Module Api No: 20100525 Zend Extension Api No: 220100525 shtool at > '/var/tmp/imagick/build/shtool' does not exist or is not executable. Make > sure that the file exists and is executable and then rerun this script. > > ERROR: `phpize' failed   4. So, I google'd it and found that I should do this: > If you see this error, it most likely means the server’s /tmp directory does > not allow executables to run. Set a different temporary directory on a > filesystem on which you can execute binaries. For instance: pear config-set > temp_dir /root/tmp > > Then re-run: pecl upgrade-all Ref. https://opdk.info/faqs/error-shown-during-install- shtool-%E2%80%98vartmpimagickbuildshtool%E2%80%99-does-not-exist-or-not- executable   5. So, I created a new directory in my root and changed the PEAR config variable like so:              # mkdir rw ../tmp2     # pear config-set temp_dir ../tmp2      **But, now, after trying to install again I get this error:**               # pecl install imagick     downloading imagick-3.1.2.tgz ...     Starting to download imagick-3.1.2.tgz (94,657 bytes)     .....................done: 94,657 bytes     ERROR: SECURITY ERROR: file config.m4 (installed to ../tmp2/imagick/config.m4) contains      parent directory reference ..      How can I fix this? I just want to install ImageMagick.


title: Why isn't sed using the extended regex mode by default?

text: I am using sed. I was using a regex that was correct as far as I could see but sed did not do anything.   Turns out that I was using `\s+` which sed can not understand (?) and when I switched to `[ ]+` it worked.   So to sum up, I made a regex which for it to work I had to escape almost everything and remove the `\s` for whitespace.   Seems that there is a mode to avoid all these which is `-r`   So I wanted to ask:   1) Why isn't `-r` the default mode for sed? Why did I have to go to so much trouble to escape everything?   2) `man` says that there is the option `\--posix` and that "POSIX.2 BREs should be supported" What does this refer to? NFA/DFA mode?


title: why can't linux see my run.sh command?

text: I have a run.sh in a directory in ubuntu linux 12.04 LTS. I've been changing the Path variable so that it can "see" binaries elsewhere in the directory structure. But I am still getting a command not found even if I specify the full path. I have only basic working knowledge of linux. What is going on? Why can't it see run.sh?               memsql@memsql-virtual-machine:~/voltdb/doc/tutorials/helloworld$ sudo /home/memsql/voltdb/doc/tutorials/helloworld/run.sh     sudo: /home/memsql/voltdb/doc/tutorials/helloworld/run.sh: command not found     memsql@memsql-virtual-machine:~/voltdb/doc/tutorials/helloworld$ ls     Client.class  deployment.xml  Insert.class  log     run.sh        Select.java     Client.java   helloworld.sql  Insert.java   README  Select.class  statement-plans     memsql@memsql-virtual-machine:~/voltdb/doc/tutorials/helloworld$ pwd     /home/memsql/voltdb/doc/tutorials/helloworld


title: How can I parallelise the upload of a directory by FTP?

text: I need to upload a directory with a rather complicated tree (lots of subdirectories, etc.) by FTP. I am unable to compress this directory, since I do not have any access to the destination apart from FTP - e.g. no tar. Since this is over a very long distance (USA => Australia), latency is quite high. Following the advice in How to FTP multiple folders to another server using mput in Unix?, I am currently using `ncftp` to perform the transfer with `mput -r`. Unfortunately, this seems to transfer a single file at a time, wasting a lot of the available bandwidth on communication overhead. Is there any way I can parallelise this process, i.e. upload multiple files from this directory at the same time? Of course, I could manually split it and execute `mput -r` on each chunk, but that's a tedious process. A CLI method is heavily preferred, as the client machine is actually a headless server accessed via SSH.


title: FreeNAS 9.2: install FreeBSD packages

text: I have installed FreeNAS 9.2amd64 (based on the same FreeBSD version) on a VirtualBox VM. I created users and pool/volume for my data. In anticipation of installing apache/mysql-server/php5/php-myadmin FreeBSD packages, I read the following docs from the freenas.org site:   * Installing non-PBI Software   * Jails So I created a pluginjail to install packages within. I understood FreeNAS packages are managed by pkgng, which works almost the same than pkg_add/pkg_info/pkg_delete etc... Then I launched the following command (don't mind the package version) from that jail shell:               $ pkg install mysql-server      And I get the following output:               Updating repository catalogue     pkg: PACKAGESITE/digests.txz: No address record           pkg: No digest falling back on legacy catalog format                                 pkg: PACKAGESITE/repo.txz: No address record      If I go to `PACKAGESITE`, I can find both `digests.txz` and `repo.txz` files. Does anyone have an idea?


title: Guake + Mint 16 (Mate), lack of transparency

text: I had the same problem with Mate and Mint 14. With Cinnamon transparency worked great. What can I do to fix this? It's not the known problem with autostart.


title: root partition getting full with nfs mounted directory

text: I am having one nfs volume, which is mounted on one of the directory of root partition. My problem is when I checked `df -ha` it adds up mounted directory file content as well. Following are my observations, for security reason few names are changed I am at / right now, `df -ha`               Filesystem            Size  Used Avail Use% Mounted on     /dev/xvda1            7.9G  3.5G  4.1G  47% /     /dev/xvdf             9.9G  183M  9.2G   2% /home/abcedf     10.84.29.62:/home/abvdef/pqrstuv                           197G   97G   91G  52% /home/abvdef/pqrstuv      here `abcdef` is again one mounted volume and `pqrstuv` is mount point of nfs you can see right now it is 3.5 gb consumed, when I execute,               root@ip-10-190-133-49:/# du -sh      3.5G    .     root@ip-10-190-133-49:/# du -sh --exclude=home     1.3G    .      When I go to `/home`               root@ip-10-190-133-49:/home# du -sh     2.6G    .     root@ip-10-190-133-49:/home# du -sh --exclude=abcdef     66M     .      when I go to `/home/abcdef`               root@ip-10-190-133-49:/home/abcdef# du -hs     2.5G    .     root@ip-10-190-133-49:/home/abcdef# du -sh --exclude=pqrstuv     32M     .      Based on above 3 observations I am concluding that my mounted nfs also calculating in `df -ha` , I want to check is this normal to happen? or I am calculating in wrong manner. output of `alias`,               alias egrep='egrep --color=auto'     alias fgrep='fgrep --color=auto'     alias grep='grep --color=auto'     alias l='ls -CF'     alias la='ls -A'     alias ll='ls -alF'     alias ls='ls --color=auto'      More details related to this, when I was on / and run `du -shx`               root@ip-10-10-221-187:/# du -shx     4.1G    .      and when I run `df -ha`               root@ip-10-10-221-187:/# df -ha     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1             9.9G  8.2G  1.3G  87% /      Here df says root partition 8.2G occupied, but du calculating only 4.1G, now where the difference 8.2G-4.1G=4.1G is going, it looks like df calculating doubled value, not sure how? and this force me to think is my mounted file system coming into picture in calculation or something else that not coming in my eyes. Finally I get the issue, See two snaps of `top` one is before restart and other is after restart, Before restart when `df -ha` says I am 8.9G full,               top - 04:36:08 up 5 days, 16:07,  3 users,  load average: 2.34, 2.46, 2.18     Tasks: 225 total,   4 running, 220 sleeping,   0 stopped,   1 zombie     Cpu(s): 19.1%us, 46.0%sy,  0.0%ni, 31.5%id,  3.1%wa,  0.0%hi,  0.2%si,  0.0%st     Mem:   7864548k total,  7189196k used,   675352k free,   861072k buffers     Swap:        0k total,        0k used,        0k free,  4221888k cached      After restart when `df -ha` says I am 5.1G full,               top - 04:39:30 up 0 min,  2 users,  load average: 2.18, 0.65, 0.22     Tasks: 223 total,   4 running, 218 sleeping,   0 stopped,   1 zombie     Cpu(s): 13.6%us, 13.4%sy,  0.0%ni, 39.2%id, 33.8%wa,  0.0%hi,  0.0%si,  0.0%st     Mem:   7864548k total,   677452k used,  7187096k free,    15328k buffers     Swap:        0k total,        0k used,        0k free,   150392k cached      Now when I observed cached values then I realize the cached is eating the extra GB that I was not able to find, any suggestion now how can I resolve this ?


title: how can a makefile detect whether a command is available in the local machine?

text: I began to use org-mode for planning out my tasks in GTD-style system. Putting every org files in a directory of a Dropbox folder, I run emacs to edit / manage these files from three different local machines: Cygwin, Mac OS X, and Debian. As I also use MobileOrg to access these org files from my iPad, a `checksums.dat` file must be kept up-to-date when any changes are made. This can be done by running `md5sum *.org > checksums.dat`. The problem is that there are _three_ different commands for `md5sum` command: `md5sum.exe` in Cygwin, `md5` in Mac OS X, and `md5sum` in Debian. The most ideal situation is a makefile, stored in a Dropbox foder, detects which command is available in the current machine and runs that command to do the md5 checksum operation.


title: On deep-created  directories

text: 1. In Windows, there is a certain limit on the number of characters in a path, which restricts how deep a directory can be created. I was wondering what the case is like in Linux?   2. Do you have some suggestions on how to organize directories to achieve the same or close enough benefits (such as good for organization) of deep directory structures, with less potential trouble one may run into?


title: Blue gradient line on top and bottom instead of Ubuntu-USB-Grub-Screen

text: I just bought a E350M1 mainboard with onboard AMD Radeon 6310 Graphics Card. I did (I think I did) the UEFI-Bios trick:               CSM activated       and plugged-in a usb-stick with an Ubuntu 13.10 Desktop i386 (made with lili Live USB Creator). Unfortunately I got a screen like this: ![freeze screen on mini-itx-board](http://i.stack.imgur.com/cJFkY.jpg) I cant see a menu, I am only able to reboot via `Ctrl`+`Alt`+`Del` I have no hd/cd/dvd/br/floppy only usb. Any ideas?


title: iptables advice with upd ports blocking in debian linux

text: please advice: I add next iptables rules:               iptables -I OUTPUT 2 -p udp --dport 53 -j ACCEPT     iptables -I OUTPUT 2 -p udp --dport 1700:1750 -j ACCEPT     iptables -I OUTPUT 3 -p udp -m udp --dport 1812 -j ACCEPT     iptables -I OUTPUT 5 -p udp -m udp --dport 1813 -j ACCEPT     iptables -I OUTPUT 5 -p udp -m udp --dport 5950:6050 -j ACCEPT     iptables -I OUTPUT 5 -p udp -m udp --dport 499:510 -j ACCEPT     iptables -I OUTPUT 5 -p udp -m udp --dport 4490:4550 -j ACCEPT     iptables -I OUTPUT 20 -p udp -j DROP      But, after apply: ipsec, l2tp and openvp udp port 6000 stops working Advice, what is wrong? Here is my udp services:               udp 0 0 0.0.0.0:500 0.0.0.0:* 3115/charon     udp 0 0 0.0.0.0:1701 0.0.0.0:* 2885/xl2tpd     udp 0 0 162.243.256.150:6000 0.0.0.0:* 2818/openvpn     udp 0 0 0.0.0.0:4500 0.0.0.0:* 3115/charon     udp6 0 0 :::500 :::* 3115/charon


title: How to uninstall java from sco openserver 5.0.6?

text: I have installed Java (J2SE 1.3.1_21) by following this tutorial: http://www.anyang-window.com.cn/in-the-sco-openserver-506-installed- on-j2se-13106-development-environment/ Now, I want to uninstall it. How can I do that?


title: What is bash's meta key?

text: I tried to use `xmodmap` to map `META_L` to the `MENU` key but it doesn't seem to be accepted by `bash` as the meta key. So, I am wondering how these components (keyboard, X, xterm, bash) relate to each in regard the the Meta- and Super-Keys. Any explanation would be appreciated. Let me put this another way. The bash man page says, for example, that the function yank-nth-arg is bound to `M-C-y` and it works when I press `Esc- Control-y`. But I find this a bit cumbersome. So how can I make bash accept another key as `Meta` (like the `Menu`) for all its default bindings?


title: Lost password for a user on a Linux Server: How reset it?

text: On a Server an user 16040 has lost his password. I have password for root but don't have password for user 16040. How can I reset his password? With `passwd 16040`, unix ask me current password that I don't have. Is there a command for reset a user's password without current password?               passwd 16040     Changing password for 16040.     Current password for 16040@friesbie.com:


title: Unable to make file system writtable no matter what

text: I have a flash card SanDisk of a camera which I plug in into my computer:               $ lsblk          mmcblk0     179:0    0   3.7G  1 disk      └─mmcblk0p1 179:1    0   3.7G  1 part           $ mount          /dev/mmcblk0p1 on /media/alex/3062-63381 type vfat (ro,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)      I want to remove all the files from .Trash-1000               sudo rm -r /media/alex/3062-63381/.Trash-1000/*     ................................................................................     rm: cannot remove ‘/media/alex/3062-63381/.Trash-1000/info/DSCF2367.JPG.trashinfo’: Read-only file system     ................................................................................      So I did this:               $ sudo umount /dev/mmcblk0p1          $ sudo umount /media/alex/3062-63381          $ sudo mount -t vfat -o rw,remount -force /dev/mmcblk0p1 /media/alex/3062-63381      Then I checked it again:               $ mount          /dev/mmcblk0p1 on /media/alex/3062-63381 type vfat (rw,rce)      But the error persisted:               sudo rm -r /media/alex/3062-63381/.Trash-1000/*     ................................................................................     rm: cannot remove ‘/media/alex/3062-63381/.Trash-1000/info/DSCF2367.JPG.trashinfo’: Read-only file system     ................................................................................      So I can't delete any file from .Trash-1000. But it's very big already so I have to do it. There is a manual locket on the card but it is NOT set to the position "lock".


title: sudo apt-get fails

text: I am running linux mint but I broke apt (deleted a lock file and ...) When I try `sudo apt-get update` or `sudo apt-get -V update` nothing happens, it just returns the command prompt. The same thing with most other `apt-get` commands. What can I do? Synaptic package manager does not open either. `/etc/apt/sources.list` is empty.


title: UBS-Stick with Arch is no longer bootable after Win8 has been booted

text: CS student but Linux newbie here. I bought an Acer Aspire S7 and wanted to try an Arch Installation on an USB- Stick. I followed the Beginner's Guide. I also set up disk encryption using dm-crypt+LUKS es described here. After everything was done, I rebooted and it worked just fine. However, I then booted Win8 and when I tried booting Arch again, it failed. The USB-key was no longer recognized as bootable. By reinstalling Grub, I can make the USB-key bootable again, but it only works as long as I don't boot Win8. Obviously, when booting Windows, the USB-key is not connected, so its data cannot be modified by the Windows boot process. It seems, installing Grub not only writes to the USB-Key but also configures something on the notebooks hdd. Something that is undone by booting Windows. I have searched for this problem, but nothing came up. So I hope I can find some ideas here. Thanks! Edit: I installed Arch from another live-usb-stick (which I can boot reliably) and followed parts 1 and 2 of the Beginners guide. Utill just before "post- intallation". When I reinstall grub I open the encrypted partition, mount root and /boot, arch-chroot into /mnt and reinstall via               grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck      I then exit, umount, close the encrypted partition and reboot. Then, booting from this stick works as long as Win8 is not booted.


title: What makes Pulseaudio send network data when no stream?

text: I have a pulseaudio over network installation that works well. However as soon as Pulseaudio connects to a local network sink, it starts sending data, even if no streams are active. The data curve is exactly the same when one stream is active, it's like a phantom stream. Pulseaudio 4 and all RTP modules disabled on both machine. What could create such behavior ? I know it is possible to prevent it since I've done it in one of my numerous configuration attempts, but can't reproduce it.


title: Installing Debian without a DE

text: I'd like to replace Fedora with Debian testing on a laptop... However, I would like to not install any desktop environment along with Debian, and simply install Openbox once the base is there. I've had problems with DE dependencies and others, so I would simply like to avoid them all together and go with a "pure", WM-only system. However, I have some concerns... When I `apt-get install` Openbox - will it install X11 along with it? Will I even be able to log in without editing various X config files, installing DMs, etc? That is, will it all be configured just as if I had Xfce/Gnome installed? If not, how could I make it so? Also, how would one go about starting Openbox straight from the text-based login console? Is that a viable alternative to various login/desktop managers out there? Another thing I'm afraid of is not having various background daemons and utilities running by default. Specifically, I am looking for keyrings, desktop notifications daemons, background power managers that might be useful for laptops and so on. Which software should I install after Openbox?


title: When should I create a new volume group instead of a new logical volume?

text: I currently have 3x1TB physical volumes in a VG and a LV that spans the entire capacity of the VG. This LV is meant to store specific files. Now I have another 2TB drive that I want to use LVM with. This will end up being part of an LV (again, using max capacity) that will be used to store different kinds of files. Should I create a new VG for the 2TB drive and another LV from that new VG? I plan on adding other 2TB drives to the mix later on, does that change the setup I should have? What are the best practises when it comes to LVM and VGs/LVs?


title: Can I ignore failed package installation statuses?

text: I've upgraded a package with `apt-get upgrade` on debian 6. The upgrade failed, but I understand why (one of the init scripts had been customised, and the upgrade script was attempting to use the old one when restarting the service). If I run `dpkg -l` the package is showing is status as `iF` (failed). Can I ignore this failed status if I believe the rest of the installation went OK, or are there other side effects to the package status?


title: Cannot see an EC2 VPN server from another EC2 instance

text: I'm using openVPN to connect to one EC2 instance from another. The client cannot see the server, however, despite that servers outside of AWS can see the server and successfully negotiate with it. It fails with "Cannot resolve host address": log output here. Config here I speculate that this is because UDP isn't configured properly. I've already opened the ODP ports on that instance via the AWS SecurityGroups - this didn't work, both for all incoming UDP, and/or for UDP from the server IP. Does anyone know what might be misconfigured in AWS to prevent this?


title: Proper way to mount samba share

text: I would like to mount a CIFS network filesystem with samba on my Arch Linux system. I would like to mount this filesystem whenever I log in (either through ssh, a TTY, or through KDM). I can get pretty close to what I want by adding the network share to `/etc/fstab`. The biggest "problem" is that this requires either hard coding my password into `/etc/fstab` or creating a credentials file with my username and password. It seems unsafe to me to keep my username and password in a plain text file even if I set the permissions to 600. Is there a "proper" way to securely automount a network share? Can I do this with PAM (my username and password are the same on both machines) and if so how?


title: Is it possible to filter duplicate lines from syslog?

text: On my mom's computer, she's getting here syslog/kern.log filled with lines from a Lexmark driver:               Sep 22 21:01:20 pamela-desktop kernel: [48657.676578] usb 1-3: usbfs: process 1490 (demond_nscan) did not claim interface 3 before use     Sep 22 21:01:20 pamela-desktop kernel: [48657.676585] usb 1-3: usbfs: process 1490 (demond_nscan) did not claim interface 3 before use     Sep 22 21:01:20 pamela-desktop kernel: [48657.676592] usb 1-3: usbfs: process 1490 (demond_nscan) did not claim interface 3 before use      Now multiply those by whatever number you need to get 161 GB. Is there anything I can do, besides write a script to filter duplicate lines out of sys/kern.log and run that as a cron job?


title: How can I split a pipe into 16 byte sequences?

text: I'm writing a bash script to automate the decryption of a certain file; however the file is encrypted in 16 byte blocks, rather than simply encoded in its entirety. Here's some psuedo code to briefly explain why I'm trying to do:               cat encrypted.bin | \     buffer and output 16 bytes when asked | \     openssl --args >> decrypted.bin      I essentially need the pipe to open and close in order to split up the data, and am unsure of how this could be done in bash. I've looked at `split`, but since the encrypted file could be several GBs, I don't want to perform that many disk writes. I should also point out that I'd like to know if there's a way to do this without looping through multiple pipes.


title: Capturing area of the screen without a Desktop Environment?

text: I'm running OpenSuse with dwm as a window manager. Since I made the switch from KDE, I haven't found a way to take a screenshot or even capture part of my screen. Is there a way I can do this in a command-line environment?


title: UDP NAT Punching

text: I have the following two problems. Please help me to solve them:   1. In symmetric NAT, as I know, the local hidden node (behind the NAT) must initiate connection in order to create a window in the NAT to allow the packets of the remote host back into the local network. Can somebody give me some idea how i can do this?   2. How can an application learn that there are NATs in the path between the source and the destination?


title: Non-printable-ASCII characters in sshd banner

text: It's possible to configure a banner for `sshd` that is to be displayed _as a connection is opened_ , via `Banner /etc/motd.ssh` in `sshd_config`. Note that this is displayed _before_ the authentication occurs, and even when an interactive shell is not launched (e.g. via `scp`). If this banner contains characters outside of the printable ASCII range, they seem to be escaped, however. Is there any way to either disable this escaping, or an alternative way to send textual output back to the client on connection which supports such characters outside of the printable-ASCII range? This would be useful both for colour escape sequences and Unicode characters.   * Related: Colorful ssh banner (not a duplicate, however, as this question is about another kind of banner)


title: What is abrt and the process abrt-action-generate-core-backtrace?

text: I recently noticed a process I hadn't seen before called `abrt-action- generate-core-backtrace` that was churning on my laptop. I waited a bit and it never seemed to stop so I killed it. ### Questions   * Did I just shoot myself in the foot somehow down the road?   * What was this process doing?   * Is there a way to spy on what this application is up to?


title: redhat oauth.so missing

text: I tried to put the oauth on my redhat server, but since I got this message :               PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/oauth.so' - /usr/lib/php/modules/oauth.so: cannot open shared object file: No such file or directory in Unknown on line 0      Do someone know how to put that file on redhat ? I'm not a Linux expert. Thank you


title: (CentOS-6.5) How to implement GNOME environment privilege escalation like GKSUDO?

text: How would I implement a `GKSUDO` -like privilege escalation control on CentOS 6.5 workstations? (standard GNOME config, x86_64 and i386) I do not want to share the root password with users, and some of the applications & commands they use do not work properly -- or at all -- when launching them from a Terminal with `$ sudo <application> <flags>`. Essentially, I would like to have CentOS 6.5 require authentication for privilege escalation operate pretty much **_exactly_** like Ubuntu/Unity has for some time now.


title: Two HDD installation

text: Is there any easy tutorial or guide how can I setup Debian (amd64 v. 7 + xface) on my server, but using this separation ? **Separation:**   * SSD (32GB) for system   * Normal HDD (1TB) for data like /var ...


title: How to recover Windows Boot Manager after a Mint installation gone wrong

text: Yesterday, my cousin wanted me to install Linux Mint onto his Windows 8 Lenovo laptop so he could dual-boot Linux Mint and Windows 8 so he could get some hands-on experience with Windows 8. I've only ever installed Linux for dual-booting on Windows XP, and I was originally not aware of all the UEFI details for installing Linux on a Windows 8 machine. So, I created the Linux Mint USB stick and put it onto my 4GB flash drive, which I then plugged into the computer. I booted into the BIOS of the computer and changed the USB stick to be the default boot option. I successfully booted from the Mint USB stick, and I opened up Gparted on the USB drive to edit the partitions. The partitions are as follows:   * /dev/sda1 (1000MB partition labeled WINRE_DRV)   * /dev/sda2 (260MB partition labeled WINDOWS_DRV, also currently iBt is mounted at /boot/efi)   * /dev/sda3 (1000M partition labeled LRS_ESP)   * /dev/sda4 (128MB partition with an unknown file system)   * /dev/sda5 (405GB partition labeled Windows8_OS)   * /dev/sda6 (25GB partition labeled LENOVO)   * /dev/sda7(12.5GB partition labeled PBR_DRV)   * **New** : /dev/sda8 (16GB ext4 partition that was trimmed off of /dev/sda5)   * **New** : /dev/sda9 (4GB linux-swpa partition trimmed off of /dev/sda5) So, I then created those last two partitions intended for Mint. I then proceeded with the default installer for Mint Linux. When reaching the partitioning stage, it didn't recognize that any other operating systems were on the system, which I thought was odd. I realize now I think this was because of UEFI with Secure Boot still being enabled. Anyways, I set up a custom partitioning, with /dev/sda8 being the intended partition for Mint. However, I didn't realize it at the time, but I installed GRUB on /dev/sda8 instead of the Master Boot Record, so GRUB was never the default chooser on startup. After finishing the installation, we then installed EasyBCD to make Linux Mint bootable, since I didn't realize I just screwed up in choosing where to install GRUB. We added a custom record for the Mint partition, and this is where things began to go horribly wrong. We rebooted the computer and were greeted by the Windows Boot Manager with two options: Linux Mint and Mint Linux. Both options resulted in the general "Windows is corrupt, insert install media to repair computer, blah blah". We realized then that something was horribly wrong. I inserted the Linux Mint USB again and forced the computer to boot from the USB, and once I was back in, I realized that I had messed up completely on the installation. I reinstalled Mint over the old /dev/sda8 and this time installed GRUB on the MDR. So, now I was at least able to boot the computer into Linux Mint. So, now the problem we're facing is that we are unable to reboot into Windows. In GRUB, I have the option to boot Mint or the Windows Boot Manager, and the Boot Manager just repeats the same issue that we were having before. We have tried installing Windows XP onto a flash drive to try to remotely change EasyBCD settings; however, the program needed to make a XP flash drive, Rufus, does not work on anything but Windows... we don't have any Windows computers available. Is there any way to remotely repair the Windows Boot Manager to safely recover and reboot into Windows 8? The ultimate goal is to prevent any data loss and to successfully boot back into Windows. Any help is appreciated!


title: What is the difference between 'rm' and 'unlink'?

text: Assuming you know the target is a symbolic link and not a file, is there any difference between using `rm` and `unlink` to remove the link?


title: openbox window positioning

text: Can one somehow instruct `openbox` about the desired location to open new windows? For example, I have two screens (LVDI, VGA) and would prefer that new windows be opened on VGA, whereas they are always opened on VLDI instead (perhaps because LVDI is listed first among monitors known to `X`). As another example, I would like to make `openbox` aware of the position of the `conky` desktop window so that new windows do not obscure it.


title: How does the authentication process with the salted hash in shadow work

text: Does the supplied password during login get converted to a salted hash and then compared to the one in /etc/shadow? /what if the user is in LDAP but not in the shadow file? Would it use kerberos?


title: Changing fonts for the Smuxi application

text: I was checking out the graphical IRC client smuxi, which I had never heard of before. This application appears to be a GNOME application. Anyway, how do I change the default font on this app? The default font is quite tiny, and I would like to make it larger. I'd prefer to make just the font on this app to be enlarged, and not all gnome applications (asuming that is an option). I'm running a wheezy-backports version of smuxi (0.11~rc5-1~bpo70+1) on Debian wheezy.


title: removing kernel modules not working for some modules

text: unfortunately i couldnt install a machine with minimal installation as a virtual machine ,so i am trying to prevent loading of unwanted modules from kernel using blacklist file. Added following to blacklist.conf //forbluetooth               blacklist rfkill     blacklist bluetooth     blacklist bnep     blacklist be2iscsi     blacklist iscsi_boot_sysfs     blacklist iscsi_tcp     blacklist libiscsi_tcp     blacklist libiscsi     blacklist scsi_transport_iscsi     blacklist bnx2i     blacklist cnic     blacklist uio     blacklist cxgb4i     blacklist cxgb4     blacklist cxgb3i     blacklist cxgb3     blacklist mdio     blacklist libcxgbi     blacklist ib_iser     blacklist rdma_cm     blacklist ib_addr     blacklist iw_cm     blacklist ib_cm     blacklist ib_sa     blacklist ib_mad     blacklist ib_core     blacklist coretemp     blacklist sunrpc     blacklist ghash_clmulni_intel     blacklist crc32c_intel     blacklist uinpu      but after restart,its still showing most of the modules,how can i remove remaining modules.               lsmod     Module                  Size  Used by     ebtable_nat            12808  0      ipt_MASQUERADE         12881  1      nf_conntrack_netbios_ns    12666  0      nf_conntrack_broadcast    12528  1 nf_conntrack_netbios_ns     ip6table_mangle        12701  1      ip6t_REJECT            12940  2      nf_conntrack_ipv6      14531  23      nf_defrag_ipv6         18178  1 nf_conntrack_ipv6     iptable_nat            13384  1      nf_nat                 25415  2 ipt_MASQUERADE,iptable_nat     be2iscsi               81848  0      iscsi_boot_sysfs       15642  1 be2iscsi     bnx2i                  54715  0      cnic                   62654  1 bnx2i     uio                    19045  1 cnic     cxgb4i                 32880  0      cxgb4                 108493  1 cxgb4i     cxgb3i                 32951  0      cxgb3                 155602  1 cxgb3i     mdio                   13436  1 cxgb3     libcxgbi               56493  2 cxgb3i,cxgb4i     ib_iser                37813  0      rdma_cm                42167  1 ib_iser     ib_addr                13786  1 rdma_cm     iw_cm                  18222  1 rdma_cm     ib_cm                  41726  1 rdma_cm     ib_sa                  32956  2 rdma_cm,ib_cm     ib_mad                 46341  2 ib_cm,ib_sa     iptable_mangle         12696  1      ib_core                73895  6 rdma_cm,ib_cm,ib_sa,iw_cm,ib_mad,ib_iser     iscsi_tcp              18334  0      libiscsi_tcp           24177  4 cxgb3i,cxgb4i,iscsi_tcp,libcxgbi     libiscsi               50543  8          libiscsi_tcp,bnx2i,cxgb3i,cxgb4i,be2iscsi,iscsi_tcp,ib_iser,libcxgbi          scsi_transport_iscsi    57491  8 bnx2i,be2iscsi,iscsi_tcp,ib_iser,libcxgbi,libiscsi          nf_conntrack_ipv4      14970  22 nf_nat,iptable_nat     nf_defrag_ipv4         12674  1 nf_conntrack_ipv4     xt_conntrack           12761  42      nf_conntrack           84046  8      nf_conntrack_netbios_ns,ipt_MASQUERADE,nf_nat,xt_conntrack,nf_conntrack_broadcast,iptable_nat,nf_conntrack_ipv4,nf_conntrack_ipv6          ebtable_filter         12828  0      ebtables               30758  2 ebtable_nat,ebtable_filter     ip6table_filter        12816  1      ip6_tables             26943  2 ip6table_filter,ip6table_mangle     microcode              23447  0      uinput                 17674  0      xen_netfront           26504  0      crc32c_intel           12902  0      xen_blkfront           22529  2      ghash_clmulni_intel    13221  0       sunrpc                255587  1


title: How can I install the Atheros AR8161 drivers without an internet connection?

text: How can I install the Atheros AR8161 drivers without an internet connection for fedora19?


title: How to make bash abort the execution of a script on syntax error?

text: To be on safe side, I'd like bash abort the execution of a script if it encounters a syntax error. To my surprise, I can't achieve this. (`set -e` is not enough.) Example:               #!/bin/bash          # Do exit on any error:     set -e          readonly a=(1 2)          # A syntax error is here:          if (( "${a[#]}" == 2 )); then         echo ok     else         echo not ok     fi          echo status $?          echo 'Bad: has not aborted execution on syntax error!'      Result (bash-3.2.39 or bash-3.2.51):               $ ./sh-on-syntax-err     ./sh-on-syntax-err: line 10: #: syntax error: operand expected (error token is "#")     status 1     Bad: has not aborted execution on syntax error!     $       Well, we can't check `$?` after every statement to catch syntax errors. (I expected such safe behavior from a sensible programming language... perhaps this must be reported as a bug/wish to bash developers) ## More experiments ### `if` makes no difference. Removing `if`:               #!/bin/bash          set -e # exit on any error     readonly a=(1 2)     # A syntax error is here:     (( "${a[#]}" == 2 ))     echo status $?     echo 'Bad: has not aborted execution on syntax error!'      Result:               $ ./sh-on-syntax-err      ./sh-on-syntax-err: line 6: #: syntax error: operand expected (error token is "#")     status 1     Bad: has not aborted execution on syntax error!     $       Perhaps, it's related to exercise 2 from http://mywiki.wooledge.org/BashFAQ/105 and has something to do with `(( ))`. But I find it still unreasonable to continue executing afte a syntax error. ### No, `(( ))` makes no difference! It behaves bad even without the arithmetic test! Just a simple, basic script:               #!/bin/bash          set -e # exit on any error     readonly a=(1 2)     # A syntax error is here:     echo "${a[#]}"     echo status $?     echo 'Bad: has not aborted execution on syntax error!'      Result:               $ ./sh-on-syntax-err      ./sh-on-syntax-err: line 6: #: syntax error: operand expected (error token is "#")     status 1     Bad: has not aborted execution on syntax error!     $


title: How to setup keyboard shortcut that enters predefined text into X11 xterminal via SSH from mac OS?

text: I do a lot of remote programming on my CentOS linux server by opening an X11 xterminal window on my Mac OS, and SSH into the server. I'm looking for an easy to use method to enter a predefined text string when hitting a customized hotkey. For example, instead of manually typing:               # cd /home/users/jim/jcode/algorithms/applications      I'd like to type something like command-A, or enter a custom key sequence like ";app" at the command line and have it be replaced with the text above. I tried various programs like TextExpander (http://smilesoftware.com/textexpander/faq.html), on my mac, but they don't support X11 xterminals. Anyone know of a good way to achieve this?


title: SSH key based login bypasses password policies

text: I noticed that logins via an SSH key bypass the LDAP password policies (password ageing, password warning, and password lockout due to failed attempts, etc). Is there any way to force key-based ssh logins to respect the password policies? My clients are old (RHEL 4), so installing sssd is not an option.


title: Matlab R2010a over ssh -X displays empty windows

text: I'm trying to use Matlab R2010a over ssh, with X forwarding. Now the X forwarding certainly works (for example xclock displays nice and fast) But when invoking matlab, I get the splash screen ok, and when the desktop loads, I just get an empty window (only the start button is displayed). The window apears somewhat functional: Clicking in the area where the menu is supposed to be does open the menu. Now the question is: how to fix this? I'm using the grml 2010.12 live cd (which is based on debian unstable), with xorg 1:7.5+8 and the nouveau X driver. Any suggestions are welcome.


title: Can't mount Samba share on Rasbian, works flawlessly on Debian

text: I have a samba share that I use in my home, this works fine on both Windows and Debian, but when trying to mount it on my Raspberry Pi I just get an error. `/etc/fstab`:               //media.lan/public /media/media.lan cifs guest, uid=1000 0 0      `dmesg`:               [ 1497. 700485] CIFS VFS: Send error in SessSetup = -13     [ 1497. 703604] CIFS VFS: cifs_mount failed w/return code = -13                    root@webcam:/home/pi# mount -a     mount error (13): Permission denied     Refer to the mount.cifs (8) manual page (e.g. man mount.cifs)     root@webcam:/home/pi#


title: How to freeze current task order?

text: I believe I have read some time ago how you can make `top` stop sorting the tasks so that they stay in the same line (easier to read) but still get updates for their values (in contrast to simply stopping the screen refresh by pressing e.g. `k` or `r`). Now I tried to find this info in both the online help and the man page but couldn't find anything like that. Of course, it's possible that I have just dreamt reading something like this.


title: How to Use Domainkeys and DKIM both with exim on freebsd server machine

text: I have setup exim mta on freebsd. I have also setup DKIM on this machine and my mails are properly signed. I want to know how to setup **Domainkeys** along with DKIM on exim so that my mails are signedf both by Domainkeys as well DKIM. This is because gmail honors DKIM as well yahoo honors Domainkeys.


title: How to install Ubuntu on a system where is already Mint and Windows 7?

text: I have already installed Linux Mint on Windows 7 so now I have dual boot with Linux Mint and Windows 7. They are both on diferent partitions. I have 1 free partition left. The question is how to install Ubuntu? Should I just run it from CD and install it on the free partition? Would I be able to run then all 3 systems (Ubuntu, Mint, Windows) from the menu when starting a computer or not? How to do that?


title: How to subtract rows (lines) with AWK

text: I'm trying to figure out how I can use AWK to subtract lines. For example, imagine the input file is:               30     20      The output would be:               10      Now, as a test I am trying to calculate the "Used" memory column from:               $ cat /proc/meminfo      So at the moment I have written this:               $ grep -P 'MemTotal|MemFree' /proc/meminfo | \         -- Here comes the calculation using AWK      I have tried the following:               $ grep -P 'MemTotal|MemFree' /proc/meminfo | \         awk '{print $2}' | awk '{$0-s}{s=$0} END {print s}'       But this just gives me the last row of data. I've found a working solution, but I doubt it's the most optimal one. All my coding experience tells me that hard coding the amount of rows is terrible :P               $ grep -P 'MemTotal|MemFree' /proc/meminfo | \         awk '{print $2}' | awk 'NR == 1{s=$0} NR == 2 {s=s-$0} END {print s}'


title: Matching Five Columns in two Files using Awk

text: I have two Input files. **File1:**               s2/80   20      .       A       T       86      F=5;U=4     s2/20   10      .       G       T       90      F=5;U=4     s2/90   60      .       C       G       30      F=5;U=4      **File2:**               s2/90   60      .       G       G       97      F=5;U=4     s2/80   20      .       A       A       20      F=5;U=4     s2/15   11      .       A       A       22      F=5;U=4     s2/90   21      .       C       C       82      F=5;U=4     s2/20   10      .       G       .       99      F=5;U=4     s2/80   10      .       T       G       11      F=5;U=4     s2/90   60      .       G       T       55      F=5;U=4      **Expected Output:**               s2/80  20 . A   T   86  F=5;U=4  s2/80  20  . A   A   20     F=5;U=4     s2/20  10 . G   T   90  F=5;U=4  s2/20  10  . G   .   99     F=5;U=4      **Logic:** I want all the lines from File1 and File2 concatenated in the Output file: **_Conditions:_** If Column 1, 2, 4 of File1 and File2 exactly match and if Column 5 of File2 has a dot ie "." or if it match exactly with Column 4 of file2. **Code:** I tried using the script:               BEGIN{}     FNR==NR{     k=$1" "$2     a[k]=$4" "$5     b[k]=$0     c[k]=$4     d[k]=$5     next     }          { k=$1" "$2     lc=c[k]     ld=d[k]     # file1 file2     if ((k in a) && ($4==$5) && (lc==$4)) print b[k]" "$0     }      But I get an Output of:               s2/80  20 . A   T   86  F=5;U=4  s2/80  20  . A   A   20     F=5;U=4      Whereas My output should be:               s2/80  20 . A   T   86  F=5;U=4  s2/80  20  . A   A   20     F=5;U=4     s2/20  10 . G   T   90  F=5;U=4  s2/20  10  . G   .   99     F=5;U=4      I would appreciate your help. Thanks.


title: Strange issue with curl/lynx and non resolving domains

text: I have a weird issue on my server in that if I use curl or lynx to try and access a URL that doesn't exist (say a non registered domain, or a domain that's not in DNS), I don't get an error, it instead delivers me to the default locally hosted website. For example: "lynx http://jksodf89s9df9sudfisdf.com" or "curl http://jksodf89s9df9sudfisdf.com" Both of these should clearly return an error (404, "Can't resolve", or something similar I'm guessing) as they don't exist - but instead I get the Apache holding page that is currently set as my default website for Apache on the server. I can only assume it's a DNS or Apache config issue, but I just can't see what would allow non existant domains to be redirected to localhost.


title: How to remove n number of lines from a file using sed command?

text: I want to remove a particular number of lines after the given pattern is matched. Can anyone please tell me how that can be done using the `sed` command ?


title: How to install my application

text: I just created a simple application which creates a file on my desktop and writes "HAHA" in it. I made it in C++ and used g++ to get a binary. It works but it's not really "installed" on linux mint. So I wondered how do I do that? How can I tell linux mint to show this in my menu where all my installed applications are listed? I heard something about moving it into /usr/bin with a bash script. I moved the application to /usr/bin with terminal but there were no changes (the app is in the directory but it's not displayed in my menu). Or do I have to restart linux mint? Maybe you could send me a link to a good tutorial. I need some help...


title: Intruder nature detection by opensource tools like tripwire

text: I want to use different kind of intrusion detection tools like OpenSource Tripwire. Please suggest me some tools which can provide me some additional information to that provided by tripwire? Secondly, how can I get IP addresses of all the clients of my server? Thirdly, Can I merge logs created by all such tools?


title: Mesa EGL not working, not even initializing

text: Nearly a week now, and I can't figure out what's wrong! Any pointers would be appreciated (pun intended)! Ubuntu 12.04 x86_64   Mesa-8.0.4 > ./configure --enable-64-bit --enable-pic -enable-opengl --enable-gles2 > --enable-xorg --enable-egl --enable-glu --with-x (Also tried with the apt-get package of Mesa)               ls /usr/local/lib | grep EGL       libEGL.so@       libEGL.so.1@       libEGL.so.1.0*        When running the simple tutorial code               display = eglGetDisplay(EGL_DEFAULT_DISPLAY);       EGLBoolean err = eglInitialize(display, NULL, NULL);      initialize fails and further functions return `EGL_NOT_INITIALIZED`.


title: scp to an alias

text: To transfer a folder from my local host to a remote host, I normally do:               $ scp -r myFolder user@host:destFolder/      Trying to make this easier, I aliased the remote host destination:               $ alias remoteHost user@host:destFolder/      However, scping to the alias doesn't work:               $ scp -r myFolder `remoteHost`     bash: user@host:destFolder/: No such file or directory     usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]                [-l limit] [-o ssh_option] [-P port] [-S program]                [[user@]host1:]file1 ... [[user@]host2:]file2


title: open corel draw files on debian

text: So I have `.cdr` files on my PC and I want to open them on my Debian 7 box. What software do I need to be able to open it?` I have:   * 512 MB RAM   * 3 GHz processor   * 256 MB graphics   * with Debian 7


title: How can I make this daemon/init run as a non root user?

text: I have an init script to kick off a daemon. The problem is it runs as root. I would like it to run as a user called "deploy". Ubuntu 12.04               #! /bin/sh          # File: /etc/init.d/unicorn          ### BEGIN INIT INFO     # Provides:          unicorn     # Required-Start:    $local_fs $remote_fs $network $syslog     # Required-Stop:     $local_fs $remote_fs $network $syslog     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: starts the unicorn web server     # Description:       starts unicorn     ### END INIT INFO          DAEMON=/usr/local/bin/unicorn_rails     DAEMON_OPTS="-c /var/www/current/config/unicorn.rb -D"     NAME=unicorn     DESC="Unicorn"     PID=/var/www/current/shared/pid/unicorn.pid          case "$1" in       start)         echo -n "Starting $DESC: "         $DAEMON $DAEMON_OPTS         echo "$NAME."         ;;       *)         echo "Usage: $NAME {start|stop|restart|reload}" >&2         exit 1         ;;     esac          exit 0


title: Centos 6.3 can't resolve hostname of network drive while others can

text: I have a network drive (external network) being used as media storage for a media server running on my router. I'm trying to switch the media server to my Centos 6.3 machine so I can take advantage of `ffmpeg` and more (unrelated).. All I'm wondering here is why my Centos server can't resolve the host name for the drive while my laptop running Ubuntu can on the same network. Ubuntu can ping it by host name and receive a response. Though I know Ubuntu has a GUI and I can click on "network" in the file system and find it there `smb://ballzdeep` it says is the location of the drive. Centos is sans GUI. I can't figure out why it doesn't find it and have been searching for a way to discover network hosts but no luck.


title: cat file to multicast

text: I have a text file (`test.txt`) which represents captured network data. The actual protocol is text-based, with NULL line endings, so this isn't a problem. I need to run this test captured data through my server, over a multicast port. The TTL can be zero -- I'll run both side of this on the same box. Is there a way to essentially `cat` a file to a multicast port? I already have tools that I use to do this with pcap files and other formats, but I'd prefer to use something quick and builtin rather than crack open that code to make it read text files. This will be run on an RHEL6.2 server. Command-line, ssh session.