title: Using $? in an if statement

text: function foo {        (cd $FOOBAR;        <some command>        if [$? -ne 0]        then           echo "Nope!"        else           echo "OK!"        fi        )     }      I am trying to write a function like the one above and place it in my .bashrc file. After I source the file and run, I get: > Total time: 51 seconds   >  -bash: [1: command not found   >  OK! Can someone help me understand what I did wrong?


title: Setup ntp client with embedded device

text: I need to run an NTP client on a very limited embedded device. `ntpd` is available but I do not see anything like `rc.conf`, or `ntp.conf`, or `xntp.conf`? Can someone advise on how to setup NTP? I ran `ntpd`, but the date and time haven't updated.


title: Can't access GPIOs when switching to systemd, but why?

text: I'm using this ARM AT91 Sam9x5ek Embedded Device, with my Linux Images made by a Buildroot. Usually my `init-system` is `Busybox`, now I changed it to `systemd`. Since then I can't access the GPIO anymore, or at least I can't change the value: This is the working script I use for changing a pin with the Busybox init system:               #! /bin/sh     echo 104 > /sys/class/gpio/export     echo out > /sys/class/gpio/gpio104/direction     echo 1 > /sys/class/gpio/gpio104/value      Now my embedded device _with systemd_ , runs everything but the last line (setting the actual value). I'm logged in as root, so permission right should actually not be the problem. This is my service file:               [Unit]     Description=USER: Camilo - GPIO          [Service]     Type=idle     ExecStart=/home/exec_camilo     ExecStop=/home/setDownGPIO          [Install]     WantedBy=multi-user.target      Does anybody know why this happens? And has somebody an idea how to fix it ? Kind Regards


title: Set permissions not to change permissions

text: Consider an example `File1.txt`, t3dev and ttuser own this file actually but When I use my id(user1) and edit this file, the file user and group are changed to my id(user1). I want to set the permissions where t3dev/ttuser will always be the user but user1 should be able to change/edit the files without changing the permissions... How can I do this?


title: Problem accessing /home from different partition

text: I'm currently using Chakra on /sda1 and Fuduntu on /sda2 (a partition I keep for trying out and playing around with distros), and both systems use /sda3 for each different /home partition (I'll call them 'Chakrahome' and 'Fuduntuhome'). Usually I never had problems accessing either /home folder (on /sda2 I've had Elementary, Ubuntu, Debian, Mint, Antix, Crunchbang and others), so I would just keep my files in 'Chakrahome' folder, linking them to the other system. Since installing Fuduntu though I am denied permission when trying to access Chakrahome, thus making all my files unavailable. I'm not sure whether it's an issue with Fuduntu or not, but I've never messed with permissions so I would like some input on how to solve this empasse. Thank you very much!


title: How do I monitor opened files of a process in realtime?

text: I know I can view the open files of a process using `lsof` _at that moment in time_ on my Linux machine. However, a process can open, alter and close a file so quickly that I won't be able to see it when monitoring it using standard shell scripting (e.g. `watch`) as explained in "monitor open process files on linux (real-time)". So, I think I'm looking for a simple way of auditing a process and see what it has done over the time passed. It would be great if it's also possible to see what network connections it (tried to) make and to have the audit start before the process got time to run without the audit being started. Ideally, I would like to do this:               sh $ audit-lsof /path/to/executable     4530.848254 OPEN  read  /etc/myconfig     4530.848260 OPEN  write /var/log/mylog.log     4540.345986 OPEN  read  /home/gert/.ssh/id_rsa          <-- suspicious     4540.650345 OPEN  socket TCP ::1:34895 -> 1.2.3.4:80    |     [...]     4541.023485 CLOSE       /home/gert/.ssh/id_rsa          <-- would have missed     4541.023485 CLOSE socket TCP ::1:34895 -> 1.2.3.4:80    |   this when polling      Would this be possible using `strace` and some flags to not see every system call?


title: Alert when running process finishes

text: There are a few questions and answers on here with regard to being alerted when a process completes/exits(1, 2) – but these all assume that the user has issued said process themselves, and thus can script it with an alert built into the governing script, or pipe the process to some kind of alert. My situation is that I would like to be alerted of the completion/exit of a process that my user is not initializing. Namely, I am bulk processing massive video files on a Ubuntu 12.04 LTS server. Certain operations on these files take a very long time, so I would like some kind of alert (email would be great) when a specific one finishes. They take so long, that doing this on a one-off basis, manually, based on PIT would be perfectly fine. To provide more info – let's say I'm processing a particularly big file, and I see that it has progressed on to an FFMPEG script, the process itself being a python script (that is quite complex, and not written by myself, and something I do not wish to modify – though that would be the first logical approach). I imagine issuing a command or script with the PID of said running python script as an argument, and when the process with that PID is no longer running, the alert script does its thing. Any ideas?


title: Trying to install DIP (Dialup Networking) package for SLIP protocol

text: We are trying to interface with a wireless modem that connects to a computer via a com-port DB-9 connection. It uses SLIP in the sense that the modem hosts a SLIP server and requires the interfacing computer to connect to it as a SLIP client. From the documentation I've read, the package`dip` seems to be the right solution. The problem though is the following:   1. It isn't bundled in modern linux distributions like it used to be,   2. I can't get the source code, found at metalab.unc.edu, to compile,   3. attempting to install the rpm also causes similar dependency issues So, potential solutions to this problem may include:   1. Solution to #1, 2, or 3 above.   2. Using a very old distribution of Linux (not ideal at all)   3. An alternative package to `dip`. `slattach` does not appear to be a viable option for our needs. Any help is greatly appreciated! **Update** Slackware 14 does not include `dip` by default, but does have `dip` available for download at http://packages.slackware.com. For the time being, I am going to try this route.


title: ls and vim color on SunOS 5.8/Solaris 8

text: I want to use ls and vim with color on Sunos 5.8 SunOS 5.8 Generic_117350-11 sun4u sparc SUNW,Sun-Blade-2500 I have installed ls (GNU coreutils) 6.9 and vim 7.2 ### In ~/.cshrc:               setenv TERM sun-color # If change to dtterm, the vim color scheme desert256 will not work.          alias ls ls -F --color=auto          setenv LS_COLORS "no=00;38;5;244:di=00;38;5;33:ln=01;38;5;37:pi=48;5;230;38;5;136;01:so=48;5;230;38;5;136;01:do=48;5;230;38;5;136;01:bd=48;5;230;38;5;244;01:cd=48;5;230;38;5;244;01:or=48;5;235;38;5;160:ex=01;38;5;64:*.tar=00;38;5;61:*.tgz=01;38;5;61:*.arj=01;38;5;61:*.taz=01;38;5;61:*.lzh=01;38;5;61:*.lzma=01;38;5;61:*.tlz=01;38;5;61:*.txz=01;38;5;61:*.zip=01;38;5;61:*.z=01;38;5;61:*.Z=01;38;5;61:*.dz=01;38;5;61:*.gz=01;38;5;61:*.lz=01;38;5;61:*.xz=01;38;5;61:*.bz2=01;38;5;61:*.bz=01;38;5;61:*.tbz=01;38;5;61:*.tbz2=01;38;5;61:*.tz=01;38;5;61:*.deb=01;38;5;61:*.rpm=01;38;5;61:*.jar=01;38;5;61:*.rar=01;38;5;61:*.ace=01;38;5;61:*.zoo=01;38;5;61:*.cpio=01;38;5;61:*.7z=01;38;5;61:*.rz=01;38;5;61:*.apk=01;38;5;61:*.gem=01;38;5;61:*.jpg=00;38;5;136:*.JPG=00;38;5;136:*.jpeg=00;38;5;136:*.gif=00;38;5;136:*.bmp=00;38;5;136:*.pbm=00;38;5;136:*.pgm=00;38;5;136:*.ppm=00;38;5;136:*.tga=00;38;5;136:*.xbm=00;38;5;136:*.xpm=00;38;5;136:*.tif=00;38;5;136:*.tiff=00;38;5;136:*.png=00;38;5;136:*.svg=00;38;5;136:*.svgz=00;38;5;136:*.mng=00;38;5;136:*.pcx=00;38;5;136:*.dl=00;38;5;136:*.xcf=00;38;5;136:*.xwd=00;38;5;136:*.yuv=00;38;5;136:*.cgm=00;38;5;136:*.emf=00;38;5;136:*.eps=00;38;5;136:*.CR2=00;38;5;136:*.ico=00;38;5;136:*.tex=01;38;5;245:*.rdf=01;38;5;245:*.owl=01;38;5;245:*.n3=01;38;5;245:*.ttl=01;38;5;245:*.nt=01;38;5;245:*.torrent=01;38;5;245:*.xml=01;38;5;245:*Makefile=01;38;5;245:*Rakefile=01;38;5;245:*build.xml=01;38;5;245:*rc=01;38;5;245:*1=01;38;5;245:*.nfo=01;38;5;245:*README=01;38;5;245:*README.txt=01;38;5;245:*readme.txt=01;38;5;245:*.md=01;38;5;245:*README.markdown=01;38;5;245:*.ini=01;38;5;245:*.yml=01;38;5;245:*.cfg=01;38;5;245:*.conf=01;38;5;245:*.c=01;38;5;245:*.cpp=01;38;5;245:*.cc=01;38;5;245:*.log=00;38;5;240:*.bak=00;38;5;240:*.aux=00;38;5;240:*.bbl=00;38;5;240:*.blg=00;38;5;240:*~=00;38;5;240:*#=00;38;5;240:*.part=00;38;5;240:*.incomplete=00;38;5;240:*.swp=00;38;5;240:*.tmp=00;38;5;240:*.temp=00;38;5;240:*.o=00;38;5;240:*.pyc=00;38;5;240:*.class=00;38;5;240:*.cache=00;38;5;240:*.aac=00;38;5;166:*.au=00;38;5;166:*.flac=00;38;5;166:*.mid=00;38;5;166:*.midi=00;38;5;166:*.mka=00;38;5;166:*.mp3=00;38;5;166:*.mpc=00;38;5;166:*.ogg=00;38;5;166:*.ra=00;38;5;166:*.wav=00;38;5;166:*.m4a=00;38;5;166:*.axa=00;38;5;166:*.oga=00;38;5;166:*.spx=00;38;5;166:*.xspf=00;38;5;166:*.mov=01;38;5;166:*.mpg=01;38;5;166:*.mpeg=01;38;5;166:*.m2v=01;38;5;166:*.mkv=01;38;5;166:*.ogm=01;38;5;166:*.mp4=01;38;5;166:*.m4v=01;38;5;166:*.mp4v=01;38;5;166:*.vob=01;38;5;166:*.qt=01;38;5;166:*.nuv=01;38;5;166:*.wmv=01;38;5;166:*.asf=01;38;5;166:*.rm=01;38;5;166:*.rmvb=01;38;5;166:*.flc=01;38;5;166:*.avi=01;38;5;166:*.fli=01;38;5;166:*.flv=01;38;5;166:*.gl=01;38;5;166:*.m2ts=01;38;5;166:*.divx=01;38;5;166:*.webm=01;38;5;166:*.axv=01;38;5;166:*.anx=01;38;5;166:*.ogv=01;38;5;166:*.ogx=01;38;5;166:"      I tried to put it into `~/.dircolors` or `~/.dir_colors`, it doesn't work, and i cannot find out the dircolors command. ### in `~/.vimrc`:                set t_Co=256      set background=dark      colorscheme desert256      The `tput colors` output:               $ tput colors     8     $ echo $?     0      After above setting, after I used latest Putty to log in the SunOS host, Putty is under default setting. ls and vim can show with color in Putty. However, if I do `su - myaccount` from Common Desk Enviroment(CDE) Terminal Emulator in the SunOS computer,the ls and vim (gvim can show with color) cannot work correctly with color as Putty, no matter the Terminal Emulator is `background:Black`, `forceground:White` or `background:White`, `forceground:Black`. Please see the pics: https://picasaweb.google.com/112839698018484354718/Sunos58 How can I let ls and vim show with color correctly in SunOS CDE Terminal Emulator like that when I log into that SunOS host from Putty?


title: How can I get better-looking fonts in my terminal (URxvt)?

text: I've noticed that the fonts in URxvt look a little bit low-res compared to fonts that I see in my browser, for example. I was wondering how could I fix my `.Xdefaults` file to make the fonts have a little bit more detail and be sharper. It might not be visible in this picture, but I can definitely notice the difference when looking myself: ![enter image description here](http://i.stack.imgur.com/sWd75.png) Here is my current `.Xdefaults`:               URxvt*background: Black     URxvt*foreground: White     URxvt*geometry: 80x30     URxvt*scrollBar: false          "URxvt.font: 9x15          !-- Xft settings -- !     Xft.dpi:        96     Xft.antialias:  true     Xft.rgba:       rgb     Xft.hinting:    true     Xft.hintstyle:  hintfull          ! -- Fonts -- !     URxvt.font:xft:Monospace:pixelsize=15     URxvt.boldfont:xft:Monospace-Bold:pixelsize=15


title: Why is so much of my new ext4 filesystem already marked as used?

text: I have just created a new raid 5 array using 3 4TB drives (aiming for 8TB of space) on an ubuntu system. While I had a few issues getting started, I believe I have set it up correctly and I have created an ext4 filesystem on it as a single partition using the whole array. When I look at it in gparted though, it reports Size: 7.28 TiB (this is correct - I know the difference between TB and TiB)   Used: 117 GiB   Unused: 7.16 TiB If I run `sudo df -h` I get               Filesystem      Size  Used Avail Use% Mounted on     /dev/md0        7.2T   51M  6.8T   1% /home/brad/raid      which is a different size again. The available is 400G less than the size, but the used is only 51M here! My question is, is this the expected output at this point in time, or is this an indication that something has gone awry? If it is expected then what is using the space that is reported on gparted as used? In case anyone wants to see it here is the output from `cat /proc/mdstat`               md0 : active raid5 sdb1[0] sdd1[3] sdc1[1]           7813772288 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [UU_]           [=>...................]  recovery =  7.2% (283321088/3906886144) finish=2181.8min speed=27679K/sec          unused devices: <none>      and from `sudo fdisk -l`               Disk /dev/sda: 250.1 GB, 250059350016 bytes     255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000ac78f             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   472330239   236164096   83  Linux     /dev/sda2       472332286   488396799     8032257    5  Extended     /dev/sda5       472332288   488396799     8032256   82  Linux swap / Solaris          WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes     255 heads, 63 sectors/track, 486401 cylinders, total 7814037168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1  4294967295  2147483647+  ee  GPT     Partition 1 does not start on physical sector boundary.          WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sdc: 4000.8 GB, 4000787030016 bytes     255 heads, 63 sectors/track, 486401 cylinders, total 7814037168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1               1  4294967295  2147483647+  ee  GPT     Partition 1 does not start on physical sector boundary.          WARNING: GPT (GUID Partition Table) detected on '/dev/sdd'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sdd: 4000.8 GB, 4000787030016 bytes     255 heads, 63 sectors/track, 486401 cylinders, total 7814037168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdd1               1  4294967295  2147483647+  ee  GPT     Partition 1 does not start on physical sector boundary.          WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sde: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sde1               1  1953525167   976762583+  ee  GPT          Disk /dev/md0: 8001.3 GB, 8001302822912 bytes     2 heads, 4 sectors/track, 1953443072 cylinders, total 15627544576 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 524288 bytes / 1048576 bytes     Disk identifier: 0x00000000          Disk /dev/md0 doesn't contain a valid partition table      Hmmmm, the bit at the end about /dev/md0 not containing a valid partition table is interesting.


title: command substitution handling in fish vs. other shells (sh, bash, zsh)

text: The program `mc` (Midnight Commander) is not intended to be used for command substitution, but I would like to know why different shells behave differently when this program (and it seems like other curses programs in general) are used as a command substitution target. In the fish shell, issuing the command below will print the string "Cannot get terminal settings: Inappropriate ioctl for device (25)\n\n".               echo (mc) # fish command substitution syntax      Another interesting thing to note is that after this command returns you can issue `jobs` to see that the `mc` process was suspended. The equivalent command in sh, bash, and zsh hangs the shell, and by hang I mean that I cannot kill the command or suspend it using C-z/C-c. The only way I can recover from the command is by killing my shell process and restarting it (from a different shell).               echo $(mc) # hangs in sh, bash, zsh      Why does the fish shell not hang? How does it handle curses or command substitution or etc. differently to produce this behavior? I feel like this is important because it might be a desirable property for other shells to have; no command should be able to render a shell totally inoperable by accident. **EDIT:** Another way to answer this question would be to show why the following program gets suspended when used as a command substitution target in the fish shell. Like `mc`, it uses curses, but it is modified to reopen stdin when it detects stdin is not a tty. This allows curses mode to be used in all shells but fish.               #define _XOPEN_SOURCE     #include <ncurses.h>     #include <stdio.h>     #include <stdlib.h>     #include <unistd.h>          int main()     {         // start curses mode         SCREEN* s = NULL;         FILE* out = stdout;         if(!isatty(fileno(stdout))) {             out = fopen("/dev/tty", "w");             // Should really test `out` to make sure that worked.             setbuf(out, NULL);         }         // Here, we don't worry about the case where stdin has been         // redirected, but we could do something similar to out         // for input, opening "/dev/tty" in mode "r" for in if necessary.         s = newterm(NULL, out, stdin);              printw("test");         getch();              endwin(); // end curses mode         delscreen(s);         puts("/home/matt");         return 0;     }      See this question for more info: http://stackoverflow.com/questions/17450014/ncurses-program-not-working- correctly-when-used-for-command-substitution. This code was a solution posted to my original question on Stackoverflow. The solution works for all shells but fish. **EDIT:** Tried to find more information by booting up fish in gdb. Used the following gdb command sequence and got the following output:               (gdb) break main     Breakpoint 1 at 0x41fe70: file fish.cpp, line 417.     (gdb) run -c echo (mc)     Starting program: /home/matt/builds/fish-shell/fish -c echo (mc)     Cannot get terminal settings: Inappropriate ioctl for device (25)      The debugger pauses here and does not produce any more output. This is strange because the breakpoint at main in never hit. The fish shell needs to parse its command line arguments before doing command substitution, but I am not sure how the threading affects observing this in the debugger.


title: installing manjaro linux wrecked my boot

text: I don't know if it's manjaro finally, but it happened after installing manjaro. I have a Samsung laptop, maybe 1 year old, 750GB HD, 4GB RAM. It came preinstalled with Windows with some repair partitions. I normally would wipe windows, but currently I am working with a client who handles conference calls through webex (which doesn't run on linux). So I installed dual boot with ubuntu 13.04, windows, and a linux mint (which I used for music creation, while ubuntu was used for work - antagonic uses, thus multiple distros). My partition table looked something like this (not completely sure anymore, GB size is approx):   * `sda1` Primary windows recovery   * `sda2` Primary windows - 100GB   * `sda3` Extended partition      * `sda4` Windows data - 100GB     * `sda5` ubuntu swap - 4GB     * `sda6` linux mint - 50GB     * `sda7` ubuntu - 400GB      * `sda8` mint swap - 4GB This all worked fine for around a year. Lately I ran into broken repositories for ubuntu 13.04. Nothing would install anymore, no `dist-upgrade` etc possible. Thus I backed up my data and wanted to give manjaro a try. I split `sda7` into two partitions, so to have a manjaro root (50GB) and a home (350GB). Installation ran without errors, but on reboot, the PC would try to get to the HD it seemed but would just reboot always, and nothing would boot up. Not even GRUB. I tried installing linux on the same new partition, the installation ran fine, but on reboot it would not boot up, not even GRUB. I tried _many_ things, reinstalling grub with `grub-install` and chroot and all tutorials I have found - nothing seemed to work. When I reinstall Windows, it is able to boot, but for whatever reason, no linux is booting, looks like GRUB is not able to install. I even just did a `dd if=/dev/zero of=/dev/sda bs=1M`, which supposedly erases the whole disk, then installed manjaro - no joy. Only windows can be installed... I don't have UEFI I think. What could have been happened? I am using linux since 1997 and I never encountered anything like this, especially as no linux seems to be able to install.


title: Is this the right way to uninstall Fedora from a dual-boot system?

text: I'm using fedora 18 side by side Windows 7 and i want to remove fedora. I'm going to that by deleting the fedora partitions from Windows 7. PS: when i installed in the first place fedora, I didn't overwrite MBR, the GRUB2 is installed in `/boot` partition. So is this method will expose me to problem when the laptop boot into Windows 7 ? ( the object of this is to get a new fresh installation of Fedora ).


title: SSH Public Key authentication - works only after a physical login

text: I am trying to connect via SSH to my ubuntu server with public key authentication. For some reasons I get an "Permission denied (publickey)." on the client, whenever I execute `ssh -i ~/.ssh/id_rsa <username>@<ip> -p <port>`. The auth.log on my server has the following output: `sshd[1425]: Connection closed by <client-ip> [preauth]` But as soon as I login physically on my server, with the samer username, the following ssh connection from my client successes. But as soon as I logout physically, the next ssh session from my client fails. /etc/ssh/sshd_config               # What ports, IPs and protocols we listen for     Port <port>     # Use these options to restrict which interfaces/protocols sshd will bind to     #ListenAddress ::     #ListenAddress 0.0.0.0     Protocol 2     # HostKeys for protocol version 2     HostKey /etc/ssh/ssh_host_rsa_key     HostKey /etc/ssh/ssh_host_dsa_key     HostKey /etc/ssh/ssh_host_ecdsa_key     HostKey /etc/ssh/ssh_host_ed25519_key     #Privilege Separation is turned on for security     UsePrivilegeSeparation yes          # Lifetime and size of ephemeral version 1 server key     KeyRegenerationInterval 3600     ServerKeyBits 1024          # Logging     SyslogFacility AUTH     LogLevel INFO          # Authentication:     LoginGraceTime 120     PermitRootLogin no     StrictModes yes          RSAAuthentication yes     PubkeyAuthentication yes     AuthorizedKeysFile      %h/.ssh/authorized_keys          # Don't read the user's ~/.rhosts and ~/.shosts files     IgnoreRhosts yes     # For this to work you will also need host keys in /etc/ssh_known_hosts     RhostsRSAAuthentication no     # similar for protocol version 2     HostbasedAuthentication no          PermitEmptyPasswords no     ChallengeResponseAuthentication no          PasswordAuthentication no          X11Forwarding yes     X11DisplayOffset 10     PrintMotd no     PrintLastLog yes     TCPKeepAlive yes     #UseLogin no          AcceptEnv LANG LC_*          Subsystem sftp /usr/lib/openssh/sftp-server          UsePAM no          ClientAliveInterval 30     ClientAliveCountMax 99999          Any clues why this could happen? Or do you have any recommendations according security? Thank you!


title: How to efficiently create (read-only) both a snapshot and a diffshot at the same time?

text: I use `rsync` to regularly create snapshots of some directories via               PAR="-aP --chmod=a-w --no-owner"     # Create diffshot     rsync $PAR --compare-dest=$CURRENT_SNAPSHOT $SOURCE/ $DEST.changeset.incomplete     find $DEST.changeset.incomplete -type d -empty -delete     mv $DEST.changeset{.incomplete,}     # Create actual snapshot     LNK="--link-dest=$PREVIOUS --link-dest=$DEST.changeset"     rsync $PAR $LNK $SOURCE/ $DEST.incomplete     mv $DEST{.incomplete,}      such that `$DEST` contains a snapshot (hard-linking to the previous snapshot at `$PREVIOUS`) and `$DEST.changeset` contains a rudimentary diffshot, i.e. only the files which have been modified or created (but no information on simple `mv`s or file removal). To make the snapshots read-only I simply have `rsync` use `\--chmod=a-w` - the original permissions are not that important, since it's basically always `ug+w`, but I wonder if there are other, more efficient means to achieve read-only status. Anyway, my main question is > How can the two calls `rsync` be combined into one / sped up?


title: How can I use Synergy when connected through different routers?

text: I use synergy to control my laptop from my desktop when I have my laptop docked at my workstation. Currently, I need to keep my laptop wired to the same router that my desktop is connected to in order to use synergy. However, I will also take my laptop and work from other parts of the house. I'd like to use just wireless on the laptop, so I don't have to switch connections to get up and move around. My desktop has a wired connection to a router. When I'm using wireless on my laptop, I'm connecting through a different router. Is there a way to set up synergy to connect from the wireless router `192.168.17.*` to the wired network `192.168.250.*`? I don't know much about network set up or terminology, so if I'm not including any pertinent details, please ask.


title: Executing a script in .zshrc

text: I'm trying to use z (link) to make navigating a little easier. The problem is that I have the following in my .zshrc file, but it doesn't seem to work:               export PATH=$PATH:/home/x/z     alias z='/home/x/z/z.sh'     . z      For some reason, the last command never seems to work. If I do it by hand after opening the shell, it's fine but executing it within the .zshrc will not work.


title: Power management hook for running scripts on wake

text: I'm looking for a way to run an arbitrary script every time my laptop wakes up.


title: Difference between process group and job?

text: What's the difference between a process group and a job? If I type `pr * | lpr` then is it both a process group as well a job? What exactly is the difference between a process group ID and a job ID? Edit: I know it appears similar to What is the difference between a job and a process?, but it is slightly different. Also, I didn't understand this concept from this thread.


title: How does the shell filename expansion delimit items within a ( * ) list?

text: I don't understand shell expansion fully yet (hopefully, one day soon I will)...   I saw this comment to a superuser question, but I think I'm still parked at the kerb... > Using Linux without the shell is like driving a Ferrari at 50 km/h through > city traffic. All fun will just go away ... I don't understand the following example.. What heirarchy, or whatever, is causing the 2nd example "array item count:" to be different to the 1st example? What happened to the shell introduced "space"?. or is it the `echo` which is introducing the space, and the shell is (perhaps) using \0?               #!/bin/bash     # Make a couple of files whose names contain a space.     junkd=$HOME/junkd     mkdir $junkd # || exit 1     cd $junkd     touch f\ {1..2}     #     echo -n * |xxd         # This shows a space between the two names.     names=$(echo -n * )     echo -n "$names" |xxd  # This shows a space between the two names.     #     # So far, it seems that the shell is inserting a space between each filename.     #     array=( $names )     echo "array item count: ${#array[@]}"      # 4 items... This shows that a space is the delimiter char ....     #     array=( * )     echo "array item count: ${#array[@]}"      # 2 items... What happened to the shell introduced space?     #


title: Is it possible to run a Vim clientserver instance over SSH+tmux

text: I've been a vim junkie for a year or so now and I've got some great little tricks burnt in to my memory. I do a lot of development (at the office) in a terminal on Ubuntu. One of the things I value most is having tmux taking care of my sessions so that if Gnome, or anything else, decides to kirk out then I haven't lost a thing. Additionally, I run a vim clientserver (C-b :neww 'vim --servername d') as one of my tmux windows and use it to receive any files I want to work with while I have my other tmux windows doing various jobs. It means I can have one vim open with no confusion about what I'm editing. When I'm working remotely (via SSH,) I connect to my tmux session and carry on but I have one problem: vim won't start a client-server instance. I presume it is X related but I can't seem to find the difference between a local tmux and a tmux via ssh.


title: Share files via bluetooth

text: I'd like to transfer files located on the harddrive of my laptop `Acer Travelmate 4002 WLMi` to my smartphone via bluetooth. My system is `Ubuntu 12.04`. I tried so far.               $ sudo service bluetooth start     bluetooth start/running, process 3315          $ sudo hcitool inq     Inquiring ...     Inquiry failed.: No such device          $ sudo rfkill list     0: phy0: Wireless LAN             Soft blocked: no             Hard blocked: yes      When I press the switch on the picture it won't turn on (yellow color). It's still turned off. In `Windows` OS it was possible to turn it on. ![enter image description here](http://i.stack.imgur.com/4nV9K.jpg) Here, I have stuck. Do you know how to succeed in transferring files?


title: what is the correct Courier / Maildir++ email (sub)folder format?

text: For representing the logical email folder structure, a "Maildir++" format exists that was first implemented by the Courier mail server, thus sometimes also being referred to as the "Courier" format. Unfortunately, some ambiguity exists in documentation and various implementations, regarding how the logical email folders are to be stored inside the main "Maildir" directory, ie. inside the main email directory containing the three subdirectories "cur", "new" and "tmp". Assuming there are three email folders, "INBOX", "Sent" and "Trash", I have understood the canonical spec to mean the following filesystem folder structure:               mail \          - cur          - new          - tmp          - .INBOX \                   - cur                   - new                   - tmp      (and likewise for .Sent and .Trash) Furthermore, assuming we have a deeper folder structure, say, a top-level email folder "Chronological/2012/09", it would be stored as follows:               mail \          - cur          - new          - tmp          - .Chronological.2012.09 \                                   - cur                                   - new                                   - tmp      Is this correct? Some docs are a bit ambiguous about this, and I've seen implementations vary: some store the top-level folders without the leading dot, and some create a new filesystem subdirectory for each subfolder level (rather than using the dots to denote a new logical level).


title: Substitute pattern within a file with the content of other file

text: I have a text file (`devel.xml`). I added the word REPLACETHIS to it in order to replace this string with the content within a different file (`temp.txt`). The closest thing I have is this:               sed -i -e "/SUBSTITUTETHIS/r temp.TXT" -e "s///" devel.txt;      This inserts the content after the string, and then deletes the string afterwards. Is this the best way to do it?


title: Drivers for HP ScanJet 2400 on Linux

text: I'm trying to install my scanner "HP ScanJet 2400". I followed the recipe from here: http://www.elcot.in/linuxdrivers_download.php, However, it was not possible at all to detect it, when working in CentOS, Fermi & OSuSE OS. Doess anyone have any suggestions on how to get this scanner working?


title: Is it possible to run a private mailserver?

text: Last week my email provider (mout.web.de) got listed on spamcop. So I cannot send emails to recipients whose mailserver uses spamcop. An obvious solotion, which popped up in the forums, is to switch to another (paid) email provider. Since I have a local mailserver (exim) running anyways, I wonder whether I can set it up in way so it delivers mail directly rather than sending it to a smarthost, as it does now. If spamcop then detects spam originating from my IP, I am willing to take the blame. However I do not own my own domain (just a dynamic dns listing) and I am worried that this could be a showstopper. I also vaguely recall, that years ago a friend of mine tried to deliver mails directly and ran into problems, beause some mailservers would refuse to accept mail from him (the exact details slipped my memory). So   * Is running my own mailserver (without smarthost) a vital alternative to switching to a different email provider?    * Will I have to register my own domain?   * Are there any other showstoppers? Is there anything an email provider can do, which I cannot do on my linux box?


title: What information exactly is in the access control bits of a page table?

text: I'm currently learning for an exam in operating systems. This includes learning some basics about page tables, which lead me to the question Why using hierarchical page tables? which mentions that access control bits take about one byte for each entry in the page table. Another source mentioned also one byte for one page. But what information is in access control bits for a hierarchical page table? tfinley.net mentions:   * Valid bit   * Dirty bit   * Do we have access to read (but why should we ever not have access to read?)   * write   * execute  That would be 5 bit. But I don't think the source is good and I still miss 3 bit. According to Gary Shute it's 4 bit additional information (valid bit, rwx). Could somebody please tell me what's in the access control bits? Preferably with a source. I guess this question might depend on the actual system. I'm happy with any system you know this for and have sources.


title: What are guarantees for concurrent writes into a named pipe?

text: For example, I created a named pipe like the following:               mknod myPipe p      And I read from it from some process (for example, some server). For example purposes, I used tail:               tail -f myPipe      If several client processes write some messages into it (for example, `echo "msg" >> myPipe`, is there some chance that messages will get interleaved, like this:                <beginning of message1><message2><ending of message1>      Or is the process of writing to named pipe is atomic?


title: I/O errors on hard disk on Linux boot

text: Here is a screenshot of booting Arch. I guess the reason is that I force poweroff my Arch linux many times. (I already force poweroff my Arch because my firefox flash plugin use too much memory to stop my system.) ![screenshot when booting Arch linux](http://i.stack.imgur.com/U0udS.jpg) Note: I can boot my Windows 7 system on the same drive disk. So I think it is not a disk problem, mostly is a partion problem. Update: I check out more information, the partion `/dev/sda9` is `/home` directory. And always error on same `sector 798717984`. I use DiskGenius software under Windows to check error. Then found an error. and that partion is not formated. ![Disk Genius screenshot](http://i.stack.imgur.com/YzKt1.png) I want to recover my Arch linux. How to solve this ? If I can not fix this error, then how to get the partion data out ? Update2: I really hope to save this partion data out. Because I have a lot of important things in this partion. I think the first step is backup this bad partion or whole hard drive into an image file (what image file ?), then let someone who can fix this partion to fix. More update: After I use DiskGenius software to fix the partion sector error. Then I use `e2fsck` to check. get error:               fsck.ext4: Bad magic number in super-block while trying to open /dev/sda9.     /dev/sda9: The superblock could not be read or does not describe a correct ext2 filesystem.     VFS: can't find ext4 filesystem.      (my this broken partion `/home` -> `/dev/sda9` is ext4 when I create it before.) And I execute command `# mke2fs /dev/sda9` to get block information:               OS type: Linux     Block size: 4096 (log=2)     Fragment size=4096 (log=2)     Stride = 0 blocks, stripe width = 0 blocks     65536 inodes, 261888 blocks     13094 blocks (5.00%) reserved for super user     First data block = 0     Maximum filesystem bloack = 268435456     8 block groups     32768 blocks per group, 32768 fragments per group     8192 inodes per group     Super block backup stored on blocks:         32768, 988304, 163840, 229376


title: Creating a local in-house testing web server

text: What we are trying to achieve is to have an in house Linux-based (probably Ubuntu) web server which we can test on before pushing to our remote dedicated hosting server. The problem we are going to face though is that at the moment what we do works because we edit (sometimes huge websites) locally on our Macs and Coda flags those edited files and allows us to publish the changed files to the live site (we also maintain and update a remote SVN repo for each project). When we implement a LAMP in house server though we cannot figure out a way to efficiently push to the local machine and then push to the remote server when we're happy. One thing we thought of was creating (somehow) a networked alias folder which can sit as the "local" directory in Coda and the public_html folder on apache (on the web server). This would mean that we work directly from the local live folder and only click "publish" when we want to make the changes live. I'm not sure how possible this is, and if we're all working from the server then there could be networking issues and all sorts - not to mention if two people were to try and edit the same file at once. What would be really useful would be to have some sort of software that will flag changes on the local server and then push them to the live server when we're happy to do so. Is there anything like that out there? Or is there another way to do this at all? It'd be good to know what other people do to get round this problem. I would assume that other companies publish to a test server before publishing the changes live. What we don't want to have to end up doing is a) publishing the WHOLE site each time we make changes or b) having to write down all the files we change and publishing them separately (through an FTP client or similar). Thanks guys (ps: I'm not sure if this is completely fitting for this SE site. I started off with a linux-specific question and I've generalised it to get help for this problem)


title: Xfce sound level applet works wrong

text: I have installed Xfce4 on Debian testing. I'm using ALSA for sound driver. If I decrease volume level by using sound control applet in Xfce panel, there is no problem till "zero level". If I decrease volume to zero, I can not increase. (I can increase, but there is no sound). After digging a bit, I found out that if I decrease master channel volume to zero level, suddenly speaker channel mutes (and vice-versa). How can I fix the issue? ## Edit: I changed theme and stuff (I don't know what I did exactly) but now it works as expected. There is no problem right now.


title: Elementary os no sound after alsa update

text: I am new to Linux but really love Elementary for its simplicity. After noticing that my sound was quite poor in Elementary, compared to Windows 8.1, I have tried updating the sound drivers. I ended up downloading one from here but after a reboot, my sound icon was gone from the toolbar and no sound can be heard. In the setting > sound I see "Dummy Output" and running alsamixer says cannot open mixer: No such file or directory. I have Googled around without any success and many suggest `sudo alsa force-reload` but that returns               Unloading ALSA sound driver modules: (none loaded).     Loading ALSA sound driver modules: (none to reload).      I have lost hope after posting in other places without any replies and I am hoping somebody here can help. I have uninstalled the driver I have previously downloaded from the link above (maybe there are pieces left behind?) and purged reinstalled both alsa-base and pulseaudio but I still can not see the sound icon or play sounds. `sudo lshw`:               description: Portable Computer     product: Inspiron 3537 (Inspiron 3537)     vendor: Winbond Electronics     version: A07     serial: 2FN1402     width: 64 bits     capabilities: smbios-2.7 dmi-2.7 vsyscall32     configuration: administrator_password=disabled boot=normal chassis=portable family=00 frontpanel_password=disabled keyboard_password=disabled power-on_password=disabled sku=Inspiron 3537 uuid=44454C4C-4600-104E-8031-B2C04F343032     *-core        description: Motherboard        product: 03JPPR        vendor: Winbond Electronics        physical id: 0        version: A00        serial: .2FN1402.CN129664280036.        slot: Type2 - Board Chassis Location      *-firmware           description: BIOS           vendor: Winbond Electronics           physical id: 0           version: A07           date: 11/12/2013           size: 128KiB           capacity: 4032KiB           capabilities: pci pnp upgrade shadowing cdboot bootselect edd int13floppynec int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer int10video acpi usb biosbootspecification      *-cpu           description: CPU           product: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz           vendor: Intel Corp.           physical id: 4           bus info: cpu@0           version: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz           serial: To Be Filled By O.E.M.           slot: U3E1           size: 759MHz           capacity: 759MHz           width: 64 bits           clock: 100MHz           capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cpufreq           configuration: cores=2 enabledcores=2 threads=4         *-cache:0              description: L1 cache              physical id: 9              slot: L1 Cache              size: 32KiB              capacity: 32KiB              capabilities: synchronous internal write-back instruction         *-cache:1              description: L2 cache              physical id: a              slot: L2 Cache              size: 256KiB              capacity: 256KiB              capabilities: synchronous internal write-back unified         *-cache:2              description: L3 cache              physical id: b              slot: L3 Cache              size: 3MiB              capacity: 3MiB              capabilities: synchronous internal write-back unified      *-cache           description: L1 cache           physical id: 8           slot: L1 Cache           size: 32KiB           capacity: 32KiB           capabilities: synchronous internal write-back data      *-memory           description: System Memory           physical id: 23           slot: System board or motherboard           size: 6GiB         *-bank:0              description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)              product: M471B5674QH0-YK0              vendor: Samsung              physical id: 0              serial: 98D205AC              slot: JDIMM1              size: 2GiB              width: 64 bits              clock: 1600MHz (0.6ns)         *-bank:1              description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)              product: NT4GC64C88B1NS-DI              vendor: Nanya Technology              physical id: 1              serial: F85A1057              slot: JDIMM2              size: 4GiB              width: 64 bits              clock: 1600MHz (0.6ns)      *-pci           description: Host bridge           product: Haswell-ULT DRAM Controller           vendor: Intel Corporation           physical id: 100           bus info: pci@0000:00:00.0           version: 09           width: 32 bits           clock: 33MHz         *-display              description: VGA compatible controller              product: Haswell-ULT Integrated Graphics Controller              vendor: Intel Corporation              physical id: 2              bus info: pci@0000:00:02.0              version: 09              width: 64 bits              clock: 33MHz              capabilities: msi pm vga_controller bus_master cap_list rom              configuration: driver=i915 latency=0              resources: irq:61 memory:b0000000-b03fffff memory:a0000000-afffffff ioport:4000(size=64)         *-multimedia:0 UNCLAIMED              description: Audio device              product: Intel Corporation              vendor: Intel Corporation              physical id: 3              bus info: pci@0000:00:03.0              version: 09              width: 64 bits              clock: 33MHz              capabilities: pm msi pciexpress bus_master cap_list              configuration: latency=0              resources: memory:b0710000-b0713fff         *-usb:0              description: USB controller              product: Lynx Point-LP USB xHCI HC              vendor: Intel Corporation              physical id: 14              bus info: pci@0000:00:14.0              version: 04              width: 64 bits              clock: 33MHz              capabilities: pm msi xhci bus_master cap_list              configuration: driver=xhci_hcd latency=0              resources: irq:58 memory:b0700000-b070ffff         *-communication UNCLAIMED              description: Communication controller              product: Lynx Point-LP HECI #0              vendor: Intel Corporation              physical id: 16              bus info: pci@0000:00:16.0              version: 04              width: 64 bits              clock: 33MHz              capabilities: pm msi cap_list              configuration: latency=0              resources: memory:b0718000-b071801f         *-multimedia:1 UNCLAIMED              description: Audio device              product: Lynx Point-LP HD Audio Controller              vendor: Intel Corporation              physical id: 1b              bus info: pci@0000:00:1b.0              version: 04              width: 64 bits              clock: 33MHz              capabilities: pm msi pciexpress bus_master cap_list              configuration: latency=0              resources: memory:b0714000-b0717fff         *-pci:0              description: PCI bridge              product: Lynx Point-LP PCI Express Root Port 3              vendor: Intel Corporation              physical id: 1c              bus info: pci@0000:00:1c.0              version: e4              width: 32 bits              clock: 33MHz              capabilities: pci pciexpress msi pm normal_decode bus_master cap_list              configuration: driver=pcieport              resources: irq:56 ioport:3000(size=4096) memory:b0600000-b06fffff ioport:b0400000(size=1048576)            *-network                 description: Ethernet interface                 product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller                 vendor: Realtek Semiconductor Co., Ltd.                 physical id: 0                 bus info: pci@0000:01:00.0                 logical name: eth0                 version: 07                 serial: ec:f4:bb:87:45:0c                 size: 10Mbit/s                 capacity: 100Mbit/s                 width: 64 bits                 clock: 33MHz                 capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation                 configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8106e-1_0.0.1 06/29/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s                 resources: irq:60 ioport:3000(size=256) memory:b0600000-b0600fff memory:b0400000-b0403fff         *-pci:1              description: PCI bridge              product: Lynx Point-LP PCI Express Root Port 4              vendor: Intel Corporation              physical id: 1c.3              bus info: pci@0000:00:1c.3              version: e4              width: 32 bits              clock: 33MHz              capabilities: pci pciexpress msi pm normal_decode bus_master cap_list              configuration: driver=pcieport              resources: irq:57 memory:b0500000-b05fffff ioport:9fb00000(size=1048576)            *-network                 description: Wireless interface                 product: QCA9565 / AR9565 Wireless Network Adapter                 vendor: Qualcomm Atheros                 physical id: 0                 bus info: pci@0000:02:00.0                 logical name: wlan0                 version: 01                 serial: 64:5a:04:ca:09:df                 width: 64 bits                 clock: 33MHz                 capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless                 configuration: broadcast=yes driver=ath9k driverversion=3.8.0-39-generic firmware=N/A ip=192.168.1.5 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn                 resources: irq:19 memory:b0500000-b057ffff memory:9fb00000-9fb0ffff         *-usb:1              description: USB controller              product: Lynx Point-LP USB EHCI #1              vendor: Intel Corporation              physical id: 1d              bus info: pci@0000:00:1d.0              version: 04              width: 32 bits              clock: 33MHz              capabilities: pm debug ehci bus_master cap_list              configuration: driver=ehci-pci latency=0              resources: irq:23 memory:b071c000-b071c3ff         *-isa              description: ISA bridge              product: Lynx Point-LP LPC Controller              vendor: Intel Corporation              physical id: 1f              bus info: pci@0000:00:1f.0              version: 04              width: 32 bits              clock: 33MHz              capabilities: isa bus_master cap_list              configuration: driver=lpc_ich latency=0              resources: irq:0         *-storage              description: SATA controller              product: Lynx Point-LP SATA Controller 1 [AHCI mode]              vendor: Intel Corporation              physical id: 1f.2              bus info: pci@0000:00:1f.2              version: 04              width: 32 bits              clock: 66MHz              capabilities: storage msi pm ahci_1.0 bus_master cap_list              configuration: driver=ahci latency=0              resources: irq:59 ioport:4088(size=8) ioport:4094(size=4) ioport:4080(size=8) ioport:4090(size=4) ioport:4060(size=32) memory:b071b000-b071b7ff         *-serial UNCLAIMED              description: SMBus              product: Lynx Point-LP SMBus Controller              vendor: Intel Corporation              physical id: 1f.3              bus info: pci@0000:00:1f.3              version: 04              width: 64 bits              clock: 33MHz              configuration: latency=0              resources: memory:b0719000-b07190ff ioport:4040(size=32)      *-scsi:0           physical id: 1           logical name: scsi0           capabilities: emulated         *-disk              description: ATA Disk              product: Hitachi HTS54757              vendor: Hitachi              physical id: 0.0.0              bus info: scsi@0:0.0.0              logical name: /dev/sda              version: JE4O              serial: J2140054KYR1XB              size: 698GiB (750GB)              capabilities: gpt-1.00 partitioned partitioned:gpt              configuration: ansiversion=5 guid=0f7b0e6a-9fa4-449d-8fb3-524c80e127f4            *-volume:0                 description: Windows FAT volume                 vendor: MSDOS5.0                 physical id: 1                 bus info: scsi@0:0.0.0,1                 logical name: /dev/sda1                 logical name: /boot/efi                 version: FAT32                 serial: 0e9a-917c                 size: 495MiB                 capacity: 499MiB                 capabilities: boot fat initialized                 configuration: FATs=2 filesystem=fat mount.fstype=vfat mount.options=rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro name=EFI system partition state=mounted            *-volume:1                 description: Windows FAT volume                 vendor: MSDOS5.0                 physical id: 2                 bus info: scsi@0:0.0.0,2                 logical name: /dev/sda2                 version: FAT32                 serial: 600d-e074                 size: 15MiB                 capacity: 39MiB                 capabilities: precious readonly hidden nomount fat initialized                 configuration: FATs=2 filesystem=fat name=Basic data partition            *-volume:2                 description: Windows NTFS volume                 physical id: 3                 bus info: scsi@0:0.0.0,3                 logical name: /dev/sda3                 version: 3.1                 serial: 7214-8f07                 size: 98MiB                 capacity: 127MiB                 capabilities: nofs ntfs initialized                 configuration: clustersize=4096 created=2014-04-26 20:59:47 filesystem=ntfs modified_by_chkdsk=true mounted_on_nt4=true name=Microsoft reserved partition resize_log_file=true state=dirty upgrade_on_mount=true            *-volume:3                 description: Windows NTFS volume                 physical id: 4                 bus info: scsi@0:0.0.0,4                 logical name: /dev/sda4                 version: 3.1                 serial: e012-cf26                 size: 460MiB                 capacity: 489MiB                 capabilities: precious readonly hidden nomount ntfs initialized                 configuration: clustersize=4096 created=2014-02-07 18:33:16 filesystem=ntfs label=WINRETOOLS name=Basic data partition state=clean            *-volume:4                 description: Windows NTFS volume                 physical id: 5                 bus info: scsi@0:0.0.0,5                 logical name: /dev/sda5                 version: 3.1                 serial: 8e282093-121f-2e48-901e-b0cc0d3175aa                 size: 201GiB                 capacity: 201GiB                 capabilities: ntfs initialized                 configuration: clustersize=4096 created=2014-02-07 18:33:27 filesystem=ntfs label=OS name=Basic data partition state=clean            *-volume:5                 description: Windows NTFS volume                 physical id: 6                 bus info: scsi@0:0.0.0,6                 logical name: /dev/sda6                 version: 3.1                 serial: 88bb-16a8                 size: 433MiB                 capacity: 449MiB                 capabilities: precious readonly hidden nomount ntfs initialized                 configuration: clustersize=4096 created=2014-04-27 21:10:23 filesystem=ntfs modified_by_chkdsk=true mounted_on_nt4=true resize_log_file=true state=dirty upgrade_on_mount=true            *-volume:6                 description: Windows NTFS volume                 physical id: 7                 bus info: scsi@0:0.0.0,7                 logical name: /dev/sda7                 logical name: /media/sda7                 version: 3.1                 serial: 3a09b668-4147-4c4a-8f39-e329be48fcbf                 size: 341GiB                 capacity: 341GiB                 capabilities: ntfs initialized                 configuration: clustersize=4096 created=2014-04-26 00:17:41 filesystem=ntfs label=Media modified_by_chkdsk=true mount.fstype=fuseblk mount.options=rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 mounted_on_nt4=true name=Basic data partition resize_log_file=true state=mounted upgrade_on_mount=true            *-volume:7                 description: Windows NTFS volume                 physical id: 8                 bus info: scsi@0:0.0.0,8                 logical name: /dev/sda8                 version: 3.1                 serial: 70f2-defe                 size: 12GiB                 capacity: 12GiB                 capabilities: precious readonly hidden nomount ntfs initialized                 configuration: clustersize=4096 created=2014-02-07 21:44:42 filesystem=ntfs label=PBR Image modified_by_chkdsk=true mounted_on_nt4=true name=Microsoft recovery partition resize_log_file=true state=dirty upgrade_on_mount=true            *-volume:8                 description: EXT4 volume                 vendor: Linux                 physical id: 9                 bus info: scsi@0:0.0.0,9                 logical name: /dev/sda9                 logical name: /                 version: 1.0                 serial: a6c40c87-72a3-4600-a9f5-4e2164d727ad                 size: 135GiB                 capabilities: journaled extended_attributes large_files huge_files dir_nlink recover extents ext4 ext2 initialized                 configuration: created=2014-04-28 17:36:17 filesystem=ext4 lastmountpoint=/ modified=2014-05-21 20:44:45 mount.fstype=ext4 mount.options=rw,relatime,errors=remount-ro,data=ordered mounted=2014-05-21 20:55:17 state=mounted            *-volume:9                 description: Linux swap volume                 physical id: a                 bus info: scsi@0:0.0.0,10                 logical name: /dev/sda10                 version: 1                 serial: 3cf35bdb-523c-4c09-8f2d-bed23767416c                 size: 6023MiB                 capacity: 6024MiB                 capabilities: nofs swap initialized                 configuration: filesystem=swap pagesize=4095      *-scsi:1           physical id: 2           logical name: scsi1           capabilities: emulated         *-cdrom              description: DVD-RAM writer              product: DVD+-RW GU90N              vendor: HL-DT-ST              physical id: 0.0.0              bus info: scsi@1:0.0.0              logical name: /dev/cdrom              logical name: /dev/cdrw              logical name: /dev/dvd              logical name: /dev/dvdrw              logical name: /dev/sr0              version: A100              capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram              configuration: ansiversion=5 status=ready            *-medium                 physical id: 0                 logical name: /dev/cdrom      *-scsi:2           physical id: 3           bus info: usb@1:1.7           logical name: scsi3           capabilities: emulated scsi-host           configuration: driver=rts5139         *-disk              description: SCSI Disk              product: xD/SD/M.S.              vendor: Generic-              physical id: 0.0.0              bus info: scsi@3:0.0.0              logical name: /dev/sdb              version: 1.00              serial: 3              capabilities: removable            *-medium                 physical id: 0                 logical name: /dev/sdb     *-battery        description: Lithium-Ion Battery        product: DELL 4WY7C416        vendor: SANYO        physical id: 1        slot: Sys. Battery Bay        capacity: 28000mWh        configuration: voltage=14.8V      Any help is greatly appreciated.


