title: Shell hangs when doing command from ssh

text: I'm trying to automate a server update process. What this should do is check for `git diff` files and list them, to later be copied from one place to the other. Here's my script on my local machine: # update_frontend.sh               #!/bin/sh     ssh [login details] -t -t 'bash -s' < ~/Scripts/update_frontend_cmd.sh      # update_frontend_cmd.sh               SOURCE=/var/www/git_front/mydir_front     TARGET=/var/www/front     dothis=          cd "$SOURCE"     for i in $(git diff --name-only origin/master master)         do         x=`echo $i | sed 's/mydir\///'`             dothis=`echo "     $dothis     cp './mydir/$x' '$TARGET/$x'"`         done          git pull     eval $dothis      Problem is, after any first input from me (be it login for git pull, or if I remove it, any other command I try to execute) causes the shell to hang. I just get a blank line an infinite waiting. Any idea what's causing this?


title: Duplicating a hard disk

text: I'd like to simply duplicate a hard disk drive to another hard disk drive of the same size. I know I can simply do:               dd if=/dev/sda of=/dev/sdb      (or whatever the names of the drives are in `/dev`). Is there a better tool for this which will show me visual progress? If I'm only using 30GB of the drive, will it only take as long as it takes to transfer 30GB or will it take as long as the drive capacity?


title: Which Linux distro/mode offers lowest interference when running your own applications?

