title: How can I test a kernel module in a mobile device?

text: I'm writing a module for the Linux kernel. When this module is ready, I'd like it to run in any device running the kernel. How can I test it in an Android phone? Do I need to recompile the whole tree for that phone with the module in to test it? If so, how can I do that? Is there some kind of `insmod` for Android?


title: Why is grep -o -w not giving me the expected output on Mac OS X?

text: If I do `echo foo bar baz | grep -o -w baz` the output is `foo bar baz` (and an extra newline).   The expected output would be `baz` as the -o option should only display the matched part.   I'm using Mac OS X 10.7.1 and the grep version is `grep (GNU grep) 2.5.1`


title: Which filesystem to backup is the best?

text: I just bought a disk to backup all my documents and to store it apart and I don't know what is the filesystem under Linux that gave me better reliability. Maybe I'll backup one time each month and it will not be connected all the time, but I want to be sure that my data will remain. Maybe ext4?


title: Use ssh with a specific network interface

text: I'm using `openconnect` to connect to vpn. After entering my credentials, I get this:               POST https://domain.name/...     Got CONNECT response: HTTP/1.1 200 OK     CSTP connected. DPD 30, Keepalive 30     Connected tun0 as xxx.xxx.xxx.xxx, using SSL     Established DTLS connection      Running `ifconfig` shows I have a new network interface `tun0` with a certain ip address. Question: How do I make `ssh` use only the network interface `tun0` so that I can access computers on that private network? **Edit:** My network configuration (`route -n`) seems to be this:               172.16.194.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8     192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0     172.16.25.0     0.0.0.0         255.255.255.0   U     0      0        0 vmnet1     169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0     0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 eth0


title: How to check if CONFIG_HIGH_RES_TIMERS enable?

text: I have to program a realtime application on Linux, but don't know whether the standard installation of Ubuntu has `CONFIG_HIGH_RES_TIMERS` enabled. How can I check this? I'm using Ubuntu 11.04 64bit.


title: How does bash continue to work correctly when you move its working directory?

text: On Linux, I moved a directory to another directory using `mv`, and in another shell, my working directory happened to be the directory that was moved. I ran `hg pull` in that shell, and to my surprise, it ran correctly in the new working directory - without me having to type `cd`. How did that work?


title: How to redirect kernel messages having the unique id substring into separate log file (using `rsyslog`)?

text: I am using `iptables`'s logging feature to debug my network activity. I use certain prefix with `\--log-prefix` parameter to uniquely identify messages in kernel log belonging to `iptables` output, for example `::IPT::LOG::`. How can I configure `rsyslog` to redirect messages tagged that way into a separate log file? Man page for `rsyslog` looks too cryptic to me.


title: Reverse rysnc with multiple sources

text: I'm working on some backup script right now. To speed the process up I used `rsync` with all folders to be backed up. _(Something like this:`rysnc -a --delete --progress $folder1 $folder2 $folder3 backupfolder/`)_ If I now want to reverse this _(meaning distributing the content of`backupfolder` to their respective folders.)_ how would I do this? **EDIT:** I did some research and found that:               for folder in $folder1 $folder2 $folder3     do         rsync -a --delete --progress backupfolder/$(basename $folder)/ $folder/     done      While the reverse is:               rysnc -a --delete --progress $folder1 $folder2 $folder3 backupfolder/      Is there a way to do this without a loop? It would be best if it was only one command!


title: List All Network Printers (including ones not installed)

text: It is easy to list the printers you've already installed with this command:               lpstat -a      However, this does not list network printers you have NOT installed. nmap will scan for all open ports on the LAN, but the list produced won't be limited to network printers:               sudo nmap -sT 192.168.0.1-254      Is there a command that does the following:   1. Detects the LAN you're currently connected to automatically.   2. Scans the entire LAN looking for Network Printers specifically.   3. Produces a list of Network Printers providing both their hostnames and IP addresses. For example, I logged into the web interface of Imagistics fx2100 printer today. It had a "Find device" feature that was capable of finding all the network printers on the LAN (see screenshot below). Seems like there would be a command in Linux that could achieve the same list and info (without scripting): ![enter image description here](http://i.stack.imgur.com/NOyN3.png)


title: Cron to not run on specific day but all other days

text: I have a cron setup to execute a bash script daily at 10pm. I have another cron setup to run monthly on the 1st of the month. Both crons launch a bash script, and the only different in the bash script is the argument they pass into the underlying java program (emulating command line launch of the java program). The problem is, I need to somehow disable the daily cron on the 1st of the month so that both don't try to run on the same day. Is this possible to do automatically? I suppose I can create another bash script to edit the cron before the 1st then again after to set things back up, but this seems... unclean.


title: What happens to local LAN traffic on linux to non-loopback addresses?

text: One thing I've never quite understood on Linux is what happens to local traffic that isn't directed at loopback. For example, given the following network setup:               [root@pe-323-master ~]# ifconfig     eth0      Link encap:Ethernet  HWaddr 00:0C:29:2B:59:85               inet addr:172.16.90.133  Bcast:172.16.90.255  Mask:255.255.255.0               inet6 addr: fe80::20c:29ff:fe2b:5985/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1881 errors:0 dropped:0 overruns:0 frame:0               TX packets:1205 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:234047 (228.5 KiB)  TX bytes:134389 (131.2 KiB)          eth1      Link encap:Ethernet  HWaddr 00:0C:29:2B:59:8F               inet addr:10.20.2.2  Bcast:10.20.2.255  Mask:255.255.255.0               inet6 addr: fe80::20c:29ff:fe2b:598f/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:77 errors:0 dropped:0 overruns:0 frame:0               TX packets:18 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:14880 (14.5 KiB)  TX bytes:1188 (1.1 KiB)          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:13585 errors:0 dropped:0 overruns:0 frame:0               TX packets:13585 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:6501824 (6.2 MiB)  TX bytes:6501824 (6.2 MiB)      what actually happens when I ping a local non-loopback address?               [root@pe-323-master ~]# ping -c 1 172.16.90.133     PING 172.16.90.133 (172.16.90.133) 56(84) bytes of data.     64 bytes from 172.16.90.133: icmp_seq=1 ttl=64 time=0.011 ms          --- 172.16.90.133 ping statistics ---     1 packets transmitted, 1 received, 0% packet loss, time 0ms     rtt min/avg/max/mdev = 0.011/0.011/0.011/0.000 ms      Does that traffic go out over the wire and come back, or is routed internally?


title: Rebuild RAID1 from existing disk, and add another