title: ksh: to print the fourth line above the matched line and second line after the matched line

text: This is the sample log file :               64.242.88.10 - - [07/Mar/2004:16:05:49 -0800] "GET /twiki/bin/edit/Main/Double_bounce_sender?topicparent=Main.ConfigurationVariables HTTP/1.1" 401 12846     64.242.88.10 - - [07/Mar/2004:16:06:51 -0800] "GET /twiki/bin/rdiff/TWiki/NewUserTemplate?rev1=1.3&rev2=1.2 HTTP/1.1" 200 4523     64.242.88.10 - - [07/Mar/2004:16:10:02 -0800] "GET /mailman/listinfo/hsdivision HTTP/1.1" 200 6291     64.242.88.10 - - [07/Mar/2004:16:11:58 -0800] "GET /twiki/bin/view/TWiki/WikiSyntax HTTP/1.1" 200 7352     64.242.88.10 - - [07/Mar/2004:16:20:55 -0800] "GET /twiki/bin/view/Main/DCCAndPostFix HTTP/1.1" 200 5253     64.242.88.10 - - [07/Mar/2004:16:23:12 -0800] "GET /twiki/bin/oops/TWiki/AppendixFileSystem?template=oopsmore¶m1=1.12¶m2=1.12 HTTP/1.1" 200 11382     64.242.88.10 - - [07/Mar/2004:16:24:16 -0800] "GET /twiki/bin/view/Main/PeterThoeny HTTP/1.1" 200 4924     64.242.88.10 - - [07/Mar/2004:16:29:16 -0800] "GET /twiki/bin/edit/Main/Header_checks?topicparent=Main.ConfigurationVariables HTTP/1.1" 401 12851     64.242.88.10 - - [07/Mar/2004:16:30:29 -0800] "GET /twiki/bin/attach/Main/OfficeLocations HTTP/1.1" 401 12851     64.242.88.10 - - [07/Mar/2004:16:31:48 -0800] "GET /twiki/bin/view/TWiki/WebTopicEditTemplate HTTP/1.1" 200 3732     64.242.88.10 - - [07/Mar/2004:16:32:50 -0800] "GET /twiki/bin/view/Main/WebChanges HTTP/1.1" 200 40520     64.242.88.10 - - [07/Mar/2004:16:33:53 -0800] "GET /twiki/bin/edit/Main/Smtpd_etrn_restrictions?topicparent=Main.ConfigurationVariables HTTP/1.1" 401 12851     64.242.88.10 - - [07/Mar/2004:16:35:19 -0800] "GET /mailman/listinfo/business HTTP/1.1" 200 6379      Need to grep the pattern "AppendixFileSystem"               grep -i "AppendixFileSystem*" log filename      Output               64.242.88.10 - - [07/Mar/2004:16:23:12 -0800] "GET /twiki/bin/oops/TWiki/AppendixFileSystem?template=oopsmore¶m1=1.12¶m2=1.12 HTTP/1.1" 200 11382      I want get the 4 th line above the matched line i.e Desired Output               64.242.88.10 - - [07/Mar/2004:16:06:51 -0800] "GET /twiki/bin/rdiff/TWiki/NewUserTemplate?rev1=1.3&rev2=1.2 HTTP/1.1" 200 4523      And the 2nd after the matched line i.e Desired Output               64.242.88.10 - - [07/Mar/2004:16:29:16 -0800] "GET /twiki/bin/edit/Main/Header_checks?topicparent=Main.ConfigurationVariables HTTP/1.1" 401 12851      PLease help


