title: How to record vfl webcam with ffmpeg? Cannot find a proper format for codec 'none'

text: Goal is to capture video from my old usb webcam (device 0733:0430). Trying to save video gives this error. (I've tried both ffmpeg and avconv.) Command `ffmpeg -f v4l2 -i /dev/video2 -s 160x120 tmp.mkv`               [video4linux2,v4l2 @ 0x815280] Time per frame unknown     [video4linux2,v4l2 @ 0x815280] Cannot find a proper format for codec 'none' (id 0), pixel format 'none' (id -1)     Assertion *codec_id != AV_CODEC_ID_NONE failed at /build/buildd/ffmpeg-2.3/libavdevice/v4l2.c:802      I know it can work on Linux, because I had it running a few years ago. How to get it to work now? * * * **Below is information about the device.** Device dmesg output               [53008.270283] usb 2-1.2: new full-speed USB device number 4 using ehci-pci     [53008.363405] usb 2-1.2: New USB device found, idVendor=0733, idProduct=0430     [53008.363416] usb 2-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0     [53008.779745] gspca_main: v2.14.0 registered     [53008.809496] gspca_main: spca505-2.14.0 probing 0733:0430     [53008.812508] usbcore: registered new interface driver spca505      ffmpeg -list_formats 1 -f v4l2 -i /dev/video2               [video4linux2,v4l2 @ 0xbed5e0] Raw       : Unsupported :                 S505 : 160x120 176x144 320x240 352x288      v4l-info /dev/video2               ### v4l2 device info [/dev/video2] ###     general info         VIDIOC_QUERYCAP             driver                  : "spca505"             card                    : "USB Camera (0733:0430)"             bus_info                : "usb-0000:00:1d.0-1.2"             version                 : 3.13.11             capabilities            : 0x85000001 [VIDEO_CAPTURE,READWRITE,STREAMING,(null)]          standards          inputs         VIDIOC_ENUMINPUT(0)             index                   : 0             name                    : "spca505"             type                    : CAMERA             audioset                : 0             tuner                   : 0             std                     : 0x0 []             status                  : 0x0 []          video capture         VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)             index                   : 0             type                    : VIDEO_CAPTURE             flags                   : 0             description             : "S505"             pixelformat             : 0x35303553 [S505]         VIDIOC_G_FMT(VIDEO_CAPTURE)             type                    : VIDEO_CAPTURE             fmt.pix.width           : 160             fmt.pix.height          : 120             fmt.pix.pixelformat     : 0x35303553 [S505]             fmt.pix.field           : NONE             fmt.pix.bytesperline    : 160             fmt.pix.sizeimage       : 28800             fmt.pix.colorspace      : SRGB             fmt.pix.priv            : 0          controls         VIDIOC_QUERYCTRL(BASE+0)             id                      : 9963776             type                    : INTEGER             name                    : "Brightness"             minimum                 : 0             maximum                 : 255             step                    : 1             default_value           : 127             flags                   : 32


title: Mounting /dev/dvd /media on VirtualBox

text: I have installed Scientific Linux on VirtualBox and I am trying to follow some exercises on a book I picked up. The first thing I need to do is:               mount /dev/dvd /media      But when I do that, I get               mount: you must specify the filesystem type      What I would like to do is mount the virtual DVD where I see that the DVD in the Options of VirtualBox has all the necessary files I need, but it won't let me mount. Can anyone tell me if something has been mis-configured or where I can check to see if it has been?


title: Linux hosts.deny settings are not applied

text: I want to make a bunch of websites unaccessible on my computer. My `hosts.allow` file:               sendmail: all     # /etc/hosts.allow: list of hosts that are allowed to access the system.     #                   See the manual pages hosts_access(5) and hosts_options(5).     #     # Example:    ALL: LOCAL @some_netgroup     #             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu     #     # If you're going to protect the portmapper use the name "rpcbind" for the     # daemon name. See rpcbind(8) and rpc.mountd(8) for further information.      My `hosts.deny` file:               # /etc/hosts.deny: list of hosts that are allowed to access the system.     #                  See the manual pages hosts_access(5) and hosts_options(5).     #     # Example:    ALL: some.host.name, .some.domain     #             ALL EXCEPT in.fingerd: other.host.name, .other.domain     #     # If you're going to protect the portmapper use the name "rpcbind" for the     # daemon name. See rpcbind(8) and rpc.mountd(8) for further information.     #     # The PARANOID wildcard matches any host whose name does not match its     # address.     #     # You may wish to enable this to ensure any programs that don't     # validate looked up hostnames still leave understandable logs. In past     # versions of Debian this has been the default.     # ALL: PARANOID          ALL: .vk.com     ALL: .ria.ru     ALL: facebook.com      My `hosts` file:               127.0.0.1   localhost     127.0.0.1:82 testsecond     127.0.1.1   shc     127.0.2.2:81  someth.com     127.0.2.2:83 test          # The following lines are desirable for IPv6 capable hosts     ::1     ip6-localhost ip6-loopback     fe00::0 ip6-localnet     fe00::0 ip6-mcastprefix     fe02::1 ip6-allnodes     fe02::2 ip6-allrouters      I do follow all recommendations about settings hosts* files and I still CAN access them. I must do something really stupid or wrong. For me it looks like they are just ignored.


title: Convert string into date time stamp in gawk or awk

text: I want to convert following string ( **20140805234656** ) into date time stamp ( **2014-08-05 23:46:56** ).I am new to gawk and I don't know the exact syntax,how can I put **-** at every 5,8 and **:** at every 14,17 and put " " at 11 index. Is there any efficient way to achieve this in awk? **EDIT** Please note that I have string as variable in awk.I generated it during some processing of records.


title: LFS System not booting or GRUB cannot access /bood/grub on boot

text: The closest question I could find is this one, however it is still quite a bit different from what I am needing: GRUB fails to install **My specific setup and the steps I followed to produce this** I am attempting to build the Linux From Scratch project, using book version 7.2. I have followed every step up along the way, and performed every test that I could do to make sure that everything was operating correctly after building. The largest change I had to make was the partitioning, I have /dev/sda1 (as /), /dev/sda2 (as /home), /dev/sda3 (as swap), and /dev/sdb1 (as /source for compiling). I am performing the installation on a blank hard drive inside of VirtualBox using a LiveCD as the host OS. So, I have ran into very few problems up until the very end. For compiling the kernel, it is not very specific for what options I need to select, so I selected the default options with one change, I made sure the option in "Device Drivers ---> Generic Driver Options ---> Maintain a devtmpfs filesystem to mount at /dev" was checked. After following the rest of the instructions on setting up GRUB, after the reboot the boot process freezes with the following output visible:               ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     ata3.00: ATA-6: VBOX HARDDISK, 1.0, max UDMA/133     ata3.00: 33554432 sectors, multi 128: LBA48 NCQ (depth 31/32)     ata3.00: configured for UDMA/133     scsi 2:0:0:0: Direct-Access ATA VBOX HARDDISK 1.0 PQ: 0 ANSI: 5     scsi 4:0:0:0: CD-ROM VBOX CD-ROM 1.0 PQ: 0 ANSI: 5     List of all partitions:     No filesystem could mount root, tried:     Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)     Pid: 1, comm: swapper/0 Not tainted 3.5.2 #1     Call Trace:      ? panic      ? mount_block_root      ? xen_write_msr_safe      ? mount_root      ? prepare_namespace      ? kernel_init      ? start_kernel      ? kernel_thread_helper     atkbd serio0: Spurious ACK on isa0060/serio0. Some program might be trying to access hardware directly.      So, when I first received that, I thought that maybe it was something to do with the kernel, maybe I didn't select what I had to select, and after a bit of googling, I found out that I should make sure that "SATA_SIL" is enabled. I also found a website detailing the kernel options that need to be enabled for a kernel running in VirtualBox (http://en.gentoo- wiki.com/wiki/Virtualbox_Guest). I then restored my machine to the saved state right before I compiled the kernel and recompiled it with the options specified on that website, along with SATA_SIL. However, after the long compilation of the kernel, I went along with the book and issued the command `grub-install /dev/sda`. However, this time, rather than installing, GRUB returned the following error:               Path to `/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting.      My first thought was that it had something to do with file permissions (because "is not readable" really sounds like file permissions). So, just to see, I set the /boot folder (recursively) to 777. Still no success. After that, I did some googling, but really returned no meaningful results. So, following along with that, I restored the machine to the version where GRUB was working but wouldn't boot up, used the same configuration and recompiled the kernel there (which, I had to add a new hard drive, /dev/sdc, because there wasn't enough space in /dev/sdb1 to compile the kernel with the new options). After going through the long compilation again, I installed the kernel, rebooted, and ... same error dump as before. **The main question** So, now I am to the point where I think I may need some help, if anyone has any ideas how I may get past this boot error and/or the GRUB installation path error, that would be great! **Extra information** All of my software is the exact version from the LFS version 7.2, a full list may be found here: http://pastebin.com/TiJBhbce Here is a complete list of the structure and setup of all of the drives in the computer: root:~# fdisk -l               Disk /dev/sda: 4294 MB, 4294967296 bytes     255 heads, 63 sectors/track, 522 cylinders, total 8388608 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: 0xeeeb9d91             Device Boot      Start         End      Blocks   Id  System     /dev/sda1            2048     6293503     3145728   83  Linux     /dev/sda2         6293504     6817791      262144   83  Linux     /dev/sda3         6817792     8388607      785408   83  Linux          Disk /dev/sdc: 17.2 GB, 17179869184 bytes     171 heads, 2 sectors/track, 98112 cylinders, total 33554432 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: 0x4c41c1df             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1            2048    33554431    16776192   83  Linux          Disk /dev/sdb: 4294 MB, 4294967296 bytes     43 heads, 32 sectors/track, 6096 cylinders, total 8388608 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: 0xd3de256f             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048     8388607     4193280   83  Linux      And the drive that should start as / upon reboot, here's the contents of /dev/sda1:               drwxr-xr-x 24 root root  4096 Feb 17 20:46 .     drwxr-xr-x  3 root root    60 Feb 17 22:46 ..     drwxr-xr-x  2 root root  4096 Feb 17 13:11 bin     drwxr-xr-x  3 root root  4096 Feb 17 16:00 boot     drwxr-xr-x  2 root root  4096 Feb 17 20:46 build     drwxr-xr-x  2 root root  4096 Feb 16 20:06 dev     drwxr-xr-x 12 root root  4096 Feb 17 15:52 etc     drwxr-xr-x  2 root root  4096 Feb 16 13:11 home     drwxr-xr-x  7 root root  4096 Feb 17 22:11 lib     drwx------  2 root root 16384 Feb 16 13:09 lost+found     drwxr-xr-x  4 root root  4096 Feb 16 20:24 media     drwxr-xr-x  2 root root  4096 Feb 16 20:24 mnt     drwxr-xr-x  2 root root  4096 Feb 16 20:24 opt     drwxr-xr-x  2 root root  4096 Feb 16 20:06 proc     drwxr-x---  3 root root  4096 Feb 17 22:14 root     drwxr-xr-x  3 root root  4096 Feb 17 09:38 run     drwxr-xr-x  2 root root  4096 Feb 17 14:36 sbin     drwxr-xr-x  2 root root  4096 Feb 16 13:11 sources     drwxr-xr-x  2 root root  4096 Feb 16 20:24 srv     drwxr-xr-x  2 root root  4096 Feb 16 20:06 sys     drwxrwxrwt  3 root root 20480 Feb 17 22:12 tmp     drwxr-xr-x 13 root root  4096 Feb 16 18:51 tools     drwxr-xr-x  9 root root  4096 Feb 16 20:24 usr     drwxr-xr-x 11 root root  4096 Feb 16 23:26 var