text: _This question is a problem derived from solving another problem that you can see onthis thread._ To make it short, my dedicated server has a RAID1 array with 2x3TB HDD. A week ago, one of them failed. The company that owns the server has replaced it, so now I have a good drive with all the data, and a new one completely empty. I am a TOTAL NEWBIE in Linux and hardware-related stuff, so forgive me is the question is very obvious but, I have no idea how to rebuild the RAID from what I have. This information might be useful (i understand there is no RAID right now):               root@rescue /dev # lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0   2.7T  0 disk     sdb      8:16   0   2.7T  0 disk     ├─sdb1   8:17   0     1M  0 part     ├─sdb2   8:18   0   127M  0 part     ├─sdb3   8:19   0   200M  0 part     ├─sdb4   8:20   0   2.7T  0 part     └─sdb5   8:21   0 455.5K  0 part     loop0    7:0    0   1.5G  1 loop     root@rescue /dev # cat /proc/mdstat     Personalities : [raid1]     unused devices: <none>      **UPDATE 1** Quick info:                  CPU1: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz (Cores 8)        Memory:  15974 MB        Disk /dev/sda: 3000 GB (=> 2794 GiB) doesn't contain a valid partition table        Disk /dev/sdb: 3000 GB (=> 2794 GiB)        Total capacity 5589 GiB with 2 Disks      **UPDATE 2:** As suggested by Trinue:               root@rescue ~ # lspci     00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)     00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)     00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)     00:1c.7 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)     00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)     00:1f.0 ISA bridge: Intel Corporation H67 Express Chipset Family LPC Controller (rev 05)     00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)     03:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller     04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)     05:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 01)      **UPDATE 3:** As suggested by @Koko, i've tried to mount the 4 partitions, but got errors on 3 of them. May this disk also be broken?               root@rescue / # mount -o ro /dev/sdb1 /mnt/disk     mount: you must specify the filesystem type     root@rescue / # mount -o ro /dev/sdb4 /mnt/disk     ntfs_attr_pread_i: ntfs_pread failed: Input/output error     Failed to calculate free MFT records: Input/output error     NTFS is either inconsistent, or there is a hardware fault, or it's a     SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows     then reboot into Windows twice. The usage of the /f parameter is very     important! If the device is a SoftRAID/FakeRAID then first activate     it and mount a different device under the /dev/mapper/ directory, (e.g.     /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation     for more details.     root@rescue / # mount -o ro /dev/sdb2 /mnt/disk     mount: you must specify the filesystem type     root@rescue / # mount -o ro /dev/sdb3 /mnt/disk     root@rescue / # cd /mnt/disk     root@rescue /mnt/disk # dir     EFI      **UPDATE 4:** As suggested by Michael Martinez and Koko, i've tried to duplicate data from sdb to sda, with the following errors:               root@rescue /mnt/disk # dd if=/dev/sdb of=/dev/sda     dd: reading `/dev/sdb': Input/output error     6619712+0 records in     6619712+0 records out     3389292544 bytes (3.4 GB) copied, 67.7475 s, 50.0 MB/s      **UPDATE 5:** These ara the instructions the owner of the server provide: http://wiki.hetzner.de/index.php/Festplattenaustausch_im_Software-RAID/en for replacing an HDD in one of their servers. However, you will notice that i don't have the raid or the partitions as in the examples they provide. **UPDATE 6:** Hetzner already answered me: _"Due to the fact that you haven't ordered an hardware RAID controller, it has a software RAID."_ **UPDATE 7:**               root@rescue / # mount /dev/sda1 /mnt/disk     mount: you must specify the filesystem type     root@rescue / # mount /dev/sda2 /mnt/disk     mount: you must specify the filesystem type     root@rescue / # mount /dev/sda3 /mnt/disk     root@rescue / # mount /dev/sda4 /mnt/disk     mount: you must specify the filesystem type     root@rescue / # mount /dev/sda5 /mnt/disk     mount: you must specify the filesystem type     root@rescue / # cd /mnt/disk     root@rescue /mnt/disk # dir     EFI      **UPDATE 8:** I should point out that before running the mount command, i `dd` sdb into sda and started to create a new array using this commands:               # mdadm --create root --level=1 --raid-devices=2 missing /dev/sdb1       # mdadm --create swap --level=1 --raid-devices=2 missing /dev/sdb2          root@rescue / # mount     proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)     sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)     udev on /dev type devtmpfs (rw,relatime,size=8176304k,nr_inodes=2044076,mode=755)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)     213.133.99.101:/nfs on /root/.oldroot/nfs type nfs (ro,noatime,vers=3,rsize=8192,wsize=8192,namlen=255,acregmin=600,acregmax=600,acdirmin=600,acdirmax=600,hard,nocto,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=213.133.99.101,mountvers=3,mountproto=tcp,local_lock=all,addr=213.133.99.101)     aufs on / type aufs (rw,relatime,si=1848aabe5590850f)     tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1635764k,mode=755)     tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)     tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=3271520k)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)     fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)      **UPDATE 9:** When server refused to boot the first time, I asked customer service for a manual reboot. The answer they gave me was: _Dear Client, we have restarted your server, but it seems that there is one hard drive faulty. If you want we can repalce them, for that please confirm us the data loss on this drive and the downtime about 15 minutes. Your server is now in the rescue system:_ Y immediately when to the robot website, when I can admin the server and searched for information about the rescue system, and here's what I found: _After activating the rescue system a config file will be created on our DHCP- server. On the next reboot your server will boot from the network and a minimal operating system will be loaded from our TFTP-server. Then you will be able to use the rescue system as long as you want. The order for the rescue system will be active for 60 minutes. If you then reboot your server, the usual system will be started from the hard disk. Please visit our Wiki for further information_ Rescue system is a 64bit Debian. **UPDATE 10**               root@rescue ~/.oldroot/nfs # ls /root/.oldroot/nfs     bash_aliases                rescue32-wheezy-v006.ext2     check                       rescue32-wheezy-v007.ext2     copy-vnode-lvs-to           rescue32-wheezy-v008.ext2     copy-vnode-lvs-to.bak       rescue32-wheezy-v009.ext2     esxi                        rescue64-lenny-v004.ext2     firmware_update             rescue64-squeeze-v011.ext2     freebsd                     rescue64-squeeze-v012.ext2     functions.sh                rescue64-squeeze-v013.ext2     images                      rescue64-squeeze-v014.ext2     images.old                  rescue64-squeeze-v015.ext2     install                     rescue64-squeeze-v016.ext2     ipmi                        rescue64-test.ext2     iso                         rescue64-wheezy-v000.ext2     knoppix                     rescue64-wheezy-v001.ext2     lost+found                  rescue64-wheezy-v002.ext2     opensolaris                 rescue64-wheezy-v003.ext2     raid_ctrl                   rescue64-wheezy-v004.ext2     README                      rescue64-wheezy-v005.ext2     rescue32-lenny-v004.ext2    rescue64-wheezy-v006.ext2     rescue32-squeeze-v011.ext2  rescue64-wheezy-v007.ext2     rescue32-squeeze-v012.ext2  rescue64-wheezy-v008.ext2     rescue32-squeeze-v013.ext2  rescue64-wheezy-v009.ext2     rescue32-squeeze-v014.ext2  shutdown-h     rescue32-squeeze-v015.ext2  shutdown-h-now     rescue32-squeeze-v016.ext2  tightvnc-vkvm.tar.gz     rescue32-test.ext2          vkvm64-squeeze-v001.ext2     rescue32-wheezy-v000.ext2   vkvm64-squeeze-v002.ext2     rescue32-wheezy-v002.ext2   vkvm64-test.ext2     rescue32-wheezy-v003.ext2   vkvm64-v001.ext2     rescue32-wheezy-v004.ext2   vkvm64-wheezy-overlay.ext2     rescue32-wheezy-v005.ext2   vkvm64-wheezy-overlay-v001.ext2      **UPDATE 11:**               root@rescue ~ # fdisk -l /dev/sdb          WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes     256 heads, 63 sectors/track, 363376 cylinders, total 5860533168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x8ab49420             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1  4294967295  2147483647+  ee  GPT     Partition 1 does not start on physical sector boundary.      **UPDATE 12:**               root@rescue ~ # parted -l     Error: The backup GPT table is corrupt, but the primary appears OK, so that will     be used.     OK/Cancel? OK     Model: ATA ST3000DM001-9YN1 (scsi)     Disk /dev/sda: 3001GB     Sector size (logical/physical): 512B/4096B     Partition Table: gpt          Number  Start   End     Size    File system  Name                          Flags      1      17.4kB  1066kB  1049kB               LDM metadata partition      2      1066kB  134MB   133MB                Microsoft reserved partition  msftres      3      135MB   345MB   210MB   fat16        EFI system partition          boot      4      345MB   3001GB  3000GB  ntfs         LDM data partition      5      3001GB  3001GB  466kB                LDM data partition               Model: ATA ST3000DM001-9YN1 (scsi)     Disk /dev/sdb: 3001GB     Sector size (logical/physical): 512B/4096B     Partition Table: gpt          Number  Start   End     Size    File system  Name                          Flags      1      17.4kB  1066kB  1049kB               LDM metadata partition      2      1066kB  134MB   133MB                Microsoft reserved partition  msftres      3      135MB   345MB   210MB   fat16        EFI system partition          boot      4      345MB   3001GB  3000GB  ntfs         LDM data partition      5      3001GB  3001GB  466kB                LDM data partition               Model: Linux Software RAID Array (md)     Disk /dev/md126: 133MB     Sector size (logical/physical): 512B/4096B     Partition Table: loop          Number  Start  End    Size   File system     Flags      1      0.00B  133MB  133MB  linux-swap(v1)               Model: Linux Software RAID Array (md)     Disk /dev/md127: 983kB     Sector size (logical/physical): 512B/4096B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0.00B  983kB  983kB  ext4


title: How can I access a shared folder from R on Ubuntu to a 2nd Ubuntu machine using Samba?

text: I have two machines running Ubuntu 12.04 LTS with Samba installed. I have access to myshared folder as expected. However, when setting in R the path `smb://mymachine1/mysharedfolder` to read a file it does't find the directory. I'm new to Ubuntu so I'm sorry if my question results obvious to you.


title: Filesystem types for encrypted partitions

text: I wish to encrypt two external hard drives using dm-crypt/LUKS for whole-disk encryption. I want one hard drive to have an ext4 filesystem for Linux use only, and the other to have an NTFS filesystem, for possible future access from Windows, as well as Linux. What I'm wondering is what filesystem type code should I allocate for each filesystem, given that they will be encrypted? Should the codes be as for normal filesystems, i.e. '83' for ext4 and '07' for NTFS, or are there special filesystem types used for encrypted volumes, or does it not make any difference which codes I choose?


title: Can't simulate initial login using sudo

text: $ sudo -iu cyrus     sudo: unable to change directory to /srv/cyrus: Permission denied     sudo: unable to execute /bin/zsh: Permission denied      I don't understand why I would get permission denied for `/bin/zsh` at all:               $ stat /bin/zsh       File: `/bin/zsh' -> `/etc/alternatives/zsh'       Size: 21          Blocks: 0          IO Block: 4096   symbolic link     Device: ceh/206d    Inode: 49686869    Links: 1     Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2014-05-02 22:19:33.464671249 +0800     Modify: 2014-05-02 22:12:21.447725196 +0800     Change: 2014-05-02 22:12:21.452724872 +0800      Birth: -      and `/srv/cyrus`:               $ stat /srv/cyrus/       File: `/srv/cyrus/'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: ceh/206d    Inode: 50467467    Links: 3     Access: (0750/drwxr-x---)  Uid: ( 1002/  cyrus)   Gid: ( 1002/  cyrus)     Access: 2014-05-02 22:05:57.702641011 +0800     Modify: 2014-05-02 22:05:58.135612918 +0800     Change: 2014-05-02 22:11:39.313461373 +0800      Birth: -      How do I debug this type of problem?


title: How to fix SSH on OSX?

text: I have been able to connect to OSX machine using ssh client successfully for hours, but then it stops working and I `get connection refused`.               ps -ax | grep ssh     841 ttys004    0:00.00 grep ssh      Using dynamic IP and the IP is correct. I turned off and on "Remote Login", but it doesn't seem to do anything. Does there need to be an SSH daemon running on OSX? How to start it? OSX 10.7.5


title: KVM to Ovirt VM migration

text: I installed ovirt on a machine that was already hosting KVM virtual machines. I am now trying to migrate those VMs over to RHEV format, but I am receiving SASL authentication errors using virt-v2v. I am not being prompted for credentials upon running the command               virt-v2v Windows7.xml -o rhev -os host.domain.net:/home/images --network ovirtmgmt Windows7      The error is               virt-v2v: Failed to connect to qemu:///system: libvirt error code: 45, message: authentication failed: Failed to step SASL negotiation: -7 (SASL(-7): invalid parameter supplied: Unexpectedly missing a prompt result)      This has been driving me crazy all night. Does anyone know anything about this?


title: The fastest desktop environment for Mint 14

text: I'm using `Mint 14` with the `Cinnamon` desktop environments, but some times it get's extremely slow. So I googled about other desktop environments and I found this great article: http://askubuntu.com/questions/65083/what-different-desktop-environments-and- shells-are-available But I don't know which one is faster, I want to install the fastest desktop environment among them, because I have a low performances in my computer.


title: Configuring anonymous rsync daemon

text: EDIT: I have since found that by using a folder in the root directory, things get a bit further - I can list the subfiles. So it really looks like permissions on the folder are the issue. I'm not sure what else to do besides chmod 777. I'm trying to configure an anonymous rsync daemon on CentOS 5.9. If I allow chroot the server reports that chroot fails. If I disable it, chdir fails.               # rsyncd.conf          max connections = 20     log file = /var/log/rsync.log     timeout = 300     use chroot = false          [builds]         path = /home/fuzz/builds         read only = yes         list = yes         uid = nobody         gid = nobody      .               # /etc/xinetd.d/rsync          # default: off     # description: The rsync server is a good addition to an ftp server, as it \     #       allows crc checksumming etc.     service rsync     {             disable = no             socket_type     = stream             wait            = no             user            = root             server          = /usr/bin/rsync             server_args     = --daemon             log_on_failure  += USERID     }      I have set all files and folders under /home/fuzz/builds to 777. The folder is owned by the user fuzz. On the client side, this works...               $ rsync rsync://host     builds      But when I try to view the contents of the builds directory, I get this error...               $ rsync -vvvv rsync://host/builds     opening tcp connection to host port 873     Connected to host (10.186.5.90)     note: iconv_open("UTF-8", "UTF-8") succeeded.     sending daemon args: --server --sender -vvvvde.Lsf . builds/     @ERROR: chdir failed     [Receiver] _exit_cleanup(code=5, file=main.c, line=1534): entered     rsync error: error starting client-server protocol (code 5) at main.c(1534) [Receiver=3.0.9]     [Receiver] _exit_cleanup(code=5, file=main.c, line=1534): about to call exit(5)


title: High performance routing with high churn ruleset. What approach is most likely to scale to C10K and beyond?