title: Trouble getting regex to work with find

text: I'm having a lot of trouble getting `find` to work with regex flags. Im using `egrep` on its own to find a date pattern in a file, like this:               egrep '[0-9]{4}-[0-9]{2}-[0-9]{2}'       which will return dates formatted as CCYY-MM-DD just fine. I'm trying to use this same pattern with `find`. I have tried:               find . -regextype egrep -regex "[0-9]{4}-[0-9]{2}-[0-9]{2}"     find . -type f -regex "[0-9]{4}-[0-9]{2}-[0-9]{2}"      Tried to backslash the curly brackets...               find . -type f -regextype egrep -regex "[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}"      All of these don't seem to return anything. I get no error messages, no output... I have even tried to redirect the ouput to a file, but nothing... It's hard to find good resources on using `find` with regex. If any one could help, I would greatly appreciate it. I'm not opposed to any of the types of regex `find` supports though I like `egrep` because of the `-o` flag for returning only the matches, NOT the entire line. But really I just need `find` to find all files in a directory that have a match of pattern above in the file name.


title: Piping Sox and FFMPEG together

text: I'm processing a variety of audio files in a bunch of different formats and I'd like to unify their format and configuration using FFMPEG and SoX. There are two steps to my process:   1. Convert the file, whatever it may originally be, to a PCM 16-bit little-endian WAV file:   `ffmpeg -i input.wav -c:a pcm_s16le output.wav`   2. Process the file in Sox to make it conform to the sample rate and channel count that we need:   `sox input.wav output.flac channels 2 rate 44.1k` I'd ideally like to pipe these two commands together so as to avoid creating an unnecessary file. I'm having a lot of trouble actually getting the format to work properly, though. SoX complains that it needs to explicitly know the format of the incoming audio, which is something that I don't even know at execution time. I know the format of the PCM audio, but I'm not sure the channel count nor of the sample rate of the incoming audio. Is there a way to pipe these two commands together, or better, to only have to use one tool for the job? The reason I've used two tools rather than just trying to do it with one: ### FFMPEG   * Not sure if there's a way to safely convert a mono audio stream to a stereo audio stream by duplicating the channels. (SoX does this natively.)   * Not sure how to change sample rate. (SoX does this natively.)   * Not sure how to output to FLAC using the best compression rate.  ### SoX   * Not able to do audio format detection as well as FFMPEG does. If I have a file without an extension, SoX asks me to manually specify the format, which doesn't work at all for my application.