title: How to remount as read-write a specific mount of device?

text: How to remount as **read-write** a specific mount of device? (one folder) The file is "Read-only file system", rw-r-r, so it not allow to change permissions. I need to replace that file, then change permissions back to read-only. I know command               mount -o rw,remount [destination folder]      I know this method is unstable, and may cause complications (every mount will get changed). So I must be sure that this will remount as read-write only a `specific destination folder`, not every mount of the device. I need do this on running system, not test environment. Embedded linux system. Is that possible? Path to folder: `/etc/foo/bar` I need remount `/bar` folder. EDIT:               mount     rootfs on / type rootfs (rw)     /dev/root on / type squashfs (ro)     proc on /proc type proc (rw)     ramfs on /var type ramfs (rw)     sysfs on /sys type sysfs (rw)     tmpfs on /dev type tmpfs (rw)     devpts on /dev/pts type devpts (rw)     /dev/mtdblock4 on /nvram type jffs2 (rw)      output of cat /proc/mounts               cat /proc/mounts     rootfs / rootfs rw 0 0     /dev/root / squashfs ro 0 0     proc /proc proc rw 0 0     ramfs /var ramfs rw 0 0     sysfs /sys sysfs rw 0 0     tmpfs /dev tmpfs rw 0 0     devpts /dev/pts devpts rw 0 0     /dev/mtdblock4 /nvram jffs2 rw 0 0      remount command               <root@elocal:/etc/foo/bar> ls -la     total 6     drwxr-xr-x    2 root     0               98 Jan 18  2011 .     drwxrwxr-x    7 root     0              105 Feb 10  2011 ..     -rw-r--r--    1 root     0             1052 Jan 18  2011 file1     -rw-r--r--    1 root     0              270 Jan 18  2011 file2     -rw-r--r--    1 root     0             1088 Jan 18  2011 file3     -rw-r--r--    1 root     0              270 Jan 18  2011 file4          mount -o rw,remount /etc/foo/bar     mount: can't find /etc/foo/bar in /proc/mounts


title: Stderr of piped shell scripts isn't always displayed

text: I piped my own shell scripts for some testing and accidentally noticed something strange. Namely, the stderr of those piped processes isn't always displayed on the screen. I simplified the scripts and here's my session with bash:               $ cat file1     echo stdout     echo stderr 1>&2     $ cat file2     echo stdout2     echo stderr2 1>&2     $ cat file3     echo stdout3     echo stderr3 1>&2          $ ./file1 | ./file2 | ./file3     stderr2     stderr     stdout3     stderr3          $ ./file1 | ./file2 | ./file3     stderr     stdout3     stderr3          $ ./file1 | ./file2 | ./file3     stderr2     stdout3     stderr3      I know that the stdout of the first two scripts is lost, since file3 doesn't read anything, but it doesn't matter here. What's happening with the `stderr2` and `stderr` outputs in the 2nd and 3rd case, respectively?


title: How can I run setfacl -m group:group2:rwx /dev/video0 /dev/snd/* on login?

text: Q: How do I grant permissions to /dev/video* and /dev/snd/* to a second user, user2 when logged in interactively as user1? I have written a wrapper for sudo that clones the XAuthority settings, and allows me to run desktop commands as a different user. The working part of it is simply running sudo with the supplied parameters:               sudo -u user2 $somecommand      However, user2 cannot use the sound or video devices, since udev has only granted them to the logged in user user1. It is possible to grant these permissions after the fact with one of these commands:               sudo setfacl -m group:user2:rwx /dev/video0 /dev/snd/*     sudo setfacl -m user:user2:rwx /dev/video0 /dev/snd/*      This code has to be run every session, but I would like these permissions to be granted to both user1 and user2 when user1 starts new display manager session. The application for this is to run somewhat untrusted programs such as browser, chat client, mail agent, and voip and webcam clients as separate users, while still allowing those programs to access the desktop and the video and sound devices. I continually end up running skype chat without sound and video capabilities :(


title: Can't access server after rvm install

text: I messed up my server yesterday, and im not quite sure how to get it straight again. After trying to install SiriProxy by severall guides failing one after the other on the step for rvm and dependencies. I now cant get into my Fedora box anymore. Neither SSH or X seems to load correctly: Trying to access it thru init 3 / x will result in stopping somewhere during load at desktop. It will let me put my credentials as normal, but then it stops with only the desktop background. Trying to ssh as normal into it gives me the following:               kennhard$ ssh root@192.168.0.201     root@192.168.0.201's password:      Last login: Mon Feb 18 05:53:46 2013     -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory          ^C-bash: /default: No such file or directory     ^CConnection to 192.168.0.201 closed.      Resulting in me having to cancel the connection since nothing happens. It seems like my .bash.rc or something are corrupt for both my root user and local "administrator" account. Also tried accessing the server thry one of the ttys CTRL+ALT+F3, but no go. How would i proceed to fix this? If I load up the machine in safemode, what logs should i fetch for troubleshooting etc? The problem started while installing and uninstalling rvm. All my cron jobs and headless installations do still work running under both administrator and root user. Such as Webmin, Sopcast, Deluge etc.


title: Why is it possible to refer to a closed stderr under bash?

text: I'd like to know why bash doesn't display an error message when we refer to a closed stderr. When it comes to other file descriptors, they have to be opened if we want to, for example, duplicate them. Stderr seems to be kinda special in this case:               $ cat file_1     echo Test1 1>&5     $ cat file_2     echo Test2 1>&2          $ ./file_1 5>&-     ./file_1: line 1: 5: Bad file descriptor     $ ./file_1 5>&1     Test1     $ ./file_2 2>&-     $ #NO ERROR and no output!     $ ./file_2     Test2      Why does the shell allow it?


title: Pronunciation for /usr directory

text: How do you pronunce `/usr`? I found in the net that someone reads it "user"... but, for what I know, this directory is not related to the user. The meaning of the acronym is "Unix specific (or system) resources". How can we better read it, making it easy to immediately understand the sense of the scope of such folder?


title: Why do I constantly have to update my apt cache?

text: When I want to install a new package, I'm usually greeted with a response like:               oliver@cloud:~$ sudo apt-get install unison     Reading package lists... Done     Building dependency tree     Reading state information... Done     E: Unable to locate package unison      Already knowing this pattern, I continue:               oliver@cloud:~$ sudo apt-get update     Hit http://downloads-distro.mongodb.org dist Release.gpg     Ign http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen Translation-en     Ign http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen Translation-en_US     Hit http://downloads-distro.mongodb.org dist Release     Ign http://downloads-distro.mongodb.org dist/10gen amd64 Packages     Ign http://downloads-distro.mongodb.org dist/10gen amd64 Packages     Ign http://http.debian.net/debian/ squeeze/contrib Translation-en_US     Ign http://http.debian.net/debian/ squeeze/main Translation-en_US     Ign http://http.debian.net/debian/ squeeze/non-free Translation-en_US     ...          oliver@cloud:~$ sudo apt-get install unison     Reading package lists... Done     Building dependency tree     Reading state information... Done     The following NEW packages will be installed:       unison     0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.     Need to get 693 kB of archives.      If I want to install a new package tomorrow, the server will not know about it until I `update` again. I've only noticed this on Debian servers and I'm not aware of any adjustments that would cause this. I understand the need for the local cache, my problem is that it seems to be reset whenever I want to install something new. I would expect the cache to stay populated for longer periods of time. Usually, when I would want to install something new the next day, `apt-get` will tell me it's unable to locate the package. On this server, `cron-apt` is installed. I must assume it's installed by default. `cron-apt` is set to run nightly at 4:00. It seems to be responsible for my lost cache:               oliver@cloud:/var/lib/apt/lists$ sudo apt-get update     ...     Fetched 12.1 MB in 11s (1,023 kB/s)     Reading package lists... Done     oliver@cloud:/var/lib/apt/lists$ ls /var/lib/apt/lists/ | wc -l     24     oliver@cloud:/var/lib/apt/lists$ sudo /usr/sbin/cron-apt     oliver@cloud:/var/lib/apt/lists$ ls /var/lib/apt/lists/ | wc -l     8      I'm not really sure why this is happening, because, from what I can tell, one of the jobs of `cron-apt` is to actually _invoke_ `apt-get update`:               oliver@cloud:/var/lib/apt/lists$ cat /etc/cron-apt/action.d/0-update     update -o quiet=2


title: Httpd can't access file even after setting httpd_sys_content_t

text: I'm currently learning SELinux. I was following the instructions in SELinux doc of RedHat. I indeed succeded after typing the following commands:               mkdir /mywebsite       //add something to /mywebsite/index.html       semanage fcontext -a -t httpd_sys_content_t "/mywebsite(/.*)?"       restorecon -R -v /mywebsite //everythins worked well by then      But I did something more afterwards:               chcon -R -t httpd_sys_content_t /mywebsite  //I can't access index.html now, as expected          restorecon -R -v /mywebsite //Still can't access index.html!!            semanage fcontext -a -t httpd_sys_content_t "/mywebsite(/.*)?"       restorecon -R -v /mywebsite  //didn't work, either          ls -dZ /mywebsite // unconfined_u:object_r:httpd_sys_content_t:s0      The error message in firefox is:               Forbidden          You don't have permission to access /index.html on this server.       Am I missing something? Or it is a bug? My OS is Fedora 20 with Apache 2.4.7.


title: Why is "wget -r -e robots=off http://ccachicago.org" not acting recursively?

text: I am trying to recursively download `http://ccachicago.org`, and am getting exactly one file, the root `index.html`, downloaded. I've looked at Download recursively with wget and started using the recommended `-e robots=off`, but it still behaves the same. How, with `wget` or some other tool, can I download a copy of the site?


title: Why is my SD card not being recognized?

text: I'm using Lubuntu 11.10 on a VAIO notebook. Here is my `uname` output:               Linux vaio 3.0.0-16-generic-pae #28-Ubuntu SMP Fri Jan 27 19:24:01 UTC 2012 i686 i686 i386 GNU/Linux      I don't know why but today my SD card is not working. When I plug it nothing happens. I tried some hints from here but nothing. I don't have any `sdf` on `/dev` folder. Here is the output of `lspci`:               00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)     00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)     00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)     00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)     02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)     03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5116 PCI Express Card Reader (rev 01)     09:00.0 Ethernet controller: Atheros Communications AR8151 v2.0 Gigabit Ethernet (rev c0)      Where did my card go? **ps:** here is my unity utilities window, suggesting me to try `sdb` ![enter image description here](http://i.stack.imgur.com/8qiZf.png)


title: Get transmission web interface working with web server

text: I have my working on default port and I want to be able to use the web interface with an URL like `http://my.domain/torrents`. I tried adding a location and a proxy conf to Nginx but it fail to work fully. I guess it's because of web interface redirections.               server {         root /data/www;         autoindex on;              server_name localhost;              location / {                 try_files $uri $uri/ /index.html;         }              location /torrents/ {                 proxy_pass_header  X-Transmission-Session-Id;                 proxy_pass         http://127.0.0.1:9091;         }     }      This conf fail because it can't reach `/transmission/rpc` (`404 /usr/share/transmission/web/rpc`) I have tried many things and I always have something missing. `transmission/rpc` or `transmission/upload` or `transmission/web` or `transmission/javascript/whatever`...


title: OpenSSL updating ciphers suites

text: For PCI compliance I was required to protect our server against BEAST attacks. While I have correctly configured the apache / openssl settings to pass a scan, these settings have effectively limited the client browsers that can securely transact on the sites https side. We are using **Centos 6.5 Final, OpenSSL 1.0.1e-fips 11 Feb 2013** I cannot find any information on how to update or add either specific or all ciphers to OpenSSL. Question 1: **Are cipher suites distributed within the OpenSSL program OR are ciphers suites add-ons?, if they are add-ons how do you update them**? Question 2: **How do you manually update to the latest OpenSSL version? Currently openssl-1.0.1i** ? (CentOS states it is already the latest - which it is not.)


title: How to print the percentage of disk use from `df -hl`

text: I know that `df -hl` outputs a list of all my partitions with its size, usage as a percentage, and space available. If I wanted to output just the size and usage as a percentage of `sda2` and `sda3`, for example, how could I tell Linux (Ubuntu) to check them, sum them and show them to me?


title: Enable server-status on my web server

text: I want to enable server-status in my web server running Linux Mint 17. I don't know where to put `extendedstatus ON` and what else to change.


title: What are pros to use OmniOS than SmartOS or OpenIndiana?

text: I could not find _good_ comparison between OmniOS and SmartOS (or OpenIndiana). So what are pros to use OmniOS than SmartOS? (As some people are nitpickers I had to make the question like this. But I would like to know pros/cons...)


title: Conflict between amd64 and i386 packages with same dependencies

text: I am running a Debian Wheezy (7.2), wich has a 64bit architecture, and wish to install _cups_ and _oracle xe_ on it. I installed _cups_ through `apt-get`, and followed those steps to install oracle. However, both programs depend on the _bc_ package. When I installed oracle, it didn't work at first, and I had to install _bc:i386_ through `apt-get`. My problem is that installing _bc:i386_ removes the amd64 version, thus uninstalling cups. When I try to reinstall _cups_ , it removes both _bc:i386_ and _oracle_. Is there a way around? I'm a bit lost and didn't find anything about my problem on Google.


title: How can I write to dmesg from command line?

text: I'd like to write a statement to dmesg. [How] can I do this?


title: Lowercase all but the first (Uppercase) letter from UPPERCASE in cyrillic

text: To make all letters a lower case except the first letter. The first letter would look like "Uppercase" after I changed (from UPPERCASE in cyrillic). The rest (not UPPERCASED) leave unchanged. I'm sorry it's in cyrillic. e.g. АБРАЗИЯ Абразия I issued the correct general command:               :%s/\<\u\zs\u*/\L&/g      And it didn't work My linux is Gentoo, my locale is echo $LANG en_US.UTF-8. I tried also:                %s/\<[А-Я]\zs\[А-Я][а-я]*...      I don't know how to use properly this syntax. I guess it might work. I don't get it, even after               :se noic /[[:upper:]]       doesn't work. Must be a locale thing (I wonder).               sed -n '322p' geod.txt | cut -f 1 -d " "      АВГИТИТ—     sed -n '322p' geod.txt | cut -f 1 -d " " | xxd     0000000: d090 d092 d093 d098 d0a2 d098 d0a2 e280      Though all letters are the same magnitude of the Unicode numbering. I've rechecked again:               file -bi geod.txt     text/plain; charset=utf-8      So it's allright with utf-8 (though "file" could go wrong). Here's my source file: http://bpaste.net/show/140967/