text: I've been asked to create a high throughput router using PC / server hardware. I'm modestly familiar with pf, iptables, and tc, but I've never had such high churn and so many rules. I hope you can help me avoid stupid solutions that won't work. My goal is to support at least 10,000 simultaneous clients, with at least 100 clients added and removed per second. Each client will have simple bidirectional routing rules with the following functionality:   * IPv6 only   * Forward packet (replacing source and dest addresses)   * Record bytes received   * Stop forwarding after a set amount of data was received My concern is that creating and destroying 100 rulesets per second will kill performance due to some hidden mutex. My candidate solutions are:   * OpenBSD with pf. This is my preferred solution.   * Debian with iptables + tc.   * A custom kernel module. I'd prefer not to do this, but I will if I must. Which of these solutions will scale best? What tricks should I use to get the best performance I can?


title: Get values block by block in same file

text: I have a file say "SAMPLE.txt" with following content,               P1     10,9:6/123456     P2     blah blah     P1     10,9:5/98765     P2     blah     blah     P1     blah blah     P2      I want a output file say "RESULT.txt" as,               Value1:123456     Value2:98765     Value3:NULL      I need to first fetch content between P1 & P2 part then I want to find value of 10,9*/ which I want to save to another value. Incase some P1--P2 block doesn't contain this value I want to save it as "NULL". How can I code the above in shell/awk ? I am very new to scripting.


title: Gallery of installed fonts

text: I want to view the fonts that are installed on my system. Specifically, I want the client-side (fontconfig) fonts, not the old-style X11 bitmap fonts. I guess what I'm looking for would be called a font viewer or font gallery. I want to see a bit of sample text for each font, ideally configurable sample text. Being able to filter by font name, available character sets and other characteristics would be a plus. A search of packages in Debian wheezy found `gnome-font-viewer` and `kfontview`, but they can only display a single font. I'd rather avoid depending on software that isn't widely available, including on the current Debian stable and Ubuntu LTS.


title: Run command automatically after login?

text: Another quick question. I have installed f.lux on Ubuntu 12.04, however the program refuses to work unless I run a command               xflux -l [longitude] -g [latitute] -k [temperature]      So I've created an alias with my settings so that I simply have to type the command `startflux` in a terminal at login. I want to automate this process so that my alias (or the full command above) will run after login, how would I go about doing so? I've read bits and pieces about editing the `rc.local` file, however trying this didn't seem to work? What exactly is the `rc.local` file and `etc/init.d/` and how are they used? Thanks!


title: can not use mount.cifs: mount error(2): No such file or directory

text: The command **mount.cifs** is found not being able to run in a gentoo system with **systemd**               ae429-1105 etc # mount -t cifs //file.abc.edu.au/user /home/directory/path -o credentials=/etc/user,rw,iocharset=utf8,file_mode=0777,dir_mode=0777     mount error(2): No such file or directory     Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)      It has been confirmed that the existence and accessibility of the mountpoint **/home/directory/path** and credential file **/etc/user**. Also the relevant modules and services has been enabled, i.e.,                ae429-1105 etc # lsmod |egrep 'fuse|cifs'      fuse                   72589  5       cifs                  312131  0      and               ae429-1105 etc # systemctl -t service -a |grep Samba     nmbd.service                         loaded active   running Samba NetBIOS                     name server     smbd.service                         loaded active   running Samba SMB/CIFS     server     winbindd.service                     loaded inactive dead    Samba Winbind daemon      This problem has been identified by many users, e.g. one example . **ALSO NOTE** that the same command executed in my Ubuntu/debian system is able to mount successfully. Other information in the problematic machine:               ae429-1105 etc # mount.cifs --version     mount.cifs version: 6.1      the version of mount.cifs installed in debian/ubuntu is 6.0


title: How to configure Linux to run benchmarks as stable as possible?

text: I have several long running benchmarks (SPEC CPU 2006 benchmarks) to run on a Linux server. The server is running Gentoo Linux with a Linux Kernel 3.6.11. I saw some big differences between different runs and I'm thinking that it could be some problem with my configuration. I'm the only user of the server. I have already done several configuration changes:   * I have disabled the CPU frequency scaling feature of the kernel.    * I have removed all cron jobs   * I made sure that there were no frequency scaling in the BIOS Is there some others things I should configure/disable/enable in the kernel or on the installation ? I do not need to make the server faster, but I want to make sure that the benchmarks are not encountering pertubations Thanks


title: Find files with similar names in a folder using shell script

text: I have a requirement of selecting xml files from a folder of same ID's. E.g. There are files with name   1. S-000001-0-0.xml   2. S-000001-0-1.xml   3. S-000001-0-2.xml   4. S-000001-0-3.xml   5. S-000001-0-4.xml   6. S-000002-0-0.xml   7. S-000003-0-0.xml From 1 to 5 Xml belongs to one ID and 6,7 belongs to different ID. My requirement is to select files of type 1 to 5 together and move to a new folder.


title: Configuring default alsa device (hw:0,0) in asoundrc

text: I am using a multimedia application (XBMC Frodo RC3) that does not allow me to select custom pcm device. It just asks the hardware device (in this case it is hw:0,0). Given this limitation I have to write an asoundrc (or asound.conf) file where I can configure the hw:0,0 device. I test the configuration by running:                   speaker-test -D hw:0,0 -c6      This simulates how the XBMC will produce surround sound. My asound.conf looks like this at the moment:               pcm.surroundsw {         type    route         slave {                 pcm surround51         }         ttable {                 0.2 1                 1.3 1                 2.1 8                 3.0 8                 4.4 1                 5.5 1         }      }      This is the working routing table so when I run `speaker-test -Dsurroundsw -c6` I get the desired behavior. What kind of asound.conf should I write to get the desired behavior when I run `speaker-test -D hw:0,0 -c6`? This is purely an ALSA configuration problem.


title: Dual booting Ubuntu and Windows 8. w8 boots through grub shell, but not from menu

text: I have a laptop, with installations of Ubuntu 12.10, and Windows 8. Windows 8 was first installed on the system, and Ubuntu was installed afterwards. During the Ubuntu installation, the installer recognized that there are existing partitions, but failed to see any OS on them. I created another ext4 partition in the free space, and installed Ubuntu. Initially grub only added the entry for Ubuntu, and Ubuntu works ok. Now I wanted to enter w8 settings to Grub manually, and modified `/etc/grub.d/40_custom:`               #!/bin/bash     exec tail -n +3 $0     # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.     menuentry "Windows 8" {         insmod part_gpt         insmod fat         insmod search_fs_uuid         insmod chain         #set root='(hd0,gpt1)'         search --fs_uuid --no-floppy --set=root --hint-bios=hd0,gpt2 --hint efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2         chainloader /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi     }      The search string (second to last) I found with this command: `sudo grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi` Now after updating grub config, rebooting and selecting windows 8 entry, it complains:               error: unspecified search type     error: file '/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi' not found          Press any key to continue      In Ubuntu however, if I do `ls /boot/efi/EFI/Microsoft/Boot/b*`               /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi     /boot/efi/EFI/Microsoft/Boot/bootmgr.efi     /boot/efi/EFI/Microsoft/Boot/boot.stl          /boot/efi/EFI/Microsoft/Boot/bg-BG:     bootmgfw.efi.mui     bootmgr.efi.mui      Now, if I press `e` to edit the Windows 8 entry, and then select `F2` to enter grub shell, indeed if I try to run `ls /boot/efi`, no files are shown. Funnily enough, if at this point I just type `exit`, windows 8 will boot up. `fdisk -l` gives me that it recognizes `/dev/sda1 as GPT partition` Any ideas what I should do to get grub working "right out of the menu"?


title: Installed programs not appearing at the Dash Home?

text: Some software that I install on my Ubuntu doesn't appear on the Dash Home menu. For example, I installed Komodo Edit (thru a .sh file). If I want to run this program, I have to go to the directory where its located and then click on it. If I type Komodo on the dash home menu, it just won't appear. Could it be it's because I didn't install it thru 'apt-get' (komodo is not available there) How can I enable a program on the dash home menu?


title: vim install on freebsd has taken 5 hours and counting

text: Ok, so installed portmaster and I'm trying with it, I'm hoping it won't take time. * * * So I've been up all night and my vim installation is still going on. I have an amazon ec2 freebsd server setup. I was hoping to setup jails, which took 4-5 hours to `make world` then crashed. I got that fixed and realized I didn't have vim. I google and found this article. So like a moron I did a make install for **vim** instead of **vim-lite** like the article says. It has been 5 hours or so and it's still going on and I have no clue what to do. It also keeps coming up with different prompts which I have to answer to continue.   1. If I kill this installation, can I just start from scratch and install vim-lite? Will my system will be ok? Will it take this long again?   2. Should I wait? I can't stay up any longer though to keep pressing enter! * * * Background: On EC2 freebsd doesn't come with ports installed at all. So I installed it, took some time. Other than that, since I did `make install clean` inside `/usr/ports/editors/vim/` it has just been spitting at my screen non-stop.


title: Is it safe to add . to my PATH? How come?

text: I've seen people mention in other answers that it's a bad idea to include the current working directory ('`.`') in your `$PATH` environment variable, but haven't been able to find a question specifically addressing the issue. So, why shouldn't I add `.` to my path? And if despite all warnings I do it anyway, what do I have to watch out for? Is it safer to add it to the end than to the the start?


title: Ubuntu 11.04 wireless driver not detected

text: When I run `iwconfig` I get: > no wireless extensions How do I get Ubuntu to detect my wireless driver? Looking at the output from `lspci` and `lsusb`, here's the relevant line, from `lsusb` (so it's a USB wifi and bluetooth device):               Bus 002 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]


title: how do I do this: dd if=coolstuff.iso of=(ssh kev@mypi )

text: the card reader on my laptop doesn't want to work. can I use dd (or some other tool) to write an image to a networked disk. I am trying to replace one raspberry pi distro with another. The SD card has 6gb free and uses only 2gb. from the SD card               $ sudo parted -l     Model: SD SU08G (sd/mmc)     Disk /dev/mmcblk0: 7948MB     Sector size (logical/physical): 512B/512B     Partition Table: msdos     Disk Flags:           Number  Start   End     Size    Type      File system  Flags      1      1049kB  95.4MB  94.4MB  primary   fat16        lba      2      95.4MB  1878MB  1783MB  extended      5      96.5MB  1878MB  1782MB  logical   ext4      3      1878MB  7948MB  6070MB  primary   ext4      And **Please** , before you criticize why I want to do this, answer the question... then tell me how stupid I am.


title: rolling snapshot of pictures taken in the last half hour