title: How to remove a USB drive without worrying if its been unmounted?

text: Sometimes I unplug my usb drive only to find out files were not written to it. I suppose the only way to ensure files are written to it is to right click on the USB drive on the desktop and then select "un-mount", but sometimes I forget. What is the best way to ensure files are written to the USB drive instantly? This way I can remove the USB drive as soon as I notice the LED light on the USB drive stopped blinking. OS: CentOS 6


title: Getting and setting screen size for Xorg

text: I would like to run a command like `get-screen-resolution` during a **X session** to get a '800x480' output. ( or whatever the actual screen size is ). Is there something available for this? Currently I take a _screenshot_ and measure the resulting `*.jpg`'s width & height attributes. Also, how do I **set the screensize** during a X session from the command- line?


title: Can you recommend a GUI text editor for a developer (features needed are inside)?

text: F-cked up with all IDE bloatware (for my purposes they are all overcomplicated and inconvenient), I came to an idea, that I'd probably better use a good editor than an IDE. I DON'T need projects, I don't need build management (I'd prefer to build manually, from command line, and write build scripts myself), I don't need perspectives, workspaces, modules, etc. I need (in importance descending order)   1. Nice GUI. (I am sorry to say this to be the first priority, but that's my taste, without it I feel uncomfortable and go unproductive). Please don't offer VIM (with no GUI) or [X]EMACS (with ugly GUI). No weird key scheme (like VIM has), no command modes (or optionally enablable and unimportant in the editor's usage), etc.   2. **Manually-definable foldable regions (like in c#)** (defined by special macroses, escaped by (any language's) comments) **in any language**. This is the most important requirement. If I find an editor meeting this point alongside with 1st one, I'd be happy already. In Windows, as far as I can remember, UltraEdit used to have this facility, but I am not sure (update: now I've installed UEx anc couldn't find such a feature there).   3. Simple, but swiss-clockwork-reliable refactoring, better to say sort of "multifile search-and-replace on steroids".   4. Syntax highlighting.   5. Corresponding open/close parentheses/braces/tags/quotes/etc. pairs highlighting.   6. Autocompletion. Probably simple, dictionary-based. Would be very nice if it could wok as an IDE, showing me class members after I put a dot and press Ctrl+Space, but I can afford lack of this feature if 1-4 features are there.   7. Code snippets / macrosses. **Explanation of point 2:** Those who are familiar with C# possibly know of #region/#endregion directives. I can place them anywhere in code, and the editor will offer an option to fold the block delimited into one line (with a title specified as the starting directive argument) and unfold it on demand (much as most of modern editors can do with language blocks, like function bodies for example, but I'd like to be able to do this with any particular block of code I want). IMHO it could be pretty easily implemented (in editors, that have already implemented code folding for language blocks) for ANY language, no language syntax analysis required. A region defining directives syntax can be provided by an editor, escaping those directives by a language's comment line syntax. For example, NetBeans IDE has this functionality for Java, it is well described here: http://wiki.netbeans.org/FaqCustomCodeFolds But in NetBeans this, unfortunately, works only with Java (and, maybe, some other) language, and doesn't work, for example, with Scala. I mostly code Scala, but, as I wrote, I'd wish, and can't see any reasons why couldn't be it made available as a language-agnostic feature - if the line contains "(whatever) #region" - this is a foldable region start, if there's something after "#region" in the line - this is the region title, if the line contains "(whatever) #endregion" - this is the region finish. Just find a start and a corresponding finish and fold it. User can replace "(whatever)" with any particular's language comment sign. **UPDATE: answer found** (just to summarize and share an answer in a more informative form, I'll include it here): There vere many good suggestions (I am going to experiment with SciTE and try learning EMACS and VIM when I'll have a proper mood). Googling myself I've also find an interesting E-TextEditor (an open-source wxWidgets-based (means cross-platform, there were successful efforts to build and install it on Fedora 10 and on Ubuntu 9.04) Mac's TextMate clone for Windows). But the answer for now, found thanks to fschmitt's suggestion, is Kate. To get my point #2 (above, in the question) for Scala (easily adaptable for any other language the way I've explained), I had only to add 2 lines in "/usr/share/kde4/apps/katepart/syntax/scala.xml":                    <RegExpr attribute="Decimal" context="#stay" String="//#region.*$" beginRegion="Region1"/>     <RegExpr attribute="Decimal" context="#stay" String="//#endregion.*$" endRegion="Region1"/>           I've taken the idea from C# syntax definition file, cs.xml. The only trick is that for this comment-aided hack to work these lines are to be placed before lines which define the language's comments. And a pleasant surprise there: Kate does not depend on tons of KDE libraries as I used to suppose - in classic (Gnome) Ubuntu 10.10 "apt-get install kate" has only downloaded one humble (less than a MiB) package.


title: Cron automated bash script to run run 1 bash script then another, plus integrity check

text: So I have a custom in-house app developed by a 3rd party. When the app is running, I can verify it is running with the "screen -ls" command. As long as screens are running for rails and freeswitch then I know the app is properly up and running. We have a specific bash script to stop the services related to the app, and 2nd script to start the services related to the app. **My question is how can I combine both these scripts to restart the app into 1 script that works like the following:**   1. Run script 1 - stop app   2. Wait until app has shutdown (screen processes are no longer running)   3. Run script 2 - start app   4. Wait until app has started   5. Check "screen" sockets to make sure a rails and freeswitch process is running. If not, then go back to step 1 and repeat.  Right now to restart the app:   1. I manually run the stop script via /tools/stop_app.sh      * This then outputs to the terminal to show services shutting down.      * Once complete, it returns me back to the terminal prompt.    2. Now I manually run the start script via /tools/start_app.sh      * This doesn't output anything, but once it has completed it returns me to the terminal prompt.    3. I then run screen -ls to verify all services for the app is running. (sometimes a service such as freeswitch doesn't start.)   4. If not, then I re-run the stop/start scripts.  It might be asked why don't I just put everything into one script. Well this custom app is very finicky and due to limited support from the developers, we need to make sure to utilize the exact tools they provided. Hence 1 script that calls the 2 separate scripts provided by the developers. By integrity check I am referring to checking the "screen" processes to make sure that the ruby and freeswitch screens are running. For the cron, I would like to perform this app restart automatically on a weekly basis. Note, when I say bash script I am not sure if it correct to say bash or shell. I have no script preference as long as it is a language that usually comes installed by default in Ubuntu Linux.