title: What does the eth0 interface name mean in Linux?

text: What do the Linux interface names mean?   * eth0   * eth1   * wlan0 My current assumption is that when we are connected to the Internet via LAN cable it's eth0 or eth1 and when we are connected with internet via WiFi it's wlan0.


title: How to schedule initial configuration of a system after cloning?

text: I want to setup a big amount of servers using cloning. After the initial image was applied, I want to run a configuration script. The cloning will be done through hard disk replication by the hardware vendor. Steps:   1. Hardware vendor builds new server   2. Hardware ships with hard drives having the initial image   3. Server is setup at final location   4. Server boots.   5. Server runs initial configuration script.   6. Server reboots. What are the approaches to implement step 5 and 6 meeting the requirements below?   * Ubuntu 12.04 LTS   * Script should start and run without user interaction when the machine is turned on.   * Script should run after all daemons started.   * Script should output status on console.   * Script should allow user input on error conditions.


title: lsof doesn't return files open by the same user

text: Consider this simple scenario:   1. I open a text file ~/textfile.txt with `vim` in one terminal (tried with both edit and read-only modes).   2. In a different terminal, I run `/usr/sbin/lsof ~/textfile.txt` Get no results Why?


title: How do I stop emacs from asking me if I want to load a large file?

text: When I open a large file in emacs, I get a message saying 'foo.bar file is large; really open?' How do I stop emacs from asking me this question all the time? In other words, if I open the file, I want to open the file, no matter how big it is.


title: Using a custom name for root device in GRUB

text: I'm working on old distro ( slackware 8.1 ) using a kernel 2.4.37.9 and I have the following problem. I want to use a custom name for boot device, say for example /dev/root1, which can replace the standard IDE device ( /dev/hdc1 ). In the standard case I have                 title Linux-2.4.37.9 hdc         root (hd0,0)         kernel /boot/vmlinuz-2.4.37.9 ro root=/dev/hdc1 console=ttyS0,9600 console=tty0 apm=off      I wanto to replace it as show belowe:                 title Linux-2.4.37.9 ccl-Test         root (hd0,0)         kernel /boot/vmlinuz-2.4.37.9 ro root=/dev/ccl1 console=ttyS0,9600 console=tty0 apm=off      Both /dev/hdc1 and /dev/ccl1 are block device with major/minor 22,1 See here:               # ls -la /dev/hdc1 /dev/ccl1     brw-rw----    1 root     disk      22,   1 Jun  9  2002 /dev/hdc1     brw-rw-rw-    1 root     root      22,   1 Feb 20 15:04 /dev/ccl1      In the standard case the boot works well while in te second case, when I'm using the dev /dev/ccl1, I got the following error :               VFS: connot open root device "ccl1" or 00:00     Please append a correct "root=" boot option     Kernel panic: VFS: Unable to mount root fs on 00:00      I also added an `initrd` which set the real-root-dev               echo 0x2201 > /proc/sys/kernel/real-root-dev      but I got the same error , with a different device value               VFS: connot open root device "ccl1" or 22:01     Please append a correct "root=" boot option     Kernel panic: VFS: Unable to mount root fs on 22:01      I also tried to use the device ccl1 as a simple mount when the PC is already running and it works, see belowe               # mount -o -ro -t ext2 /dev/ccl1  /mnt/tmp     # df     Filesystem           1k-blocks      Used Available Use% Mounted on     LABEL=Flash-Root        242678    169769     65399  73% /     /dev/shm                452620      9308    443312   3% /var     /dev/ccl1               242678    169769     65399  73% /mnt/tmp      Any suggestions ?


title: (debian) installing mod_qos on apache results in error on start

text: I installed the mod_qos module using the steps found here, every step went perfectly fine without any problems, however, when attempting to restart the apache service it returned the following error:               apache2: Syntax error on line 203 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/qos.load: Cannot load /usr/lib/apache2/modules/mod_qos.so into server: /usr/lib/apache2/modules/mod_qos.so: undefined symbol: EVP_DecryptFinal      The contents of the qos.load file is just this line:               LoadModule qos_module /usr/lib/apache2/modules/mod_qos.so      How do I solve this error?


title: cat >/path/to/file <<EOF drops some paste content, also patch <<EOF too. Why?

text: From time to time I like to use `cat >/etc/configfile <<EOF` thing, and paste content, then send `EOF` that will flush it into file. Its good with one or two lines, but when there's more of them, some of content is missing, some extra newlines are added and so one. Same goes if I use `patch <<EOF`, even with a simple patch with less than 2000 characters in total. I suspect my terminal (urxvt) to do something wrong, It paste the content extreme fast but miss something, when I use mintty from cygwin, its slow as hell but not a single line is skipped. Also, if I enter Vim and paste it there, nothing is missed. The shell does not matter, happens on zsh, bash and ash.


title: How to merge two network interface in one?

text: I have two network interface on my router: wlan0 and wlan1. First for 2.4Ghz and second for 5Ghz. Also i have Coova-chilli with setting HS_LANIF=wlan0. Therefore captive portal (chilli) work for only one interface in same time. I have enable both wireless network in same time and make it work together with captive portal. Can i merge these interfaces in one? May bridge i don't know. For use it as HS_LANIF=br-wlan. I have OpenWRT system and router WDR4300.


title: Does the order of partitions matter much?

text: I've just ran a test install of Arch on a separate computer, and now I'm ready to do the real thing on my main one. However, since the guide didn't explicitly recommend it, I did not install with a swap partition. It would generally seem like a nice idea to have swap, but I was wondering where should I actually place it relative to my two other partitions. I have three partitions in mind: `/`, `/home` and the swap one. Is it OK to place them in random order?


title: TIFFReadDirectory warning: unknown field