text: I've taken this:               find -maxdepth 1 -mtime +1 -type f -exec cp '{}' backup \;      Which should copy all the regular files in the current directory more than 1 day old to the directory backup (assuming the directory backup exists). And this:               find . -mmin -40                       Which should find files modified in the last 40mins. To give this:               find -mmin -30 -exec cp '{}' backup \;      But I'm not sure what to do next. How can I modify the above statement to copy all files and directories from `/nmt` to `/home/pi/box/street_pictures` for the last 30 min, overwriting what was previously in `/home/pi/box/street_pictures`. I, in effect, want half an hour rolling snapshot of pictures taken and placed in the `/nmt` directory to be present in the `/home/pi/box/street_pictures` directory. If I run this command each min, is it possible to do this so I don't have to clear the directory and re-copy the full hour each time?


title: How to use AWK record separator?

text: Here is the input:               *           true, false, yes, no, always, never.     *     *******************************************************************************     default:         su = true         ...         maxexpired = -1         umask = 077         expires = 0          someuser:         su = true         ...      and I only need this output:               077      So I only need the "umask = 077" line for the default user. This is a snippet from /etc/security/user. "grep -p" doesn't works, because there isn't any empty line before "default:". I googled for awk record separators, but didn't found out how to do this. How can I do this? ( "..." are just other attributes.. ) UPDATE: updated the input template, Thanks


title: zmodem not working without minicom

text: I want to upload and download file from and to the target board. I am able to send the file from the target board to PC using zmodem protocol to be specific using command                 sz -vv -b filename > /dev/ttyS0 < /dev/ttyS0      This will work fine only if the minicom is running in the PC. Since minicom is not installed in the target board am not able to send the file from PC to the board. Can anyone tell me that , is there any way to send the file without minicom using zmodem protocol.


title: why is my laptop-mode configuration being ignored?

text: I am running Debian GNU/Linux Jessie (testing) on my laptop. I enabled the systemd laptop-mode service:               $ sudo laptop_mode     Laptop mode      enabled, active [unchanged]      and in my `/etc/laptop-mode/conf.d/cpufreq.conf` I have (trimmed everything else, using defaults)               CONTROL_CPU_FREQUENCY=1     BATT_CPU_GOVERNOR=powersave     LM_AC_CPU_GOVERNOR=powersave     NOLM_AC_CPU_GOVERNOR=performance      which are modes supported by all my CPUs:               cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors     performance powersave     performance powersave     performance powersave     performance powersave      However, if I reboot with AC (or plug in the mains) and look in               cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor      powersave     powersave     powersave     powersave      all the CPUs are using powersave. So why is my config being ignored? How can I fix this? Relevant info:   * I do not have `pm-utils` or `acpid` installed (because they are known to conflict with `systemd` and `laptop-mode` in various ways)   * this was on a fresh install and there are no legacy CPU config options left over in any other laptop-mode config file.


title: How to get SCP execution time in milliseconds?

text: I have a script in which i am reading source and destination IP address from a csv file and recording the time in milliseconds it is taking to copy the file from source to destination (using scp). Below is my script.               #!/bin/bash     while IFS="," read f1 f2     do             echo "Source IP        : $f1"                    echo "Destination IP   : $f2"     export sourceIP=$f1     export destIP=$(echo "$f2" | tr -d '\n')     ssh -t -t sjain@$f1 'bash -s' <<ENDSSH     #Start copying 100MB File     startTime=$(($(date '+%s%N')/1000000))     echo \$startTime     scp MB_100.txt sjain@$destIP:/home/sjain     endTime=$(($(date '+%s%N')/1000000))     echo \$endTime     printf 'Elapsed time in copying 33KB file: %s\n' \$((endTime-startTime))      #Write the stats to the file     echo $sourceIP','$destIP',33KB,'\$((endTime-startTime)) >> report.txt     exit     ENDSSH          #Write the stats to the file     #echo '10.234.0.9,10.234.0.19,33KB,'\$((endTime-startTime)) >> report.txt          done < ipaddress.csv      **Output**               [sjain@XYZ ~]$ #Start copying 100MB File     [sjain@XYZ ~]$ startTime=1394659673854     [sjain@XYZ ~]$ echo $startTime     1394659673854     [sjain@XYZ ~]$ scp MB_100.txt sjain@10.X.X.X:/home/sjain     MB_100.txt                                    100%  100MB 100.0MB/s   00:00     [sjain@XYZ ~]$ endTime=1394659673855     [sjain@XYZ ~]$ echo $endTime     1394659673855     ndTime-startTime)) D01 ~]$ printf 'Elapsed time in copying 33KB file: %s\n' $((e     Elapsed time in copying 33KB file: 1     [sjain@XYZ ~]$ #Write the stats to the file     Time)) >> report.txt01 ~]$ echo 10.Y.Y.Y','10.X.X.X',33KB,'$((endTime-start     [sjain@XYZ ~]$ exit     exit     Connection to 10.Y.Y.Y closed.      The problem that I am facing right now , it is not returning me the time in milliseconds (i think) , it is giving in seconds. Please help in fixing this issue.


title: Convert unix time from variable to normal time in AIX

text: -d doesn't work(date: Not a recognized flag: d):                date -d @1141421607      and awk's               awk -vNEXTEXECDATUM="$NEXTEXECDATUM" 'BEGIN { print strftime("%c", NEXTEXECDATUM); exit }'      doesn't work: "awk: 0602-553 Function strftime is not defined." **My question** : how can I convert unix time from variable to normal time in AIX?


title: How to compile xbindkeys

text: I cloned the git repository of `xbindkeys` using:               git clone git://git.sv.gnu.org/xbindkeys.git      I want to compile it. How can I do this? Where can I find the compile instructions? What are the dependencies?


title: How to securely manage etckeeper from gitolite?

text: I want to maintain my debian servers by pushing etc into gitolite. The problem is that gitolite shouldn't be run as root and neither as a user that can get shell access into the system from the outside. However I need gitolite to interact with etckeeper in hooks and triggers (eg. make sure all pending changes to the working tree are committed and pushed into the bare gitolite repo before any git operations from an outside user take place) for which root access is required. I'm wondering what would be a **safe, simple and elegant** way to solve this problem. Obviously many solutions are possible, but i'm not that adept at linux sys administration, so I seek some inspiration. Possible solutions I have thought about:   * have two different users and some messaging system (producer/consumer or a deamon) with gitolite leaving a task to be executed by the root user. (seems very complicated compared to the luxury of a git hook which is a shell script that can execute any commands, especially since I will need to wait for the exit code)   * use setuid? Seems made for the task, but reading up on it, it seems dangerous and not very supported for shell scripts... Can someone point me in the right direction? **Update** : I ended up finding some answers to this question myself, so posted an answer below. Any other solutions/considerations more than welcome...


title: all media converter

text: do you know something which is able to convert almost all media types? from flv to music to wav to mp3?


title: blocking facebook.com outside facebook.com domain

text: https://addons.mozilla.org/en-US/firefox/addon/facebookblocker/      So are there any ways to block facebook.com outside the facebook.com domain?      I need a souliton that's not "webbrowser related" - no Add-on, so e.g.: a Privoxy rule.   It would still not work on HTTPS sites, only on HTTP, ok, but I still need this rule, but I don't have a clue what it is. Does anybody has?      Thank you!      UPDATE   on a desktop PC/Fedora 15      So I don't want to block facebook.com. I just don't want that that e.g.: if there is a foo.org that has a


title: How much disk space does a list of files use

text: How can I find how much disk does a list of files uses? I'm looking for a variation of               du -s *.sql      I want to see only the grand total, and with the command above, it always shows a line for each file.


title: How to list only non-<defunct> processes?

text: Is there a combination of command-line options for `ps` or `pgrep` or some other relatively direct way to determine if a particular process name is actually running (available for normal use).. By "running", I mean to specifically exclude processes which are `<defunct>` or any other non-running processes (eg. zombies :)... This sample script shows an example of `<defunct>` items:               #!/bin/bash   ubuntu 10.04            pgrep ^gnuserv$     # 25591     # 25599     # 27330            ps $(pgrep ^gnuserv$)  # command ammended as per pilcrow's good suggestion     #   PID TTY      STAT   TIME COMMAND     # 25591 ?        Zs     0:00 [gnuserv] <defunct>     # 25599 ?        Zs     0:00 [gnuserv] <defunct>     # 27330 pts/2    S+     0:00 gnuserv      * * * I could further `sed` the output, but I think/hope there's a more direct way...


title: Move Complete ORACLE from one system to another