title: Screen flickering (only on desktop) with Fedora 20, but why?

text: I'm using Fedora 20 and since I returned from the weekend, my screen flickers very fast. This occurs only on the desktop (excluding the menubar, with the fedora-menu and the clock, etc.) and the explorer, programs are not affected of this. Selecting anything on the desktop is not possible, probably it's cleaning or refreshing all the time. I can't think of applying any updates on last use, but today I installed all of the fedora updates and brought the BIOS to the newest version, which didn't solve the problem. Has anyone an idea where this comes from? (If further information is needed, please let me know.) ## Update Problem is "solved" if I turn the desktop background in to a straight color instead of a picture, then all misbehavior are disappeared. But this is just a workaround


title: not getting desired output with cut command?

text: [root@localhost ~]#  ps aux | grep ata     root        19  0.0  0.0      0     0 ?        S    07:52   0:00 [ata/0]     root        20  0.0  0.0      0     0 ?        S    07:52   0:00 [ata_aux]     root      1655  0.0  2.6  22144 13556 tty1     Ss+  07:53   0:18 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-t1gMCU/database -nolisten tcp vt1     root      3180  0.0  0.1   4312   728 pts/0    S+   14:09   0:00 grep ata     [root@localhost ~]#  ps aux | grep ata | cut -d" " -f 2          [root@localhost ~]#      I would expect second column in the output; but not getting anything. Any ideas ?