text: When trying to view tif image files in `feh`, the following pair of error messages is printed to `stderr`:               TIFFReadDirectory: Warning, Unknown field with tag 37553 (0x92b1) encountered.     TIFFReadDirectory: Warning, Unknown field with tag 37554 (0x92b2) encountered.      `TIFFReadDirectory` is a C library, and the error message is self-explanatory (manpage). Unfortunately, I can't find much information about the relevant tag numbers (37553, 37554). What do these tags specify? Can I build support for them into `TIFFReadDirectory`? The problem is that they prevent functionality when viewing the files in the `feh` image viewer, specifically the ability to lock viewport settings from one image to another.


title: use bluetooth-next development tree for kernel

text: It possible to change the kernel module of bluetooth that is using the kernel, instead of using the stable tree i would like to use the development tree?


title: Net-SNMP over TCP?

text: Is it possible to get Net-SNMP running over TCP instead of UDP? The daemon program can be configured at the termiinnal to listen for TCP connections with: `snmpd tcp:1161` However, there are no flags for the `snmpget` to use TCP? Regards.


title: strace works for some builtin commands

text: I'm trying to understand some kernel level concepts in Linux. I was checking on the difference between _shell builtin_ commands and the other executable commands. This wonderful answer clearly tells the difference and also specifies the need for shell builtin commands. Now I know that using `type <command-name>`, I could check if it is an external or shell builtin command. So I decided to do some `strace`'ing on the various commands to understand more of the internals. I learned this neat little trick to do `strace`'es on shell builtin commands. I was able to do `strace` on `cd ..` as well according to the above answer. Now when I run `type pwd` and get the output as, `pwd is a shell builtin`. So, I expect that I wouldn't be able to run `strace` on it, since it too is a shell builtin. But when I did an `strace` on it, I was surprised to see that `strace` worked without the need to do `stty`. I verified `strace` for `echo` as well and it worked fine too. So my understanding is, that `strace` worked in the case of `pwd` and `echo` because the execution of `pwd` and `echo` did not change any of the shell's behavior. Am I correct in my understanding?


title: What is the reverse of echo -e?

text: If I have a string with nonprintable characters, new lines, or tabs, is there a way I can use `echo` to print this string and show codes for these characters (e.g., `\n` for new line, `\b` for backspace)?


title: Setting up encryption after debian wheezy install

text: How do you set up encryption on your home dir after the debian wheezy install. I missed the part in the graphical install that sets that up for you. I am using the automatic partition on the whole of the Free space


title: Why has `whonix` gateway a full blown `kde` dekstop?

text: Why is it that the gateway, that's just there to relay traffic in to and out of tor network, has a full blown kde desktop? Is it possible to down-size it by 'apt-get purge kde-workspace' or are there any implications against?


title: Adding script to autostart

text: I have this script:               #! /bin/bash     xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080     1083 1088 1120 -hsync +vsync     xrandr --addmode DVI-I-1 1920x1080_60.00     xrandr --output DVI-I-1 --mode 1920x1080_60.00      This is .tele1 file in /home/user I wish that this script is run with the system, but don't know how...


title: Is there a file for each socket?

text: "Everything is a file" in the UNIX World. Above sentence is famous. When I run `echo "hello programmer" >> /dev/tty1` , I can watch the given string on `TeleType 1` , .... What and where is file per each `socket`? Suppose my friend connects to my PC, and its IP is `h.h.h.h` , how can I access the respective file? Is it possible?


title: key bindings table?

text: Do we have a key bindings table that translates all the various ways of referring to a key press? I'm using `zsh`, but I presume that if there was such a table it would work for any shell. The reason I ask is that I'd like to assign some keybindings and I have no way of knowing how to refer to them (unless I'm going to steal one that's already defined). For example, in 'zbindkey' we have this sort of thing:               [[ "$terminfo[kend]"  == " O"* ]] && \         bindkey -M emacs "${terminfo[kend]/O/[}"  end-of-line      ... and I can guess that "kend" means that this refers to the `End` key. Cross checking with `bindkey` I see these lines:               "^E" end-of-line     "^[OF" end-of-line     "^[[F" end-of-line      ... so I trust that one of those lines refers to the `End` key. Which one? We also have this in the "bindkey" file:               bindkey "\e[A" history-beginning-search-backward      Now, I happen to know that that's the `Up Arrow` key, but how could I find out if I didn't know?               $ bindkey (at CLI)      ... gives us a different language for the same key:               "^[[A" history-beginning-search-backward      ... but at least now I know that `^[[A` in bindkey-at-CLI speak is the same thing as `\e[A` in bindkey-in-zbindkey speak. That's easy. In the old days in DOS, the `Up Arrow` was `0;72` \-- you could find the scan code of every legal keystroke and there was only the one language. Is there a table? Or some other way of being able to pick a keystroke and know how to refer to it in `terminfo[]` ... in " bindkey-in-zbindkey " ... in "bindkey-at-CLI " and/or in whatever other languages there may happen to be? Again, in DOS there was the `scancode` program -- type a keystroke, and you got the scancode. It was sinfully easy. * * * From the answers I guess then that there is no way to print out a table of all possible bindings? Anyway 'bindkey' does almost what I want:               pts/2 HP-y5-10-Debian1 root /aWorking/Docs $ bindkey -L     bindkey "^@" set-mark-command     bindkey "^A" beginning-of-line     bindkey "^B" backward-char     bindkey "^D" delete-char-or-list     bindkey "^E" end-of-line     ...      at least I can see all existing bindings, even if not all _possible_ bindings. Now, if there was just some way of translating the key glyphs into 'regular' terms:               bindkey "Home" beginning-of-line      ... then I'd be happy.


title: sed or grep to get only the values without numbers

text: I have a file like below.                1. VMware ESX      2. SCCM      3. Healthcare Information Technology      4. vSphere      5. Citrix Metaframe      6. IT Service Management      7. ITIL      8. Active Directory      9. Project Portfolio Management     10. Windows     11. Incident Management     12. Change Management     13. Disaster Recovery     14. Governance     15. Citrix     16. Stakeholder Management     17. Project Delivery     18. IT Operations     19. Infrastructure      I want only the values after `.` I need only the values like VMWare ESX, SCCM etc to store in an array. I tried the below command.               echo $line | grep -o -P '.'      But it is giving me characters before dot.


title: ACPId suspend-to-ram: can you specify waking up using keyboard events?

text: This is Gentoo Linux with OpenRC (updated to systemd later on), and ACPI \+ some power management features in the kernel for Intel. ACPId is up and running. I can suspend to ram using:               echo -n "mem" > /sys/power/state      This works, but I need to use the power button to wake up. Is there a way to wake up from keyboard events like pressing the space bar? The keyboard is a wireless USB keyboard. I've looked at the content of the script in `/etc/acpi` and it offers no insight into doing this. Most of the information I find is usually geared at laptop users. Do I really need something like the old `pm- utils` to accomplish this and is there anything wrong with just using acpid?               cat /proc/acpi/wakeup     Device  S-state   Status   Sysfs node     P0P2      S4    *disabled     P0P3      S4    *disabled  pci:0000:00:06.0     P0P1      S4    *disabled  pci:0000:00:1e.0     PS2K      S4    *enabled   pnp:00:0b     EUSB      S4    *enabled   pci:0000:00:1d.7     USBE      S4    *enabled   pci:0000:00:1a.7     P0P4      S4    *disabled  pci:0000:00:1c.0     P0P5      S4    *disabled     P0P6      S4    *disabled  pci:0000:00:1c.2     P0P7      S4    *disabled     P0P8      S4    *disabled     P0P9      S4    *disabled     GBEC      S4    *disabled     USB0      S4    *enabled   pci:0000:00:1d.0     USB1      S4    *enabled   pci:0000:00:1d.1     USB2      S4    *enabled   pci:0000:00:1d.2     USB3      S4    *disabled     USB4      S4    *enabled   pci:0000:00:1a.0     USB5      S4    *enabled   pci:0000:00:1a.1     USB6      S4    *enabled   pci:0000:00:1a.2     MBT4      S4    *disabled      Seemingly relevant kernel options used (3.10.25-gentoo SMP, 64bit, IA32emul=off, no-multilib):   * CONFIG_HOTPLUG_CPU=y and with cpu0_hotplug by default   * Suspend to ram and standby Hibernation   * Power mgmt debug support    * Suspend/resume event tracing   * ACPI support   * CPU idle PM support   * Cpuidle Driver for Intel Processors   * Support for systemd through Gentoo option in kernel was enabled BIOS setup is pretty standard:   * I've enabled ACPI2.0 extra tables   * Not seeing any wake events for USB but I've tried wake up events from PCI/PCIe/PS2 etc but indeed this is a wireless usb keyboard   * Board is old school winner Maximus Formula with Q6600 Core2quad OpenRC was updated to `systemd` and the kernel was recompiled to support that. Configuration was also updated like so. With systemd, apcid is not required in all instances. For instance without running you can issue `systemctl suspend` and the behavior is... the same as before i.e. wake up only from power button... `pstree` output:               systemd        ├─acpid -f       ├─at-spi-bus-laun       │   ├─dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork--print-addres       │   └─2*[{at-spi-bus-laun}]       ├─at-spi2-registr --use-gnome-session       │   └─{at-spi2-registr}       ├─dbus-daemon --system --address=systemd: --nofork --nopidfile--systemd-activation       ├─dbus-daemon --fork --print-pid 5 --print-address 7 --session       ├─dbus-launch --sh-syntax --exit-with-session       ├─dhcpcd -q --nobackground       ├─login --           │   └─bash       │       └─startx /usr/bin/startx       │           └─xinit /etc/X11/xinit/xinitrc -- /etc/X11/xinit/xserverrc :0 -auth...       │               ├─X -nolisten tcp :0 -auth /home/user/.serverauth.3329       │               └─openbox --startup /usr/libexec/openbox-autostart OPENBOX       │                   ├─firefox       │                   │   ├─plugin-containe ...       │                   │   │   └─6*[{plugin-containe}]       │                   │   └─35*[{firefox}]       │                   └─vlc       │                       └─4*[{vlc}]       ├─lxterminal       │   ├─bash       │   │   └─htop       │   ├─bash       │   │   └─su       │   │       └─bash       │   │           └─grc /usr/lib/python-exec/python2.7/grc tail -f ...       │   │               ├─grcat /usr/lib/python-exec/python2.7/grcat conf.log       │   │               └─tail -f /var/log/emerge.log       │   ├─bash       │   ├─gnome-pty-helpe       │   └─{lxterminal}       ├─mount.ntfs /dev/sdb1 /mnt/div -o rw       ├─roxterm       │   ├─bash       │   │   └─su       │   │       └─bash       │   │           └─pstree -a       │   ├─gnome-pty-helpe       │   └─{roxterm}       ├─systemd --user       │   └─(sd-pam)                        ├─systemd-journal       ├─systemd-logind       ├─systemd-udevd       ├─wbar --pos bot-right --taskbar --isize 24       └─xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55


title: Hard Disk Space Shows in One Place, Shows Less in "Computer" Folder?