text: ![enter image description here](http://i.stack.imgur.com/5ypWW.jpg) I have 2 identical server with exact disk partitions (OS CENTOS 6.4 both ) [My college central oracle server]. Entire ORACLE HOME ( bin , control files, data files everything on oracle) is on 2nd Disk (which is not a OS disk) Since OLD server had reached end of life (from HP) a new HP machine with upgraded RAM (OLD system had 16 GIG where as new system as 64 GIG). Now Since All oracle Dependencies (RPM, libraries, environmental variables, JAVA, Users and groups) are already made on new server. So Now Question is .. Can I remove Disk [Oracle HDD] from OLD server and insert it on NEW server and just start Oracle (sqlplus "/ as sysdba" or dbstart and lnsctrl). Can it will give any challenge. (I have cold backups, export backup, & RMAN backup too). I just want to give a try on above case. Will this work ??


title: Why does showkey show a different keycode compared to xev?

text: Looking for an answer I came across this question. There's something like this: > The keycode X uses and the keycode the kernel uses are OFF BY 8 for > "historical reasons". So take 97 - 8 = 89 and use 89 with the setkeycodes > command (again as root): Does anyone know what the historical reasons are and why the codes differ by 8?


title: What's the difference between the ^S and ^Z control characters inside a terminal?

text: When using a terminal emulator, one can stop the currently running program with either `CTRL-Z` or `CTRL-S`. What's the difference between these signals?


title: In Debian 6, how to start a daemon as a different user?

text: I'm trying to start the Tor daemon as another user. When it installs, Tor automatically creates a new user "debian-tor", however, it does not run as this user, but rather as root. In Debain 5 I removed Tor from start up with Update-rc.d, and added a new start up script that basically does `su debian-tor -c '/etc/init/tor $1'`. This worked great, but in Dabian 6 (using insserv instead of update-rc.d) it asked for **debiant-tor** 's password (in spite of running as root). I'm at a loss here, my iptables will only work if Tor runs as a different user, and it's much safer not to run it as root. What can I do?


title: Awk printf number in width and round it up

text: I need to **printf** a number out, but with given width and rounded (with awk!)               %10s      I have this and somehow I need to connect the `%d` but everything I do, ends up with too much parametres for awk (because I have more columns). Help please.


title: Are packages downloaded from multiple mirror sites?

text: I'm running F17 and inside of `yum.repos.d`. I see multiple repos listed like `adobe-linux-1386.repo`, `fedora.repo`, `google-chrome.repo`, etc. When I `yum install` are some files being downloaded from multiple different repos or all from one?


title: How to force rsync to overwrite read-only archive files?

text: I'm using `rsync` to copy some source code. The copied code must not be modified at the destination place by my mistake while code editing. So I set `\--chmod=u-w` flag to make it read-only after copying.                rsync --delete -a --chmod=u-w      First is working well. But from second time `rsync` cannot perform copying because destination is read-only.               rsync: delete_file: unlink "/path/file1" failed: Permission denied (13)     rsync: delete_file: unlink "/path/file2" failed: Permission denied (13)     rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]      I believe there's some feature that forces `rsync` to overwrite any files regardless of readonly or writable. How can I do that?


title: Grep ^ and $ at the same time

text: I'm, trying to use grep with a ^ and $ at the same time but for some reason that does not work. If I type               grep '^s.*e' german.dic      I get a lots of words starting with `s` and having an `e` somewhere. A snippet from the output               szientistischer     szientistisches     szintigraphische     szintigraphischem     szintigraphischen     szintigraphischer     szintigraphisches      So there is a word 'szintigraphische', which has an e at the end of the line. What I would expect now is that if I typed               grep '^s.*e$' german.dic      that I would at least get that result. However, the resultset is empty. How should I write a correct regexp to find all words starting with an `s` and ending with an `e`?


title: Realtek drivers prevent detection of eth1 interface?

text: Here's the situation: I had a working network setup on my Debian box, with two Ethernet interfaces being reported by `ifconfig` - eth0, and eth1. eth0 is an onboard Realtek NIC, and eth1 is a D-Link PCI NIC. Sound, however, was not working on the system. Following the advice on this page, I went to Realtek's website and downloaded the "LINUX driver for kernel 3.x and 2.6.x and 2.4.x". I unzipped it, and after installing the necessary build and Linux header packages, I ran `r8168-8.037.00/autorun.sh` as root. _Upon review, I made a big mistake here._ I clicked on "Realtek PCIe GBE Family Controller Series Drivers" rather than "HD Audio Codec Driver", so I installed their networking driver instead of their audio driver. Oops. In any case, I am now looking for a way to undo this mess. No error messages seemed to be output, but sound was still not working, so I rebooted the machine. When it came up again, `ifconfig -a` now only shows me the `eth0` interface and not `eth1`. Also, `find /sys/devices/ -type d | grep eth` only returns me `eth0` devices, and no `eth1` devices. Nor does `dmesg | grep eth1` give any output. Somehow the new Realtek drivers have prevented `eth1` from being detected! Sound still isn't working, by the way. How is this happening and how can I fix it? I guess I'll have to live without sound but I want to get back my working `eth0` and `eth1` configuration. How can I get Linux detecting `eth1` again? It looks like it may have installed some stuff into `/lib/modules/3.2.0-4-amd64/kernel/drivers/net/ethernet/realtek`, if that helps. For example, the `r8168.ko` file is in both the `src` directory of the drivers I unzipped, and in that `/lib...` directory.


title: configure iptables to accept incoming requests

text: Let me clarify: I have an iMac wich is wireless connected to the router from the ISP. The Centos computer is connected to the iMac with a cable and internet sharing is turned on. Installed Nginx on the Centos but I can not get access to it from my iMac. If I run `curl 192.168.3.2` I get connection refused On my Centos `wget 192.168.2.3` is working, because I get the index page from the iMac server running Apache. Is Centos running a firewall? EDIT for the moment I turned off iptables and I can connect, but what I would like to ask now is how to set a rule to allow incoming requests.


title: Static IP config no longer persistent in CentOS6

text: I was messing around with KVM in CentOS 6.3 when I noticed I was having problems with the IP address of my principle network connection (eth0). I backed out my bridge and restored the network-script file for eth0 but the IP address still goes missing after reboot. At this point I have to return to the console and restart the "network" service. The address will then be restored but only until the next boot. I have turned off NetworkManager but this does not seem to help. The ifcfg is below:               *DEVICE=eth0      ONBOOT=yes      BOOTPROTO=static      NM_Controlled=no      IPADDR=192.168.17.49      NETMASK=255.255.255.0      GATEWAY=192.168.17.1         DEFAULT=yes DNS1=67.69.184.212*      Any ideas?


title: What is happening exactly when I install a package with yum?

text: I'm running F17 from Terminal. I was wondering what is happening in the background when I `yum install packagename`. Is that package being searched for on my browser? Where is it being downloaded from? Is that a default location?


title: How to find the url of the saved web page?

text: I am facing this issue since long. I open a web page and save on my hard drive. Later I open the saved file. But suppose I want to know the url of the same page, how to know that. As I have no idea of how to get the url, I again have to search for the page in google. Does url also gets saved somewhere while saving the web page?


title: What does "kernel-resident" mean?

text: Quoting from the `ifconfig` man page: > `ifconfig` is used to configure the kernel-resident network interfaces. It > is used at boot time to set up interfaces as necessary. After that, it is > usually only needed when debugging or when system tuning is needed. What does kernel-resident mean?


title: Debian chroot blocking PTTYs on host

text: I've created a Debian-based chroot environment using `debootstrap` under Arch Linux, and fill it with life like this:               #!/bin/sh          mount -t proc proc $CHROOT/proc     mount -t devpts devpts $CHROOT/dev/pts          chroot $CHROOT /bin/bash --login -c "/etc/init.d/ssh start"      The problem is that after executing the script above, I'm not able to open new terminals on the host system anymore:               urxvt: can't initialize pseudo-tty, aborting.      Shutting down the `chroot` (stopping `sshd`, unmounting proc and dev/pts) does not bring back new terminals on the host. What am I missing here?


title: Unable to loop through cURL command

text: I am able to execute individual cURL commands using,               curl -u user:password -v -XPOST -H 'Content-type: text/xml' -d '<featureType><name>quadrella_indica</name></featureType>' http://localhost:8080/geoserver/rest/workspaces/opengeo/datastores/species/featuretypes      But I need to loop through the entire list of shp file and so,               for f in *.shp        do         a=${f,,};        curl -u user:password -v -XPOST -H 'Content-type: text/xml' -d    '<featureType><name>${a%.*}</name></featureType>' http://localhost:8080/geoserver/rest/workspaces/opengeo/datastores/species/featuretypes      done      But unlike the success that I receive when I am adding them individually, I receive an error when I loop through,               * About to connect() to localhost port 8080 (#0)     *   Trying ::1... connected     * Server auth using Basic with user 'admin'     > POST /geoserver/rest/workspaces/opengeo/datastores/species/featuretypes HTTP/1.1     > Authorization: Basic YWRtaW46Z2Vvc2VydmVy     > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3     > Host: localhost:8080     > Accept: */*     > Content-type: text/xml     > Content-Length: 47     >      * upload completely sent off: 47out of 47 bytes     < HTTP/1.1 400 Bad Request     < Server: Apache-Coyote/1.1     < Content-Type: text/plain     < Transfer-Encoding: chunked     < Date: Sun, 25 Nov 2012 18:19:31 GMT     < Connection: close     <      * Closing connection #0     Trying to create new feature type inside the store, but no attributes were specified      I am doing something wrong in the looping as the individual cURLs work just fine. How can I correct it?


title: How to initialize a read-only, global, associative array in Bash?

text: I execute the following code in Bash version "GNU bash, Version 4.2.39(1)-release (x86_64-redhat-linux-gnu)":               function foobar {       declare -rgA FOOBAR=([foo]=bar)     }     foobar     declare -p FOOBAR     # Output: declare -Ar FOOBAR='()'      Why doesn't Bash initialize `FOOBAR` with `([foo]=bar)` according to `declare -p`? The same declaration works outside of a function, e.g.               declare -rgA FOOBAR=([foo]=bar)     declare -p FOOBAR     # Output: declare -Ar FOOBAR='([foo]="bar" )'      Similarly the following code but without `FOOBAR` being read-only works:               function foobar {       declare -gA FOOBAR       FOOBAR=([foo]=bar)     }     foobar     declare -p FOOBAR     # Output: declare -A FOOBAR='([foo]="bar" )'      Is this a bug or feature?


title: adding text to filename before extension

text: I would like to add text to the end of filename but before the extension. Right now I am trying, `for f in *.shp; do echo $f_poly; done` the output is,               Quercus_acutifolia.shp_poly     Quercus_agrifolia.shp_poly     Quercus_corrugata.shp_poly     Quercus_cortesii.shp_poly     Quercus_costaricensis.shp_poly     Quercus_havardii.shp_poly     Quercus_hemisphaerica.shp_poly     Quercus_kelloggii.shp_poly     Quercus_knoblochii.shp_poly     Quercus_laceyi.shp_poly      I want it to be,               Quercus_acutifolia_poly.shp     Quercus_agrifolia_poly.shp     Quercus_corrugata_poly.shp     Quercus_cortesii_poly.shp     Quercus_costaricensis_poly.shp     Quercus_havardii_poly.shp     Quercus_hemisphaerica_poly.shp     Quercus_kelloggii_poly.shp     Quercus_knoblochii_poly.shp     Quercus_laceyi_poly.shp


title: HDI script fixed (non-interactive) input in a command-line gui program?

text: I want to create a simple script that initiates a simple gui-based program (think ncurses-style, text-based graphics in a shell) in Debian. I only access the server through SSH, so I can't do standard macros or anything. The input is always the same: I just need it to start the program, then within the context of the program, send an "enter" keystroke, an "R" keystroke, and an "F7" keystroke. I've been working on this for a while now, and I can't seem to figure anything out. Is there any way to do this within a bash script? Thank you and have a good day


title: How do I fix my FastCGI Pinax / Django deployment?

text: I'm running OSX Lion (posted here because this is a Unix-specific question), and am trying to deploy a Pinax project via FCGI. I have the FastCGI daemon running:               $ ps wwaux | grep fcgi     jonathan          522   0.0  0.2  2480420   4216   ??  S    10:54AM   0:01.14 python manage.py runfcgi method=threaded host=127.0.0.1 port=1054     jonathan         6981   0.0  0.0  2434892    536 s001  R+    2:00PM   0:00.00 grep fcgi      In my /etc/hosts I have:               FastCGIExternalServer /Users/jonathan/orthodox/orthodox.fcgi -host 127.0.0.1:1054          <VirtualHost *:80>         ServerAdmin cjshayward@pobox.com         ServerName orthodox-network.com         ServerAlias www.orthodox-network.com orthodox.haywardfamily.org         DocumentRoot /Users/jonathan/orthodox         Alias /media /Users/jonathan/orthodox/media         RewriteEngine On         RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]         RewriteCond %{REQUEST_FILENAME} !-f         RewriteRule ^/(.*)$ /orthodox.fcgi/$1 [QSA,L]     </VirtualHost>          <Directory /Users/jonathan/>         Options Indexes FollowSymLinks MultiViews         AllowOverride None         Order allow,deny         allow from all     </Directory>      On this machine I have no other VirtualHosts. In /Users/jonathan/orthodox/orthodox.fcgi, I have:               #!/usr/bin/python     import sys, os          # Add a custom Python path.     sys.path.insert(0, "/Users/jonathan")          # Switch to the directory of your project. (Optional.)     os.chdir("/Users/jonathan/orthodox")          # Set the DJANGO_SETTINGS_MODULE environment variable.     os.environ['DJANGO_SETTINGS_MODULE'] = "orthodox.settings"               from django.core.servers.fastcgi import runfastcgi     runfastcgi(method="threaded", daemonize="false")      _And when I pull it up in a browser it hangs._ Any advice about what I can correct to have an FCGI Django deployment?


title: How do I satisfy the "warnings" Pinax requirement?

text: I'm trying to build a Pinax virtualenv. I get, on Precise Penguin with 0.7:               jonathan@ubuntu:~/Downloads/Pinax-0.7-bundle/scripts$ ./pinax-boot.py ~/virtual     New python executable in /home/jonathan/virtual/bin/python     Traceback (most recent call last):       File "/home/jonathan/virtual/lib/python2.7/site.py", line 67, in <module>         import os       File "/home/jonathan/virtual/lib/python2.7/os.py", line 49, in <module>         import posixpath as path       File "/home/jonathan/virtual/lib/python2.7/posixpath.py", line 17, in <module>         import warnings     ImportError: No module named warnings     ERROR: The executable /home/jonathan/virtual/bin/python is not functioning     ERROR: It thinks sys.prefix is '/home/jonathan/Downloads/Pinax-0.7-bundle/scripts' (should be '/home/jonathan/virtual')     ERROR: virtualenv is not compatible with this system or executable      --EDIT-- There is a similar-looking, but different, error under 0.7.3:                New python executable in /home/jonathan/v/bin/python     Traceback (most recent call last):       File "/home/jonathan/v/lib/python2.7/site.py", line 67, in <module>         import os       File "/home/jonathan/v/lib/python2.7/os.py", line 398, in <module>         import UserDict       File "/home/jonathan/v/lib/python2.7/UserDict.py", line 83, in <module>         import _abcoll       File "/home/jonathan/v/lib/python2.7/_abcoll.py", line 11, in <module>         from abc import ABCMeta, abstractmethod       File "/home/jonathan/v/lib/python2.7/abc.py", line 8, in <module>         from _weakrefset import WeakSet     ImportError: No module named _weakrefset     ERROR: The executable /home/jonathan/v/bin/python is not functioning     ERROR: It thinks sys.prefix is '/home/jonathan/Pinax-0.7.3-bundle/scripts' (should be '/home/jonathan/v')     ERROR: virtualenv is not compatible with this system or executable      --EDIT-- How should I be creating virtual environments, or what should I be doing instead, under 0.9a2 compared to 0.7? (I do not see 0.9a2 providing a pinax- boot.py script.)


title: Openbox overwrites xmodmap configuration

text: I am setting up openbox on my laptop running Linux Mint 13. I want my Caps Lock key to act as an additional control key. I put the required settings in my `~/.Xmodmap` file and checked it by running               xmodmap ~/.Xmodmap      It works correctly. However when I relogin to my openbox session, these key changes are not present. Running the above `xmodmap` command gets it working again, but I want it to happen automatically at startup. What's interesting is that I added a test `zenity` command as following to my `~/.config/openbox/autostart` file               zenity --info --text=Hello      This produces a small dialog window and exits only after the dialog is closed. Now, when I relogin to my openbox session, the Caps Lock acts as a Ctrl key, _until_ the zenity dialog is closed. Once that dialog is closed, the Caps Lock returns to its default behavior. I haven't found anything on this with google so I'm asking for help here. Do you guys have any ideas on what might be going wrong? ## Update: I have been trying to figure this out and in my experiments, I copied my `/usr/bin/xmodmap` file to `/usr/bin/xmodmap_` and replaced the `/usr/bin/xmodmap` file with the following bash script               #!/bin/bash          {         echo '-------'         date         echo xmodmap "$@"     } >> ~/xmodmap-calls          exec /usr/bin/xmodmap_ "$@"      So, every time any damn script on the system runs `xmodmap`, I get to know it. With this, I relogin and I only find one entry in my `~/xmodmap-calls` file, which is the one running my `~/.Xmodmap`, which is expected. So, I figured its not a `xmodmap` that is overwriting my changes. Next, a bit of googling introduced me to the `setxkbmap` command, which apparently can also do the same thing. I replaced that executable also, similar to xmodmap above. And I got the culprit command!               setxkbmap -option terminate:ctrl_alt_bksp      I have absolutely no idea what that does, but after running `xmodmap ~/.Xmodmap` (which applied my settings correctly), if I run the above command, my changes are reset! _Edit_ : This is turning out real funny. Just a `setxkbmap` command without any arguments, happily overwrites my changes by the `xmodmap ~/.Xmodmap` command. Now I have two things to figure out, where is this `setxkbmap` being run from & why and how to fix this. I'm still investigation but could seriously use some help :) ## Update 2 To hell with `xmodmap`. I can't figure out where the `setxkbmap` is being called from, but I figured a way to use `setxkbmap` command to make my Caps Lock behave as Ctrl.               setxkbmap -option ctrl:nocaps      Just before starting openbox. Works brilliant. The caps lock key stays acting as a ctrl key. `xmodmap` is never run. I'll keep this question here open so someone who knows these things can provide some insight. Also, for people who face this after me :) ## Update 3 Here's the contents of my `.config/openbox/autostart`, as requested by pedrosaurio.               #!/bin/bash          # Set the wallpaper.     feh --bg-scale /wall.png          # Set default brightness.     xbacklight -time 1 '=40'          # Compositing.     xcompmgr &          # The panel.     tint2 &          # Start a terminal too.     roxterm &      This doesn't have anything to do with the keyboard, as far as I can tell. Also, here's the script that starts my session: (Run by lightdm)               #!/bin/bash          setxkbmap -option ctrl:nocaps          exec openbox-session