title: Live USB linux distro to backup my Windows machine

text: I just bought a new laptop. It has an SSD. I'm very paranoid about SSDs, and I keep backing up everything. First of all: I am using TrueCrypt to crypt my system partition, which is the entire SSD. My laptop is running windows7. I would like to do what follows: create a USB hard drive with two encrypted partitions: Partition1 hosts a live linux distro, Partition2 is just a NTFS partition where I can save the backup of my laptop. When the live linux boots, it should ask me for the password to boot the live linux system (which is encrypted). When the live linux system is ready, it should mount the crypted partition of my laptop, unlock it using a password stored as plain text on the live linux system, mount the Partition2 using a password stored as plain text on the live linux system, create an image of the system partition of my laptop on Partition2 of the USB hard drive. The passwords are stored as plain text since the live system partition is encrypted too. What I would like to know is:   1. Would a headless minimal live Debian system be fine to achieve this?   2. Is TrueCrypt the right software to install on the live linux machine?   3. How can I create an IMAGE of the entire SSD of my laptop so that if it stops working I can simply buy a new SSD, copy the whole data of the old ssd to the new ssd?   4. To give you a better idea of what I would like to achieve: this would be like virtual machines "snapshots". If the VM messes up, or the VM's files become corrupt, you can simply replace the VM's files with the latest working snapshot you have. If my SSD breaks, I would like to simply buy a new one, restore all the data on it, and have my system working back again. Any advice, suggestion or opinion is very welcome.