text: I'm interested in a Linux distro to build C projects and test their behavior in a very predictable and controlled environment. I'm especially concerned about letting the scheduler deal as much as possible with the threads in my application and not with other processes running in the background. Size of the distro is not an issue (I don't have resource constraints)


title: Command line utility to learn bit twiddling hacks

text: I am currently reading Hacker's Delight and would like to practice as I read through the book. Is there any command line *nix tool to perform binary operations and see output in binary?


title: Pattern Matching and Delete the whole line

text: I want to delete all the Lines of File 1, if Column1 of File1 matches exactly with Column 1 File2. File 1:               r001:21:10    21    AAAAAATTTGC    *     =    XM:21     r002:21:10    21    YAAAATTTGC     *     =    nM:21     r001:21:10    21    TTAAAATTTGC    *     =    XM:21     r0012:21:10   21    LLAAAATTTGC    *     +    XM:21     r001:21:10    21    AAAAAATTTGC    *     =    GM:21      File2:               r001:21:10     r001:21:20     r002:41:36     r002:41:99     r002:41:87     r0012:21:1      Expected Output:               r002:21:10    21    YAAAATTTGC     *     =    nM:21     r0012:21:10   21    LLAAAATTTGC    *     +    XM:21      I am new in the field and would appreciate your help.


title: How to Increase Screen Resolution in Linux Mint. (Parallels and iMac)

text: I'm very new to Linux and I've decided to install Linux Mint on a Virtual Machine on my iMac 27 inch using Parallels 7. But, the screen resolution is stuck at 800x600 and there are no options in the setting that will let me change it to a higher setting. How can I increase the resolution of Linux Mint? Is there a way to do it through the terminal? I tried downloading the drivers for my raideon 6970m but it's not helping at all. I also tried installing Parallels Tools, but that did not help with the screen resolution. Also tried setting my memory settings for the VM to 512mb... still didn't work at all.


title: can packages marked Debian/Ubuntu be installed in Linux Mint as well?

text: I have been using Ubuntu 12.10 for some time now, and I kinda hate it. 12.04 was a lot better. While i can still revert to 12.04, I am thinking about trying out Linux Mint based on 12.10 (the Nadia version). I have not tried Mint before. The question I have is, can all 'Ubuntu' based packages be installed in Mint also, without any issues? For example, most of the packages that I download from respective sites list a version for linux like this "Debian/Ubuntu" and then give a .deb file, which is quite easy to install in Ubuntu. If I get such a file, is that relevant to Linux Mint as well? If a package is made for Debian/Ubuntu, will that package be directly installable in Linux Mint as well?


title: Native Instruments Audio Kontrol 1 - crackling sound

text: I am very new user to the Linux world. I istalled newest Ubuntu on my old ASUS A7CC laptop. I would like to use also my older external sound interface Native Instruments Audio Kontrol 1. I am able to choose _Analog output (Audio Kontrol 1)_ When I am at Sound settings menu. But the sound coming out is very glitchy / cracky, I dont know how to describe it... Maybe the best example is situation when you have very limited buffer size on your ASIO sound interface and you have slow PC too and you keep getting buffer underruns in some DAW application. Any idea how to fix this issue?


title: Accessing another user's files

text: I have a file `"abc"` with permissions 440 .The owner of this file is `"root"` and the group of this file is `"groupabc"` . I have a user `"user1`" .Is their anyway I can see the contents of files `"abc"` using the user `"user1"` ? I don't have the root password. What comes to my mind is that since file `"abc"` belongs to the group `"groupabc"` ,so if I can add the user `"user1"` to the group `"groupabc"`. I should be able to view the contents of the file `"abc"`. I tried command `usermod` ,but since I don't have the `sudo` access ,It didn't work.Is their anyway I can view the contents of the file `"abc"`.


title: Run `dbus-send` in a remote system

text: I'm trying to run `dbus-send` in a remote system but somehow I'm not able to run it. But the same `dbus-send`, if I run it in the local system, is working fine. **COMMAND** : `ssh remote@xx.xx.xx.xxx "dbus-send --print-reply --dest=service.name /object/path object.path.Service.method string:"XYZ""` How can I run `dbus-send` command from the remote system? **SYSTEM INFO** Linux 3.13.0-29-generic Ubuntu i686 GNU/Linux


title: ecryptfs mounted via command line, what do I need to backup?

text: I asked this question on the ecryptfs launchpad, but it expired there without answer. https://answers.launchpad.net/ubuntu/+source/ecryptfs- utils/+question/235226 It might be trivial, but I really don't want to get it wrong for obvious reasons. On the other hand, the answers that I find are all related to the Ubuntu home directory encryption where a wrapped passphrase is used and they're confusing me. Question: I am mounting a directory as ecryptfs               sudo mount -t ecryptfs -o  ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes /srv_backend /srv_use      Now I want to backup the encrypted folder /srv_backend. What do I need to backup apart from the obvious data there and my password. The command line reply mentions a "Filename Encryption Key (FNEK) Signature [3c2034c2f35aab36]". What is this used for? Do I need to back it up / remember it?


title: I can't connect with CUPS

text: I installed CUPS following the Debian Wiki instructions with:               apt-get install cups-client cups-pdf cups      Then started the CUPS service, `/etc/init.d/cups start`, and then tried connecting to `http://localhost:631/`, but `firefox` or `w3m` can't connect with it. When I run `/etc/init.d/cups status`, the answer is: > Status of Common Unix Printing System: cupsd is running. My OS is Debian Wheezy. Edited: Added output of logs and some commands Output from `netstat -lntp`:                   Active Internet connections (only servers)     Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1834/rpcbind         tcp        0      0 0.0.0.0:48240           0.0.0.0:*               LISTEN      1868/rpc.statd       tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      2564/cupsd           tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      3206/exim4           tcp6       0      0 :::111                  :::*                    LISTEN      1834/rpcbind         tcp6       0      0 :::44155                :::*                    LISTEN      1868/rpc.statd        Output from `/var/log/cups/error_log`:               E [25/Sep/2013:00:07:12 +0200] Unable to bind socket for address 127.0.0.1:631 - Cannot assign requested address.     E [25/Sep/2013:00:11:42 +0200] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.     E [25/Sep/2013:00:11:42 +0200] Unable to bind socket for address 127.0.0.1:631 - Cannot assign requested address.     E [25/Sep/2013:00:34:43 +0200] Avahi client failed, closing client to allow a clean restart     E [25/Sep/2013:08:09:21 +0200] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.     E [25/Sep/2013:10:34:11 +0200] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.     E [25/Sep/2013:10:47:41 +0200] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.     E [25/Sep/2013:16:20:49 +0200] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.     E [25/Sep/2013:16:53:56 +0200] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.     E [25/Sep/2013:16:53:56 +0200] Unable to bind socket for address 127.0.0.1:631 - Cannot assign requested address.      Output from `/var/log/cups/access_log`:               localhost - - [25/Sep/2013:00:07:15 +0200] "POST / HTTP/1.1" 200 3498492 CUPS-Get-PPDs -      `iptables-save` has no output.


title: Why does VirtualBox crash when I finish the install of BackTrack?

text: I have a windows 7 64-bit machine in which I have installed VirtualBox and decided to install BackTrack. The installation finished fine, but when it asked me to "please remove installation media and close the tray (if any) then press ENTER" VirtualBox crashes. I have tried going through the installation process twice but it has crashed both times. Additional Info just in case: Host operating system: windows 7 64-bit 6GB of RAM, I5 ![enter image description here](http://i.stack.imgur.com/t2E2H.png) ![enter image description here](http://i.stack.imgur.com/M0hQQ.png) **SOLVED** : As I said in the comment below I found out that the crash does not affects the install...just restart virtualbox and start backtrack. But I still don't know what is causing this.


title: How to boot EFI kernel using QEMU (kvm)?

text: Hey guys I'm trying to emulate a EFI enviroment using QEMU (kmv), virtualbox takes 15 minutes to boot in EFI mode using archboot. Using legacy BIOS mode I can boot using this command:               root@citsnmaiko-deb:/home/maiko/uefi/ovmf# qemu-system-x86_64 -kernel  ../bzImage -initrd ../rootfs.gz -append "rw root=/dev/ram0  ramdisk_size=40960"      and it works with my custom kernel and file system.               file ../bzImage      ../bzImage: Linux kernel x86 boot executable bzImage, version 3.6.1 (root@citsnmaiko-deb) #4 , RO-rootFS, swap_dev 0x3, Normal VGA      it has EFI support too. I'm trying to do the same with EFI files that I downloaded from here               wget http://ufpr.dl.sourceforge.net/project/edk2/OVMF/OVMF-X64-r11337-alpha.zip -P ovmf     cd ovmf/     unzip -x OVMF-X64-r11337-alpha.zip     # rename the files for QEMU find them     mv OVMF.fd bios.bin     mv CirrusLogic5446.rom vgabios-cirrus.bin     # start QEMU     root@citsnmaiko-deb:/home/maiko/uefi/ovmf# qemu-system-x86_64 -L .  -kernel  ../bzImage -initrd ../rootfs.gz -append "rw root=/dev/ram0  ramdisk_size=40960"      Could not open option rom 'linuxboot.bin': No such file or directory     pci_add_option_rom: failed to find romfile "pxe-e1000.bin"      And I'm dropped in EFI shell not enable to boot. ![QEMU + EFI + LINUX KERNEL + SHELL](http://i.stack.imgur.com/qd4Ax.png) If I use the the latest Ubuntu release using the same EFI enviroment               root@citsnmaiko-deb:/home/maiko/uefi/ovmf# qemu-system-x86_64 -L . -boot d -cdrom ../ubuntu-12.10-desktop-amd64.iso     pci_add_option_rom: failed to find romfile "pxe-e1000.bin"      The boot process works fine ![enter image description here](http://i.stack.imgur.com/AML7H.png) I've tried to replace the Ubuntu boot files with mine but I'm not completely understand its functionality then I just replace the files after mount the iso:               mkdir tmp     bsdtar xf ubuntu-12.10-desktop-amd64.iso -C tmp     cp bzImage tmp/casper/vmlinuz     cp rootfs.gz tmp/casper/initrd.lz      genisoimage -o customUbuntu.iso tmp/     qemu-system-x86_64 -L . -boot d -cdrom customUbuntu.iso       the same EFI Shell appears. Is it ok? initrd.lz and rootfs.gz are interchangeable right ? How about bzImage and vmlinuz ? What am I missing?


title: How to set an alias on a per-directory basis?

text: Suppose you have an alias `go`, but want it to do different things in different directories? In one directory it should run `cmd1`, but in another directory it should run `cmd2` By the way, I have an aliases for switching to the above directories already, so is it possible to append the `go` alias assignment to the `foo` alias?               alias "foo=cd /path/to/foo"      Working in bash(?) on OSX.


title: Configuring Wireless Network

text: After a long struggle I finally seem to have installed the non-free wireless firmware for my wireless NIC. I'm trying to set up a file server, so I want to configure the network to be static. Would one of you guys mind helping me? For example I don't know what my /etc/network/interfaces file should look like, currently it looks like this:               auto lo     iface lo inet loopback               allow-hotplug wlan1     iface wlan1 inet static         address 192.168.10.111         netmask 255.255.255.0         network 192.168.10.0         broadcast 192.168.10.255         gateway 192.168.10.1         # wireless-* options are implemented by the wireless-tools package         wireless-mode managed         wireless-essid Optimus Pwn         wpa-psk s:roonwolf # I changed this from wiresless-key1 or something like that         dns-* options are implemented by the resolvconf package, if installed         dns-nameservers 192.168.10.1         dns-search localdomain      My ifconfig command looks like this:               lo Link encap: Local Loopback     inet addr: 127.0.0.1 Mask: 255.0.0.0     inet6 addr: ::1/128 Scope: Host     UP LOOPBACK RUNNING MTU:16436 Metric:1     RX packets: 95 errors: 0 dropped: 0 overruns: 0 frame: 0     TX packets: 95 errors: 0 dropped: 0 overruns: 0 carrier: 0     collisions: 0 txqueuelen: 0     RX bytes: 10376 (10.1KiB) TX bytes: 10376 (10.1 KiB)               wlan1 Link encap: Ethernet HWaddr 00:18:f3:85:99:07     inet addr:192.168.10.111 Bcast:192.168.10.255 Mask:255.255.255.0     UP BROADCAST MULTICAST MTU:1500 Metric:1     RX packets:0 errors:0 dropped:0 overruns:0 frame:0     TX packets:0 errors:0 dropped:0 overruns:0 carrier: 0     collisions:0 txqueuelen:1000     RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)      Here's what I get when I iwlist my ssid:               wlan1     Scan completed :           Cell 01 - Address: 00:14:D1:A4:0A:36                     Channel:6                     Frequency:2.437 GHz (Channel 6)                     Quality=70/70  Signal level=-17 dBm                       Encryption key:on                     ESSID:"Optimus Pwn"                     Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s                               9 Mb/s; 12 Mb/s; 18 Mb/s                     Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s                     Mode:Master                     Extra:tsf=00000003ff6381c1                     Extra: Last beacon: 100ms ago                     IE: Unknown: 000B4F7074696D75732050776E                     IE: Unknown: 010882848B960C121824                     IE: Unknown: 030106                     IE: Unknown: 0706555320010B1B                     IE: Unknown: 200100                     IE: WPA Version 1                         Group Cipher : TKIP                         Pairwise Ciphers (1) : TKIP                         Authentication Suites (1) : PSK                     IE: Unknown: 2A0100                     IE: Unknown: 32043048606C                     IE: Unknown: DD180050F2020101070003A4000027A4000042435E0062322F00                     IE: Unknown: DD1E00904C334C101BFFFF000000000000000000000000000000000000000000                     IE: Unknown: 2D1A4C101BFFFF000000000000000000000000000000000000000000                     IE: Unknown: DD1A00904C3406001900000000000000000000000000000000000000                     IE: Unknown: 3D1606001900000000000000000000000000000000000000                     IE: Unknown: DD0900037F01010000FF7F      When I ping 192.168.10.101(My primary desktop) I get               PING 192.168.10.101 (192.168.10.101) 56(84) bytes of data.     From 192.168.10.111 icmp_seq=2 Destination Host Unreachable      When I ping google.com I get(after a lengthy pause):               ping: unknown host google.com      What exactly am I doing wrong here? Should I restart the network?


title: Unable to access Linux share from a Windows machine with NT_STATUS_BAD_NETWORK_NAME error

text: On the Linux machine I changed the smb.conf like this:               [john]     path = /root/john/downloads     available = yes     valid users = john     read only = no     browsable = yes     public = yes     writable = yes      The path /root/john/downloads is mounted like this:               mount -o umask=0000,gid=1001,uid=1001 /dev/sdb1 /root/john/downloads      where gid and uid are `john`. Now when I try to access the share with the Windows machine \\192.168.0.2\john I get the error `network path was not found` with Wireshark I saw it's the NT_STATUS_BAD_NETWORK_NAME error. What is wrong with this, why isn't it working? When I choose /home/john as the path it works perfectly.


title: Why does --text="$@" only pass the first word?

text: When I run the following script with some arguments like `arg1 arg2 arg3`:               #!/bin/bash     zenity --entry --text="$@"      zenity creates an entry dialog with this text: "arg1" whereas I expect "arg1 arg2 arg3" If I use a variable like the following script it shows all arguments for the entry text.               #!/bin/bash     text="$@"     zenity --entry --text="$text"      Whats the difference between these scripts? Why the first one replaces `$@` with the first argument only?


title: Missing usbserial driver

text: I am looking for the usbserial driver: “option” for Debian Jessie and armel architecture. Is there a package that contains this and other usbserial drivers? Where is the source-code for this driver located?


title: Replace "<?php print t('Blabla'); ?>" to be "Blabla"

text: Lets say in `file.php`, there is lots of php print text: `<?php print t('Blabla'); ?>`, `<?php print t('Text Here'); ?>`, etc. What I need is to remove `<?php print t('` and `'); ?>` of the php print text. So, `<?php print t('Blabla'); ?>` will become `Blabla`, `<?php print t('Text Here'); ?>` will become `Text Here`, etc. If one php print text in one line, I think I know how to use `sed` to replace, but how about if one long line contains several php print text I just wonder how to replace it?


title: Samsung Ultra book won't wake up after hibernate and suspend on Crunchbang

text: I've been struggling for a few hours to get suspend and hibernate working on my Samsung ATIV BOOK 9 Lite. When I try to resume the screen power led goes on, but screen stays black. The capslock led doesn't react when pressing the capslock key, so increasing the brightness of the screen using the Fn keys also doesn't work. I've used kernel versions 3.11 and 3.12rc5 and the pm logs won't tell me much.               $ uname --all     Linux wiske 3.11-2-amd64 #1 SMP Debian 3.11.10-1 (2013-12-04) x86_64 GNU/Linux      My hardware:               $ lspci     00:00.0 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Root Complex     00:01.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Device 983d     00:01.1 Audio device: Advanced Micro Devices [AMD] nee ATI Device 9840     00:02.0 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Function 0     00:02.3 PCI bridge: Advanced Micro Devices [AMD] Family 16h Processor Functions 5:1     00:02.4 PCI bridge: Advanced Micro Devices [AMD] Family 16h Processor Functions 5:1     00:10.0 USB controller: Advanced Micro Devices [AMD] FCH USB XHCI Controller (rev 01)     00:11.0 SATA controller: Advanced Micro Devices [AMD] FCH SATA Controller [AHCI mode] (rev 40)     00:12.0 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 39)     00:12.2 USB controller: Advanced Micro Devices [AMD] FCH USB EHCI Controller (rev 39)     00:13.0 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 39)     00:13.2 USB controller: Advanced Micro Devices [AMD] FCH USB EHCI Controller (rev 39)     00:14.0 SMBus: Advanced Micro Devices [AMD] FCH SMBus Controller (rev 3a)     00:14.2 Audio device: Advanced Micro Devices [AMD] FCH Azalia Controller (rev 02)     00:14.3 ISA bridge: Advanced Micro Devices [AMD] FCH LPC Bridge (rev 11)     00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Function 0     00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Function 1     00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Function 2     00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Function 3     00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Function 4     00:18.5 Host bridge: Advanced Micro Devices [AMD] Family 16h Processor Function 5     01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 0c)     02:00.0 Network controller: Atheros Communications Inc. AR9565 Wireless Network Adapter (rev 01)      Last log lines from `/var/log/pm-suspend.log`:               $ tail -n /var/log/pm-suspend.log     + maybe_chvt     + is_set true     + return 0     + return     + is_set no     + return 1     + local status=0     + log      + is_set true     + return 0     + local fmt=%s\n     + [  = -n ]     + printf %s\n           + log -n /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:      + is_set true     + return 0     + local fmt=%s\n     + [ -n = -n ]     + fmt=%s     + shift     + printf %s /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:      /usr/lib/pm-utils/sleep.d/99video hibernate hibernate: + hook_exit_status 0     + log success.     + is_set true     + return 0     + local fmt=%s\n     + [ success. = -n ]     + printf %s\n success.     success.     + LAST_HOOK=99video     + IFS=          + IFS=            + inhibited     + [ -f /var/run/pm-utils/pm-suspend/storage/inhibit ]     + return 0     + date     + log Tue Dec 10 22:52:08 CET 2013: performing hibernate     + is_set true     + return 0     + local fmt=%s\n     + [ Tue Dec 10 22:52:08 CET 2013: performing hibernate = -n ]     + printf %s\n Tue Dec 10 22:52:08 CET 2013: performing hibernate     Tue Dec 10 22:52:08 CET 2013: performing hibernate     + sync     + do_hibernate     + [ -n  ]     + echo -n disk      How can I enable suspend and/or hibernate on my CrunchBang installation?


title: How to get server's ssl certificate in a human readable form?

text: For example, I want to find out when the certificate for encrypted.google.com expires (i.e. `Not After` date), and what other domains may use it for authentication (Subject Alternative Names).


title: Debian Console Font with Nvidia Drivers?

text: On my Debian Squeeze (6.x) installation my system had a nice small login shell font (terminus??) but after installing the nvidia drivers for my machine it boots up using a very chunky font (on a 24 inch screen). I tried to edit the appropriate file leaving font as "fixed" but changing size from 16 to 8 (one of the suggested options) but it made no visible difference. I may wish to occasionally ditch gnome and work purely on a text console. Any solution or suggestions?


title: How does apache determine what directory to show from public_html?

text: I am using Ubuntu 12.04 and have configured apache to serve from `~/public_html`. I am trying to serve some directory contents over http on LAN. When I did the following:               ln -s ../Videos/android-internals-marakana/ android-internals-marakana        I was able to see the specified directory at localhost (in browser) with my public_html directory contents as follows:               k4rtik: public_html $ ls -l     total 12     lrwxrwxrwx 1 k4rtik k4rtik   37 May 27 15:59 android-internals-marakana -> ../Videos/android-internals-marakana/     drwxrwxr-x 2 k4rtik k4rtik 4096 May 19 13:05 cgi-bin     -rw-rw-r-- 1 k4rtik k4rtik 1406 May 19 12:20 favicon.ico     -rw-r--r-- 1 k4rtik k4rtik  178 May 19 10:21 nindex.html      But when I similarly try creating a link to android documentation with               ln -s ../bin/android-sdk-linux/docs/ droid-docs      I get the symbolic link in directory listing but not at localhost in browser. I have checked everything I could on my own - directory permissions, validity of the link, typing the dir name in the url directly (received **Forbidden** - You don't have permission to access /droid-docs on this server. there). Any clue on what's going on and how to get this to work? Is it because `bin` folder is somewhat special as compared to other folders in my `home` directory?


title: HTTPd shows PHP code instead of executing it

text: My setup:               # grep php /etc/httpd/conf/httpd.conf      LoadModule php5_module  modules/libphp5.so     AddType x-httpd-php .php     AddHandler php5-script .php          # grep PHP /etc/httpd/conf/httpd.conf      PHPIniDir /etc/          # grep open_tag /etc/php.ini      ; short_open_tag     short_open_tag = On          # /etc/init.d/httpd start     Starting httpd: [Tue Dec 04 03:26:29 2012] [warn] module php5_module is already loaded, skipping     httpd: apr_sockaddr_info_get() failed for holdsworth     httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName                                                                [  OK  ]          # cat /var/log/httpd/error_log      [Tue Dec 04 03:26:37 2012] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0     [Tue Dec 04 03:26:37 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Tue Dec 04 03:26:37 2012] [warn] module php5_module is already loaded, skipping     [Tue Dec 04 03:26:45 2012] [notice] Digest: generating secret for digest authentication ...     [Tue Dec 04 03:26:45 2012] [notice] Digest: done     [Tue Dec 04 03:26:53 2012] [warn] ./mod_dnssd.c: No services found to register     [Tue Dec 04 03:26:53 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations     [Tue Dec 04 03:28:35 2012] [notice] caught SIGTERM, shutting down      access_log is empty. When I open index.php, it shows its content.               [root@holdsworth steve]# ls -lah /var/www/html/php/index.php      -rwxrwxrwx. 1 root root 1.7K Oct 31 18:38 /var/www/html/php/index.php      Help please!!


title: What is the 't' folder?

text: I'm mainly a Windows guy, programming C#, but I often do use technologies that were intended for Linux machines like git, MySQL, perl scripts, memcached, php, etc... And therefore I am exposed to these tools. I like looking at the code base of these tools every once in a while, and something I realized in many code bases is a folder called `t` with a bunch of files with the `t` extension. What are these files? How come the folder doesn't have a more descriptive name?


title: small screen in virtualbox installed OSs

text: have installed two virtual OSs. The host OS is debian. Two virtual OSs are win XP and debian ( without graphical environment) . I have install guest additions too. The win XP one is displayed in fullscreen mode but the debian one isn't. Is it related to it is in text mode ? How can I bring it to fullscreen mode? I use virtualbox.


title: Grep with spaces suddenly doesn't work

text: When performing a `grep` like:               $ tail -f apilog_2014.07.09.log | grep "HELLO" | grep "99999"      I get the desired output:               12:22:35 server apache2:  HELLO FRIEND 99999     12:22:35 server apache2:  HELLO FRIEND 99999     12:22:35 server apache2:  HELLO FRIEND 99999      However if I do:               $ tail -f apilog_2014.07.09.log | grep "HELLO FRIEND" | grep "99999"      I don't get anything. My locale settings are all set to `en_US.utf8` and I've tested with `[[:space:]]` and with `\s`. No results. The file itself is `text/plain; charset=us-ascii` (checked with `file -bi apilog_2014.07.09.log`). The files themselves are written with `rsyslog`, if that is any type of hint. Using `Ubuntu 12.04.4 LTS`. Is there anything I'm missing? As requested:               $ grep "HELLO" apilog_2014.07.09.log | od -c     0000000   1   4   :   2   7   :   0   0       s   o   f   i   a       c     0000020   a   r   l   o   s   :           A   P   I   L   O   G       H     0000040   E   L   L   O       F   R   I   E   N   D       t   e   s   t     0000060   i   n   g  \n   1   4   :   3   1   :   4   5       s   o   f     0000100   i   a       c   a   r   l   o   s   :           A   P   I   L     0000120   O   G       H   E   L   L   O       F   R   I   E   N   D     0000140   t   e   s   t   i   n   g       6   3   9   0   3  \n     0000156      **UPDATE 14 Jul 2014** Answer here: Grep with spaces suddenly doesn't work Related question (same solution): Piping from grep to awk not working


title: Create a new command for mutt

text: I try to create a command (and not a macro) on mutt to print the mail in file, for this a put the following line on the `~/.muttrc`:               macro index,pager print-on-file '<enter-command>set print_command="muttprint -x --paper A4 --printer TO_FILE:/tmp/$USER.ps && zathura /tmp/$USER.ps"<enter>p' "Print on file and open it on the reader"      As you see, I try to make the command `<enter-command>set print_command="muttprint -x --paper A4 --printer TO_FILE:/tmp/$USER.ps && zathura /tmp/$USER.ps"<enter>p` by `:print-on-file` and not by pressing a single key. I know `macro` isn’t the good command but I don’t found on the mutt’s configuration. So, how to make a new command?


title: Why does awk not sum to 0

text: I have this file and I want to sum all the number in first column. Easy:               awk '{s+=$1;print $1,s}' file     -0.4157 -0.4157     0.0143 -0.4014     0.5973 0.1959     -0.5679 -0.372     -0.2041 -0.5761     0.7130 0.1369     -0.5931 -0.4562     -0.9191 -1.3753     0.1048 -1.2705     0.4196 -0.8509     0.4196 -0.4313     0.2719 -0.1594     0.0797 -0.0797     0.0797 -5.55112e-17      You see, the last one should be 0. I know that `e-17` is zero, but sometimes the output is exactly 0. If it's not 0, the output is in range of `e-15` to `e-17`, in negative or positive form. To fix this, I have to use the absolute value:               awk '{s+=$1;if (sqrt(s^2)<0.01) s=0;print $1,s}' file      Do you know why this happens?


title: Adding comments using 'set -x'

text: Sometimes it is really handy to just add               set -x      to the top of your script to show all commands before they are executed. There is only one drawback creating scripts with a decent output: I don't know how to add text output to the script this way. If I use               echo 'some comment'      it will result in printing it doubled:               + echo 'some comment'     some comment      And if I use `#` it isn't shown at all. How can I add comments that are printed out like with `echo`? If I use `set -x`?


title: cp --attributes-only documented but not working "now"?

text: **PROBLEM** : `cp --attributes-only Source Target` results in two files unchanged, where the attributes from _Source_ should be copied to _Target_. **Attempts to solve** : As I have the **8.13** version of `coreutils` installed [Aha?], I wonder why this option is mentioned, but doesn't seem to work. No error messages, no nothing, even when running it with `\--verbose`. The same goes when trying to copy the attributes from various accounts. Nothing. In `cp`'s man page I found the option `\--attributes-only -> don't copy the file data, just the attributes` In this answer I found that > With recent versions of GNU coreutils (≥ **8.6** ), you can use cp > --attributes-only to replicate the metadata … of a file on another file > without changing the target file's contents. In another posting, someone mentions to be working in Ubuntu, but then there are remarks that I doesn't work on Mac OS X. **QUESTION** : Where am I wrong? Could it be the older version of coreutils - and if so, why is there something documented that doesn't work »now«?


title: How do I permanently mount a separate partition as folder in a separate home partition?

text: I'd like to create the following situation:   * A separate partition for my user's home directory,   * A second separate partition for _~/Documents_ , and   * A third separate partition for _~/Videos_ and _~/Music_. Achieving the first point doesn't seem to be hard, and that's already covered in questions like: How can I move the home directory to a separate partition? Achieving the other two goals should follow the same pattern, but I'm not sure if I have to take care of the order of mounting somewhere/-how (i.e., **first** _/home/user_ , **then** _/home/user/whatever_ ) . AFAIK the order in _/etc/fstab_ doesn't matter at all. While it might be easier to set up, I **don't** want to make the XDG directories symbolic links, unless other solutions were overly complex.


title: How 'safe' is it to use new distributions of linux?

text: I _hope_ this is the right place to ask this. I was looking at some new distros of linux that came out fairy recently and I really like their UI. I want to start using one of these but I'm a bit skeptical about the security of the system. Is it possible that when building the system they had introduced (unintentionally) security bugs ? I trust distributions such as ubuntu and debian because they have been around a long time and have good developers working on them. Should I also trust new distros? As for the new distributions I was talking about: Elementary OS, Bodhi, Pinguy.


title: Allow Windows file share through a Linux Firewall

text: I'm struggling to enable NTFS share between two Windows (XP and 7) hosts through a Linux firewall. Here's my setup:               [XPMachine-LAN1]---------->[LINUX FIREWALL]---------->[Win7-LAN2]      What I want to do is to NAT the NTFS input from the XP machine to the same ports on the Win7 machine. The problem is that when I try from the XP machine to open the network share `\\\LINUXFIREWALL` then the firewall doesn't seem to be NATing the packets to the Win7 machine. I've opened the standard NTFS/Samba ports like 135:139 and 445, some of them need UDP and the others TCP (details available on various sites). However since I am running 2 different versions of windows I tried to google that to see if there would be a change between XP and 7 and that list is available on MS website : http://windows.microsoft.com/en- GB/windows7/Networking-home-computers-running-different-versions-of- Windows#section_2 My question is, if you are running 2 windows machine through a *nix box with iptables, can I ask what your iptables file looks like? Am I missing something? Thanks


title: dhcp settings wifi radar linux mint

text: I am trying to connect to my wifi network. Using the standard connection manager in linux mint 13 xfce was not a good idea. No wifi networks are shown there. and when I left-click on it, the wireless are is gray. I found the tool called wifi-radar which shows all available networks around. But connecting to the right network is not possible so far. I seem to have configure a lot of things to get it right. However, I receive a dhcp error and I am trying to refer the dhcp setting right. In wifi-radar, it refers to this path:               command: /sbin/dhcpcd     pid file: /etc/dhcpc/dhcpcd-%(interface)s.pid      when I lookup this file or directory, it is not there. Where should the DHCP setting refer to? and for the ssid settings: I have a WPA security set. So I guess I have to add it as the tool does not seem to recognize this automatically (why not? the windows xp zero configuration utility does not seem to be so bad at all). which settings for my wifi network do I have to set?               -wifi options:     mode:     channel:     key:     security:          -wpa:     driver:      I am dissapointed that it is so hard to connect to my wifi network using a linux version, aimed at user-friendly-ness output of `iwconfig`:                wlan1     IEEE 802.11g  ESSID:off/any             Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated              Bit Rate:54 Mb/s   Tx-Power:10 dBm   Sensitivity=0/3             RTS thr:off   Fragment thr:off           Power Management:off           Link Quality:0  Signal level:0  Noise level:0           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:0   Missed beacon:0      output of `iwlist scan`:                Cell 04 - Address: CC:5D:4E:91:2F:CC                     ESSID:"DAroontjepower"                     Protocol:IEEE 802.11b                     Mode:Master                     Frequency:2.412 GHz (Channel 1)                     Quality:89/100  Signal level:-39 dBm  Noise level:-96 dBm                     Encryption key:on                     Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s                               9 Mb/s; 12 Mb/s; 18 Mb/s                     Extra:bcn_int=100                     Extra:atim=0                     IE: Unknown: 000E4441726F6F6E746A65706F776572                     IE: Unknown: 010C82848B960C1218243048606C                     IE: Unknown: 02050000000001                     IE: Unknown: 030101      one more thought: I read on another site that when you use ndiswrapper, for some networkadapters this means only no security or WEP-security might work. How can I found out if this cards also belongs to these cards? Might that also explain that wcid-gtk says the network is WEP encrypted?


title: Clearing dpkg downloaded data?

text: I'm using dpkg (Cydia), and a package keeps saying that it's downloading 26.2 MB, and resuming at 166.0 kB. It is consistently failing to install properly. Is there a way to clear this "saved data" and start the download fresh again?


title: xinerama, 2 cards, 3 monitors

text: I've been trying to get this right and I'm so nearly there, but not quite. This machine has an Intel adapter with one monitor, and an ATI adapter with two. I'm happy to use xinerama to get this working. Here is my xorg.conf (Ubuntu 12.04):-               Section "Monitor"         Identifier "Dell1"         Option  "DPMS"     EndSection          Section "Monitor"         Identifier "Dell2"         Option  "DPMS"         Option "Left" "Dell3"     EndSection          Section "Monitor"         Identifier "Dell3"         Option  "DPMS"     EndSection          Section "Device"         Identifier      "intel"         Driver          "intel"         BusID           "PCI:0:2:0"     EndSection          Section "Device"         Identifier      "ati"         Driver          "radeon"         BusID           "PCI:2:0:0"     #   Option          "Monitor-DVI-0" "Dell3"     #   Option          "Monitor-VGA-1" "Dell2"     EndSection          Section "Screen"         Identifier      "Screen 0"         Device          "intel"         #Monitor                "Dell1"         DefaultDepth    24     EndSection          Section "Screen"         Identifier      "Screen 1"         Device          "ati"         Monitor         "Dell2"         SubSection      "Display"                 Depth   24                 Virtual 2560 1024         EndSubSection     EndSection          Section "ServerLayout"         Option  "xinerama"      "on"         Identifier      "multihead"         Screen          "Screen 0"         Screen          "Screen 1" LeftOf "Screen 0"     EndSection          Section "Module"         Load    "glx"     EndSection      All three monitors are 1280x1024 Dells. With this, I get all three monitors live. The one connected to the Intel (the rightmost) is the primary Physical arrangement on desk:               [ Dell 3 ] [ Dell 2 ] [ Dell 1 ]     {      ATI          } {  Intel }      X server layout:               [Dell  2 ]          ] [ Dell 1 ]     [     Dell 3        ] [        ]      By this, I mean that if you start at the RHS on Dell 1, and move left, you jump to Dell 3 next. Dell 3 is showing a virtual size of 2560, and as you hit the left edge of it, it starts to pan. At this point, you also appear on Dell 2, and by the time you hit the leftmost edge, Dell 3 and 2 are showing the same thing. How can I get the monitors to lay out correctly? Many thanks! John EDIT:- Tried this instead, and again it almost works. Without the "Primary" options I get Unity on Dell1 and black screens on the others (but mouse moves across). With "Primary" options I get no Unity, background on all monitors which flickers, displays flicker when keys pressed, and it's generally very odd.               Section "Monitor"         Identifier "Dell1"         Option  "DPMS"         Option "Primary" "False"     EndSection          Section "Monitor"         Identifier "Dell2"         Option  "DPMS"         Option "Primary" "False"     EndSection          Section "Monitor"         Identifier "Dell3"         Option  "DPMS"         Option "Primary" "True"     EndSection          Section "Device"         Identifier  "intel"         Driver      "intel"         BusID       "PCI:0:2:0"     EndSection          Sec>tion "Device"         Identifier  "ati0"         Driver      "radeon"         Option      "ZaphodHeads" "DVI-0"         BusID       "PCI:2:0:0"         Screen      0     EndSection          Section "Device"         Identifier  "ati1"         Driver      "radeon"         Option      "ZaphodHeads" "VGA-1"         BusID       "PCI:2:0:0"         Screen      1     EndSection          Section "Screen"         Identifier  "Screen 0"         Device      "intel"         Monitor     "Dell1"         DefaultDepth    24     EndSection          Section "Screen"         Identifier  "Screen 1"         Device      "ati0"         Monitor     "Dell2"         DefaultDepth    24     EndSection          Section "Screen"         Identifier  "Screen 2"         Device      "ati1"         Monitor     "Dell3"         DefaultDepth    24     EndSection          Section "ServerLayout"         Option  "xinerama"  "on"         Identifier  "multihead"         Screen      "Screen 0"         Screen      "Screen 1" LeftOf "Screen 0"         Screen      "Screen 2" LeftOf "Screen 1"     EndSection          Section "Module"         Load    "glx"     EndSection


title: What is the network controller and how does it relate to Wi-Fi?

text: I am working on getting wireless up and running on my Ubuntu 12.04 machine. In this tutorial, the guy says "your network controller is your Wi-Fi." To me, that seems to imply that the network controller is the piece of hardware that handles your wireless connection. Does the network controller also handle your Ethernet connection? When I run `lspci` and `grep` for network I see that my Network controller is a Realtek Semiconductor Co. device. What exactly does that device do? My Ethernet is working fine. Do I need to find a driver that will handle both wired and wireless connections for this network controller? Or do I need a Wi-Fi driver for the network controller because the network controller only handles Wi-Fi.               $ lspci -vvnn | grep Network     03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:818b]


title: How do I actually read an XML file in human form that makes sense?

text: I downloaded a catalog and it is in XML format. How do change it from code to human-readable form, and ideally save it as a plain text file? I've never worked/seen these before; I tried messing with xslproc as it was recommended on here for somewhat similar things, but couldn't get it to work. I successfully loaded it in textWrangler, which formats it correctly (indents/colors/etc) in XML, but i don't see how I can actually 'run' it to print its contents. I also tried Excel, Word, Notepad, and just ended up with errors. If that wasn't clear, i have stuff like this:                     51.9029244701	           47.0082067303	      and I want it like this:               51.9029244701     47.0082067303      I want to make a text file with this catalog's information.


title: Systemd user unit that depends on system unit (sleep.target)

text: I was reading doc and it is still unclear for me, whether the following is possible to accomplish: service defined in `~/.config/systemd/user/task.service` that depends on system `sleep.target` (`~/.config/systemd/user/sleep.target.wants/task.service`). Now I expect `task.service` to start when I run `$ systemctl suspend`, however `task.service` is not started. I'm running debian, with systemd version 208, `systemd --user` configured more or less as described on the ArchWiki. I wonder whether my scenario could be implemented with systemd at all, or are `\--system` and `\--user` completely isolated by design so that `\--user` unit may not be a dependency of a `\--system` unit. In case it is possible, what might be the problem in my case?


title: VirtualBox guest using Bridged networking unable to obtain DHCP address

text: I have a computer, called Loki, that works as a virtual machine host and DHCP server. The DHCP daemon is listening on port `eth0`. Part of `/etc/dhcp.conf`:               subnet 192.168.13.0 netmask 255.255.255.0 {         range 192.168.13.140 192.168.13.140;     }          host Windows7VM {         hardware ethernet 08:00:27:57:C9:69;         fixed-address 192.168.13.150;         option subnet-mask 255.255.255.0;         option broadcast-address 192.168.13.255;         option routers 192.168.13.1;     }          host TerminalAdam {         hardware ethernet ...;         fixed-address 192.168.13.151;         option subnet-mask 255.255.255.0;         option broadcast-address 192.168.13.255;         option routers 192.168.13.1;     }      `eth0` is configured like this:               ifconfig eth0 192.168.13.1 netmask 255.255.255.0      There is another computer, called TerminalAdam. The DHCP client configuration of TerminalAdam works fine. Now I need to connect Windows7 virtual machine to this network, so that both TerminalAdam and Windows7VM DHCP clients are configured by Loki's DHCP server. In VirtualBox VM network settings I choose `bridge`, device `eth0`. When I turn on the VM, I get this in `/var/log/messages.log` several times:               Apr 27 14:36:41 localhost dhcpd: DHCPDISCOVER from 08:00:27:57:c9:69 via eth0     Apr 27 14:36:41 localhost dhcpd: DHCPOFFER on 192.168.13.150 to 08:00:27:57:c9:69 via eth0      But in Windows I have "connection to network is not available" in the network adapter status and I cannot connect.


title: issues with GNU tail -f and combination of commands

text: $ tail -f /logs/filename.log | awk '!(/list)'      I am able to run this command in GNU Linux flavour But when I written in a script it is not working. test.ksh:               variable="/logs/filename.log | awk '!(/list)'"      tail -f $var      Getting the error as               tail: cannot open `|' for reading: No such file or directory     tail: cannot open `grep' for reading: No such file or directory     tail: cannot open `list' for reading: No such file or directory      How is need to work on this? Can anyone guide on this?


title: Succinct way to respond to user input?

text: Of course you can do this sort of thing,               read var; if [[ $var = 'y' ]]; then echo "Yes"; fi      But is there any way to skip the first step and do something a little more like this, (ideally without needing a subshell):               if [[ $(read var) = 'y' ]]; then echo "Yes"; fi      Of course the above doesn't work unless you add `echo`, but I'm looking for something much cleaner and simpler than this:               if [[ $(read var; echo "$var") = 'y' ]]; then echo "Yes"; fi      It would be ideal if this would work:               if [[ read = 'y' ]]; then echo "Yes"; fi


title: After adding FORWARD NAT rules, cannot connect system eth0

text: I was trying to make bridge connection between wlan and eth on Centos.. I made Forward and NAT rules and then something wrong with System eth0 connection. It does not connect anymore.. Could you help me how to solve this issue? How can I go back working eth0 settings ? Edit : Here is what I did from command line                iptables -A FORWARD -i eth1 -j ACCEPT      iptables -A FORWARD -o eth1 -j ACCEPT           sysctl -w net.ipv4.ip_forward=1


title: Boot SystemRescueCd using UEFI?

text: How would you boot SystemRescueCd if you don't have the option to use the legacy-bios? I have the new UEFI and I have no luck booting SystemRescueCd(with a USB stick). I am planning to back up my partitions to a separate HDD. My OS is x86_64 Arch Linux. Do you recommend any other distributions that boot with UEFI? Hardware: Motherboard, Toshiba VG10S, processor, i7-4700mq haswell 22nm, graphics, Nvdia geforce gt 740m. I also have failed to boot Arch Linux(2013.07.01), Ubuntu (13.04), and Parted Magic(2013.06.15).


title: Modify XML file based on partial name

text: I've been using Xmlstarlet to modify some `.xml` files but I am lost trying to figure out how to modify a tag based on a partial name. What is the best way to comment out an entire line that begins with `<` and ends with `>` when the line has a name of `spiral` in it?


title: Share aliases and PATH setting between zsh and bash

text: The shell that I normally use is `zsh`. I have several aliases to enable color in some programs such as `ls` and `grep`. I've also set my custom path so that I can execute programs in non-standard place (such as in `~/bin/`). I won't change root's shell to `zsh`, but I would like to share these setting so that root can have it as well. I find out that `zsh` is not sourcing `/etc/profile`. I can source it in `/etc/zsh/zprofile`, but I would like some other more "proper" way.


title: Changing user password through GUI app

text: I was making a GUI application to manage users and groups in Linux! I'm done with the part where it creates a new user, but stuck with the part where it gives the newly created user a new password. What my app simply does is to take the required input (username, list of groups, and password) through a GUI and runs a script passing this info as argument. Let's say we have a user account, xyz. If I want to change the password for this account, then all I need to do is simply run the command:               passwd xyz      This will ask for new password. Now I can create a new account using scripts because all the required info is passed in the command line.               useradd -m -G users -g "groups" -s /bin/bash "UserName"      I can run a script through Qt app and create the user, but in `passwd cmd`, the input is asked in the other line. How does one deal with that?


title: Is there a way to switch to "su -" after switching users through "su"?

text: Maybe the title wasn't worded quite clear. But basically what I want to be able to do is to switch to having used "su -" instead of the traditional hyphenless "su" after already using "su" to switch to another account. My initial thought was to do another "su -" but that sounded a bit silly, is there a better way to do this?


title: What is the font used for GNU documentation?

text: I am interested in learning how documentation for GNU related software is written, and am wondering what type of font is used in their PDF documentation? (for instance, the GCC manual here: http://gcc.gnu.org/onlinedocs/gcc-4.5.1/gcc.pdf) Thanks.


title: How do I fix unix so that I can use the arrow keys in a terminal?

text: Before I was able to use the `Up`/`Down` arrow keys to cycle through previous commands, but now when I press a directional key it outputs "^[[A". I'm running a bash shell. How do I fix this?


title: Issues using sublime text to edit command line in VI mode

text: I am using the following to edit the current command line in Sublime Text 2 (using a working `subl` alias) **`.zshrc`**               set -o vi          EDITOR='subl'; export EDITOR          bindkey -M vicmd v edit-command-line       This opens up sublime, but the window is blank. If I set the editor back to Vim, I am able to open a new vim buffer with the current command line in it. `fc` works just fine.


title: How to increase the TTY fontsize?

text: I have a fedora machine, I am used to working on CLI since I had CRT monitor, after switching to TFT - the experience is not the same I had with CRT, the font is smaller now. How to change it?


title: Auditing Linux: tell me to what IPs a connection was established

text: I need a command, or something that runs as a cron job, that logs what IPs my machine is communicating with, what ports, and what process did it.


title: SELinux denied access

text: I keep receiving this message from SELinux in a bug report. I am new to Linux, running Fedora 13 and I am learning as I go. Any advice on what this might be would be appreciated.               Summary:          SELinux is preventing /usr/sbin/semodule access to a leaked /tmp/tmpGTbWYh file     descriptor.          Detailed Description:          [semodule has a permissive type (semanage_t). This access was not denied.]          SELinux denied access requested by the semodule command. It looks like this is     either a leaked descriptor or semodule output was redirected to a file it is not     allowed to access. Leaks usually can be ignored since SELinux is just closing     the  leak and reporting the error. The application does not use the descriptor,     so it will run properly. If this is a redirection, you will not get output in     the /tmp/tmpGTbWYh. You should generate a bugzilla on selinux-policy, and it     will get routed to the appropriate package. You can safely ignore this avc.          Allowing Access:          You can generate a local policy module to allow this access - see FAQ     (http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385)          Additional Information:          Source Context                system_u:system_r:semanage_t:s0-s0:c0.c1023     Target Context                system_u:object_r:initrc_tmp_t:s0     Target Objects                /tmp/tmpGTbWYh [ file ]     Source                        semodule     Source Path                   /usr/sbin/semodule     Port                          <Unknown>     Source RPM Packages           policycoreutils-2.0.83-28.fc13     Target RPM Packages                Policy RPM                    selinux-policy-3.7.19-62.fc13     Selinux Enabled               True     Policy Type                   targeted     Enforcing Mode                Enforcing     Plugin Name                   leaks


title: Ubuntu unattended install : echo keypress to dialog

text: Ubuntu 12.04 LTS Server 64 My unattended-mode `bootstrap.sh` script contains:               apt-get upgrade -y      I know that during execution a primitive UI for GRUB installation will be shown which requires entering keypress sequence:               up arrow      space bar      enter/return      Is it possible to pipe this sequence, something like:               echo key1 key2 key3 | apt-get upgrade -y


title: `cp -al` snapshot whose hard links get directed to a new file when edited

text: I am trying to take snapshots of a massive folder regularly. I have read here: http://www.mikerubel.org/computers/rsync_snapshots/#Incremental   that `cp -al` takes a snapshot of a folder by simply copying the hard links. That is all great, but the problem is that in this snapshot, if I change a file, it changes in all snapshots. What I would like instead is to have the system create a new file on-change and link to that instead. That way each snapshot would not become invalid on an edit of the first file. How can I achieve that? p.s. I tried `rsync -a --delete --link-dest=../backup.1 source_directory/ backup.0/`, but it has the same problem.


title: Permission bits not being enforced on samba share

text: I have a problem where permission bits are not being enforced on a samba share using a Linux client. I have samba configured on the server to force a certain user, group and permission bits and this works as expected until I touch the file or it becomes the target of IO redirection. Here's what's happening:               user@linuxbox:~-->ls -l ~/archive/foo.txt     ls: cannot access /home/user/archive/foo.txt: No such file or directory     user@linuxbox:~-->touch ~/archive/foo.txt     user@linuxbox:~-->ls -l ~/archive/foo.txt     -rw-rw-r-- 1 archive archive 0 2010-09-13 20:29 /home/user/archive/foo.txt     user@linuxbox:~-->touch ~/archive/foo.txt     user@linuxbox:~-->ls -l ~/archive/foo.txt     -rwxrwxrwx 1 archive archive 0 2010-09-13 20:30 /home/user/archive/foo.txt      Notice when I touch the existing file its permission bits are 0777. They're supposed to be 0664 like when it was first created. How can I enforce 0664 on the existing file? I have version 3.0.24 on the server and version 3.4.7 on the client. Here's my smb.conf:               [global]     interfaces = egiga0     unix charset = UTF8     workgroup = workgroup     netbios name = foo     server string = Foo     security = USER     map to guest = bad user     host msdfs = no     encrypt passwords = yes          [archive]     comment = File Archive     path = /home/archive     force user = archive     force group = archive     read only = yes     write list = @archive     guest ok = yes     create mask = 0     force create mode = 0664     security mask = 0     force security mode = 0664     directory mask = 0     force directory mode = 0775     directory security mask = 0     force directory security mode = 0775


title: User's Login date and login time

text: I want to fetch user's login time and login date, is there any command in Unix providing User's login date and User's login time ? this problem i want to perform in Shell-script where username is accepting from the end-user and after checking the availability of user, i would like to fetch that user's login time and login date in different variable and then display using 'echo' command.


title: Does one end of a pipe have both read and write fd?

text: As far as I understood one end of a pipe has both read and write fd's and the other end also has read and write fd's. Thats why when we are writing using `fd[1]`, we are closing the read end e.g. `fd[0]` of the same side of the pipe and when we are reading from the 2nd end using `fd[0]` we close the `fd[1]` of that end. Am I correct?


title: How to get started with CentOS?

text: I've been working with Debian GNU/Linux for a long time and am very proficient with it. However for a new project I've got to got familiar with CentOS ASAP. So my Question is: **How do I get started** (from a SysAdmin POV) **with CentOS ASAP**? Please remember that I'm an experienced SysAdmin, I just have no experience with RPM based Distributions in general and especially CentOS and looking for good resources to get that missing knowledge.


title: Grub error: file '/grub/i386-pc/normal.mod' not found?

text: I recently install arch (hopefully successfully) on my machine. When I went to reboot however I had a problem. I got a black screen with text saying               Grub loading.     Welcome to GRUB!     error: file '/grub/i386-pc/normal.mod' not found.     Entering rescue mode...     grub rescue>      I have since googled looking for an answer. I almost found one here on the Ubuntu forums yet then I saw one of the comments saying it was untrue. There is also another answer but I'm not sure if I want to install from the live CD for fear of messing things up. You would understand my fear if you too spent 7 hours setting this up after constantly running into partitioning, command, tutorial, and system problems. What a joy. Anyone know of an easy solution to getting grub working?


title: zsync vs. jigdo

text: What's the difference between zsync and jigdo? Their core functionality seems the same, so I'm curious on things like performance, file size, and ease-of- use. Would also be interesting to know why one got created when one already existed.


title: How to remove duplicate entries in 'Open With' Nautilus dialogue?

text: Would be nice to be shown the magic button that will help me remove this eyesore: ![alt text](http://i.stack.imgur.com/OyWPe.png) It's Nautilus **2.30** on Debian (and has been there in previous versions as far as I can remember).


title: Can Apache Web server Respond to SMTP/IMAP/POP3 requests?

text: Bear with me, please. I want to know what functions are provided by the Apache 2.4.9 Web server on Fedora 20. I understand that Apache responds to HTTP request only. I believe that SMTP and POP3 protocols don't use HTTP. Is this correct? Can Apache respond to protocols other than HTTP? Can we have more than one Apache process running on a single IP address that will respond to HTTP requests as well as mail requests? Thanks in advance..


title: Mail delivery problems

text: Once upon a time there was a server. Lets call it zzz.com, running Ubuntu LTS 10. Then, domain owner decided to create his corporate mail via Google Apps, and created account username@zzz.com. Everything looks to be fine with username@zzz.com. Mail is sent / received. But there is one mysterious problem. When PHP script at zzz.com is trying to send some mail to [ANYNAME]@zzz.com, mail is not delivered. Sendmail works fine when trying to send mail anywhere else. There is a non-delivery notification in this case in the mail log. What could this be? How can this be fixed?


title: My alias parser works on the command line but not from a script

text: I'm trying to create a simple script that will dump all my aliases into a file that bash can load when it starts up, while making sure the alias of - to popd works properly: `alias -p | sed 's/alias -=/alias -- -=/' > ~/.bash_aliases` If I run that on the command line, it seems to work, but if I put it in a script and run that (with `#!/bin/bash` at the top and `chmod +x`), instead I get an empty file. Can someone tell me what bit of bash lore I'm missing? If it matters, I'm using bash v4.2.10.


title: What GNU/Linux magazines, e-zines are available?

text: What GNU/Linux specific magazines, e-zines (free and paid) are there ?


title: Directory with +x permission, parents without it. When would this be useful?

text: Say I have a folder called `folder` in the following path:               my_path = /a/b/c/d/e/folder      and a file called `file` in that folder. Then, say I run this command to remove group permissions under /a/               > chmod g-rwx -R /a/      Now, say I give `+rx` permissions to `folder`:               > chmod g+rx /a/b/c/d/e/folder      Then, if a second user in my group runs:               > ls /a/b/c/d/e/folder      or               > cat /a/b/c/d/e/folder/file       she gets permission errors, and as far as I understand this is because I need to provide `g+x` access to to all the parents of `folder`. My question then is, **when or why** would it ever be useful to give `+x` permission to a directory whose parent does **not** have it? Thanks


title: Cross compiling htop libncursesw not found

text: I'm trying to cross compile htop on an x86 Ubuntu 13.10 machine for Raspberry Pi ARM architecture. I've a crosstool-ng toolchain correctly configured, but when I use the command: `./configure CC=/home/fb/crosstool-ng/toolchains/arm-rpi-linux- gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc CXX=/home/fb/crosstool- ng/toolchains/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-g++ --host=arm-rpi-linux-gnueabihf --build=i686-pc-linux-gnu --target=arm-rpi- linux-gnueabihf` I get this error: `checking for refresh in -lncursesw... no configure: error: You may want to use --disable-unicode or install libncursesw.` If I use the ./configure on the x86 machine, the procedure works, because `libncursesw5` and `libncursesw5-dev` are installed. The same on the Raspberry Pi. If I launch the ./configure then it works. I tried to specify the location of the libraries with the `LDFLAGS` but I get always the same error. Where am I supposed to put those libraries?! Or what is the problem when cross compiling?


title: What are "kernel data structures"?

text: While reading about the Linux kernel I came across the notion of kernel data structures. I tried to find more information via Google, but couldn't find anything.   * What are kernel data structures?    * What are their requirements, usage, and access?   * What's the organization of data structure inside the kernel? Examples of kernel data structures might be `file_operations` or `c_dev`.


title: How do I remove a driver when apt-get remove fails?

text: I am trying to remove `fglrx-driver` as part of an upgrade from `wheezy` to `jessie`. Running `apt-get dist-upgrade` failed with the following message: > >     fglrx-driver ... >     dpkg: error processing fglrx-driver (--remove): >      subprocess installed post-removal script returned error exit status 20 >     Errors were encountered while processing: >      fglrx-driver >     E: Sub-process /usr/bin/dpkg returned an error code (1) >   I tried running `sudo apt-get remove fglrx*` but got the same message. How do I get around this? Do I need to somehow "unload" the driver? If so, how?


title: iptables rules not reloading on CentOS 6.x

text: I have one single ipset added to my `iptables` on a CentOS 6.x box and this rule is lost when the machine reboots. I've found **this answer** showing how to make a Ubuntu system reload the `iptables` rules after a reboot but this directory is not present on CentOS. How do I make this CentOS box load the firewall rules after a reboot? **NOTE:** Yes, I'm saving the rules using `iptables save` and the file is being saved. This is what is inside `/etc/sysconfig/iptables`:               # Generated by iptables-save v1.4.7 on Mon Apr  8 09:52:59 2013     *filter     :INPUT ACCEPT [2713:308071]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [1649:1766437]     -A INPUT -p tcp -m multiport --dports 25,587,465,110,143,993,995 -m state --state INVALID,NEW,RELATED,ESTABLISHED -m set      --match-set blocking src -j DROP      COMMIT     # Completed on Mon Apr  8 09:52:59 2013      the command shows `-A INPUT` but when I created it I have used `-I INPUT`. The rule used to create this was:               iptables -I INPUT -p tcp -m multiport --dports 25,587,465,110,143,993,995 -m state --state NEW,ESTABLISHED,RELATED,INVALID -m set --set blocking src -j DROP


title: How do I convert a '.pages' file to something unix-y?

text: I have a file with the extension '.pages´. I _think_ that means iWork, but I'm not sure. Anyway, searching for "convert pages linux" produces a fair few false negatives! Does anyone happen to know a way to convert it to something reasonable on Linux?


title: Mount 2 directories on other servers to the same partition of local server

text: I have 3 servers, same OS (redhat 5.5 x64). There's the same package installed on these servers. Server 01 and 02 store their files at the directory /A (cause they use the same package, the directory which places the output files is the same, too). Server03 has a folder which can be accessed by WEBGUI, called /B I need to synchonize files in /A of serevr 01 ad 02 to /B (server03), means mount both directories /A from the first machines (01 and 02) to only directory /B. so that server 03 will be able to copy all files from the folders /A of the other servers. I would be happy to receive your supports. I have been struggle with this issue for months.


title: Is Inactive memory related to the Commited but unused?

text: From the Linux procfs documentation:                     Active: Memory that has been used more recently and usually not reclaimed unless                   absolutely necessary.         Inactive: Memory which has been less recently used. It is more eligible to be                   reclaimed for other purposes     Committed_AS: The amount of memory presently allocated on the system. The committed                    memory is a sum of all of the memory which has been allocated by                    processes, even if it has not been "used" by them as of yet. (...)      My question relates to the Commited_AS memory, and the part of it that is actually used/unused. My understanding is that Active memory is the part of committed memory that is actually used. However, I do not know what happens with Inactive memory; does it also include the committed but unused memory, apart from memory that has not been recently used?


title: enigmail: automatic display of photo id

text: Is there a possibility if a signed message is displayed and the key of the signer contains a photo id that this picture is displayed in thunderbird directly? Now it is only possible with "details", "key properties", "display foto"


title: program executing for 2 days

text: I have a java program which implements the Hungarian algorithm. I made changes to the existing code in such a way that the input is read from file. I have a pretty huge input around 32,000 rows for which I am calculating the maximum edge weight. The problem is, when I run the program using the command,               java Hungarian_algorithm.java      for which, I got an error, `java.lang.outofMemoryError:java Heap space error`. So, after researching a bit on the error, I ran the program using the below command.               java -d64 -Xms6g -Xmx8g Hungarian_algorithm      I started the execution 2 days back and the program has still not produced any output. So, I decided to check the memory consumption in the server. **Output of top command**               PID    USER     PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                 20760 ramesh    20   0 8482m 5.9g 3484 S  101 75.9   3099:13 java       **output of free -m command**                total       used       free     shared    buffers     cached     Mem:          7991       7937         54          0         37       1432     -/+ buffers/cache:       6467       1524     Swap:        30514       4626      25888      Should I wait for the program to produce some output or some error atleast or kill the execution of the program?


title: Thunderbird Quick Filter - remove default text

text: The Quick Filter window displays by default the text `Filter These messages... <Ctrl+Shift+K>` as displayed on the attached screenshot. ![enter image description here](http://i.stack.imgur.com/Pywt5.png) The text disappears when I start typing into the window, but reappears again when the text in the window is deleted. I find the text distracting. Is there any way to remove it? I would like to have an empty window with no text. I am using Thunderbird 24.4.0


title: Finding modified date and time of file from recovered disk image

text: Some jpeg files have been recovered from an image file of a floppy disk. Is there a way to get the modified, created and last accessed date and times of those files recovered, i.e. the time and date on the floppy disk not the PC it was recovered on? I have tried commands like find and stat, but they give the times of when the files were retrieved on my own machine.


title: How do I install Awesome Windows Manager in Terminal?

text: Right now I'm running on Kubuntu and I'd like to install Awesome Window Manager in terminal. I've used Xmonad but I'd like another window manager, but don't know how to install "Awesome" from the terminal.


title: Libav: Find out the exact time that the first frame coming from an RTSP stream was dumped into a file

text: I am dumping an RSTP stream from a web camera into a file using `avconv`:               avconv -f rtsp -rtsp_transport tcp -i rtsp://user@password/     192.168.1.4/stream.cgi -t 100 -c:v libx264 -s 1024x768 -an     /home/borrajax/Videos/capture.mp4      When I execute the command above, `avconv` seems to wait for a few... seconds (if so) and then starts recording. I'm guessing it's buffering and/or waiting for a keyframe. I'd like to know if I can get the exact time when the first frame was dumped into the destination file. (milliseconds, if it were possible) I need to synchronize the video with some other timestamped events, and I need it to be as precise as possible. Another workaround that would work great for me would be (instead of trying to get the exact time of the first frame) telling `avconv` something like " _do whatever buffering or waiting that you need to do, but make sure the first frame is dumped at EXACTLY this time_ ". Although that seems a bit more difficult to do. Is there any way of accomplishing this? I am using `Ubuntu 12.04.3 LTS` (64 bit) and `libav-tools` Version: 4:0.8.9-0ubuntu0.12.04.1 (with `libavcodec-extra-53` and `libavutil-extra-51` installed)


title: Mounting USB disks automatically (How it works)

text: Background: I am trying to mount a usb disk as read only but my ubuntu install is mounting it rw when I plug the disk in. I can unmount the disk manually and remount it manually as read only with the umount and mount commands but thats no fun. Could someone give me a quick explanation on how exactly usb mounts are automatically done on a typical linux system (udev? historical background is nice too) and maybe how I can tweak this process into letting me read the disk ro? Thanks. _Edit:_ I'm using gnome if that helps at all.   _Edit2:_ In my haste I forgot to provide a bit more information. This is what the disk looks like from the output of 'mount'.               /dev/sdb1 on /media/LaCie type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)      _Edit3:_ This also may be relavent in its own way. In the mount output I also have the following:               gvfs-fuse-daemon on /home/fletcher/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=fletcher)        I thought this might have been related to the above fuseblk mount, but what I found out was this. Gvfs is the Gnome virtual file system. It is a virtual filesystem built on top of the already existing kernel vfs. gvfs uses the GIO library (which is a VFS API) to access files, devices, remote network locations, etc. In this case above ('gvfs-fuse-daemon') gvfs is using FUSE to mount files/locations/devices. This is essentially what happens when you mount a remote network connection in Nautilus. It will use FUSE to mount the location (inside?) the .gvfs directory, and then it will communicate with the gnome virtual file system layer to communicate with the new mount. Basically this structure allows the user to dynamically mount new locations and interact with them through nautilus. _Just for reference:_ FUSE is a userspace filesystem, aka it allows the user to run mount even when that user is not root) So where does that leave me? Well the LaCie disk is being mounted with type fuseblk. This is just a block device mounted with fuse. So some daemon has autodetected the drive when it was plugged in and then gone ahead and run fuse to mount my block device. So what daemon is this, and how is it configured (my guess is it is some internal gnome thing) is the most important question. A secondary question is how the system automatically detected a newly inserted usb disk, but I think thats a bit of an aside and much lower level here (read: udev?). _Links:_   * Gvfs   * gvfs-fuse-daemon   * FUSE   * GIO


title: Does traffic addressed to one of a Linux system's own interfaces ever leave the system?

text: I have two separate servers running on the same port on a Linux system, one binded to the loopback interface, and the other to the public Ethernet interface. If I connect a client on that system to the public socket, is the system smart enough to keep the traffic internal to itself?


title: High IO-APIC-fasteoi interrupt usage eth0

text: I believe this is due to an `rsync` cronjob which runs every 15 minutes. This is a RHEL 6 box running in ESXi. `/proc/interrupts` shows:               18: 3386804969   IO-APIC-fasteoi   eth0      and the system load sometimes spikes to over 30.00. This is a single core system. The command `sar` shows the majority of the load at that time is "%system". I would like to determine why the load is going so high, and if it is in fact the due to `rsync`. Troubleshooting ideas? Could this be due to `rsync` performing checksums? Does `rsync` take advantage of TCP offloading for performing checksums?


title: Merge nonzero blocks of huge (sparse) file A into huge file B

text: I have two partial disk images from a failing hard drive. File B contains the bulk of the disk's contents, with gaps where sector reads failed. File A is the result of telling `ddrescue` to retry all the failed sectors, so it is almost entirely gaps, but contains a few places where rereads succeeded. I now need to merge the interesting contents of File A back into File B. The algorithm is simple:               while not eof(A):        read 512 bytes from A        if any of them are nonzero:            seek to corresponding offset in B            write bytes into B      and I _could_ sit down and write this myself, but I would first like to know if someone else has already written and debugged it. (To complicate matters, due to limited space, File B and File A are on two different computers -- this is why I didn't just tell `ddrescue` to attempt to fill in the gaps in B in the first place -- but A can be transferred over the network relatively easily, being sparse.)


title: How do I grep a file in a smb mount point without using mount or fstab?

text: I don't have permission to mount a smb share with the mount command or by using /etc/fstab, but I'm able to use the smb protocol in Nautilus (smb://10.1.1.1/share), for example ... s Is it possible to grep a file or use any command in it in these conditions like I do in local files? I'm running openSUSE 13.1 with LXDE.               $ uname -a     Linux thom 3.11.6-4-desktop #1 SMP PREEMPT Wed Oct 30 18:04:56 UTC 2013 (e6d4a27) x86_64 x86_64 x86_64 GNU/Linux          $ mount     devtmpfs on /dev type devtmpfs (rw,relatime,size=944020k,nr_inodes=236005,mode=755)     tmpfs on /dev/shm type tmpfs (rw,relatime)     tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)     devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)     /dev/sda1 on / type ext4 (rw,relatime,data=ordered)     proc on /proc type proc (rw,relatime)     sysfs on /sys type sysfs (rw,relatime)     tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)     cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)     tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,mode=755)     /dev/sda2 on /home type ext4 (rw,relatime,data=ordered)          $ ls -a ~/.gvfs     ls: não é possível acessar /home/thom/.gvfs: Arquivo ou diretório não encontrado


title: Hosts file: Is it incorrect to have the same IP address on multiple lines?

text: For a while I have been formatting my hosts file like this. Notice the same ip on two lines:               e.f.g.e foo.mydevsite.com     e.f.g.e foo.myOtherDevSite.com      I read recently that aliases are supposed to be consolidated on one line:               e.f.g.e foo.mydevsite.com foo.myOtherDevSite.com       However, I don't like this method because you can't easily comment out certain aliases like so or add comments to particular aliases:                 a.b.c.d foo.mydevsite.com          # myDevSite on box 1     # a.b.c.d foo.myOtherSite.com        # myOtherSite on box 1        a.b.c.d ubuntuBox                              e.f.g.e foo.myOtherSite.com        # myOtherSite testing environment      I believe the third method has been working fine; is there a problem with this?


title: How to replace icons in Linux Mint?

text: I have a problem with linux mint. The icons, I am trying to genericize my computer, with Tux logos. But some way or another, the icons reverted to linuxmint after a reboot (files were overwritten with the mint logo...). I really dislike this. I need to know how to gut linuxmint components and possibly do an in-place swap to another distro. It looked like this: http://www.youtube.com/watch?feature=player_embedded&v=-0icCwQVtFE But as soon as I rebooted, the tux menu icons change to linuxmint.


title: Insufficient privileges in NetworkManager with xmonad

text: I have problem with Network Manager in xmonad. Let's say I want to connect to a new wireless network. When I try to do so, error is displayed, saying: "insufficient privileges". But when I try do do this with Gnome 3 there is no problem. And, when new network is added (using Gnome), I can now connect to this network when I am using xmonad. I use Debian Sid, with 3.2.0-1-486 kernel, latest (0.10) version of xmonad. In xmonad, I use NetworkManager applet (0.9.2.0). Part of my .xsession:               gnome-screensaver &     gnome-settings-daemon &     if [ -x /usr/bin/nm-applet ] ; then         nm-applet --sm-disable &     fi     update-notifier &     exec xmonad      I suppose that I should add something to .xsession, but I am not sure about that. I hope that you can give me some clues and maybe even a solution. Thank you.


title: Write inside a socket open by another process in Linux

text: Is it possible on Linux for a process to write inside a socket open by another one? Let's say I open a connection to google.com using netcat:               myuser@linux:~$ nc google.com 80      Now I can lookup for the process pid and open its file descriptor folder:               myuser@linux:~$ ls -la /proc/24105/fd     totale 0     dr-x------ 2 myuser myuser  0 2012-03-10 19:01 .     dr-xr-xr-x 7 myuser myuser  0 2012-03-10 19:01 ..     lrwx------ 1 myuser myuser 64 2012-03-10 19:02 0 -> /dev/pts/12     lrwx------ 1 myuser myuser 64 2012-03-10 19:02 1 -> /dev/pts/12     lrwx------ 1 myuser myuser 64 2012-03-10 19:01 2 -> /dev/pts/12     lrwx------ 1 myuser myuser 64 2012-03-10 19:02 3 -> socket:[3947162]      So now I would like to make the HTTP request using an echo inside that socket:               myuser@linux:~$ echo "GET / HTTP/1.1" >> /proc/24285/fd/3     bash: /proc/24285/fd/3: no such device or address      Doing it as root doesn't change the result. I can't write inside the socket but I can write inside the stdin:               myuser@linux:~$ echo "GET / HTTP/1.1" >> /proc/24285/fd/0     myuser@linux:~$      But it's not what I want to do. I was thinking: a Linux socket should be treated like a file, isn't it? One or more processes can use the same socket, so why can't I do this?


title: Passing SSH options to git-clone

text: I connect to my server using SSH: `ssh user@server -p 2224 -zZ abcd` I also have a git repository on my server. The only way I know to clone is: `git clone ssh://user@server.com:2224/path/to/repo` Using the above command I can't connect to my server because `-zZ abcd` is not in the command. I tried the following commands but doesn't work. `git clone ssh://user@server.com:2224/path/to/repo -zZ abcd` `git clone "ssh://user@server.com:2224/path/to/repo -zZ abcd"` How can I include ssh parameters in `git-clone` command?


title: How to append multiple lines to a file without last newline?

text: I have a very long string that is split in chunks. I want to append them to a file without putting the newline character using bash. Example:   First append               cat >> abc.sh << EOL     echo "bla bla"     ifcon     EOL      Second append               cat >> abc.sh << EOL     fig -a     uname -a     EOL      And the file _abc.sh_ should be:               echo "bla bla"     ifconfig -a     uname -a      and not               echo "bla bla"     ifcon     fig -a     uname -a      How can I achieve this?


title: Debian package created by checkinstall overwrites a config file in /etc/default

text: I'm using checkinstall (1.6.2) to create a Debian package from compiled binaries. "make install" copies two files as follows:               install -m 0755 gmediarenderer /etc/init.d     install -m 0644 -T gmediarenderer.conf /etc/default/gmediarenderer      Both of these files are correctly incorporated into the .deb package created by checkinstall. The standard behaviour for files to be installed in /etc is for files installed here not to be overwritten when changed by the user. However, dpkg always overwrites them with the files from the package, and "dpkg -r" always removes the customised files. Can anyone explain why this is happening, and how I might make it stop? Edit: Changing the "install" commands to raw "cp" commands makes no difference (not that I really expected it to).


title: How to resize an LVM partition at the beginning

text: I have resized lvm partitions in the past, but after the resize there is space at the end of the partition. What I want to achive is to have the space at the beginning of the partition instead. The reason for this is that I want to use grub2, but the size of the grub image is bigger than the size of the MBR, so I want to move my partition a little bit to give it more space. Here is my configuration: fdisk:               Disk /dev/sda: 120.0 GB, 120034123776 bytes     255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0xa2f2ca9b             Device Boot      Start         End      Blocks   Id  System     /dev/sda1              63   125949599    62974768+  8e  Linux LVM     /dev/sda2   *   125949600   230436359    52243380    7  HPFS/NTFS/exFAT     /dev/sda3       230436360   234436544     2000092+  82  Linux swap / Solaris      pvdisplay:                 --- Physical volume ---       PV Name               /dev/sda1       VG Name               vg1       PV Size               60.00 GiB / not usable 832.00 KiB       Allocatable           yes (but full)       PE Size               4.00 MiB       Total PE              15360       Free PE               0       Allocated PE          15360       PV UUID               6O3e7e-0ofs-mqpW-QyKM-H8yL-CwFf-zBkNES      vgdisplay:                 --- Volume group ---       VG Name               vg1       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  9       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                2       Open LV               0       Max PV                0       Cur PV                1       Act PV                1       VG Size               60.00 GiB       PE Size               4.00 MiB       Total PE              15360       Alloc PE / Size       15360 / 60.00 GiB       Free  PE / Size       0 / 0          VG UUID               RhdcOf-b1xm-QNQT-7cou-ctNA-eO4b-5p2nmq      lvdisplay:                 --- Logical volume ---       LV Name                /dev/vg1/lvroot       VG Name                vg1       LV UUID                xKbY2T-kyat-Ane0-guYy-ub2a-i8Gh-cUdSgZ       LV Write Access        read/write       LV Status              available       # open                 0       LV Size                20.00 GiB       Current LE             5120       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           254:3            --- Logical volume ---       LV Name                /dev/vg1/lvhome       VG Name                vg1       LV UUID                3PPBuA-iCpW-BXVG-F00F-VO6P-oUOB-Nct4Sc       LV Write Access        read/write       LV Status              available       # open                 0       LV Size                40.00 GiB       Current LE             10240       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           254:4      What I want to do is resize lvroot by a little bit ... 1MB will be sufficient in this case, then shrink it at the beginning, then shrink the pv, delete the partition and recreated at a new start location with the same end location.


title: Size of data that can be written to / read from sockets

text: I was wondering if there is an easy way to find the maximum size that is supported by Linux sockets? (Is this configurable? If so where?) For example, most of the socket examples found on the web send "Hello Socket" or some such other small string, however if I put the whole of _War And Peace_ into the socket, when does it break? As everything is a file, is it the maximum file size? How is it coordinated when sockets connect different file systems? I'm most interested in stream sockets.


title: How to check downloaded package on OpenBSD 5.1?

text: Under linux there is a package called "ubuntu-keyring" - it's for checking that the downloaded packages (from the offical repositories) are the ones that are on the server. How can I do this under OpenBSD? How can I check that the downloaded package (via pkg_add - from the offical repo) is the one that is on the server? UPDATE: is rsync good for the job??


title: How to run a job every 6 hours starting at 3:00 using runwhen

text: I try to make runwhen perform a job every 6 hours, starting at 3:00 in the morning. (How) Can this be done?


title: How to remove all the panels in XFCE?

text: I'm pretty happy with AWN and need no native XFCE panels. I've removed all of them but can't remove the last one remaining. Is there a decent way to do it?


title: Where does Debian store network connectivity history?

text: I would like to know if Debian has anywhere where it stores a history of network connectivity- IP addresses/server, DNS etc?


title: Look at the tar log contents without extracting them

text: `tar -tvf file.tar` contains log files. Is there anyway to do something like this               tar -tvf file.tar | head -1 | awk '{print $NF}' | xargs less {}      This would give file not found, but is there a way?


title: Why do I have to stop/restart cups in redhat linux in order to use a custom filter?

text: A colleague wrote a filter utility for me in ruby that allows me to print barcodes from a textfile. (The filter replaces @{blah} with the proper PCL and a barcode checksum character so that "blah" prints in a barcode font.) I call this filter from an executable in my local bin directory. However on a fresh reboot, this process fails. (I can switch between 2 particular failures by manipulating permissions; either the filter fails to replace @{blah} with anything, or nothing prints.) If I stop and restart cups, it all works like I want it to. How can I make this work without having to restart CUPS?


title: How can you move (or copy) all files of a certain type to a directory in Unix?

text: I'm not very familiar with all the tricks of `grep/find/awk/xargs` quite yet. I have some files matching a particular pattern, say `*.xxx`. These files are in random places throughout a certain directory. How can I find all such files, and move them to a folder in my home directory on Unix (that may not exist yet)?


title: Can I connect to Windows machine from Linux shell?

text: I can connect to Linux machines from Windows using PuTTY/SSH. I want to do the other way round - connect to a Windows machine from Linux. Is this possible?


title: Low Cost, 2 Ethernet Ports & Runs Linux

text: Looking for an inexpensive embedded device that contains 2 Ethernet Ports, runs Linux (or some other type of Unix), and is under $50. My main concern is cost. It must be under $50 and have 2 Ethernet ports. It can be a bare circuit board, it doesn't need to be a complete device with cover and all.


title: Is Traffic Control (tc) broken in Fedora 17?

text: After upgrading from Fedora 16 to Fedora 17, Traffic Control no longer seems to work. Running `# tc qdisc show` will output: `qdisc pfifo_fast 0: dev eth0 root refcnt 2 bands 3 priopmap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1` However, if I run `# tc qdisc add dev eth0 root netem delay 100ms` or similar commands such as `# tc ... loss 2%` or `# tc ... corrupt 3%` I get the following: **`RNETLINK answers: No such file or directory`** Downgrading back to Fedora 16 allows me to use Traffic Control without this problem, so I'm convinced it's not a hardware issue. This question is similar to http://serverfault.com/questions/318926/tc-netem- possibly-missing but I believe the right components were installed by checking `# yum provides */tc` and ascertaining that tc is from the package `iproute`, whose latest installation I have. Is `netem` part of another package I must also install?


title: traceroute with explicit gateway selection

text: I have a router (running Linux) that is connected to two ISPs, the routes are selected using BGP, however, I would like to ping/trace each connection separately. The standard traceroute command seems to be able to do it (allow selection of outgoing interface, source IP), but it does not allow selection of the gateway. While there is a command line option (-g), all it does is set the IP routing option instead of just sending the packet there. Here's what I want: Let's say My router has two IPs - 10.0.0.1 (given by first ISP), 10.1.0.1 (given by second ISP). The default gateway (next hop) on the first ISP is 10.0.0.254 and on the second is 10.1.0.254. One of them is selected as the current default gateway (by BGP), but I also want to be able to use trace/ping trough the other gateway. I cannot change the routing table (without causing connection interruptions, especially if the other ISP has a problem). traceroute_oth --nexthop 10.0.0.254 8.8.8.8 should give               1 10.0.0.254     2 some-iother-ip.first-isp.com     ...     x 8.8.8.8      traceroute_oth --nexthop 10.1.0.254 8.8.8.8 should give               1 10.1.0.254     2 some-ip.second-isp.com     ...     x 8.8.8.8      EDIT: "traceroute -i" does not work because the router does not know the other gateway. Basically, the routing table is this (simplified):               0.0.0.0/0 gw 10.0.0.254 eth0      There is no way for the program to know what the default gateway on eth1 (link to the other ISP) is without me explicitly specifying it.


title: How can I use locate only for a directory

text: This finds a large number of files that are under various subdirectories of "Dropnot"               $ locate Dropnot      Can I find _just_ the directory location with `locate`? (which directory "Dropnot" is in) So if `Dropnot` is in `/home/me/`, that's the only entry that gets returned. If so, what's the simplest / shortest way ? Preferably through a flag or symbol rather than piping out and greping for it, etc, but I'd take anything as an option. Maybe some sort of Dropnot$ for end of line? (but didn't work).


title: vim hot keys with variables

text: I am trying to do a mapping that moves the current line to another line. Something like               nnoremap < space >m$VARIABLE :m $VARIABLE <CR> dd


title: Find software package with greatest number of system manual pages

text: I want to output the name of the installed software package that owns the greatest number of system manual pages. Is there a command to do this?