title: Substitute part of text file using bash script

text: I'm writing a shell script (bash) to fetch and build several bits of software. The script also writes several small config files and needs to alter a couple of pre-existing config files. What is the best way to find and substitute a few lines of a text file from a bash script? This sounds like a job for `sed`, but I don't understand the syntax...


title: Max password size in AIX 6.1

text: I found on the AIX documentation some rules to set about passwords length : > **minlen** Defines the minimum length of a password. The value is a decimal > integer string. The default is a value of 0, indicates no minimum length. > The maximum value allowed is PW_PASSLEN attribute. This attribute is > determined by the minalpha attribute value added to the minother attribute > value. If the sum of these values is greater than the minlen attribute > value, the minimum length is set to the result. > > **Note** : The PW_PASSLEN attribute is defined in `/usr/include/userpw.h`. > The value of the PW_PASSLEN attribute is determined by the system-wide > password algorithm that is defined in `/etc/security/login.cfg` . > > The minimum length of a password is determined by the minlen attribute and > should never be greater than the PW_PASSLEN attribute. If the minalpha > attribute + minother attribute is greater than the PW_PASSLEN attribute, > then the minother attribute is reduced to PW_PASSLEN attribute - minalpha > attribute. But, for consistency, I need to set the max length for password to 12. I dont understand exactly how to configure the userpw.h to set this max at 12. There is my actual PW_PASSLEN :               #define PW_PASSLEN   ((__extension_status & _EXTENSION_C2)? \                            max_pw_passlen():__get_pwd_len_max())


title: I deleted the /boot server is still running is reinstall necessary?

text: This is stupid. I ordered 2SSD from a provicer. Usually I am the one doing the partitioning and formatting. I will then know which one is the SSD by looking at disks that's not partitioned yet. Turns out, despite the unmanaged status of the server, and price that's unusually low, the provider, perfectip.net did the installation and partitioning. In other word, they go above and beyond duty and have improved a lot. While I actually appreciate it, I did not know how to differentiate which one is which. So I repartition and reformat sdb and sdc because I thought that's the new SSDs. I got warning saying that sdc1 is in use, and I was like, how come? It's a new hard disk. So I unmount and go ahead nevertheless. I went to /boot which seems to be where /sdc1 is mounted too and I saw a bunch of .img file. Ah, it must be back up I suppose. In short, if I go to /boot I see nothing. To further add complication /sdc1 which is now mounted to /home3 is only 440 MB even though the whole /sdc is 1.5 T hard disk.               root@host [/boot]# df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/VolGroup-lv_root                            50G  8.6G   39G  19% /     tmpfs                  32G     0   32G   0% /dev/shm     /dev/mapper/VolGroup-lv_home                           1.3T  192G  1.1T  16% /home     /usr/tmpDSK           485M   11M  449M   3% /tmp     /dev/sdc1             485M   11M  449M   3% /home3     /dev/sdb1              97M  5.6M   87M   7% /home2      doing               root@host [/boot]# fdisk -l          Disk /dev/sdb: 256.1 GB, 256060514304 bytes     255 heads, 63 sectors/track, 31130 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xb4852a81             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1       31130   250051693+  8e  Linux LVM          Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes     255 heads, 63 sectors/track, 182401 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00037518             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1               1      182401  1465136001   8e  Linux LVM          Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes     255 heads, 63 sectors/track, 6527 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000               Disk /dev/mapper/VolGroup-lv_swap: 33.8 GB, 33839644672 bytes     255 heads, 63 sectors/track, 4114 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000               Disk /dev/mapper/VolGroup-lv_home: 1412.2 GB, 1412247322624 bytes     255 heads, 63 sectors/track, 171695 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          root@host [/boot]#      As you see, there is only 1 partition in sdc namely sdc1 There is a bunch of /dev/mapper which I do not understand what. Oh ya in addition of deleting /sdc1, I recreated /sdc1 and mount that and can't unmount. So I am screwed do I? All files are already backed up. Server is still running anyway. Should I ask for a reinstall?


title: Can one install an armel Ubuntu package on armhf Ubuntu system?

text: My particular concern is about installing "coq" in Ubuntu 12.04 for Toshiba AC100 (armhf distro), which hasn't been built successfully for armhf, but is available for armel -- https://answers.launchpad.net/ac100/+question/218291. So, can one install an armel Ubuntu package on armhf Ubuntu system, and will it work?


title: Groups differ from the local ones when logging in remotely