text: I have 320 Hard Disk but in the picture in Computer Properties, it says capacity is 45GB. Which is obviously not true.Anyone know why? I don't want to have less storage than I do in real life, I want to have the ability to use all available storage. On the other hand... I think it's root that has 54GB, although I still don't get how root has it's own storage. ![enter image description here](http://i.stack.imgur.com/3WeZF.png) ![enter image description here](http://i.stack.imgur.com/feaes.png)


title: Why would one want to compile multiple .cpp files to the same executable?

text: Why would you do               g++ -Wall -I/usr/local/include/thrift *.cpp -lthrift -o something      instead of:               g++ -Wall -I/usr/local/include/thrift -c Something.cpp -o something.o     g++ -Wall -I/usr/local/include/thrift -c Something_server.cpp -o server.o     g++ -Wall -I/usr/local/include/thrift -c your_thrift_file_constants.cpp -o constants.o     g++ -Wall -I/usr/local/include/thrift -c your_thrift_file_types.cpp -o types.o      and then:               g++ -L/usr/local/lib -lthrift *.o -o Something_server      Am I right that the first step does essentially the same thing as the second sequence? Also, to make them identical should `something` be `Something_server` in the first line?


title: Can less retain colored output?

text: Can I get less not to monochrome its output? E.g., the output from `git diff` is colored, but `git diff | less` is not.


title: Sed: extending a string of numbers to a certain number of digits by padding with zeros

text: I'm currently trying to modify an echoed string of alphanumeric characters by piping it to sed. The area I'm interested in modifying is a block of numbers, which I would like to make 8 characters long by inserting an appropriate number of zeros to the front of it. For example: Input: `loremipsumdolorsit2367amet` Desired output: `loremipsumdolorsit00002367amet` Is it possible to do this with sed? The blocks of numbers I'm dealing with are less than 8 characters, if that helps. I'm not sure if this post helps. Thanks in advance! Edit: there is only one block of numbers in each string.


title: Forbid a given user to use a given range of port

text: I would like to forbid a user account on linux to use a a given port. So far, without root privileges, a user can't use ports under 1024. Is there a way to limit a user to a given range of ports, let say [2100-2199] ?


title: Why won't Gedit save my file the first time I try?

text: I'm using Gedit on Fedora, and when I try to save, it states that it's unable to, but if I try again, it succeeds. So, it saves only on the second attempt, every time.


title: Arch Linux Using the Wrong MTA

text: I try to do this:               $ mail -s "Hello world" foo@example.com     This is a test from my server     EOT      …and get this:               /usr/sbin/ssmtp: No such file or directory     $ "/home/user//dead.letter" 9/248     . . . message not sent.      Which makes sense, because I uninstalled SSMTP in favor of Postfix. How do I change it so `mail` uses the right MTA?


title: variable concatenation not working?

text: I have a simple bash shell script which is driving me bonkers. All I want to do is run a command which returns a result which I will then use in another command. The result of the first command returns a location on my hard drive with spaces. Here's what I have...               # Get list of virtual machines.  VMname will hold the address of the .vmx file     VMname=`./vmrun list`     echo $VMname          # Get list of snapshots     command="./vmrun listSnapshots "     command=$command"'"     command=$command$VMname     command=$command"'"     echo $command     snapshotList=`$command`      It looks like when I try to append the single quotes around the $VMname it only appends to the left, ie I only the left single quote is appended. Is there something silly I am doing wrong? This really is driving me crazy!


title: Why am I failing to mirror a web site (using wget)?

text: I have tried using `wget --mirror http://tshepang.net/`, but it only retrieves one page, " **tshepang.net/index.html** ". Is this a bug in wget? Here's the output, from using the `--debug` option:               DEBUG output created by Wget 1.12 on linux-gnu.          Enqueuing http://tshepang.net/ at depth 0     Queue count 1, maxcount 1.     [IRI Enqueuing `http://tshepang.net/' with None     Dequeuing http://tshepang.net/ at depth 0     Queue count 0, maxcount 1.     --2011-01-15 12:32:51--  http://tshepang.net/     Resolving tshepang.net... 66.216.125.32     Caching tshepang.net => 66.216.125.32     Connecting to tshepang.net|66.216.125.32|:80... connected.     Created socket 4.     Releasing 0x089e2be0 (new refcount 1).          ---request begin---     GET / HTTP/1.0          User-Agent: Wget/1.12 (linux-gnu)          Accept: */*          Host: tshepang.net          Connection: Keep-Alive                    ---request end---     HTTP request sent, awaiting response...      ---response begin---     HTTP/1.1 302 Found          Server: nginx/0.7.65          Date: Sat, 15 Jan 2011 10:33:45 GMT          Content-Type: text/html; charset=utf-8          Connection: keep-alive          Status: 302 Found          Location: http://posterous.com/sso/verify/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F          X-Runtime: 3          Set-Cookie: cookies_enabled=true; path=/          Cache-Control: no-cache          Content-Length: 141          X-Varnish: 419207385          Age: 0          Via: 1.1 varnish          X-Cache: MISS                    ---response end---     302 Found          Stored cookie tshepang.net -1 (ANY) / <session> <insecure> [expiry none] cookies_enabled true     Registered socket 4 for persistent reuse.     Location: http://posterous.com/sso/verify/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F [following]     Skipping 141 bytes of body: [You are being redirected.] done.     --2011-01-15 12:32:52--  http://posterous.com/sso/verify/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F     conaddr is: 66.216.125.32     Resolving posterous.com... 184.106.20.99     Caching posterous.com => 184.106.20.99     Releasing 0x089e3e20 (new refcount 1).     Found posterous.com in host_name_addresses_map (0x89e3e20)     Connecting to posterous.com|184.106.20.99|:80... connected.     Created socket 5.     Releasing 0x089e3e20 (new refcount 1).          ---request begin---     GET /sso/verify/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F HTTP/1.0          User-Agent: Wget/1.12 (linux-gnu)          Accept: */*          Host: posterous.com          Connection: Keep-Alive                    ---request end---     HTTP request sent, awaiting response...      ---response begin---     HTTP/1.1 302 Found          Server: nginx/0.7.65          Date: Sat, 15 Jan 2011 10:33:46 GMT          Content-Type: text/html; charset=utf-8          Connection: close          Status: 302 Found          Location: http://tshepang.net/sso/recovery/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F          X-Runtime: 7          Set-Cookie: _sharebymail_session_id=296a636c8ed3cb6e4e7cabb10256008a; domain=.posterous.com; path=/; HttpOnly          Cache-Control: no-cache          Content-Length: 142          X-Varnish: 2019529137          Age: 0          Via: 1.1 varnish          X-Cache: MISS                    ---response end---     302 Found     cdm: 1 2     Stored cookie posterous.com -1 (ANY) / <session> <insecure> [expiry none] _sharebymail_session_id 296a636c8ed3cb6e4e7cabb10256008a     Location: http://tshepang.net/sso/recovery/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F [following]     Closed fd 5     --2011-01-15 12:32:53--  http://tshepang.net/sso/recovery/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F     Reusing existing connection to tshepang.net:80.     Reusing fd 4.          ---request begin---     GET /sso/recovery/2d35d71b1e728dc99f3c153eaf6f8fa0?jumpto=%2F HTTP/1.0          User-Agent: Wget/1.12 (linux-gnu)          Accept: */*          Host: tshepang.net          Connection: Keep-Alive          Cookie: cookies_enabled=true                    ---request end---     HTTP request sent, awaiting response...      ---response begin---     HTTP/1.1 302 Found          Server: nginx/0.7.65          Date: Sat, 15 Jan 2011 10:33:46 GMT          Content-Type: text/html; charset=utf-8          Connection: keep-alive          Status: 302 Found          Location: http://tshepang.net/          X-Runtime: 5          Set-Cookie: _sharebymail_session_id=cab0227db8c38f17e572984ee188dc5e; domain=tshepang.net; path=/; HttpOnly          Cache-Control: no-cache          Content-Length: 86          X-Varnish: 419207606          Age: 0          Via: 1.1 varnish          X-Cache: MISS                    ---response end---     302 Found     cdm: 1 2     Stored cookie tshepang.net -1 (ANY) / <session> <insecure> [expiry none] _sharebymail_session_id cab0227db8c38f17e572984ee188dc5e     Location: http://tshepang.net/ [following]     Skipping 86 bytes of body: [You are being redirected.] done.     --2011-01-15 12:32:54--  http://tshepang.net/     Reusing existing connection to tshepang.net:80.     Reusing fd 4.          ---request begin---     GET / HTTP/1.0          User-Agent: Wget/1.12 (linux-gnu)          Accept: */*          Host: tshepang.net          Connection: Keep-Alive          Cookie: _sharebymail_session_id=cab0227db8c38f17e572984ee188dc5e; cookies_enabled=true                    ---request end---     HTTP request sent, awaiting response...      ---response begin---     HTTP/1.1 200 OK          Server: nginx/0.7.65          Date: Sat, 15 Jan 2011 10:33:49 GMT          Content-Type: text/html; charset=utf-8          Connection: keep-alive          Status: 200 OK          ETag: "6ec7aeb4e15e3a80e733f7c2b5e00d6f"          X-Runtime: 1680          Cache-Control: private, max-age=0, must-revalidate          Content-Length: 66513          X-Varnish: 419207692          Age: 0          Via: 1.1 varnish          X-Cache: MISS                    ---response end---     200 OK     Length: 66513 (65K) [text/html]     Saving to: `tshepang.net/index.html'               0K .......... .......... .......... .......... .......... 76% 25.7K 1s         50K .......... ....                                       100% 39.3K=2.3s          2011-01-15 12:32:58 (27.9 KB/s) - `tshepang.net/index.html' saved [66513/66513]          Deciding whether to enqueue "http://tshepang.net/".     Already on the black list.     Decided NOT to load it.     Redirection "http://tshepang.net/" failed the test.     FINISHED --2011-01-15 12:32:58--     Downloaded: 1 files, 65K in 2.3s (27.9 KB/s)


title: How to change bash console font to display UTF-8 characters

text: I'm having some trouble with displaying UTF-8 characters correctly on bash. I was trying to extract some zipped files that contained accented characters in their names, and I was getting the invalid multibyte characters error. I created a `.bash_profile` with this:               export LANG=en_US.UTF-8     export LOCALE=UTF-8      This solved the extraction problem. But the console still doesn't show the accented characters correctly. Konqueror has no problem with the accented characters. What do I have to do?


title: How can I create users with only remote ftp access on Linux server?

text: I'm running a Ubuntu 10.04 LTS server and I want to create users who can only access the server from ftp. What I did so far is:   * Install vsftpd   * Create new user with default login shell set to /bin/false The normal users on the server are all able to access their home folder through ftp but the users to whom remote shell access is removed by setting it to "/bin/false" are not able to log by ftp either. I don't understand how the shell access affects the vsftpd server? How could I enable the ftp access without re-enabling shell? UPDATE: I found this reference that states that I should use /sbin/nologin (seems to be /usr/sbin/nologin in Ubuntu) and that it should not affect ftp access but it does not work in my case.


title: plesk update fails

text: I have a dedicated server running CentOS 5.3. I'm trying to update Plesk 9.5.2 to version 10.0.0 but update fails. I do it with yum:               yum update psa* --skip-broken -t      but it fails and I get the errors at the end:               Skip-broken could not solve problems     Error: plesk-mail-pc-driver conflicts with psa-qmail     Error: plesk-mail-pc-driver conflicts with psa-qmail-rblsmtpd     Error: plesk-mail-qc-driver conflicts with plesk-mail-pc-driver     Error: plesk-core conflicts with plesk-billing     Error: Missing Dependency: sw-engine = 2.0 is needed by package plesk-billing-6.0.4-20090625.11.noarch (installed)     Error: Missing Dependency: pp-sitebuilder >= 10.3.0 is needed by package psa-10.3.0-cos5.build1012110629.18.x86_64 (plesk)     Error: plesk-mail-pc-driver conflicts with plesk-mail-qc-driver      Is there a way that I could solve this?


title: hpux leaves files that start with a # behind after I uninstall a program. Is this normal and how do I delete them?

text: I have tried using `rm -f` on these files, and I am running as root, so I should be able to delete them. So why does this program leave behind these files and how can I remove them. Here is what the files look like: ` -rwxr-xr-x 1 root sys 6180112 Apr 2 23:28 ##libprog.so.4.5.1   -rwxr-xr-x 1 root sys 427384 Apr 2 23:28 ##libprogn.so.1.0.0   -rwxr-xr-x 1 root sys 578912 Apr 2 23:28 ##libprogcacheipc.so.1.0.0   -rwxr-xr-x 1 root sys 225976 Apr 2 23:28 ##libvtsmartcache.so.1.0.0   -rwxr-xr-x 1 root sys 1338920 Apr 2 23:28 ##libprogil.so.1.0.0   -rwxr-xr-x 1 root sys 6180112 Apr 2 23:28 #libprog4.so.4.5.1`   Here is the error I get when trying to remove a file:   `rm -f /opt/prog/lib/hpux64/##libprog.so.4.5.1 rm: /opt/prog/lib/hpux64/##libprog.so.4.5.1 not removed. Text file busy`


title: Format windows (NTFS) hard drive on Ubuntu using command line

text: This is really a two part question. I've never formatted a hard dirve on Linux/Unix, so please bear with me. I had an old Windows machine which recently died. So I decided to put the hard drive into my Ubuntu server. This hard drive is currently NTFS file format, the Disk info is as follows                  description: ATA Disk        product: SAMSUNG HD502HI        physical id: 0.0.0        bus info: scsi@1:0.0.0        logical name: /dev/sdb        version: 1AG0        serial:        size: 465GiB (500GB)        capabilities: partitioned partitioned:dos        configuration: ansiversion=5 sectorsize=512 signature=000c6181      **Part One** I need to get some files of this hard drive, but when I try to mount the hard drive all that seems to mount is the `/boot` partition. Here is what I am doing Edit `fstab` and add the following:               /dev/sdb /media/Microsoft ntfs-3g defaults,locale=en_US.utf8 0 0      Then after this I mount using the following command               sudo mount -ro /dev/sdb /media/Microsoft       Can some one tell me what I am doing wrong, and how I can mount the right partition? **Part Two** Once I have successfully mounted the hard drive and copied the files. How do I go about formatting the hard drive and make it usable for my Linux system? From what I have read I have to do something like               mkfs.ext3 /dev/sdb      then create a partition using `fdisk` Can some one direct me to what I actually need to do?


title: Using Bash to write to a device in /sys?

text: I have one of these: ![](https://github- camo.global.ssl.fastly.net/ca2357152356e8258438f2fe6a17a9c16622d3f9/687474703a2f2f692e737461636b2e696d6775722e636f6d2f45616c74422e706e67) Basically, it's a USB device with three LEDs (red, green, and blue). The Linux kernel has supported this device through the `usbled` module for quite some time now. However, I am not sure how to actually control the device from a Bash script. The `/sys` directory contains the following files:               root@desktop:/sys/devices/pci0000:00/0000:00:13.0/usb5/5-3/5-3:1.0# ls     bAlternateSetting   bInterfaceSubClass  ep_81     red     bInterfaceClass     blue                green     subsystem     bInterfaceNumber    bNumEndpoints       modalias  supports_autosuspend     bInterfaceProtocol  driver              power     uevent


title: How do I remove Linux Mint that is sharing a partition with Windows?

text: I installed Linux Mint on my computer that was already running Windows 7 and later realised it was sharing the same partition `C`. How do I remove Linux Mint without affecting my files and programs in `C`?


title: How to check how many Oracle user sessions are running

text: I need to check how many users are connected to server for specific applications through a browser. I'm mainly interested in Oracle. My server runs RHEL.


title: Use Linux to read contents of Windows encrypted folder

text: Windows allows the selective encrypting of certain files or folders. I currently have a Windows folder that is set to "encrypt contents to secure data". (The Windows partition is NTFS.) If I mount this drive under Linux, is there anyway to decrypt the contents of the directory so that I can read the files without having to reboot into Windows?


title: Possible to use brace (permutation) and array expansion simultaneously?

text: Bash's `{}` brace expansion syntax allows for creating easy permutations               # echo {b,c,d}{a,e,i,o,u}     ba be bi bo bu ca ce ci co cu da de di do du      However it's not clear to me if/how it's possible to use this along with arrays except in very awkward use of `$()` `echo` and `eval` Is there a simple way to use arrays with curly brace (permutation) expansion? For example sake, imagine something like (which does not work of course):               CONS=( b c d )     VOWEL=( a e i o u )          echo {${CONS[@]}}{${VOWEL[@]}}


title: How to load tp_smapi on Thinkpad X120e

text: My brand new Thinkpad X120e is working well with Ubuntu Natty. Now I want to get the tp_smapi module to work so I can control battery charge behavior. Unfortunately I get "no Thinkpad embedded controller" (below). The thinkwiki tp_smapi page says in this case "you should upgrade your BIOS. Some early BIOS (like 1.x on the X31) don't handle the embedded controller". But in my case, dmidecode suggests I'm already using the almost-newest BIOS from IBM.               # apt-get install tp-smapi-dkms     ...(works)...     # modprobe -v tp_smapi     WARNING: Error inserting thinkpad_ec (/lib/modules/2.6.38-7-generic/updates/dkms/thinkpad_ec.ko): No such device     FATAL: Error inserting tp_smapi (/lib/modules/2.6.38-7-generic/updates/dkms/tp_smapi.ko): No such device     # tail -1 /var/log/syslog     Apr 19 23:45:05 xilotl kernel: [ 5552.149408] thinkpad_ec: no ThinkPad embedded controller!     # dmidecode -s bios-version     8FET26WW (1.10 )      Any other idea how to make this work? UPDATE: Here are other relevant portions of `dmidecode` (that is, `dmidecode -t0 -t1 -t11`):               Handle 0x0000, DMI type 0, 24 bytes     BIOS Information         Vendor: LENOVO         Version: 8FET26WW (1.10 )         Release Date: 03/09/2011         ...          Handle 0x0001, DMI type 1, 27 bytes     System Information         Manufacturer: LENOVO         Product Name: 0596CTO         Version: ThinkPad X120e         ...          Handle 0x0027, DMI type 11, 5 bytes     OEM Strings         String 1: OEM default string


title: How to recompile a Debian package with -Os?

text: There are a few larger programs I am interested in compiling with -Os. The normal method I use to patch/recompile programs is apt-get source followed by dpkg-buildpackage. I learned from the dpkg-buildflags man page that I can set global flags in a configuration file. This seems to work for only some packages if I append the flags I want. The problem is that most programs ignore the flags and build with -O2 (and in some cases -O3) anyway. Is there a way I can force the compiler to use -Os?


title: how to ssh to remote server and use local emacs to edit files?

text: Is there a way to use the emacs installed my local computer to access remote files I have in a remote server? I have googled and found out that I should use TrampMode however it is necessary for me to know the exact file path. Isn't there a way for me to open an ssh connection to the remote server and from there open the files with the local emacs in my computer?


title: sed ranges aren't always able to match only one line

text: Consider the following range: `1,/pattern/`. If pattern matches on the first line, the range matches for the whole file:               $ cat 1.sh     #!/usr/bin/env bash     set -eu     seq 1 4 | sed -rn '1,/'"$1"'/p'     $ ./1.sh 1     1     2     3     4     $ ./1.sh 2     1     2      What would you do about it? **UPD** Here's what I did (just in case):               re='/1/'     seq 1 4 | sed -rn "1{$re{p;q}}; 1,${re}p"      Or this way:               seq 1 4 | sed -rn "1{/1/{p;q}}; 1,//p"


title: Two HDD partitions with the same name result in uncertain directories

text: I'm running Ubuntu 14.04 on a machine that has a lot of hard drives plugged into it. These hard drives have partitions with old OS's which have a lot of key data that I use often. The problem is, I have 2 partitions with the same name, "Main Drive" and "Main Drive". Ubuntu, to differentiate between them, renames one drive to "Main Drive1", while keeping the other just "Main Drive". The problem is, every time I restart Ubuntu, it chooses **randomly** which partition to rename. As a result, any bookmarks or directories that I have in those partitions, do not work, and have to be reconfigured every time I reboot. Are there any solutions to this problem?


title: Range of the command cut in unix

text: I'm trying to make a shell script, I want to cut a string using the 'cut' unix command, as follows:               namecmpaux=$(echo $namecmp |cut -c0-19)      But when I run the shell tells me the following error:               cut: fields and positions are numbered from 1      Try `cut - help 'for more information.      I remember previously used the 'cut' command using zero as the lower limit position, but now tells me that the command should start at 1. Why?, depends on the operating system? previously used SunOS and now i'm using ubuntu 12.04


title: Particular site is not working on Ubuntu 12.04

text: I surf net in Ubuntu 12.04. All the sites are working, except one site `http://developer.android.com/`. I don't know why. At the same time, the same url opens in Windows perfectly. So the site is up and the problem isn't related to the proxy either. I am totally feeling helpless. Why is this happening? Firefox shows the error > Server Not found               wget http://developer.android.com/          Resolving developer.android.com (developer.android.com)... failed: Name or service not known.     wget:unable to resolve host address 'developer.android.com'                    ping developer.android.com          ping: unknown host developer.android.com      **cat /etc/hosts**               127.0.0.1      localhost     127.0.1.1      devsda          # The following lines are desirable for IPv6 capable hosta     ::1     ip6-localhost   ip6-loopback     fe00::0    ip6-localnet     ff00::0    ip6-mcastprefix     ff02::1    ip6-allnodes     ff02::2    ip6-allrouters       **cat /etc/resolv.conf**               #  Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)     #  DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN     nameserver 127.0.0.1      **devsda@devsda:~$ host developer.android.com**               ;; Truncated, retrying in TCP mode.     Host developer.android.com not found: 5(REFUSED)      **devsda@devsda:~$ host developer.android.com 8.8.8.8**               Using domain server:     Name: 8.8.8.8     Address: 8.8.8.8#53     Aliases:           developer.android.com is an alias for www3.l.google.com.     www3.l.google.com has address 74.125.236.33     www3.l.google.com has address 74.125.236.37     www3.l.google.com has address 74.125.236.35     www3.l.google.com has address 74.125.236.39     www3.l.google.com has address 74.125.236.32     www3.l.google.com has address 74.125.236.46     www3.l.google.com has address 74.125.236.38     www3.l.google.com has address 74.125.236.40     www3.l.google.com has address 74.125.236.41     www3.l.google.com has address 74.125.236.36     www3.l.google.com has address 74.125.236.34     www3.l.google.com has IPv6 address 2404:6800:4007:800::1005


title: mv complains about standard input in a pipeline that filters file name with grep

text: I'm trying to move several .avi files that have spaces in from a CD to my home folder. I've already know how to get rid of the spaces:               find /media/mathscd/ | grep -L -r "*.avi" | for file in *; do mv "$file" echo $file | tr ' ' '_' ; done      But I'm struggling to get move to find the edited files and move them en masse into the folder. I keep getting the error `mv: cannot stat '(standard input)': No such file or directory`. This is the code I'm trying to use:               find /media/mathscd/ | grep -L -r  "*.avi" | xargs -I{} mv {} /home/09murphyt/Downloads/      Can someone please tell me what I'm doing wrong?


title: Why is it impossible to change the inode count of an ext filesystem?

text: I know that it isn't possible to change the inode count of an ext filesystem after its creation, but I haven't been able to find any explanation on _why_ it isn't. Can anyone enlighten me?


title: How to recover TrueCrypt datas?

text: I have 1GB worth of data locked up in an encrypted TrueCrypt volume and I forgot the password to it. Is there any way to recover it?


title: How to make HOME, END to work on terminal without X

text: my current keys config is:               typeset -A key          key[Home]=${terminfo[khome]}     key[End]=${terminfo[kend]}     key[Insert]=${terminfo[kich1]}     key[Delete]=${terminfo[kdch1]}     key[Up]=${terminfo[kcuu1]}     key[Down]=${terminfo[kcud1]}     key[Left]=${terminfo[kcub1]}     key[Right]=${terminfo[kcuf1]}     key[PageUp]=${terminfo[kpp]}     key[PageDown]=${terminfo[knp]}          # setup key accordingly     [[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line     [[ -n "${key[End]}"     ]]  && bindkey  "${key[End]}"     end-of-line     [[ -n "${key[Insert]}"  ]]  && bindkey  "${key[Insert]}"  overwrite-mode     [[ -n "${key[Delete]}"  ]]  && bindkey  "${key[Delete]}"  delete-char     [[ -n "${key[Up]}"      ]]  && bindkey  "${key[Up]}"      up-line-or-history     [[ -n "${key[Down]}"    ]]  && bindkey  "${key[Down]}"    down-line-or-history     [[ -n "${key[Left]}"    ]]  && bindkey  "${key[Left]}"    backward-char     [[ -n "${key[Right]}"   ]]  && bindkey  "${key[Right]}"   forward-char          # Finally, make sure the terminal is in application mode, when zle is     # active. Only then are the values from $terminfo valid.     function zle-line-init () {         echoti smkx     }     function zle-line-finish () {         echoti rmkx     }          if [ -n "${DISPLAY:-}" ]; then        zle -N zle-line-init        zle -N zle-line-finish     fi      completion and other zsh files here: https://github.com/Cynede/dotfiles/blob/master/.zsh/config.sh The trouble is that this `bindkey "${key[Home]}" beginning-of-line` doesn't work for terminal with no Xorg running seems like. It pastes `~` on both `HOME` and `END`. How can I make it to work without Xorg too?


title: How do I get the difference between two timestamps?

text: I am creating a simple backup script. I would like to have a message saying "You last backed up x days ago" on login. I can create a file when I do the backup "backup/.last_backup_timestamp" but what format should I use and how would I find the difference in days between then and now in bash? Thank-you


title: How to change the default web page in Linux Mint 12

text: I need help with Linux Mint 12. I am trying to change the default web page, so that people using guest-session will open a specific web page instead of Linux Mint's corny default site. Also, please note that when I installed Chromium, the Linux Mint default page comes up there too. There must be a global variable somewhere. It would likely be in the same place that Ubuntu keeps the same variable. Does anyone know where this variable is?


title: Blocking outgoing connects with iptables

text: I have a (non production) machine where external supporters have shell-access (non-root). I want to prevent them from going further on into our network from that machine using iptables. The "normal" firewall-gui only blocks incoming traffic. How can I set up rules like "accept all incoming traffic (plus response), but allow only new outgoing traffic for specific targets (like snmp-traps to the monitoring server)"? OS is CentOS 5


title: tee and grep at the same time (shell)?

text: I'm trying to run a server that writes to $log (a txt file) and then find all the text in the logfile that starts with '[1]' and put it in another file. Here's my attempt. `tee -a $log` works along with everything else. The grep command doesn't though.               run="tail -n0 -f -s 0.01 $cmds | (while true; do $tron --userconfigdir $userconfigdir --userdatadir $userdatadir --vardir $var; done) | tee -a $log | grep '^[1]' > ${var}logs/chatlogs.log"      What can be done to copy all the text from `tee -a $log` starting with '[1]' to another file?


title: Configure fstab for a bootable usb

text: I'm trying to clone a partition and make it a bootable usb. I've made two ext3 partitions (just like the installation I'm cloning). The first one is small and has `grub/` and the kernel. The second partion is large and contains `/`. I need to modify the `fstab` to fit the new usb device and I'm not really sure how to do that. The old `fstab` looks like this:               # <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>     /dev/nfs                /               rootfs          noauto,rw       0 0     tmpfs                   /var/run        tmpfs           defaults        0 0     tmpfs                   /var/lock       tmpfs           defaults        0 0     tmpfs                   /tmp            tmpfs           defaults        0 0          # Mount the POSIX mqueue filesystem     none                    /dev/mqueue     mqueue          defaults        0 0      When I try to run `grub-install /dev/sdc` I get:               /usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).      I got this idea from this question I also get this on another machine when I run `grub install`:               /dev/nfs: Not found or not a block device.


title: Setting tab width in C++ output in bash

text: I have a `c++` program and I use the tab character `"\t"` to organize my output to a human-readable columns. However, 8-spaces-wide column in bash is too narrow for me. How can I increase it? **Note:** In C++ forums people say: _"C++ just outputs the character and is not responsible for the visible output"_. In linux forums people say: _"It is the program you use to output to terminal that is responsible for this, probably`less` or so."_


title: Shell script to backup directories

text: I'm running eclipse on windows and would like to automatically backup my src direcories for all my projects. I installed cygwin and tried to make a simple backup script but I am having trouble properly specifying the destination filename. The backups should be in the current directory.directory of the script.               #!/bin/bash               for f in /cygdrive/c/Documents\ and\ Settings/USERNAME/My\ Documents/Eclipse\ Workspace/*     do             echo "in folder \"$f\""             cp -a "$f"/src/ ./????.bak          done      I would like ???? to be the project folder (not the absolute path). Thanks.


title: CUPS - check if print successful (either python or in system)

text: **EDIT: I forgot to make it clear I'm using python and pycups. The code is python but I shouldn't have thought that was enough.** I've dug through the cups documentation a few times and couldn't find anything to do this. Is there any message that gets returned on a successful print that can be captured? For example in this code:               import os     import cups          conn = cups.Connection()          f = open('testreceipt.txt', 'w')     f.write('something')     f.close()     printer_returns = conn.printFile('EPSON_TM-P2.01', 'testreceipt.txt', 'test', {})     print printer_returns      All that printer_returns gets assigned appears to be the print job id (208,209,...,n). This occurs whether or not a printer is connected, and thus can't be relied upon for confirmation. In this case the target printer is a receipt printer attached by a serial->usb cable into a raspberry pi running raspbian. I've considered monitoring the cups log file for successful prints but that seems like a bad way to go about it. I'm not sure where else to go with finding a solution so if anyone has thoughts, please share them.


title: tmux status line with blank line on top?

text: I have a nice tmux status line, but I don't like how the bash/commands run flush along it...that is, if the screen is full, i'm typing things right above the status line. I'd like a one line break above it, so that what i'm typing ever "touches" the status line...is there any way to do this? Example: Let's say I have a very small terminal window that is two lines long               bash>$ (cursor)     1: bash*  2: bash-  3: vim-      How would I get a blank line to separate the status bar from the prompt, like:               bash>$ (cursor)          1: bash*  2: bash-  3: vim-


title: Piped command changes PID

text: I created a (Debian) init Script for an executable Jar file:               [...]     NAME=NameOfMyShellScript     DAEMON="/usr/share/myApp/bin/$NAME"     USER="myUser"     PIDFILE="/usr/share/myApp/run/$NAME.pid"     EXTRA_ARGS=" -c $USER --background --make-pidfile"     [...]     start-stop-daemon --start --quiet $EXTRA_ARGS --pidfile $PIDFILE --startas $DAEMON --     [...]       My init script basically just invokes `start-stop-daemon` which executes a shell script:               #!/bin/sh     XNAME="hellofellow_1"     SCALATRA_ENV="development"     TMP_DIR="tmp/$XNAME/"     JAVA_OPTIONS="-Xmx2024M -XX:MaxPermSize=512M"     LOGFILE="logs/$XNAME.log"     PORT="8080"     JAVA_OPTIONS="$JAVA_OPTIONS -Djava.io.tmpdir=$TMP_DIR \       -Dorg.scalatra.environment=$SCALATRA_ENV"          cd $(dirname $0)/../     rm -Rf $TMP_DIR*     exec java $JAVA_OPTIONS -jar current/myJarFile.jar $PORT > $LOGFILE      This works so far, my applications runs and any output is written to `$LOGFILE`. To enhance logging with rotation I then tried to to something like: `exec java $JAVA_OPTIONS -jar current/myJarFile.jar $PORT | multilog t s131072 n100 '!/bin/gzip' /my/log/dir` Logging works perfect, but now `start-stop-daemon` writes the `PID` of `multilog` to `$PIDFILE` and not the `PID` of my java process (so stopping does not work anymore). Is there any "pipeline magic" that can be used to prevent that from happening? :)


title: Customize Lynx's filetype behavior

text: I love `lynx`. I love browsing without tabs. Call me a luddite, but I only use a modern browser if I have to. Which is about twice a day, for a few minutes at most. There's one thing I really really hate about `lynx`, though. It's not immediately apparent how to customize `lynx`'s behavior when it comes to filetypes. If I encounter a .pdf file, it downloads it, then dutifully asks me if I'd like to save it to disk. Thanks, `lynx`. It's like you read my mind or something. If I encounter a .torrent file, `lynx` downloads it, then opens it with `transmission-gtk`. Uh... no, `lynx`. I would have either preferred `transmission-cli` or just having the torrent file. If I try to open a magnet URL, `lynx` doesn't know what to do with it. (Psst! `transmission-cli`, `lynx`! But the worst is when I download .ogg, because `lynx` assumes that I want to play it with VLC _in the TTY_ using caca to render the video as ASCII. Bad `lynx`! How do I whip lynx into shape? How do I customize this behavior? Editing `/etc/lynx/lynx.cfg` does not seem to do the trick.


title: Why don't the servers use 7z?

text: By default on a UNIX machine install, I can see the logs are rotated with gzip. **Question:** Why doesn't the UNIX world use by default 7z? It would be much more efficient than gzip.. I just compressed a directory with many HTML files.   7z: 1,8 MByte zip: 440 MByte


title: Change Xfce Theme from bash script

text: I have a convertible notebook, and am writing a bash script to change from standard desktop to tablet mode. I am running XFCE. Currently, the script is switching reading the orientation from a built-in accelerator on and off, but I want it to also switch the XFCE theme programmatically. Apparently, `xfce4-settings-manager` does not have any command line options to switch the theme, and `gtk-theme-switcher2` does not apply options for the scrollbar - which is one of the things that are larger with the theme that I want to switch to. Is there any way to do that from command line?


title: Why was n't kqueue socket polling mechanism not implemented in Linux?

text: Linux has epoll for socket polling mechanism. kqueue seems to be better than epoll. Why did linux went with epoll rather than kqueue? I read about libkqueue. But that is implemented in user space and doesn't seem to be as efficient as a native kqueue implementation.


title: What is the "initialization time" in the find command?

text: When I try to refer find command's man page , I come across               -mmin n             The value of n can be one of the following:               n                    Evaluates as True if the file modification time subtracted from the initialization time, divided by 60 seconds (with any remainder discarded), is                    n.               -n                    Evaluates as True if the file modification time subtracted from the initialization time, divided by 60 seconds (with any remainder discarded), is                    less than n.               +n                    Evaluates as True if the file modification time subtracted from the initialization time, divided by 60 seconds (with any remainder discarded), is                    greater than n (in case of UNIX03, greater than n+1).             Note: Files modified after the find command start time will not be taken into account. However, when the find command is used within the unary NOT             operator for non-UNIX03 behavior, the files modified after the command start time will be displayed until the value of n.        -mtime n             The value of n can be one of the following:               n                    Evaluates as True if the file modification time subtracted from the initialization time, divided by 86400 seconds (with any remainder discarded),                    is n. 86400 seconds is 24 hours.               -n                    Evaluates as True if the file modification time subtracted from the initialization time, divided by 86400 seconds (with any remainder discarded),                    is less than n.               +n                    Evaluates as True if the file modification time subtracted from the initialization time, divided by 86400 seconds (with any remainder discarded),      What is this initialization time? Is this the time when find command got invoked?


title: Should I care about unnecessary cats?

text: A lot of command-line utilities can take their input either from a pipe or as a filename argument. For long shell scripts, I find starting the chain off with a `cat` makes it more readable, especially if the first command would need multi-line arguments. Compare               sed s/bla/blaha/ data \     | grep blah \     | grep -n babla      and               cat data \     | sed s/bla/blaha/ \     | grep blah \     | grep -n babla      Is the latter method less efficient? If so, is the difference enough to care about if the script is run, say, once a second? The difference in readability is not huge.


title: Using symbolic link on directory with contents

text: I'm working on a Debian machine with a bunch of different filesystems and I'm trying to manipulate a large amount of data in MySQL. I've run out of room in my home directory, but there's a ton of empty space in other systems (particularly one that's located in /srv). I want to make it so that /var/lib/mysql (the directory that stores MySQL data) seems to still be in its rightful location, but all of its data is stored in /srv/mysql. How can I do this?


title: How to get Debian's volume control working with Pulse

text: I finally configured Pulse to work with every application, however using the volume control on my keyboard still controls the default ALSA selected device. How do I change it so it adjusts the current Pulse selected device?


title: Why is there a Debian backport of Linux kernel?

text: I understand the reason for having a backport is so that you can run newer software on an old system without using newer (and therefore unproven) libraries. That is, the newer software would get built by an older (and certified stable) toolchain. In the case of the Linux kernel (Debian 6 shipped with **2.6.32** and the backported kernel is **2.6.38** ), why is there even a backport? I ask because I suppose that the kernel doesn't have library dependencies, so installing a kernel from the development suites of Debian shouldn't cause issues.


title: What fedora 15 should I download?

text: I would like to get Fedora 15, but I also need `kmod-nvidia-PAE` drivers. So, which iso exactly should download to make the `kmod-nvidia` work when I will download it by RPM Fusion? (Like the right kernel, not one that `kmod-nvidia` isn't made for.)


title: imagemagick creating one big image by piling up thousand of images of the same width?

text: I've got a few tens of thousands of images all of 2000 pixel width, and I would like to pile them up in one big image of summed up height and 2000 pixel width. I guess there must be a way to do that with imagemagick but I couldn't find a way to script it out for tens of thousands of images. Any suggestions?


title: Is it dangerous to remount a partition rw/ro frequently?

text: I'm developing an embedded linux system running on a SD card. To protect the SD against corruption I've used a read only root filesystem as well as an extra partition where I mount /home, also in read only mode. It is in /home where the program runs and performs read-write operations. When the software needs to write some data on the disk, it echoes these two commands and saves the data between them:               mount -o remount,rw /dev/mmcblk0p3 /home     mount -o remount,ro /dev/mmcblk0p3 /home      I'm doing this to ensure maximum prevention agains corruption if power goes down. But, I don't know if the cure may be worse than the disease. Is it dangerous for the filesystem or the SD card to perform such a frequent partition remounting each time I want to save some data? Another question. Is it dangerous to remount a partition where a program is running? I mean, not writing data on the disk, just running with the own program variables.


title: Key mappings in Linux

text: What do people mean when they point out that the "keys are not properly mapped" in a Linux installation when working on the command line? Isn't the default installation OK? What extra/specific mappings are needed? I also was told that for my Mac where my `Home` and `End` and `Ctrl` keys do not do what I expected.


title: How do I get a linux kernel patch set from the mailing list?

text: I don't subscribe to the linux-kernel mailing list, but I want to get a set of patches that were posted a few weeks ago and apply them to my kernel for testing. I'm very familiar with patching, building, etc. My question is, what's the best way to get a copy of this patch set? It's not applied to any Git repo that I'm aware of, it's just been posted to the mailing list for discussion. I find a number of sites that archive the linux-kernel mailing list and I can see the set of patches there, but none of these sites have any method (that I can find) of downloading the raw email so I can use "git apply" or "patch" or whatever. Just copy/pasting the content from my web browser seems like it will not be very successful due to whitespace differences etc. How do people manage this?


title: What options are there for tuning Linux file system caching?

text: What various types of caching are possible in the ext3 file system and how can their values be changed using system calls or other methods? I don't want to use commands or tools.


title: Parsing log files

text: I am trying to develop a system statistics tool for Ubuntu that will store data about resource utilization of processes/users. I am storing these data in my own log files like `/var/log/<process>.log`. I want to know if there is any API (like `procfs` for collecting data about processes) for parsing my own log files using C programming language. These log files will contain simply username, process id, CPU%, MEM%, I/O etc.


title: Reset dselect selection before package installation

text: I was looking through the list of packages with `dselect`, but pressed `Return` twice by mistake, thereby making it confirm and quit the `[S]elect` option. When I go to the `[I]nstall` option, it's now suggesting to install a number of new packages that I don't want (and that have nothing to do with what I was looking for in the first place). Since I haven't proceeded with the installation itself, is there a way to reset the selection to what it was before I selected new packages, without going through the list one by one and pressing `-` for each package? (It doesn't matter if it's done via `dselect` or via another related command.) **EDIT: (Adding an example)** I've tried on another machine where `dselect` is installed. Let's assume that package `gnugo` isn't installed (that's just an example).   * Launch `delect` and choose `[S]elect` to get the list.   * Search for `gnugo` in this list (using `/`, if you're not familiar with `dselect`).   * Select it with `+`.   * Press `Return` to validate the suggestions and `Return` again to validate go back to the main menu (the mistake I made).   * Go to `[I]nstall`. It will now say:              Reading package lists... Done     Building dependency tree            Reading state information... Done     The following NEW packages will be installed       gnugo:i386 libgpm2:i386 libncurses5:i386 libreadline6:i386 libtinfo5:i386     0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.     Need to get 1,926 kB of archives.     After this operation, 9,634 kB of additional disk space will be used.     Do you want to continue [Y/n]?         * Here, choose not to continue (`n`).   * Quit `dselect`.   * `dpkg --get-selections | grep gnugo` yields nothing at all.   * Start `dselect` again, go straight to `[I]nstall` again, the packages will still be selected for installation. Of course, I can go back into the `[S]elect` list, search for `gnugo`, press `_` to deselect it, but in a more complex case, you may have to go through the new packages list one by one. `[I]nstall` in `dselect` is visibly a front-end to `apt-get install`, but I'm not sure where it gets its selection from. It appears `dpkg --get-selection` is not it. As far as `dselect` is concerned, I'd like to reset it in a state where everything maked with `***` stays at it was, but what's now marked with only `**` (and not installed yet) goes back to `__`, without having to go manually through the suggested list from the `[I]nstall` menu. **EDIT 2:** This is clearly related to the content of `/var/lib/dpkg/status`, which contains this entry:               Package: gnugo     Status: install ok not-installed     Priority: optional     Section: games      If I change this manually to `Status: deinstall ok not-installed`, it disappears from the selection in `dselect` (which makes sense). What I would like is a general way of turning whatever says `Status: install ok not-installed` into `Status: deinstall ok not-installed` (leaving packages saying `Status: install ok installed` unaffected).


title: Confused about ident

text: I inherited a bunch of files that begin with the following statement at the top               Ident:/some/path/to/a/file      Ident seems to be related to C coding and make files but I am not really sure. None of the files I have are source code or anything like that. Just text files. What is the usage of Ident?