title: GRUB reported “error: file not found.” when booting CentOS 5

text: I installed CentOS 5.3 by using a 4GB USB disk on an old PC that I used run a Debian on it. After a series of housework on the fresh system, I reboot the system using:               sudo shutdown -r now      After that, the machine did not reboot successfully instead of directly powering down. When I started the machine, after the BIOS, then GRUB.... But the GRUB gave this:               GRUB loading.     Welcome to GRUB!          error: file not found.     Entering rescue mode...     grub rescue>      Then I googled around and did find some information on this. As the post said, I did the following in an attempt to wake up the machine. First, I entered:               ls      then I received:               (hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)      and the last two partitions seems to be the ones in the USB disk. Second, I entered:               ls (hd0)/      and received:               error: unknown filesystem.      I `ls`-ed the rest and get:               ls (hd0,msdos3)/     ./ ../ lost+found/ home/ boot/ sys/ proc/ var/ tmp/ dev/ etc/ root/ selinux/ usr/ bin/ lib/ media/ mnt/ opt/ sbin/ srv/ misc/      and               ls (hd0,msdos1)/     ./ ../ lost+found/ grub/ memtest86+-1.65 message initrd-2.6.18-128.el5.img System.map-2.6.18.el5 config-2.6.18-128.el5 symvers-2.6.18-128.el5.gz vmlinuz-2.6.18-128.el5      Then I followed the advice exactly on the very post to do this:               set prefix=(hd0,msdos1)/grub      and               set root=(hd0,msdos3)      After the settings, I entered:               insmod normal      and got:               error: file not found.      Could any one help me? I'm stucked....


title: Delete files in .7z package

text: I am using FileRoller to manage the *`.7z` and using Ubuntu 12.10. When the *`.7z` file is encrypted, I can add new files to the package, I can modify text files, can I delete files too?


title: Problem with recursive download using wget

text: I am trying to learn how to use recursive download with `wget` from the wget info page. For example, let us try to download all the images of xkcd. A list of all the pages is present in the xkcd archive. All pages have a single png file in them. The png file is present in a different host, imgs.xkcd.com. I tried with this command:               wget -r -HD imgs.xkcd.com -l 2 -A.png http://www.xkcd.com/archive/ --random-wait      The result:                xkcd $ tree     .          0 directories, 0 files           xkcd $ wget -r -HD imgs.xkcd.com -l 2 -A.png http://www.xkcd.com/archive/ --random-wait     --2014-01-10 18:49:55--  http://www.xkcd.com/archive/     Resolving www.xkcd.com (www.xkcd.com)... 107.6.106.82     Connecting to www.xkcd.com (www.xkcd.com)|107.6.106.82|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 83226 (81K) [text/html]     Saving to: `www.xkcd.com/archive/index.html'          100%[=============================================================================================================>] 83,226      68.3K/s   in 1.2s              2014-01-10 18:49:57 (68.3 KB/s) - `www.xkcd.com/archive/index.html' saved [83226/83226]          Loading robots.txt; please ignore errors.     --2014-01-10 18:49:57--  http://imgs.xkcd.com/robots.txt     Resolving imgs.xkcd.com (imgs.xkcd.com)... 107.6.106.82     Reusing existing connection to www.xkcd.com:80.     HTTP request sent, awaiting response... 404 Not Found     2014-01-10 18:49:58 ERROR 404: Not Found.          Removing www.xkcd.com/archive/index.html since it should be rejected.          --2014-01-10 18:49:58--  http://imgs.xkcd.com/static/terrible_small_logo.png     Reusing existing connection to www.xkcd.com:80.     HTTP request sent, awaiting response... 200 OK     Length: 11001 (11K) [image/png]     Saving to: `imgs.xkcd.com/static/terrible_small_logo.png'          100%[=============================================================================================================>] 11,001      --.-K/s   in 0.05s             2014-01-10 18:49:58 (229 KB/s) - `imgs.xkcd.com/static/terrible_small_logo.png' saved [11001/11001]          FINISHED --2014-01-10 18:49:58--     Total wall clock time: 2.9s     Downloaded: 2 files, 92K in 1.2s (74.4 KB/s)           xkcd $ tree     .     |-- imgs.xkcd.com     |   `-- static     |       `-- terrible_small_logo.png     `-- www.xkcd.com         `-- archive          4 directories, 1 file           xkcd $      This is obviously not what I want. It seems that wget rejected `www.xkcd.com/archive/index.html` _before_ reading it and checking for links. Even if `.html` is added to the accept list (as suggested in an answer), it doesn't download the images. What is the mistake in the command?


title: Problem Installing UBUNTU 14.04 (AND Mint 16, which is based on UBUNTU 13.10) as dual boot on RAID 0 with Windows 8.1

text: Ok, I know that there is Dual-Boot Ubuntu 14.04 and Windows 7 on FakeRAID Installation error - question marks "????..." and that that post has some answers for me, but I don't know if it exactly matches what I need help with. I am running on a RAID 0, not sure if it's a Fake RAID or not. I posted my question on the LinuxMint forum as well. And since Mint is based on Ubuntu and I was trying to install either or (Ubuntu 14.04 or LinuxMint 16), I figured I'd ask here as well. Here is what I posted on LinuxMint Forums: But I have my own questions, I can provide the requested information upon request. Just to start I am running an Alienware (Dell) M17xR3. It came with Windows 7. Have a RAID 0 array, I think it's a "Fake" RAID, but I know I also have a hardware RAID controller. _Previously partitioned and had Ubuntu 13.04 installed, had no issue installing it, creating the partition and installing GRUB._ I have since upgraded to Windows 8.1 Pro, lost GRUB during the installation, but from the HDD partition size of Windows, I knew my Linux partition was still there. Should have just reinstalled GRUB, but instead tried reformatting the Linux partition and doing a clean install of **Ubuntu 14.04 x64** and also tried Mint 16 x64 Cinnamon. Exact same installer, and exact same error message, happened after the custom partition section, got just ??????. I don't know if Windows 8 created an EFI/UEFI install, but I'm pretty sure Windows 7 didn't have it. Though I'm not 100% positive. If someone can help me, I would greatly appreciate it. This is the link to the thread I posted it to: http://forums.linuxmint.com/viewtopic.php?f=46&t=164950&e=0 Per that thread it was asked for some terminal outputs to be posted so here they are: "sudo parted -l" output:               Error: Can't have a partition outside the disk!                                     Error: /dev/sdb: unrecognised disk label                                            Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/isw_dcigjjhddj_M17X_RAID0p6: 212GB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0.00B  212GB  212GB  ext4               Error: /dev/mapper/isw_dcigjjhddj_M17X_RAID0p5: unrecognised disk label             Error: Can't have a partition outside the disk!                                     Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/isw_dcigjjhddj_M17X_RAID0p3: 758GB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0.00B  758GB  758GB  ntfs               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/isw_dcigjjhddj_M17X_RAID0p2: 14.2GB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End     Size    File system  Flags      1      0.00B  14.2GB  14.2GB  ntfs               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/isw_dcigjjhddj_M17X_RAID0p1: 41.1MB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End     Size    File system  Flags      1      0.00B  41.1MB  41.1MB  fat16               Model: Linux device-mapper (striped) (dm)     Disk /dev/mapper/isw_dcigjjhddj_M17X_RAID0: 1000GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type      File system  Flags      1      32.3kB  41.1MB  41.1MB  primary   fat16        diag      2      41.9MB  14.2GB  14.2GB  primary   ntfs         boot      3      14.2GB  773GB   758GB   primary   ntfs      4      773GB   1000GB  228GB   extended               lba      6      773GB   984GB   212GB   logical   ext4      5      984GB   1000GB  15.7GB  logical               Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0     has been opened read-only.     Model: PLDS DVD+-RW DL-8A4SH (scsi)     Disk /dev/sr0: 1252MB     Sector size (logical/physical): 2048B/2048B     Partition Table: mac          Number  Start  End     Size    File system  Name   Flags      1      8192B  24.6kB  16.4kB               Apple      2      171MB  180MB   9306kB               EFI      "sudo blkid" output:               /dev/loop0: TYPE="squashfs"      /dev/sda: TYPE="isw_raid_member"      /dev/sr0: LABEL="Linux Mint 16 Cinnamon 64-bit" TYPE="iso9660"      /dev/sdb: TYPE="isw_raid_member"      /dev/mapper/isw_dcigjjhddj_M17X_RAID0p1: SEC_TYPE="msdos" LABEL="DellUtility"  UUID="5450-4444" TYPE="vfat"      /dev/mapper/isw_dcigjjhddj_M17X_RAID0p2: LABEL="RECOVERY" UUID="3C9A4EA39A4E5A12"     TYPE="ntfs"      /dev/mapper/isw_dcigjjhddj_M17X_RAID0p3: UUID="C614C2E714C2D997" TYPE="ntfs"      /dev/mapper/isw_dcigjjhddj_M17X_RAID0p6: UUID="e39970ed-c278-4135-a8fb-3806cd62835b" TYPE="ext4"       "lsblk" output:               NAME                                   MAJ:MIN RM   SIZE RO TYPE   MOUNTPOINT     sda                                      8:0    0 465.8G  0 disk        └─isw_dcigjjhddj_M17X_RAID0 (dm-0)     252:0    0 931.5G  0 dmraid        ├─isw_dcigjjhddj_M17X_RAID0p1 (dm-1) 252:1    0  39.2M  0 part          ├─isw_dcigjjhddj_M17X_RAID0p2 (dm-2) 252:2    0  13.2G  0 part          ├─isw_dcigjjhddj_M17X_RAID0p3 (dm-3) 252:3    0 706.4G  0 part          ├─isw_dcigjjhddj_M17X_RAID0p4 (dm-4) 252:4    0     1K  0 part          ├─isw_dcigjjhddj_M17X_RAID0p5 (dm-5) 252:5    0  14.6G  0 part          └─isw_dcigjjhddj_M17X_RAID0p6 (dm-6) 252:6    0 197.3G  0 part        sdb                                      8:16   0 465.8G  0 disk        └─isw_dcigjjhddj_M17X_RAID0 (dm-0)     252:0    0 931.5G  0 dmraid        ├─isw_dcigjjhddj_M17X_RAID0p1 (dm-1) 252:1    0  39.2M  0 part          ├─isw_dcigjjhddj_M17X_RAID0p2 (dm-2) 252:2    0  13.2G  0 part          ├─isw_dcigjjhddj_M17X_RAID0p3 (dm-3) 252:3    0 706.4G  0 part          ├─isw_dcigjjhddj_M17X_RAID0p4 (dm-4) 252:4    0     1K  0 part          ├─isw_dcigjjhddj_M17X_RAID0p5 (dm-5) 252:5    0  14.6G  0 part          └─isw_dcigjjhddj_M17X_RAID0p6 (dm-6) 252:6    0 197.3G  0 part        sr0                                     11:0    1   1.2G  0 rom    /cdrom     loop0                                    7:0    0   1.1G  1 loop   /rofs      "inxi -b" output:               System:    Host: mint Kernel: 3.11.0-12-generic x86_64 (64 bit) Desktop: Gnome Distro: Linux Mint 16 Petra     Machine:   Mobo: Alienware model: M17xR3 version: A08 Bios: Alienware version: A08 date: 07/29/2011     CPU:       Quad core Intel Core i7-2670QM CPU (-HT-MCP-) clocked at 2192.734 MHz      Graphics:  Card-1: Intel 2nd Generation Core Processor Family Integrated Graphics Controller                 Card-2: NVIDIA GF116M [GeForce GT 560M]                 X.Org: 1.14.3 drivers: (unloaded: fbdev,vesa) FAILED: nouveau,intel Resolution: 1920x1080@60.0hz                 GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 9.2.1     Network:   Card-1: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet driver: atl1c                 Card-2: Qualcomm Atheros AR93xx Wireless Network Adapter driver: ath9k      Drives:    HDD Total Size: 1000.2GB (-)     Info:      Processes: 211 Uptime: 20 min Memory: 524.9/7932.9MB Client: Shell inxi: 1.8.4       I hope you all can help.