text: We store our users in LDAP, alongside some groups that have meaning across different systems (organizational roles including `wheel`). There are also groups local to workstations, e.g. `audio` or `video` that are not desirable to be put into LDAP. Now if I log in locally I get those local groups, but if I log in via SSH into the same machine I lack them. They of course come back, if I use `su` straight afterwards. I may be on the wrong track, but suspect PAM. Relevant entries from `nsswitch.conf`               passwd:      compat ldap     shadow:      compat ldap     group:       compat ldap      As for pam, always the auth line, but the other lines are the same `/etc/pam.d/sshd`               auth            include         system-remote-login      `/etc/pam.d/system-remote-login` (identical to `system-local-login` I might add)               auth            include         system-login      `/etc/pam.d/system-login`               auth            required        pam_tally2.so onerr=succeed     auth            required        pam_shells.so      auth            required        pam_nologin.so      auth            include         system-auth     auth            optional        pam_gnome_keyring.so          account         required        pam_access.so      account         required        pam_nologin.so      account         include         system-auth     account         required        pam_tally2.so onerr=succeed           password        include         system-auth     password        optional        pam_gnome_keyring.so          session         optional        pam_loginuid.so     session         required        pam_env.so      session         optional        pam_lastlog.so      session         include         system-auth     session         optional        pam_gnome_keyring.so auto_start     session         optional        pam_motd.so motd=/etc/motd     session         optional        pam_mail.so      `/etc/pam.d/su`               auth       sufficient   pam_rootok.so     auth       required     pam_wheel.so use_uid     auth       include              system-auth          account    include              system-auth          password   include              system-auth          session    include              system-auth     session    required     pam_env.so     session    optional             pam_xauth.so      /etc/pam.d/common-auth:               auth    required     pam_group.so use_first_pass      What could be the problem and how would I solve it? I'm happy to provide other information needed.


title: Command line join of password protected wireless networks in Ubuntu, Arch Linux, or other distros?

text: Is there a way to join a password protected wireless network via the command line in installations of Ubuntu or Arch Linux with no desktop environment or any GUI installed? Also, could this be done during a text-based installation and set up of those systems? Just for example, this might be important when installing (without a GUI) from a live CD where many packages need to be downloaded, but only a password protected wireless network is available. Thanks.


title: Reserve Ports for modem

text: I have a modem with 16 ports using for sending SMS. When it's connected to my Linux machine, I get 16 ports from `ttyUSB0` to `ttyUSB15`. Currently if I remove this modem and attached another it,I get it 16 ports from `ttyUSB0` to `ttyUSB15`. How can I reserve first 16 ports for specific vendor with creating udev file, so when I remove this modem it and insert another one, it is assigned from `ttyUSB16` onwards? Edit My udev rule file Contents are as follows, which is working but port number changes everytime I replug               Name=="Future Technology Devices International,Ltd",SUBSYSTEMS=="usb", ATTRS{idProduct}=="6011", ATTRS{idVendor}=="0403", SYMLINK="Ketan%b", KERNEL=="ttyUSB[0-15]*", MODE="0666", SYMLINK+="ttyUSB1",      Output               ls -l /dev/K*     lrwxrwxrwx 1 root root 7 2013-01-08 15:09 /dev/Ketan-8.1 -> ttyUSB1     lrwxrwxrwx 1 root root 7 2013-01-08 15:09 /dev/Ketan-8.2 -> ttyUSB5     lrwxrwxrwx 1 root root 8 2013-01-08 15:09 /dev/Ketan-8.3 -> ttyUSB11     lrwxrwxrwx 1 root root 8 2013-01-08 15:09 /dev/Ketan-8.4 -> ttyUSB12      Here ports are 16 but they are divided in Group of four. ttyUSB 1,5,11,12 Values are changing every time I Plug modem


title: How to exclude NFS directories with find?

text: I need to search for files that has no user OR no group.               find / -nouser -o -nogroup      I think this is OK. But, I don't want to search NFS shares. How can I exclude the NFS shares in the find command?


title: Which script from /etc/init.d/ started the process?

text: Let's say we have a PID of a process and we know that it was started by init during startup. How do we find the script name that started it? One way is to run `grep $PROCESS_NAME /etc/init.d/*`, but that solution is neither bulletproof nor very elegant. Another one would be to run `service --status-all` and there is a good chance that the PID will be returned by one of the services, but that's even less elegant than the previous solution EDIT: The OS is RedHat/Ubuntu. Let's suppose we have sshd running with PID 2083 like so:               UID        PID  PPID  C STIME TTY          TIME CMD     root      2083     1  0  2012 ?        00:00:00 /usr/sbin/sshd -D      The parent of it is `init` and I _guess_ that it was started with the command `service sshd start` during bootup, but if we have something that cannot be easily guessed, for example a convoluted startup command or because of an obfuscated `/etc/init.d/somedeamon` script - how do we find the `somedeamon` script, knowing only the PID?


title: Can I use xterm to read/write to a pts without spawning another process (e.g a shell)?

text: I have a process which reads and writes to a pseudo terminal. I would like to open xterm and have it open a pseudo terminal and leave it open so I can communicate with this process without creating yet another process. Right now I use the following hack. I create a trivial program:               void main() {while(1);}      and then I open it in an xterm window like this:               xterm ~/a.out      Then I can write to the other process and read its output on the xterm window. Is there any way I can do this without having xterm spawn some useless process? Edit: The process I am trying to communicate with is an operating system which is running inside the Bochs emulator. I am trying to connect the serial port on the emulated system with a pseudo terminal on the host system. I specify the particular pseudo terminal in the Bochs configuration file like this:               com1: enabled=1, mode=term,dev=/dev/pts/4


title: Having nVidia OpenGL 32bit driver on a 64bit Debian system in multiarch

text: I'm trying to install 32 bit nVidia drivers on my 64-bit system (to get wine working with OpenGL). So I tried:               root@grzes:/lib# aptitude install libgl1-nvidia-glx:i386 libxvmcnvidia1:i386     The following NEW packages will be installed:     libgl1-nvidia-glx:i386 libxvmc1:i386{ab} libxvmcnvidia1:i386     0 packages upgraded, 3 newly installed, 0 to remove and 2 not upgraded.     Need to get 6,661 kB of archives. After unpacking 32.2 MB will be used.     The following packages have unmet dependencies:     libxvmc1 : Conflicts: libxvmc1:i386 but 2:1.0.7-1+deb7u2 is to be installed.     libxvmc1:i386 : Conflicts: libxvmc1 but 2:1.0.7-1+deb7u2 is installed.     The following actions will resolve these dependencies:     Remove the following packages:      1) kaffeine      2) kplayer      3) libxine1-x      4) libxine2-x      5) libxvmc1      6) libxvmcnvidia1      7) mencoder      8) mplayer      9) mplayerthumbs      10) nvidia-glx      11) smplayer      12) smplayer-themes      13) smplayer-translations      14) task-desktop      15) task-gnome-desktop      16) xine-ui      17) xserver-xorg-video-all      18) xserver-xorg-video-intel      19) xserver-xorg-video-openchrome          Leave the following dependencies unresolved:      20) digikam recommends mplayerthumbs      21) libgl1-nvidia-glx recommends libxvmcnvidia1      22) nvidia-kernel-dkms recommends nvidia-glx (>= 304.88)     23) youtube-dl recommends mplayer2 | mplayer      Accept this solution? [Y/n/q/?] q     Abandoning all efforts to resolve these dependencies.     Abort.      However, as you can see there is a conflict. How can I make it work?


title: light linux server for small business

text: I want to convert my old pc (733Mhz CPU, 40 Gb HD, 256 Mb RAM) to a nexus server(Local Maven repository). I don't need no GUI. I have read about puppy, MacPup and Lubuntu here, but I don't know if they meet my purpose or not. And I guess using a USB flash drive instead of a hard drive will be a good practice in this case, so being able to run on a USB memory stick is one important factor. I have read that puppy can load itself entirely on RAM, I don't know if I need this feature or not, any suggestion on this matter will be appreciated. I like Ubuntu because I have installed and used it so many times, but this fella says that it is to heavy on RAM. Any suggestions on which distributions I should look into?


title: VirtualBox image from running VPS

text: I have an Ubuntu Server 10.04 VPS (Virtual Private Server) that hosts my website. I would like to clone this VPS and create a VirtualBox machine from it. How can I do this?


title: Are cygwin vim commands different than normal vim?

text: I am unable to edit text files using vim in cygwin. I have to press `i` many times to insert text. Sometimes it works and sometimes doesn't. Whenever I move cursor up down I have to press I many times. What could be the problem? Does `backspace` work in cygwin?


title: How to record Skype video calls on Linux?

text: I'd like to conduct recorded video interviews with Skype and am looking for a reliable tool to accomplish that. Is there anything out there that's not slow or buggy? I'm running (K)Ubuntu.


title: How to get data shown out of workspace or directly from application?

text: Because of some reason I had to use another web browser than my main which I use daily and I chose a small browser which I installed long time ago. This brower is called Dooble, version 0.07 (dooble-0.0+svn874) and I have been using it about 2 weeks. In this period of time I opened a lot of sites which I need to open again in future so I need a browsing history. I checked before start of using it that it keeps this history. Now I would like to get an access to the history and save it or export or just look at it. But there is a problem with it. The history is shown on a list, which is in menu bar, like File, Edit or Help. The list is too large to display it on the visible workspace. It rolls down to the end of the workspace and then to the right with no limit (just go out from the screen) and about 95% of content is outside of the visible part of the workspace, so I can't see the history although the browser keeps it. I decided to get it in other way. I was looking for the history on the disk, because I suspected that it may be stored in a file. I checked the list of files it using/generated with command "lsof" and there is no file connected with Dooble. I also searched in ram memory, I copied an image of ram and opened in hex editor and looked for appropriate string with no results. The idea to take a screenshot of the active window is also wrong because it takes only the visible part. There is no possibility to change a resolution of a display in my case. I suppose that browser may encrypt the history stored in ram, like it does in the current version, but my version is very old (2008 probably) and I have no documentation or help files to this with specification. Moreover I use swap, but I can't read its contents. The swap is a file and when I copy it and open like the image of ram there is nothing inside except zeros - the file is full of zeros although swap is full in some part which I can see typing "free" in terminal. Here is the source of this version: http://dooble.sourcearchive.com/documentation/0.0plus- psvn874-0ubuntu2/dir_9cc8d803eb63e208c05c995ec1941f6c.html , I'm not programmer and don't understand it but maybe it would be helpful in finding any solution, if so tell me please how can I use it. I use Ubuntu and Gnome. I can't close the browser and obviously system because the history will be deleted permanently. I really believe that there are people here who know what to do in my case. I'm not good in IT, so I will appreciate every hint.


title: Am I running Bash?

text: I am using OS X 10.8.5. I am trying to figure out if the terminal is running bash. When I type in the following it says "getent" command not found -- but the error message seems to be coming from bash.               Me$ getent passwd $(whoami) | awk -F: '{print $NF}'     -bash: getent: command not found      Am I running bash?


title: sed - how to do several consecutive substitutions but process file only once?

text: If I am doing several substitutions which need to be consecutive, e.g.               sed -i '/^[[:space:]]*browser.*\.should/s/browser/expect(browser/' t1_spec.rb     sed -i '/expect(browser.*\.should/s/\.should/).should/' t1_spec.rb     sed -i 's/\.should/\.to/' t1_spec.rb      sed -i 's/==/eq/' t1_spec.rb       Is there a better way to do this that will only go through the t1_spec.file once and do the the 4 substitutions for each line rather than going through the file 4 times?


title: Unable to patch 2 errata on OpenBSD 5.5

text: I'm trying to patch OpenBSD 5.5 with all of the 10 errata. The command I use to patch is:               signify -Vep /etc/signify/openbsd-55-base.pub -x /path/to/patch/ \     -m - | (cd /usr/src && patch -p0)      007_sendmail.patch.sig and 009_dhcp.patch.sig present some problems when patching. The error message when applying 007_sendmail.patch.sig is:               Patching file gnu/usr.sbin/sendmail/conf.c using Plan A...     Hunk #1 succeeded at 5309     done     #cd gnu/usr.sbin/sendmail     ksh:cd: /root/gnu/usr.sbin/sendmail - No such file or directory     #make obj     make: don't know how to make obj     Stop in /root      009_dhcp.patch.sig also presents some issues:               #cd sbin/dhclient     ksh:cd: /root/sbin/dhclient - No such file or directory


title: Problem setting up DVWA in Wheezy 64 bits

text: I'm trying to get running Damn Vulnerable Web Application in a virtual machine with Wheezy. The easy way if it was 32 bits is install XAMPP and copy the dvwa to htdocs. However I'm using 64 bits and I don't wanna be messing with 32 bits libs. I've installed every needed component separately. I installed php5, mysql and apache2. Then I copied dvwa to /var/www/ but when I try to access it (127.0.0.1/dvwa/login.php) I get always a blank page. I have never configured a web server so maybe I'm skipping something. I installed dvwa with xampp in a W7, and all was fine, so seems it's a missconfiguration in apache or something.


title: Group permissions ineffective, permission still denied

text: I've got a problem with UNIX permissions : I'm working under Debian Squeeze, and one of my scripts, run by `www-data`, needs to move a file, `23550.zip`, placed in the home directory of another user, `autodo`, to a subdirectory in this user's home (`/home/autodo/.processed`) to mark it as already processed. I tried to change the group ownership of `/home/autodo`, `/home/autodo/23550.zip` and `/home/autodo/.processed` to the group `www-data` to allow the `www-data` user to move this file, but it still fails saying `Permission denied`, as you can see below (as I'm French, I translated french messages back to English, although I can't be sure the translation is the one displayed in English version of these commands) :               sh-4.1$ ls -lah /home/autodo     total 27M     drwxr-xr-x  3 autodo www-data 4,0K  9 janv. 15:17 .     drwxr-xr-x 88 root   root     4,0K  8 janv. 15:21 ..     -rwxr-xr-x  1 autodo ftpusers 4,8K  5 sept. 23:14 19236.zip     -rwxr-xr-x  1 autodo www-data  26M  9 janv. 14:26 23550.zip     -rwxr-xr-x  1 autodo ftpusers 2,3K  6 janv. 20:44 3194.zip     -rwxr-xr-x  1 autodo ftpusers 1,1M  5 sept. 23:38 53274.zip     -rwxr-xr-x  1 autodo ftpusers  585  6 sept. 00:50 70069.zip     -rwxr-xr-x  1 autodo ftpusers  220 16 nov.  15:10 .bash_logout     -rwxr-xr-x  1 autodo ftpusers 3,2K 16 nov.  15:10 .bashrc     drwxr-xr-x  2 autodo www-data 4,0K  9 janv. 15:16 .processed     -rwxr-xr-x  1 autodo ftpusers  675 16 nov.  15:10 .profile     sh-4.1$ ls -lah /home/autodo/.processed     total 66M     drwxr-xr-x 2 autodo www-data 4,0K  9 janv. 15:16 .     drwxr-xr-x 3 autodo www-data 4,0K  9 janv. 15:17 ..     -rwxr-xr-x 1 autodo ftpusers 3,8K  8 janv. 22:42 100583.zip     -rwxr-xr-x 1 autodo ftpusers 1,7K  9 janv. 02:48 12211.zip     -rwxr-xr-x 1 autodo ftpusers 2,2K  8 janv. 22:43 166273.zip     -rwxr-xr-x 1 autodo ftpusers 424K  8 janv. 22:52 193894.zip     -rwxr-xr-x 1 autodo ftpusers 1,2M  9 janv. 01:13 20662.zip     -rwxr-xr-x 1 autodo ftpusers  59M  9 janv. 00:43 22352.zip     -rwxr-xr-x 1 autodo ftpusers 1,2M  8 janv. 22:42 23704.zip     -rwxr-xr-x 1 autodo ftpusers 214K  9 janv. 02:34 24704.zip     -rwxr-xr-x 1 autodo ftpusers  632  9 janv. 01:17 26360.zip     -rwxr-xr-x 1 autodo ftpusers 2,8K  9 janv. 01:03 31795.zip     -rwxr-xr-x 1 autodo ftpusers 106K  9 janv. 00:11 31797.zip     -rwxr-xr-x 1 autodo ftpusers 413K  9 janv. 00:44 31799.zip     -rwxr-xr-x 1 autodo ftpusers 4,4K  8 janv. 22:30 31803.zip     -rwxr-xr-x 1 autodo ftpusers 2,3K  5 janv. 21:19 3194.zip     -rwxr-xr-x 1 autodo ftpusers  13K  8 janv. 23:33 5705.zip     -rwxr-xr-x 1 autodo ftpusers 2,8K  8 janv. 22:19 5858.zip     -rwxr-xr-x 1 autodo ftpusers  86K  9 janv. 04:34 604.zip     -rwxr-xr-x 1 autodo ftpusers 2,6M  9 janv. 03:34 7091.zip     -rwxr-xr-x 1 autodo ftpusers 3,4K  8 janv. 21:25 7878.zip     -rwxr-xr-x 1 autodo ftpusers 752K  9 janv. 03:37 8127.zip     -rwxr-xr-x 1 autodo ftpusers 6,1K  8 janv. 22:01 84846.zip     -rwxr-xr-x 1 autodo ftpusers 358K  9 janv. 02:42 989.zip     sh-4.1$ id     uid=33(www-data) gid=33(www-data) groups=33(www-data),2000(ftpusers)     sh-4.1$ mv /home/autodo/23550.zip /home/autodo/.processed/     mv: unable to move « /home/autodo/23550.zip » to « /home/autodo/.processed/23550.zip »: Permission denied      I also tried to `setgid` this user's directory, but it also failed with the same `Permission denied`, and to `adduser www-data ftpusers`, but it still failed with the same error. I have to admit that I'm lost; I always thought that the permissions of a group owning a file meant the same than the owner ones, but this problem contradicts this, and I can't think that there can be such a bug in the Linux kernel, so I _have to had missed something_ , but where, dammit!


title: How to send the content of an emacs buffer to gcc without writing to disk?

text: It's common for me to run a throwaway piece of code I'm not particularly interested in saving on my disk, so I'm often working inside emacs in a buffer not attached to any file in my system. When working with _interpreted_ (I'm a little reluctant to use this term) languages like Python, Scheme or Lua, each respective major mode (the common ones) offer ways of running the REPL/interpreter inside the editor and executing the content of a buffer directly. (Generally with a function called `send-buffer` or something like that). However when working with C, I cannot find a similar functionality. I find myself forced to save the file to disk, in order to give `gcc` a filename as argument. **Is there a way to send the content of an emacs buffer to gcc without writing the file to disk?**


title: RHEL - GDM could not write to authorization file

text: I am getting an error as " **GDM could not write to your authorization file** " if I try to login as a non root user in my RHEL system. I restarted the machine hoping that the _tmp_ files will be cleared and so I will not get this error on booting. However, I still get the error. I ran the `df -h` command and I got the below output.               Filesystem            Size  Used Avail Use% Mounted on     /dev/sda2              39G   39G     0 100% /     /dev/sda5             102G   33G   64G  34% /opt     /dev/sda1              99M   12M   83M  13% /boot     tmpfs                 1.5G     0  1.5G   0% /dev/shm      I read in this link that clearing log files should help. But `logrotate` should be doing it and even if I delete the log files I might encounter the same error in future. Is there any specific reason for this error? What should I try to increase the space on `/dev/sda2` so that I can ensure non-root users can login to the machine?


title: Does curl have a --no-check-certificate option like wget?

text: I am trying to make a curl request to one of our local development servers running a dev site with a self-signed SSL cert. I am using curl from the command line. I saw some blog posts mentioning that you can add to the list of certificates or specify a specific (self signed) certificate as valid, but is there a catch-all way of saying "don't verify" the ssl cert - like the `\--no-check- certificate` that wget has?


title: .inputrc TAB not behaving as expected

text: I'm on a roll today, here's another question: How come when I put these into `.inputrc`, they both do the same thing?               TAB: menu-complete     Shift-TAB: menu-complete-reverse      i.e. they both do whatever the last one says.


title: How to get the cloned guest connected to the Internet?

text: I made a clone of a VM(running a version of Centos 6) on KVM, but the clone wouldn't connect to the Internet. Issuing `ifconfig` shows no interfaces but the `lo`. Interestingly, the original system can connect to the Internet. I didn't make any change to the default settings. Anything that I could do to make it work?


title: How to hibernate a RHEL6 machine?

text: I am using RHEL6 and I don't see a `hibernate` option for it. Doesn't RHEL6 have a hibernate option? ![enter image description here](http://i.stack.imgur.com/1ZnrE.png) I tried `pm-hibernate` from command line but it said: > PM: Cannot find swap device, try `swapon -a` I tried `swapon -a` then I again tried `pm-hibernate` and it showed the same message again. PS: I don't have a swap partition in my machine.


title: USB bEndpointAddress varies when run on different targets

text: I am running a target application that implements the usb gadget driver FunctionFS and has 4 endpoints. I write the descriptors to the endpoint ep0 and the other 4 endpoints are opened for read/write access. However, when I connect the device to a host, the `bEndpointAddress` of the Endpoints depends on the target platform that I run my application on. They're both arm architecture (cortex a5 and a9) running linux kernel 3.6.9 and 3.0.35. What could be the reason for this?


title: how do I install the stock centos repositories?

text: I have a situation where the stock repo files that should exist in `/etc/yum.repos.d/` (like `centos-base.repo`) are not present. I need to get them installed. I am sure this is simple, but after hours of searching, it seems I am not googling it correctly. Basically I have a server with custom repos that are useless to me. I need epel, and epel needs `centos-base.repo`. I also need postgres repo.