title: Changing KDE's mouse theme and buttons settings from a shell script

text: I'm trying left handed mousing, and I want to be able to easily switch between right handed mode and left handed mode. There is a utility for Windows called SwapMouseButtons that allows to bind a key for that switch - both swapping the buttons and changing the pointer's direction. I would like to do something similar for KDE in a shell script. Swapping the buttons is easy with `xinput`, but I'm having a hard time changing the mouse theme to a left handed theme from the command line. I also prefer to find a KDE solution for the button swapping, as changes made via `xinput` are session-bound and KDE settings are saved. I wouldn't like to have a left handed theme with right handed buttons after a reset... The problem is, I can't find much documentation on KDE's command line utilities. I found this post that suggests using `kapplymousetheme`, which seems promising, but I can't figure out how to use it(no man page, no `\--help` flag...) I've also found that `kcmshell4 cursortheme` opens the mouse theme dialog, and that `kcmshell4` accepts the `\--args` flag for sending arguments to the module, but I couldn't find nor figure out what arguments I need to send to just change the mouse theme without opening the dialog(if that's even supported). I should also note that I want these changes to take effect immediately. Changing a configuration file and having to restart the system(or even just X or KDM) won't do, though if I can reload that configuration file(with a command line utility, of course) so that the changes will take effect immediately that will be fine. Thanks in advance!


title: Debian boots on one Mac but not another

text: I'm trying to boot Debian from a USB Hard Drive (using rEFIt as a boot loader), and am successful on two newer-model MacBook Pros and a Hackintosh (no surprise there), but I'm not successful on several other Mac computers at my university. rEFIt loads just fine and sees my Debian partition, but when I try to boot it, it gives the error: > no bootable device - insert boot disk and press any key I've read that this can be caused by several things, but I believe the fact that I can boot on some Macs eliminates most of these possibilities. I'm not terribly well-versed in bootloaders and how they interface with the firmware, which seems to be one of the last remaining solutions, so I would appreciate some troubleshooting help.


title: Bootloader error installing Fedora

text: I need a dual boot in my computer, Windows 7 and Fedora 17. I first installed Windows 7 and created the partition scheme during Windows install: - Partition 1: is a small partition automatically created by Windows when I create a partition (around 100MB) - Partition 2: Partition where I will install Windows 7. - Partition 3: Free space where I will install Fedora. Everything works fine with Windows. Then I install Fedora, I create another partition for boot (around 500MB) and another logical partitions for swap and root (actually Fedora creates those partitions in the free space). After all the installation the system shows a warning message: `There was an error installing the bootloader. The system may not be bootable`. In fact, the system is not bootable. After the installation the computer always boots into Windows. The weird thing is that I installed both systems several days ago and I had do reinstall both OSs, but not sure what is happening now. Note: I also tried installing Grub2 with the live cd, but I have several problems with that, so may me is easier to solve the issue of the bootloader.


title: Rotate pdf file less than 90 degree?

text: How can I rotate a PDF file less than 90 degree under Ubuntu? Can I do that interactively?


title: Does swap need to be on a contiguous LVM logical volume

text: I am setting up a machine to run a number of virtual machines. I am using a single HDD with a boot partition and an LVM partition. I read on the Arch wiki that logcial volumes which will be used for swap should be setup with `-C y` > To create a contiguous partition, which means that your swap space does not > get partitioned over one or more disks nor over non-contiguous physical > extents. How important is this? If i have a dozen VMs each with a contiguous logical volume for swap and a non-contiguous logical volume for /, how will having so many contiguous logical volumes affect my ability to resize logical volumes (either contiguous or non-contiguous)?


title: why there is random behaviuor for a background job?

text: going through advanced bash scripting guide example 3.3 running a loop in background, i found this :               #!/bin/bash     # background-loop.sh     for i in 1 2 3 4 5 6 7 8 9 10 # First loop.     do     echo -n "$i "     done & # Run this loop in background.     # Will sometimes execute after second loop.     echo # This 'echo' sometimes will not display.     for i in 11 12 13 14 15 16 17 18 19 20 # Second loop.     do     echo -n "$i "     done     echo # This 'echo' sometimes will not display.     # ======================================================     # The expected output from the script:     # 1 2 3 4 5 6 7 8 9 10     # 11 12 13 14 15 16 17 18 19 20     # Sometimes, though, you get:     # 11 12 13 14 15 16 17 18 19 20     # 1 2 3 4 5 6 7 8 9 10 bozo $     # (The second 'echo' doesn't execute. Why?)     # Occasionally also:     # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     # (The first 'echo' doesn't execute. Why?)     # Very rarely something like:     # 11 12 13 1 2 3 4 5 6 7 8 9 10 14 15 16 17 18 19 20     # The foreground loop preempts the background one.     exit 0          # Nasimuddin Ansari suggests adding sleep 1     #+ after the echo -n "$i" in lines 6 and 14,     #+ for some real fun.      i dont get this, does anybody understands this.


title: How many ways can we install applications in Linux?

text: Can anyone explain me in how many ways can we install the applications in Linux os. And which is the better way to install ?


title: Chromium doesn't display Flash in Debian Wheezy

text: Since Google phased out the NPAPI, it cannot use `flashplugin-nonfree`. I understand it needs to use `pepperflashplugin-nonfree`, but it's not available in the repos. Is it because of my `/etc/apt/sources.list`? It looks like that now:               deb http://ftp.bg.debian.org/debian/ wheezy main contrib non-free     deb-src http://ftp.bg.debian.org/debian/ wheezy main contrib non-free     deb http://security.debian.org/ wheezy/updates main     deb-src http://security.debian.org/ wheezy/updates main     deb http://ftp.bg.debian.org/debian/ wheezy-updates main     deb-src http://ftp.bg.debian.org/debian/ wheezy-updates main      Any changes I should make there? Or how do I install pepperflashplugin- nonfree?


title: Create new file type association

text: Let's assume I have a program X that uses files with the extension .xez. How can I make X the default application for all files with the extension .xez? My first idea was `xdg-mime default X.desktop application/.xez`. Yet this does not work. Files with the extension .xez are still associated with Gnome Archive Manager since files with .xez represent a sort of .zip archive.


title: Use SED or AWK to move string to new column and row

text: I have a .csv file that is tab delimited and I need to move the header row information to a "new" column at the beginning and a specified numbers of rows down. Please forgive any formatting errors for this post as it is my first here. I would like to use standard tools that I currently use such as SED or AWK but if another tool/method is more appropriate I would welcome the suggestion. TIA PS. The header changes per file, that's why I need to copy it instead of just placing the string "CAT" in the appropriate row and column.                                           CAT         DOG     DOG     DOG     DOG     DOG     DOG     DOG         DOG     DOG     DOG     DOG     DOG     DOG     DOG         DOG     DOG     DOG     DOG     DOG     DOG     DOG         DOG     DOG     DOG     DOG     DOG     DOG     DOG      Would become:                                           CAT                 DOG     DOG     DOG     DOG     DOG     DOG     DOG                 DOG     DOG     DOG     DOG     DOG     DOG     DOG         CAT     DOG     DOG     DOG     DOG     DOG     DOG     DOG                 DOG     DOG     DOG     DOG     DOG     DOG     DOG


title: Samba permissions don't apply

text: All groups exist and the users are in their belonging defined group.               [homes]     comment = Home Directories     admin users = @admin     browseable = no     read only = no     create mask = 0750      (Users can't write in their homes. Why?)               [pi]     comment = pi Home Folder     valid users = @admin     write list = @admin     path = /home/pi     read only = no     browseable = yes      (Users from admin group have no write rights. Why?)               [personal]     comment = files     valid users = danny     path = /home/danny/personal     read only = no     browseable = no      (User danny has no write access.)               [downloads]     comment = Download Folder     valid users = @users     write list = @admin     path = /home/danny/downloads     read only = no     guest ok = no      (Admins should have write access but they haven't got it.) Could you help me analyze the problem here?