title: fedora slow to aquire network ip after startup or cable unplug

text: I've installed Fedora 19, and i'm new to it (I used Ubtuntu until now). After every reboot, or when i unplug my network cable, the system is slow to pickup the state change, and it takes a long time until the system reloads its IP from my router (i'im using DHCP). On ubuntu these changes were instantaneous, and resuming from sleep or occasional cable unplugs were handled without problems. How can i fix this?


title: Making ruby available to all users

text: I intend to use Ruby when programming my Raspberry Pi which is running the Debian based Occidentals. Via SSH, I executed:               curl -L https://get.rvm.io | bash -s stable --ruby      which downloaded the ruby source and compiled it. It tool about 2 hours to complete. I would like to use ruby via AdaFruit's WebIDE - http://learn.adafruit.com/webide/. However, the ruby installation I performed via SSH created a folder called `.rvm` in the `pi` user's directory, whereas the WebIDE uses the `webide` user account. What is the best way to allow the `webide` user account access to ruby? I tried moving the `.rvm` folder from `/home/pi` to `/etc/share`, but this didn't work - when trying to use ruby at a terminal I got the error "ERROR: Missing RVM environment file: '/home/pi/.rvm/environments/ruby-2.0.0-p353'" so I must've broken some link. I'm holding back running another 2hr install for the webide user as I'm sure there's a better way!


title: How do I set affinity of a particular thread on FreeBSD?

text: As the title says, I'm trying to figure out how to set the affinity of a particular thread (but not the entire process) on a FreeBSD system. On Linux, I'm able to do this with `ps -L uH [pid]`, obtaining the LWP ID of the thread, and then using `taskset` as I would with an actual PID - `taskset -pc [cpu list] [lwp]`. I haven't been able to find a similar method for FreeBSD. I'm able to get a thread ID with `procstat -t [pid]`, but attempting to set the affinity on that (with `cpuset -l [cpu list] -p [thread id]`) returns "no such process."


title: Buffer size for capturing packets in kernel space?

text: Going through the man page of `tcpdump`, it seems kernel can drop the packets if the buffer is full. I was wondering if:   1. that size is configurable and/or   2. where can I see the size for my distro? From the man page (for easy reference): > packets ``dropped by kernel'' (this is the number of packets that were > dropped, due to a lack of buffer space, by the packet capture mechanism in > the OS on which tcpdump is running, if the OS reports that information to > applications; if not, it will be reported as 0).


title: How to turn off all screensaver/display power saving methods under Scientific Linux 6.1?

text: How can I ensure that my screen won't go "black" after given time?


title: How to use Deskjet 2050 J510 scanner on Scientific Linux 6.1?

text: https://bugzilla.redhat.com/show_bug.cgi?id=672306 So... I need to install hplip-3.11.3a-1.fc14 ? How? I can't find the rpm in the repositories, and I can't find the rpm on the net.. can someone please describe how to bring the scanner to life?


title: Grow/resize RAID when upgrading visible size of disks

text: I originally created a software RAID using a controller that could only address 2TB per disk. The disks are 3 TB disks. It worked fine, but only used the first 2TB of each disk. I have now changed the controller to see the full 3TB. I would therefore like `/dev/md0` to use the last 1 TB, too. I have tried:               # mdadm --grow /dev/md0 --size=max     mdadm: component size of /dev/md0 has been set to 2147479552K      But as you can see it only sees the 2TB. If I try forcing it higher:               # mdadm --grow /dev/md0 --size=2147483648     mdadm: Cannot set device size for /dev/md0: No space left on device      So somehow the system can see the disks are 3TB (in `/proc/partitions`), but the RAID cannot see them as 3TB. # mdadm details:               # mdadm --detail /dev/md0     /dev/md0:         Version : 1.2     Creation Time : Fri Mar  2 15:14:46 2012      Raid Level : raid6      Array Size : 38654631936 (36863.93 GiB 39582.34 GB)     Used Dev Size : 2147479552 (2048.00 GiB 2199.02 GB)     Raid Devices : 20     Total Devices : 21     Persistence : Superblock is persistent          Update Time : Wed Apr 25 19:47:09 2012           State : active     Active Devices : 20     Working Devices : 21     Failed Devices : 0     Spare Devices : 1               Layout : left-symmetric      Chunk Size : 4096K                 Name : node5:1            UUID : 8603c3df:b740ba22:8c9c82fd:a18b3133          Events : 845          Number   Major   Minor   RaidDevice State       20      65       32        0      active sync   /dev/sds        1      65       64        1      active sync   /dev/sdu        2      65       80        2      active sync   /dev/sdv        3      65       96        3      active sync   /dev/sdw        4       8      192        4      active sync   /dev/sdm        5       8       32        5      active sync   /dev/sdc        6       8       48        6      active sync   /dev/sdd        7       8       64        7      active sync   /dev/sde        8       8       80        8      active sync   /dev/sdf        9       8       96        9      active sync   /dev/sdg       10       8      112       10      active sync   /dev/sdh       11       8      128       11      active sync   /dev/sdi       12       8      144       12      active sync   /dev/sdj       13       8      160       13      active sync   /dev/sdk       14       8      176       14      active sync   /dev/sdl       15       8      208       15      active sync   /dev/sdn       16       8      224       16      active sync   /dev/sdo       17       8      240       17      active sync   /dev/sdp       18      65        0       18      active sync   /dev/sdq       19      65       16       19      active sync   /dev/sdr            21      65       48        -      spare   /dev/sdt      # Disk sizes:               # cat /proc/partitions |grep 2930266584        8       48 2930266584 sdd        8       32 2930266584 sdc        8      112 2930266584 sdh        8       96 2930266584 sdg        8       80 2930266584 sdf        8      128 2930266584 sdi        8      176 2930266584 sdl        8       64 2930266584 sde       65       32 2930266584 sds        8      192 2930266584 sdm        8      144 2930266584 sdj       65       80 2930266584 sdv        8      224 2930266584 sdo        8      208 2930266584 sdn        8      160 2930266584 sdk        8      240 2930266584 sdp       65        0 2930266584 sdq       65       64 2930266584 sdu       65       16 2930266584 sdr       65       48 2930266584 sdt       65       96 2930266584 sdw      Edit:               # mdadm --version     mdadm - v3.1.4 - 31st August 2010     # uname -a     Linux lemaitre 3.2.0-0.bpo.1-amd64 #1 SMP Sat Feb 11 08:41:32 UTC 2012 x86_64 GNU/Linux      The RAID6 uses the full disks (i.e. no partitions) This morning the system crashed. After a reboot the system did not find the RAID (which was terrible). All disks showed up as spares (S):               cat /proc/mdstat      Personalities :      md0 : inactive sdr[20](S) sds[21](S) sdq[18](S) sdp[17](S) sdo[16](S) sdn[15](S) sdl[14](S) sdk[13](S) sdj[12](S) sdi[11](S) sdh[10](S) sdg[9](S) sdf[8](S) sde[7](S) sdd[6](S) sdc[5](S) sdm[4](S) sdv[3](S) sdu[2](S) sdt[1](S)           42949652460 blocks super 1.2      Even here it is clear that `mdadm` did not find the 3 TB size. I ran `mdadm --stop /dev/md0`. Removed the entry in /etc/mdadm/mdadm.conf. Ran ` mdadm -A --scan --force`, which caused the RAID to come online and rebuild.


title: Submit "&" to Drupal 6 form using cURL?

text: I'm using this code to create a node in Drupal 6:               curl -b cookies.txt -d \         title="$(sed '1,/sblmtitle/d;/slpstitle/,$d' file.html)" \         -d form_build_id=form-5312da71abefb3bf1f63f1f2b7cf9105 \         -d form_token=f65aaefcf6f4b20c9a3d34f5af13ccaf \         -d form_id=post_node_form -d op=Save http://www.site.com/node/add/post      The `file.html` contains:               spasi     sblmtitle     Some title here & there     slpstitle      Drupal creates a node with title `Some title here`. Drupal rejects the character `&`; What can I do to make Drupal 6 accept `&`?


title: How to start a windows partition from the Grub command line?

text: I have Windows 7 installed on my system. After I installed Windows 7, I installed Fedora on a separate partition so that I could dual boot. I removed Fedora by deleting the partition it was installed on. Now I am unable to start my system. On boot, my system stops at the Grub command line. I want to boot to my Windows 7 installation which I haven't removed from my system. This is displayed on startup               GNU GRUB version 0.97-71.fc15 (634k lower /306122k upper momory)<br> [     minimal BASH-like editing is supported.for the first word, TAB lists     possible commands completions.anywhere else TAB lists the possible     completion of device/filename.]     grub>      How can I boot my Windows partition from this grub command?


title: Regex : how to verify that there are 13 greek letters with an odd number of consonants

text: Another regex that I can't seem to crack :( I tried with `egrep '([qwrtzpsdfghjklxcvbnmy]{1})|([qwrtzpsdfghjklxcvbnmy]{3})|([qwrtzpsdfghjklxcvbnmy]{5})|([qwrtzpsdfghjklxcvbnmy]{7})' greek.txt ` However this also returns words with 4 consonants, I do not understand why. Why is it matching words with 4 vowels aswell ? So this is my greek.txt :               alpha     beta     gamma     delta     epsilon     zeta     eta     theta     iota     kappa     lambda     mu     nu     xi     omicron     pi     rho     sigma     tau     upsilon     phi     chi     psi     omega      So alpha is ok( l p h = 3 ), beta isnt ( b t = 2) , gamma is ok (g m m = 3), delta is ok (d l t =3 ),...


title: Opening a file with space from Ruby

text: When I need to progmatically open in emacs a file that has a space in its name, how can I do that? I've tried these commands from a Ruby script, inside backquotes or `popen(…)`:               emacs "foo bar"      or               emacs foo\ bar      opens two files each named `foo` and `bar`, but I want to open a file named `foo bar`.


title: How does sudo remember you already entered root's password?

text: When using sudo on Linux, it asks for root password, but only the first time you run it. If you run another sudo command, it remember you already entered the password previously and doesn't ask for it:               thomas@ubuntu:~$ sudo id     [sudo] password for thomas: ******     uid=0(root) gid=0(root) groups=0(root)     thomas@ubuntu:~$ sudo id     uid=0(root) gid=0(root) groups=0(root)      How does sudo do it? Where is this information stored? My idea is that it remembers the terminal id (like pts/1), but where is this stored? The first sudo process is ended when it's done with the command, right? I know sudo is a setuid program, so it has root's privileges all the time, but I still can't think of a good place to store an information that a user has already entered a password. Is there some daemon process involved?


title: Setting up a user for sftp acces into a sub directory of another users home directory

text: An interesting problem. The broader goal is to setup a directory that one of our clients can sftp into (via ssh keys, not user/pass combination) and upload files. This directory will need to be accessed by another cPanel user (called user1) running crons which are in-turn running php scripts to handle these files and act on them (reading, and possibly moving). I have setup a new user (called user2) with it's home directory in a sub directory of user1. I am able to sftp into the home directory of user2 using a username / password combination. But I am now unable to connect using ssh keys. I have setup the ~/.shh/authorized_keys file and everything for user2. From what I understand the issue is due to file ownership. As user2 doesn't explicitly own the files in ~/.ssh it refuses to look in the file and therefore refuses the key. Does anyone have any experience, advice or suggestions to working this out. Even if my initial solution isn't feasible and I have to go down another path.


title: How to get green/red terminals under OpenBSD?

text: For linux machines I can use:               # vi ~/.bashrc # red/green terminal colors regarding exit code          export PROMPT_COMMAND='PS1="`     if [[ \$? = "0" ]];     then echo "\\[\\033[0;32m\\]";     else echo "\\[\\033[0;31m\\]";     fi`[\u@\h \w]\[\e[m\] "'     export PS1      to get green terminal when exit code is 0, and get red prompt when exit code is not 0. How can I do this under OpenBSD? (the default ksh) (I was trying to do it, but with no luck - using ssh to connect to the OpenBSD machine from my notebook - ubuntu/gnome-terminal. )


title: How to get the public key from sshd server without touching the known_hosts file?

text: Are there any tricks to get the public key (the line that goes into the known_hosts file after I answered yes after connecting with ssh) of a server?


title: UTF 8 filenames?

text: In unix based operating systems are utf6 filenames permissible? If so do I need to do anything special to write the file to disk. Let me explain what I'm hoping to do. I'm writing an application that will transfer a file via ftp to a remote system but the filename is dynamically set to via some set of meta data which potentially could be in utf8. I'm wondering if there's something I need to do to write the file to disk in unix/linux. Also as a follow up does anyone know what would happen if I did upload a utf 8 filename to a system doesn't support utf8?


title: Why should we use a ~15-25 GB root partition?

text: I have separate partitions for `/` and `/home`, yet my root partition is ~30 GB and growing. Why does everyone recommend a 15-25 GB root partition, and how is this achieved? Here is my space usage, along with some info of the storage culprits:               [lucas@lucas-ThinkPad-W520]~$ sudo du -sh /     du: cannot access ‘/proc/4889/task/4889/fd/4’: No such file or directory     du: cannot access ‘/proc/4889/task/4889/fdinfo/4’: No such file or directory     du: cannot access ‘/proc/4889/fd/4’: No such file or directory     du: cannot access ‘/proc/4889/fdinfo/4’: No such file or directory     du: cannot access ‘/run/user/1000/gvfs’: Permission denied     39G    /          [lucas@lucas-ThinkPad-W520]~$ sudo du -sh /* | sort -h -r     du: cannot access ‘/proc/4951/task/4951/fd/4’: No such file or directory     du: cannot access ‘/proc/4951/task/4951/fdinfo/4’: No such file or directory     du: cannot access ‘/proc/4951/fd/4’: No such file or directory     du: cannot access ‘/proc/4951/fdinfo/4’: No such file or directory     du: cannot access ‘/run/user/1000/gvfs’: Permission denied     9.7G    /var     9.2G    /usr     7.9G    /home     4.7G    /data     4.5G    /opt     1.2G    /lib     963M    /media     165M    /boot     57M    /root     16M    /etc     11M    /sbin     9.6M    /bin     3.8M    /lib32     1.6M    /run     48K    /tmp     16K    /lost+found     8.0K    /srv     4.0K    /mnt     4.0K    /lib64     4.0K    /dev     4.0K    /cdrom     0    /vmlinuz.old     0    /vmlinuz     0    /sys     0    /proc     0    /initrd.img.old     0    /initrd.img     [lucas@lucas-ThinkPad-W520]~$           [lucas@lucas-ThinkPad-W520]~$ sudo du -sh /data/*     3.1G    /data/db     545M    /data/rs1     545M    /data/rs2     545M    /data/rs3          [lucas@lucas-ThinkPad-W520]~$ sudo du -sh /opt/*     4.2G    /opt/android-sdk-linux     179M    /opt/google     112M    /opt/spotify          [lucas@lucas-ThinkPad-W520]~$ sudo du -sh /var/lib/mongodb/     8.3G    /var/lib/mongodb/          [lucas@lucas-ThinkPad-W520]~$ sudo du -sh /usr/share/doc     1.5G    /usr/share/doc          [lucas@lucas-ThinkPad-W520]~$ sudo du -sh /usr/share/texlive/     1.2G    /usr/share/texlive/          [lucas@lucas-ThinkPad-W520]~$      Also, I am about to re-install my OS (upgrading from Ubuntu 13.10 to 14.04), so I have the opportunity to change the partition size of root. Any recommendations?               [lucas@lucas-ThinkPad-W520]~$ lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 465.8G  0 disk      ├─sda1   8:1    0   1.5G  0 part      ├─sda2   8:2    0 258.4G  0 part      ├─sda3   8:3    0     1K  0 part      ├─sda4   8:4    0  15.6G  0 part      ├─sda5   8:5    0    83G  0 part /     ├─sda6   8:6    0   7.9G  0 part [SWAP]     └─sda7   8:7    0  95.7G  0 part /home     sr0     11:0    1   964M  0 rom  /media/lucas/Ubuntu 14.04 LTS amd64          [lucas@lucas-ThinkPad-W520]~$ sudo blkid     /dev/sda1: LABEL="SYSTEM_DRV" UUID="30CA6C06CA6BC6A6" TYPE="ntfs"      /dev/sda2: LABEL="Windows7_OS" UUID="9426707E26706362" TYPE="ntfs"      /dev/sda4: LABEL="Lenovo_Recovery" UUID="E2CA772DCA76FD5B" TYPE="ntfs"      /dev/sda5: UUID="7d513625-85de-41b7-9c81-0d3fbc4e6a0f" TYPE="ext4"      /dev/sda6: UUID="602d2625-8ab9-44e5-b73a-d1f0181f5549" TYPE="swap"      /dev/sda7: LABEL="home" UUID="b1507090-0652-4dae-9fe4-3611de8ab218" TYPE="ext3"      /dev/sr0: LABEL="Ubuntu 14.04 LTS amd64" TYPE="iso9660"


title: Script that checks and saves text to file

text: Can you give example for a script where user is asked to enter name, surname and age. And then check if name and surname contains only letters and age contains only digits? And if the information is correct it is added to file.


title: How do I go about removing all my wifi tools in Arch?

text: My wifi setup is messed up and I keep disconnecting. I want to start from scratch, so I need to know how to thoroughly remove all my wifi tools. I don't want to forget some errant config file and have my new setup skewed. What's the best way to get a listing of my wifi programs and services?


title: How do I find out which process is using my V4L2 webcam?

text: I tried to run the following:               $ vlc -I dummy v4l2:///dev/video0 --video-filter scene --no-audio --scene-path webcam.png --scene-prefix image_prefix --scene-format png vlc://quit --run-time=1                                                          VLC media player 2.0.7 Twoflower (revision 2.0.6-54-g7dd7e4d)                                                                                [0x1f4a1c8] dummy interface: using the dummy interface module...                                                                                [0x7fc19c001238] v4l2 demux error: VIDIOC_STREAMON failed                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                libv4l2: error setting pixformat: Device or resource busy                                                                                [0x7fc19c007f18] v4l2 access error: cannot set input 0: Device or resource busy                                                                                [0x7fc19c007f18] v4l2 access error: cannot set input 0: Device or resource busy                                                                                [0x7fc1a4000b28] main input error: open of `v4l2:///dev/video0' failed                                                                                [0x7fc1a4000b28] main input error: Your input can't be opened                                                                                [0x7fc1a4000b28] main input error: VLC is unable to open the MRL 'v4l2:///dev/video0'. Check the log for details.                                                                                [0x7fc19c007cc8] idummy demux: command `quit'          So I'm assuming that there is a program currently accessing my webcam, which is cumbersome since its light is off and `lsof | grep /dev/video` returns nothing. Is there another, proper way to check what processes are currently using my webcam? Or is the problem of an entirely different nature?


title: Good ways to host or distribute my patch for the Linux Kernel Mailing List

text: I have an approximately 1500 line patch for the Linux kernel - introducing a new file system. I have lots of problems with posting a patch straight to the kernel mailing list (gmail mangles the patch/it's very long/no easily apparent way to break the patch up except by hand etc) I don't want to use git format-patch as it generates a long, long series of patches, many of which are junk (eg debug printks and the like) and I am not at present able to suggest people pull off my git (I'm on the road and it's on a lap top without a fixed IP and so on). So, what is the best way to do this? I fear this is too large to host at github (is it?) or is there an easy way to get people to be able to pull the patch for testing in a way that will be acceptable to people on LKML?


title: Fedora session / process startup issues

text: I've installed fedora 16 with lxde(xfce) desktop. My problem is that when I login into the system, it gives me redundant app startup, for instance it launches Installation manager, also I've noticed quite a few httpd processes. Looks really strange to me. Any suggestions guys ?               [midnight@localhost ~]$ ps aux | grep httpd     root       985  0.0  0.3 437472  9964 ?        Ss   18:58   0:00 /usr/sbin/httpd -k start     apache     988  0.0  0.4 441816 12112 ?        S    18:58   0:00 /usr/sbin/httpd -k start     apache     989  0.0  0.2 437472  6112 ?        S    18:58   0:00 /usr/sbin/httpd -k start     apache     990  0.0  0.2 437472  5364 ?        S    18:58   0:00 /usr/sbin/httpd -k start     apache     991  0.0  0.2 437472  5364 ?        S    18:58   0:00 /usr/sbin/httpd -k start     apache     992  0.0  0.2 437472  5364 ?        S    18:58   0:00 /usr/sbin/httpd -k start     apache     993  0.0  0.2 437472  5364 ?        S    18:58   0:00 /usr/sbin/httpd -k start     apache     994  0.0  0.2 437472  5364 ?        S    18:58   0:00 /usr/sbin/httpd -k start     apache     995  0.0  0.2 437472  5364 ?        S    18:58   0:00 /usr/sbin/httpd -k start


title: How to restore a Fat32 filesystem under Linux

text: Here is what happened: I used the Laptop and accessed some data on my usb stick. Then I closed the Laptop putting the system into sleep mode. The USB-Stick was still plugged in. After the laptop was completely in sleep I removed the Stick (the light was off, so it must have been without power). I woke up the laptop today without the USB-Stick. Now when I re-plug it, the filesystem will not be mounted automatically. I tried to manually mount it:               chi mnt # mount -t vfat /dev/disk/by-id/usb-JetFlash_Transcend_4GB_QTMFKJQQ-0\:0-part1 usb/     mount: wrong fs type, bad option, bad superblock on /dev/sdb1,            missing codepage or helper program, or other error            Manchmal liefert das Syslog wertvolle Informationen – versuchen            Sie  dmesg | tail  oder so      Doing a `dmesg | tail` I found the following:               FAT-fs (sdb1): bogus number of FAT structure     FAT-fs (sdb1): Can't find a valid FAT filesystem      So I tried to do `fsck.vfat` on the partition of the stick, to see if it can somehow fix it:               chi mnt # fsck.vfat /dev/disk/by-id/usb-JetFlash_Transcend_4GB_QTMFKJQQ-0\:0-part1      dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN     Cluster size is zero.      Is there some way to repair the filesystem on the stick using linux tools? I am using gentoo. Also shouldn't this behavior be considered a bug or at least dangerous? Removing the stick while the system is in sleep mode sounds like a common use- case to me. Also if you remove it, it is very easy to forget to put it back in before you turn the system back on, and I don't think this should kill your file-system like this. I am willing to report this bug, but I don't know which mailing list/bugtracker would be the correct one. _EDIT_ : I found some suggestions online. However if I try this using:               dd if=/dev/disk/by-id/usb-JetFlash_Transcend_4GB_QTMFKJQQ-0\:0-part1 of=sector6.bin bs=512 count=1 skip=6 conv=noerror,sync     dd if=sector6.bin of=/dev/disk/by-id/usb-JetFlash_Transcend_4GB_QTMFKJQQ-0\:0-part1 bs=512 count=1 conv=noerror,sync,notrunc      I still get the same error afterwards. I also tried using `CHKDSK F: \R \T` under windows as suggested by some posts, but this tool only reports the drive as `RAW` and thus unsuported.


title: Alternate FIFO device for Linux with a (way) bigger buffer while still having filesystem semantics?

text: I am developing something that consists of a program I made generating output, and a program I did not make (and would very much like not to have to alter it) consuming it. I am using a named FIFO created with `mkpipe`. I suspect I have a performance bottleneck due to the smallness of the Linux FIFO buffer. (And such size cannot be changed without patching the kernel.) Is there an alternative FIFO-like thing I can use with a buffer of, say, a couple dozen megabytes? The not-made-by-me program can read from anything that can have a filesystem name - `/dev/stdin`, a named pipe (like it's doing now), a real file, `/dev/any-character-device`... Even a third-party free kernel module could do, if no other alternative is available.


title: How to clone an apt repository to keep all old packages?

text: This may sound trivial, but I haven't found a solution anywhere yet. Is there a way to backup or clone an apt repository such that I get a clone that (1) contains all current packages and (2) keeps all old packages. I know that there is `apt-mirror` and `apt-clone` but the very brief documentation doesn't say anything if old package versions are kept. Unfortunately our product depends on packages from a repository where only the newest version is kept. I would like to maintain a local repository that contains the current and all old package versions. Is that possible and how?


title: Customized Work Emails and Signatures with Each Firm, perhaps with Mutt and Procmail to look Professional?

text: CompanyA sends mail, I want to respond to them with `me@companyA.com` and signatureA. When CompanyB sends mail, I want to respond to them with `me@companyB.com` and signature B. Etc.               1. How can I do a hook to change the line `set from="me@CompanyX.com" in .muttrc?          2. How can I -- change the signature according to the sender A, B, C, etc?      If someone has a similar problem of having many work -emails that you forward to your server to manage, please, provide me details how you manage this kind of activity. I use mutt, procmail and I have full-blown *ix servers if needing something special.


title: Which application to use for a calendar?

text: I need a calendar that stores everything locally as I work from places that dont have internet sometimes (I'm a virtual office). I really can't figure it out from reading what I can find about the subject. I am using Mint 12.


title: Linux tools to choose suitable Cisco ASA 5500

text: I have a linux webhosting server which attracts DDOS attacks. I want to use **Cisco ASA 5500 Series Adaptive Security Appliances** to protect the linux server from them. I know there are many factors should you know before you choose the suitable hardware firewall like the amount of this DDOS and pps ..etc Please suggest a linux tools to measure those factors and to help me collect the required informations ( pps - amount of DDOS - concurrent connections and other factors ).


title: Using RVM with gvim without installing the ruby binary

text: In Arch Linux, apparently `gvim` requires to install ruby as a dependency. However, if I want to work with RVM, then I don't need the binary ruby installed. Can that cause problems? Can ruby be removed and gvim configured to use the RVM version of ruby that's installed? Note that trying sudo `pacman -Rs ruby` outputs an error:               error: failed to prepare transaction (could not satisfy dependencies)     :: gvim: requires ruby      Any tips?


title: Wrong language setting in Arch KDE

text: I've installed KDE on Arch Linux, everything is ok, except the language, infact after that I've installed italian language and setted that as preferred, the texts of tabs, settings and so on is mixed in american english and italian. I want use only italian and american english is available languages menu (not preferred). How could I delete american english?


title: iceweasel (firefox) browser re-installation

text: I uninstalled my browser (iceweasel) from Add/Remove Software option in Kali Linux.At the time of removal it asked for one dependent package also to be uninstalled that I don't remember. But now when I am re-installing it as per instruction given on its official Site , it's giving the following error:               Reading package lists... Done     Building dependency tree            Reading state information... Done     Package iceweasel is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or is only    available  from another source     E: Package 'iceweasel' has no installation candidate      Any suggestions !!!


title: Spawn login prompt in an X terminal

text: I have a system that runs a bash script when it starts (I use `/etc/init.d/rc.local` to execute it without needing to log in). For reasons I won't go in to here, I need to launch a graphical terminal to run the script. It does things like display diagnostic messages while starting an application. The way I start everything in `rc.local` is like this               xinit urxvt --hold -e /path/to/script      After doing all its diagnostic stuff, the script launches a full screen application. When that application dies (for whatever reason) the user gets dropped back at the urxvt terminal exactly where the script left off before launching. What I would like to happen is that when the application dies, the script launches a new urxvt terminal with a login prompt. I have tried `urxvt --ls` and `urxvt --loginShell` but every time the new terminal is launches, I get a shell with the root user logged in - obviously not idea. How can I make it launch a login prompt with no user logged in?


title: rsnapshot LVM without root

text: I'd like to cron a local backup to a locally mounted USB drive. I'm using rsnapshot and want it to back up an LVM snapshot onto the USB drive. But, unless I run the cron as root it complains that I can't make an LVM snapshot because I don't have permission to look at /dev/mapper/control. Am I missing something? This is on CentOS 6.4.


title: Get notified from avahi

text: After looking for a zero-conf browser valid implementation I realised that inside my linux machine (ubuntu) I already have avahi and typing:               avahi-browse -alr      I get a complete list of all devices notified by their bonjour conf. **Question:** how to get events from it? I mean, how can I get notification (execute a script) when a bonjour device is connecting on my network? How to detect when it is switched off?


title: Upgrading Linux (Fedora) with LUKS encrypted volume

text: I have FC18 on a `LUKS/dm-crypt` encrypted hard disk. I'd like to upgrade the system via a FC20 dvd. I looked around a bit and it seems that upgrading the system via the installation procedure from the DVD would require some specific steps to ensure the correct recognition of the disk's contents. The alternative would be, perhaps, to update yum repository and upgrade from there, but the first option seems "cleaner", and it has been so in my limited experience. It's still not clear to me whether trying to make the DVD installer recognize the encrypted partition is an easy and reliable process. Should I back up /home and perform a clean install?


title: Specifying DNS settings to override those of DHCP

text: Every 6 months or so I cannot access the DNS on whatever router I'm using. usually have to add the nameserver by hand to the `/etc/resolv.conf` file. I've tried adding Google free DNS to the file and it changes nothing. What can I do to not have to manually change the file each time I go to different coffee shop?


title: Cannot figure out how to revert back to backed up profile file

text: Basically, I made a backup copy of my `/etc/profile` (or `~/.profile` I can't remember exactly) file that executes as soon as you login to a TTY, and then I changed the one that was there, and now it automatically logs you out as soon as you login. I just need to view the current file and make a modification to the script, but I can't figure out a way to get to it. I've tried a Ubuntu live CD but I can't figure out how to get permission after I mount the drive locally. I have Grub installed but I removed all of the options except the default from the menu. Edit: also if it's relevant, I the disk is a `.vhd` that I am trying to access via virtualbox.


title: Can zfs resilvering destroy data with misreported device failures?

text: I have had a situation where I am moving data into a new zfs raidz pool with four devices, some of them virtual to facilitate the migration. The system completely hung in the middle of a device replace of a file based device to a physical device. The system did not even respond to SysRq and had to be reset physically. When it came back online then zfs had decided that only 2 out of 4 devices were online and started resilvering and reporting loads of errors. I didn't know how to stop it doing this, it keeps going in the backround even when the pool is unmounted. By the time I managed to get the totally ok missing device online it has reported many many errors. Does that mean that zfs has destroyed data while resilvering due to the missing device? Or can it now resilver correctly back again now that it has it's original devices in place? When it was resilvering with only 2 devices then it was resilvering on sda3 below:                       NAME                             STATE     READ WRITE CKSUM         zfs_raid                         DEGRADED     0     0 38.5K           raidz1-0                       DEGRADED     0     0  129K             sda3                         ONLINE       0     0     0             sdc2                         ONLINE       0     0     0             replacing-2                  DEGRADED     0     0     3               /zfs_jbod2/zfs_raid/zfs.1  OFFLINE      0     0     0               sdb1                       ONLINE       0     0     0  (resilvering)             /zfs_jbod/zfs_raid/zfs.2     ONLINE       0     0     0  (resilvering)      errors: 25852 data errors, use '-v' for a list


title: Remove PIN from SIM card?

text: On Linux, given an USB surfstick with a SIM card that has a PIN, how can I disable the PIN of the SIM card? Note that the PIN is known, I do not want to crack it etc, just disable it.


title: Variable assigned inside ssh command doesn't return proper value

text: I'm executing the below command in the `ssh` part of my script. The command is meant to cut the file size from `ls` option and storing it to a variable. Then print the variable:               echo "Enter srouce file";     read src_file;     src_size =`ls -latr $src_file | awk  '{ print $5 }' `;     echo "The source file size is $src_size ";      This works fine when it is executed on the command line. When I try the same command inside a script via `ssh`:               ssh user@server "echo "enterfile";read src_file;echo "enter path ";read path;cd $path;src_size=`ls -latr $src_file | awk  '{ print $5 }' ` ; echo The source file size is $src_size;"      This fails. It stores some local temporary value and returns the same instead of correct file size.


title: How to Originate Call from Polycom Intercom via Dialplan

text: We have polycom phones for use with our Asterisk 1.8 PBX. Consider this: On the phone at extension 2536, I dial 3333. This should originate a call from extension 2500 to play a sound. In other words, I want to use the phone at 2536 to play sounds over another phone. Now this I am able to do, but I have to _answer_ the phone that receives the call. I want it to auto-answer via it's speakerphone. I've already configured the sip.cfg files in the polycom tftp directory. Both phones are Polycom 601's.               [macro-RingAngelusBell]     include => intercom     exten => s,1, NoOp(Ringing-zee dee bell! ${CHANNEL} dialed: ${MACRO_EXTEN})     ;same => n,ChanIsAvail(SIP/2500,js)     same => n,Originate(SIP/2500,exten,soundeffects,thebell,1)     same => n,NoOp(Originate Status: ${ORIGINATE_STATUS})     same => n,Hangup()          [soundeffects]     exten => thebell,1(thebell),SIPAddHeader(Alert-Info: Auto Answer)     same => n, Answer()     same => n,NoOp(soundeffects: thebell)     same => n,Playback(soundfx/angelusbell)     same => n,Hangup()      I've tried this, too: In this case, when I dial 3333 from 2536, 2500 rings, but it isn't supposed to. Instead, 2500 is supposed to CALL "thebell" from it's speakerphone and play the bell sound over it's speaker.               [macro-RingAngelusBell]     include => intercom     exten => s,1, NoOp(Ringing-zee dee bell! ${CHANNEL} dialed: ${MACRO_EXTEN})     same => n,SIPAddHeader(Alert-Info: Auto Answer)     same => n,Originate(SIP/2500,app,Dial(thebell))     same => n,NoOp(Originate Status: ${ORIGINATE_STATUS})     same => n,Hangup()      And in my sip.cfg:               <alertInfo voIpProt.SIP.alertInfo.1.value="Auto Answer"     VoIpProt.SIP.alertInfo.1.class="3"     voIpProt.SIP.alertInfo.2.value="intercom" voIpProt.SIP.alertInfo.2.class="4"     />      `alertInfo.1.value` is set to `"Auto Answer"` because the phone should not ring at all, although I've tried `Ring Answer` and it doesn't make any difference. I have to say that I'm rather confused... I know what I want but not how to get it! The call gets originated from the soundplay, but not using the intercom.


title: Make grep work for special filenames

text: I have a set of `txt` files whose names may contain space or special characters like `#`. I have a `grep` solution `grep -L "cannot have" $(grep -l "must have" *.txt)` to list all the files who have `must have` but not `cannot have`. For instance, there is a file `abc defg.txt` which contains only 1 line: `must have`. So normally the grep solution should find out `abc defg.txt`, but it returns:               grep: abc: No such file or directory     grep: defg.txt: No such file or directory      I think for filenames containing `#`, the grep solution is also invalid. Could anyone help me amend the grep solution?


title: eth0 not installed on CentOS

text: How would I go about installing **eth0** on CentOS? When I do `ifconfig -a`, **eth0** is not there. Here is the output of `ip link`:               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue         link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     3: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue         link/void


title: trac svn python bindings messed up rebuild python

text: My trac and svn used to work it still does if i click on the links many times. How ever it complaines of he followign and i am not sure what to do i have followed http://trac.edgewall.org/wiki/TracSubversion and http://trac.edgewall.org/wiki/TracSubversion but nothings changed. I am using centos 5, svn 1.6, trac 0.10.4, python 2.4.3               2013-11-29 14:24:14,458 Trac[main] ERROR: Unsupported version control system "svn". Check that the Python bindings for "svn" are correctly installed.     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request         dispatcher.dispatch(req)       File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 191, in dispatch         chosen_handler = self._pre_process_request(req, chosen_handler)       File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 263, in _pre_process_request         chosen_handler = f.pre_process_request(req, chosen_handler)       File "/usr/lib/python2.4/site-packages/trac/versioncontrol/api.py", line 73, in pre_process_request         self.get_repository(req.authname).sync()       File "/usr/lib/python2.4/site-packages/trac/versioncontrol/api.py", line 91, in get_repository         raise TracError('Unsupported version control system "%s". '     TracError: Unsupported version control system "svn". Check that the Python bindings for "svn" are correctly installed.     2013-11-29 14:24:15,090 Trac[loader] DEBUG: Loading file plugin ez_setup from /usr/share/trac/plugins/ez_setup.py     2013-11-29 14:24:15,154 Trac[loader] DEBUG: Loading egg plugin trac.ticket.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,286 Trac[loader] DEBUG: Loading egg plugin trac.ticket.query from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,345 Trac[loader] DEBUG: Loading egg plugin trac.attachment from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,345 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.svn_fs from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,564 Trac[loader] DEBUG: Loading egg plugin tracopt.mimeview.enscript from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,627 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.patch from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,629 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.txtl from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,643 Trac[loader] WARNING: Cannot load plugin trac.mimeview.txtl because it requires "textile>=2.0"     2013-11-29 14:24:15,643 Trac[loader] DEBUG: Loading egg plugin trac.admin.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,644 Trac[loader] ERROR: Failed to load plugin trac.admin.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin.web_ui     2013-11-29 14:24:15,682 Trac[loader] DEBUG: Loading egg plugin trac.web.session from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,683 Trac[loader] DEBUG: Loading egg plugin trac.ticket.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,684 Trac[loader] ERROR: Failed to load plugin trac.ticket.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin     2013-11-29 14:24:15,685 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.rst from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,699 Trac[loader] WARNING: Cannot load plugin trac.mimeview.rst because it requires "docutils>=0.3"     2013-11-29 14:24:15,699 Trac[loader] DEBUG: Loading egg plugin trac.db.postgres from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,701 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,734 Trac[loader] DEBUG: Loading egg plugin trac.timeline from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,735 Trac[loader] ERROR: Failed to load plugin trac.timeline from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named timeline.web_ui     2013-11-29 14:24:15,736 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.pygments from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,749 Trac[loader] WARNING: Cannot load plugin trac.mimeview.pygments because it requires "Pygments>=0.6"     2013-11-29 14:24:15,750 Trac[loader] DEBUG: Loading egg plugin trac.wiki.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,750 Trac[loader] ERROR: Failed to load plugin trac.wiki.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin     2013-11-29 14:24:15,751 Trac[loader] DEBUG: Loading egg plugin trac.about from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,752 Trac[loader] ERROR: Failed to load plugin trac.about from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named about     2013-11-29 14:24:15,752 Trac[loader] DEBUG: Loading egg plugin tracopt.ticket.commit_updater from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,758 Trac[loader] ERROR: Failed to load plugin tracopt.ticket.commit_updater from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])       File "build/bdist.linux-i686/egg/tracopt/ticket/commit_updater.py", line 48, in ?     ImportError: No module named compat     2013-11-29 14:24:15,759 Trac[loader] DEBUG: Loading egg plugin trac.wiki.interwiki from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,762 Trac[loader] DEBUG: Loading egg plugin trac.ticket.roadmap from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,765 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.svn_prop from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,766 Trac[loader] ERROR: Failed to load plugin trac.versioncontrol.svn_prop from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named svn_prop     2013-11-29 14:24:15,766 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.silvercity from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,779 Trac[loader] WARNING: Cannot load plugin trac.mimeview.silvercity because it requires "SilverCity>=0.9.4"     2013-11-29 14:24:15,779 Trac[loader] DEBUG: Loading egg plugin trac.wiki.macros from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,780 Trac[loader] DEBUG: Loading egg plugin trac.db.sqlite from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,790 Trac[loader] DEBUG: Loading egg plugin tracopt.ticket.deleter from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,045 Trac[loader] ERROR: Failed to load plugin tracopt.ticket.deleter from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])       File "build/bdist.linux-i686/egg/tracopt/ticket/deleter.py", line 22, in ?     ImportError: No module named translation     2013-11-29 14:24:16,046 Trac[loader] DEBUG: Loading egg plugin trac.wiki.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,054 Trac[loader] DEBUG: Loading egg plugin tracopt.mimeview.php from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,055 Trac[loader] DEBUG: Loading egg plugin trac.web.auth from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,090 Trac[loader] DEBUG: Loading egg plugin trac.wiki.web_api from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,091 Trac[loader] ERROR: Failed to load plugin trac.wiki.web_api from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named web_api     2013-11-29 14:24:16,092 Trac[loader] DEBUG: Loading egg plugin trac.admin.console from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,092 Trac[loader] ERROR: Failed to load plugin trac.admin.console from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin.console     2013-11-29 14:24:16,093 Trac[loader] DEBUG: Loading egg plugin trac.db.mysql from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,094 Trac[loader] DEBUG: Loading egg plugin tracopt.perm.authz_policy from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,096 Trac[loader] ERROR: Failed to load plugin tracopt.perm.authz_policy from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])       File "build/bdist.linux-i686/egg/tracopt/perm/authz_policy.py", line 23, in ?     ImportError: cannot import name IPermissionPolicy     2013-11-29 14:24:16,097 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.svn_authz from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,097 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,098 Trac[loader] ERROR: Failed to load plugin trac.versioncontrol.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin     2013-11-29 14:24:16,098 Trac[loader] DEBUG: Loading egg plugin trac.search from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,099 Trac[loader] ERROR: Failed to load plugin trac.search from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named search.web_ui     2013-11-29 14:24:16,099 Trac[loader] DEBUG: Loading egg plugin tracopt.perm.config_perm_provider from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,100 Trac[loader] DEBUG: Loading egg plugin trac.prefs from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,101 Trac[loader] ERROR: Failed to load plugin trac.prefs from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named prefs.web_ui     2013-11-29 14:24:16,101 Trac[loader] DEBUG: Loading egg plugin trac.ticket.report from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg      I have tried downloading and re-installing trac 0.10.4 and I also noticed the following problem, I cannot create any trac projects either               [root@hero trac]# trac-admin nagios initenv     Traceback (most recent call last):       File "/usr/bin/trac-admin", line 21, in ?         from trac.scripts.admin import run     ImportError: No module named scripts.admin      29th november is when all this happened, only 3 packages where updated.               [root@hero trac]# rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n' | sort -n | tail -20     1272376205 (Tue 27 Apr 2010 02:50:05 PM BST) perl-Digest-SHA     1272376206 (Tue 27 Apr 2010 02:50:06 PM BST) perl-Net-DNS     1272376367 (Tue 27 Apr 2010 02:52:47 PM BST) perl-Net-IMAP-Simple     1297437326 (Fri 11 Feb 2011 03:15:26 PM GMT) rsync     1303313671 (Wed 20 Apr 2011 04:34:31 PM BST) bacula-libs     1303313686 (Wed 20 Apr 2011 04:34:46 PM BST) bacula-client     1319625083 (Wed 26 Oct 2011 11:31:23 AM BST) nano     1320596688 (Sun 06 Nov 2011 04:24:48 PM GMT) libsmbclient     1320596692 (Sun 06 Nov 2011 04:24:52 PM GMT) samba-common     1320596694 (Sun 06 Nov 2011 04:24:54 PM GMT) perl-Convert-ASN1     1320596695 (Sun 06 Nov 2011 04:24:55 PM GMT) samba-client     1320596697 (Sun 06 Nov 2011 04:24:57 PM GMT) samba     1360917828 (Fri 15 Feb 2013 08:43:48 AM GMT) which     1380191389 (Thu 26 Sep 2013 11:29:49 AM BST) httperf     1380798707 (Thu 03 Oct 2013 12:11:47 PM BST) libssh2     1380798733 (Thu 03 Oct 2013 12:12:13 PM BST) libssh2-devel     1380799094 (Thu 03 Oct 2013 12:18:14 PM BST) php-pear     1385728355 (Fri 29 Nov 2013 12:32:35 PM GMT) neon     1385728360 (Fri 29 Nov 2013 12:32:40 PM GMT) subversion     1385728366 (Fri 29 Nov 2013 12:32:46 PM GMT) mod_dav_svn      In theory if i remove the dir `/usr/share/trac` and `/usr/lib/python2.4/site- packages/trac/` and re-install trac 0.10.4 should it not work? I have tried this and it does not. I have now done the following which has fixed issue of allowing me to create trac projects, however I cannot get into trac using browser.               [root@hero trac]# easy_install -m trac     Searching for trac     Best match: Trac 0.12     Processing Trac-0.12-py2.4.egg     Removing Trac 0.12 from easy-install.pth file     Installing trac-admin script to /usr/bin     Installing tracd script to /usr/bin          Using /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg          Because this distribution was installed --multi-version, before you can     import modules from this package in an application, you will need to     'import pkg_resources' and then use a 'require()' call similar to one of     these examples, in order to select the desired version:              pkg_resources.require("Trac")  # latest installed version         pkg_resources.require("Trac==0.12")  # this exact version         pkg_resources.require("Trac>=0.12")  # this version or higher          Processing dependencies for trac     Finished processing dependencies for trac      The error I receive is               [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):, referer: http://hero/trac/     [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch\n    log=debug), referer: http://hero/trac/     [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 461, in import_module\n    f, p, d = imp.find_module(parts[i], path), referer: http://hero/trac/     [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend: ImportError: No module named trac, referer: http://hero/trac/


title: Automatically set file attributes in a given directory

text: Let's say I want to set one or more attributes (in the `chattr` sense) on every file created in a given directory. Is there a way to achieve this automatically, like `umask` does for file permissions ? In other words, is there a way to omit the `chattr` step in :               $ copy file /path/to/backup/     $ chattr +i /path/to/backup/file      for every file created in `/path/to/backup/` ? Note : My system is Debian and my filesystem is ext3.


title: cp --backup=numbered for folders

text: To backup existing files with number suffixes, I can do the following:               cp --backup=numbered afile /path/to/dest      But this does not apply when I try to do the same with a folder:               cp -R --backup=numbered afolder /path/to/dest      How can I achieve this? * * * Maybe I should demonstrate a bit what I want to achieve. First we have two dirs:               ls -ld source container     drwxrwxr-x 6 kaiyin kaiyin 4096 Nov 29 22:11 container     drwxrwxr-x 2 kaiyin kaiyin 4096 Nov 29 22:09 source      Then we do this: myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ Ideally I want this result:               tree container/     container/     ├── source     ├── source.~1~     ├── source.~2~     └── source.~3~


title: Can Not Install JStock on Ubuntu (zorin 7)

text: Trying to install Jstock on a Linux Ubuntu Box. As a new user trying to install this product. I have received this error after following instruction - on to a Ubuntu (Zorin7) system. ### Instructions How to install JStock in Linux?               user@ubuntu804desktop:~$ cd ~     user@ubuntu804desktop:~$ wget http://downloads.sourceforge.net/jstock/jstock-1.0.7i-bin.zip     user@ubuntu804desktop:~$ unzip jstock-1.0.7i-bin.zip     user@ubuntu804desktop:~$ cd jstock/     user@ubuntu804desktop:~/jstock$ chmod 755 jstock.sh     user@ubuntu804desktop:~/jstock$ ./jstock.sh      This is the error after imputing - `cd jstock` it returned the following:-               :~/jstock$ /jstock$ chmod 755 jstock.sh     bash: /jstock$: No such file or directory     :~/jstock$ ls     config  database  docs  extra  jstock.jar  jstock.sh  lib      Can you please advise?


title: How to merge two files based on the matching of two columns?

text: I have file1 likes:               0   AFFX-SNP-000541     NA     0   AFFX-SNP-002255     NA     1   rs12103     0.6401     1   rs12103_1247494     0.696     1   rs12142199  0.7672      And a file2:               0   AFFX-SNP-000541     1     0   AFFX-SNP-002255     1     1   rs12103     0.5596     1   rs12103_1247494     0.5581     1   rs12142199  0.4931      And would like a file3 such that:               0   AFFX-SNP-000541     NA   1     0   AFFX-SNP-002255     NA   1     1   rs12103     0.6401   0.5596     1   rs12103_1247494     0.696   0.5581     1   rs12142199  0.7672   0.4931      Which means to put the 4th column of file2 to file1 by the name of the 2nd column.


title: Delete files recursively that DON'T match regexp

text: I'm attempting to clean out a bunch of temporary files from a folder tree, but don't want to delete files that match some criteria, specifically executable files, .tpl files, and not the subfolder 'data'. I see the question here Delete files in a directory that match a regexp, using a Mac terminal is almost what I'm looking for, but they have a regex they are trying to match, and I have a regex that I don't want matches. I can do this to find all of the files I don't to delete:               find . -executable -o -regex '.*\.tpl'      Is there a way to invert the matches, like -v does with regex?


title: Copying many CDs to disk

text: I have many old (data) CDs. I want to copy them all to the disk, but the problem is that some of these CDs are no longer readable and it is extremely tiresome to copy the CDs one by one. Is there some tool to expedite this process?


title: See the STDOUT redirect of a running process

text: If I start an app with this command:               /path/to/my/command >> /var/log/command.log      And the command doesn't return, is there a way, from another prompt, to see what the STDOUT redirect is set to? I'm looking for something like either               cat /proc/PID/redirects      or               ps -??? | grep PID      but any method will do.


title: How/why does this globbing expression work?

text: In one of my bash scripts I needed to obtain the last part of a colon delimited string. For example I needed to grab the numeric `289283` value from the following value:               OK: DriveC-ReadBytesPerSec: 289283      After some trial and error I arrived at the following:               READRESULT="OK: DriveC-ReadBytesPerSec: 289283"     echo ${READRESULT#*:*:*}      Which outputs `289283`. The problem is that whilst it gets the job done, I don't fully understand why `${READRESULT#*:*:*}` produces the correct result. Can anyone explain how this globbing expression works?


title: foomatic-configure producing weird perl warnings

text: I am using CentOS 6.4 and trying to use the 'foomatic-configure' for print information and am receiving some weird errors: Perl: v5.10.1 foomatic: foomatic-4.0.4-1.el6_1.1.i686 Command line:               foomatic-configure -r -P -q      Produces these warnings:               Use of uninitialized value $manufacturer in string eq at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 354.     Use of uninitialized value $model in string eq at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 355.     Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 2147.     Use of uninitialized value $d in hash element at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1143.     Use of uninitialized value in regexp compilation at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1146.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1146.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1189.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1191.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1193.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1195.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1197.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1199.     Use of uninitialized value in hash element at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1249.      Yukk, what is up with that??? I do receive the perl hash for `$QUEUES[0]` with the correct data, but could do without the error messages.... **UPDATE:** Looks as though I can suppress these messages using the following: `foomatic-configure -P -q -r 2>/dev/null` Shouldn't have to do that though....


title: MySQL is running out of cache

text: I installed MySQL Workbench on Linux Mint 17. When I enter the `i` character from keyboard MySQL runs out cache in MySQL query display. Then MySQL shuts down. I would appreciate it if you could help.


title: init.d script won't send graphical data

text: I have a client sever java program. The client's work is to capture the screen and send data to server. An additional function it does is opens the website given from server and send some text to server. I wanted the client to run at startup, so I wrote a script and used it in `/etc/init.d` and used `update- rc.d scriptname defaults` and then rebooted. On reboot, the text I am supposed to receive works perfectly. But I am not able to browse or receive captured screen from client. The script I used in init.d is as follows:               #!/bin/sh          ### START INIT INFO     # Provides: suscript     # Required-Start:    $remote_fs $syslog $local_fs $network     # Required-Stop:     $remote_fs $syslog $local_fs $network     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Start daemon at boot time     # Description:       Enable service provided by daemon.     ### END INIT INFO          java -jar /etc/capture/capture.jar      I run the client jar as root. How do I bring the graphical data to the server?


title: how to round trip a bash associative array to a text file?

text: I want to memorize an associative array between different script runs. What I have so far is that given a text file containing one key/value pair:               (     [james]=bond     )      Is a script to load that into an associative array, add to it, then echo it out in a way which can be redirected into a second file:               #!/bin/bash     file=`cat $1`     key=$2     value=$3     declare -A row="$file"     row[$key]=$value     echo "("     for server in "${!row[@]}"         do echo "[$server]=${row[$server]}"; done     echo ")"      then I can run it as:               ./arrays.sh file1 honey rider > file2 ; mv file2 file1      Giving               (     [james]=bond     [honey]=rider     )      Yet it seems very clunky. Is there a cleaner way to do this?


title: Feh - strange behavior when loading backgrounds in Arch Linux

text: I am experiencing a strange problem with Feh in Arch Linux. When I start my openbox session, feh loads the background for a split second and then it goes away. If I manually load the background then feh will operate perfectly for the remainder of my session but on startup it always fails. I am running Arch Linux (current) and Openbox 3. Relevant files: ~/.config/openbox/autostart.sh               # Set a background color     BG=""     if which hsetroot >/dev/null 2>&1; then         BG=hsetroot     else         if which esetroot >/dev/null 2>&1; then         BG=esetroot         else         if which xsetroot >/dev/null 2>&1; then             BG=xsetroot         fi         fi     fi     test -z $BG || $BG -solid "#303030"          # D-bus     if which dbus-launch >/dev/null 2>&1 && test -z "$DBUS_SESSION_BUS_ADDRESS"; then            eval `dbus-launch --sh-syntax --exit-with-session`     fi          if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then       /usr/libexec/gnome-settings-daemon &     elif which gnome-settings-daemon >/dev/null 2>&1; then       gnome-settings-daemon &     elif which xfce-mcs-manager >/dev/null 2>&1; then       xfce-mcs-manager n &     fi          if which start_kdeinit >/dev/null 2>&1; then       LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &     fi          # Run XDG autostart things.  By default don't run anything desktop-specific     # See xdg-autostart --help more info     DESKTOP_ENV="OPENBOX"     if which /usr/lib/openbox/xdg-autostart >/dev/null 2>&1; then       /usr/lib/openbox/xdg-autostart $DESKTOP_ENV     fi          ## My startup programs:     cairo-compmgr &     pypanel &     sh ~/.fehbg &      ~/.fehbg               feh  --bg-fill '/home/cknadler/Wallpaper/wall.jpg'      At this point I am either looking for a solution to make feh load correctly every-time I start my session or possibly an alternative the feh for loading backgrounds in openbox. Either would be greatly appreciated, thanks.


title: What would be a good choice for an elastic file system (for adding storage at a later date)?

text: I'm currently running a Debian 6.0 server with EXT3, but I'd like to move over to Arch. It's being used as a file server right now with a 1TB drive in it (of which 650GB in it is used). What I'd like to do at a later point (when I'm not completely broke) is buy another drive and add it to the same system (for backing up my main rig). What would be the easiest way of accomplishing this? I've looked into RAID, but it'd be useless because I'd have to reinitialize the array every time I added a new drive. **Note: I'm not fussed about redundancy, it's only going to be hosting mirrored backups which I can easily remake in the case of data loss.** Basically: System with clean 1TB drive in, what should I do now to prepare for a new striped drive at a later date _without having to reinitialize any arrays?_


title: Passing pipeline value as parameter to xargs for use by eval echo

text: I have a text file that I'm using as a template, it looks like this:               Hostname     : $HOSTNAME     Host Address : $HOSTADDRESS      My bash script sets two variables, `HOSTNAME` and `HOSTADDRESS`, reads the template file then does an `eval` to expand `$HOSTNAME` and `$HOSTADDRESS`:               HOSTNAME="SH_SQL_0089"     HOSTADDRESS="172.16.3.44"     TEMPLATE=`cat template.txt`     MESSAGE=`eval echo $TEMPLATE`      The resultant value of `MESSAGE` is:               Hostname     : SH_SQL_0089     Host Address : 172.16.3.44      Is it possible to reduce the last two lines to something like:               MESSAGE=$(cat template.txt | eval echo ????)      I tried using `xargs`:               MESSAGE=$( cat template.txt | xargs -i bash -c "eval echo {}" )      But it only substitutes `$HOSTNAME` and strips the carriage returns. The reason I want to do this is that I need to add a third processing step and pipe the `eval`'d output to that. I feel I'm so close.


title: Simple CLI rss reader, that can print only subject and uri, based on new since time interval

text: So what I'm looking for is easy enough to code, but I'm wondering if it already exists, so I don't going releasing duplicate code. I need a feed reader, that prints the subject, and uri on one line, to stdout. It should be able to be configured (not necessarily by config file) to only show new feeds in say the last 5 minutes. The reason I want this is because I'm coding my ping.fm replacement. I basically want to be able to do something like `feedreader | pingit` where `pingit` will do, `foreach` line of input, make a separate post. In this way I'll also be able to `echo -n "my social post" | pingit` I'll probably also make `pingit "post"` work.


title: How to scale xvfb?

text: I'm looking to develop a web-application that translates request parameters into a PNG/GIF chart. I'm looking to reuse an open source charting library, but I have concerns about the scalability. A long time ago, we were using a single Xvfb buffer to render our image into, but that basically meant servicing only one incoming request at a time. According to the man page it seems we can create numerous buffers? If so, is it simply ensuring there is enough physical RAM to prevent excessive paging?


title: Writing basic systemd service files

text: I am developing a Nodejs application that the user interacts with via HTTP on localhost. There are practically no parameters and the daemon has virtually no dependencies and it just needs to be up by log-in time. I would like to follow the idioms on each platform for start-up scripts, and that means Upstart on Ubuntu and systemd on Fedora.   * **Are there any good tutorials for writing systemd system files?**   * **Are there any 'best practices' to be aware of?** I have found these resources:   * Fedora wiki page about systemd   * Blog about writing systemd system files   * Systemd on Wikipedia I am mostly looking for an API of sorts as a reference, as well as a basic format to follow.


title: Shell script to check for the presence of one or more files with a specific extension?

text: I want to write a script to find a file with specific extension.this much i have done:               #!/bin/bash     file="/home/Savio/Dsktop/check/*.csv"     file1="/home/Savio/check/*.txt"     if [[ -f "$file" && -f "$file1" ]];     then         echo " found."     else         echo "not found."     fi      Where the `check` folder contains sub-folders. Please correct me if anything wrong is there


title: Mint changes default route when eth0 comes back and breaks existing tcp connections

text: I have two interfaces on my laptop (eth0, wlan0). lets say I am moving away from desk and connecting to an internal network A using openvpn software which uses wlan0 as gateway. I then ssh to a few vms inside this network A. when I return back to my desk, the system detects eth0 is available and automatically changes default route. I then lose vpn connection and all the ssh sessions with the vms in network A. on wlan0               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         10.147.76.1     0.0.0.0         UG    0      0        0 wlan0      when reestablished connection with eth0               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         10.148.93.1     0.0.0.0         UG    0      0        0 eth0      how to solve this issue?


title: Pulseaudio failed to create secure directory in nfs share

text: My pulseaudio cannot run, because it attempts to create `~/.config/pulse` under a different user. (probably `pulse`?).               user@localhost ~$ pulseaudio      E: [pulseaudio] core-util.c: Failed to create secure directory (/home/user/.config/pulse): Permission denied      Since the home directory is mounted from nfs and the server will never allow user `pulse` to access that directory (even for reading) it must either use a different path outside the home directory or run with a different user. I have checked `/etc/pulse/client.conf`, but there doesn't seem to be any configuration option on that. Any ideas on how this problem can be solved?


title: Archlinux installation problem

text: I've used 2 usb's, both livelinuxusb and unetbootin, and tried multiple reinstalls and formats. Whenever I try and install Archlinux x86_64 it unpacks the kernel and the says "0.000 fast tsc calibration failed" after that the computer runs but the screen turns off. What am I doing wrong?


title: SSH server is not disconnecting session when I shutdown the machine

text: I have a Arch Linux virtual machine, if I shutdown the machine while a ssh connection is alive. The SSH session would stuck (and the machine shuts down correctly) So the server is not disconnecting the session before the SSH service gets stopped. But on Ubuntu there's no such behavior, what problem could it be?


title: tar.bz2 7zip selective extract prformance

text: We use tar.bz2 as our archive of server logs. We also write tools that selectively parse these archived logs. Many times I must regex-search one file’s lines in the archive to determine if other logs contained in the same archive are relevant to the parsing needs. (I have a regex match for the file name/path) From a performance stand point I think I facing some limits. But it could be that I have a gap in my knowledge. I mostly script in python and have some basic bash skills. The archives are large and stored on a mount. I would like to avoid as much reading and local/temp storage as I can and especially when archives don’t qualify for a full parsing. Option 1 (waste bandwidth and cpu resources save local storage)   1. Read the whole bz2 file to local disk.   2. Uncompress the tar as I scan the file list.    3. Uncompress again to search the first log file.   4. Then if this archive qualifies uncompress again to extract the log that I must parse.   5. Move on to the next archive Or (waste local storage and waste less bandwidth)   1. Read the whole bz2 file to local disk.   2. Extract most of the files that meet a potential interesting criteria (would need to take most everything)   3. Now every file is just on my local file system. Scan the first log   4. Then if it qualifies move on to the log that I must parse.   5. Delete all the local storage and move on to next archive. When I research compression tools like 7zip zip rar bz2… Most links give me information about compression speed and compression size. I would like to use something like 7zip because the compression size is important long term. This is not the base of my question! But I also ‘think’ that zip has the ability to expose the full file list and extract one file without decompressing the whole archive. (Because the file list is in headers…) But zip is not very native on Linux.   Is there a way to optimize the process using the existing tar.bz2? What are some tools / methods I should consider? (Switch out tar, use 7zip?)


Why does CentOS even with its latest release ship older versions of apps such as Python 2.6? What is the reason and logic behind it?


title: How to make wpa_supplicant automatically log into file

text: I am trying to troubleshoot a wireless connection on FreeBSD. I am manually editing the `/etc/wpa_supplicant.conf` file So far the `wpa_cli` status only tells me that it's Unauthorized. I'd like to get a more verbose message and log the messages into a file for each wireless adapter.   1. How do I make wpa_supplicant automatically log into a file?   2. How do I make wpa_supplicant automatically change his debug level after a reconfigure?


title: Determine dynamically allocated port for OpenSSH RemoteForward

text: ## Question (TL;DR) When assigning ports dynamically for remote forwarding (a.k.a. `-R` option), how can a script on the remote machine (for instance sourced from `.bashrc`) determine which ports were chosen by OpenSSH? * * * ## Background I use OpenSSH (on both ends) to connect to our central server, that I share with multiple other users. For my remote session (for now) I would like to forward X, cups and pulseaudio. The most trivial is forwarding X, using the `-X` option. The allocated X address is stored in the environmental variable `DISPLAY` and from that I can determine the corresponding TCP port, in most cases anyways. But I hardly ever need to, because Xlib honors `DISPLAY`. I need a similar mechanism for cups and pulseaudio. The basics for both services exist, in the form of the environmental variables `CUPS_SERVER` and `PULSE_SERVER`, respectively. Here are usage examples:               ssh -X -R12345:localhost:631 -R54321:localhost:4713 datserver          export CUPS_SERVER=localhost:12345     lowriter #and I can print using my local printer     lpr -P default -o Duplex=DuplexNoTumble minutes.pdf #printing through the tunnel     lpr -H localhost:631 -P default -o Duplex=DuplexNoTumble minutes.pdf #printing remotely          mpg123 mp3s/van_halen/jump.mp3 #annoy co-workers     PULSE_SERVER=localhost:54321 mpg123 mp3s/van_halen/jump.mp3 #listen to music through the tunnel      The problem is setting `CUPS_SERVER` and `PULSE_SERVER` correctly. **We use port forwardings a lot and therefore I need dynamic port allocations. Static port allocations are not an option.** OpenSSH has a mechanism for dynamic port allocation on the remote server, by specifying `0` as bind-port for remote forwarding (the `-R` option). By using the following command, OpenSSH will dynamically allocate ports for cups and pulse forwarding.               ssh -X -R0:localhost:631 -R0:localhost:4713 datserver      When I use that command, `ssh` will print the following to `STDERR`:               Allocated port 55710 for remote forward to 127.0.0.1:4713     Allocated port 41273 for remote forward to 127.0.0.1:631      There is the information I want! Ultimately I want to generate:               export CUPS_SERVER=localhost:41273     export PULSE_SERVER=localhost:55710      However the "Allocated port ..." messages are created on my local machine and sent to `STDERR`, which I can't access on the remote machine. Oddly enough OpenSSH does not seem to have means to retrieve Information about port forwardings. How do I fetch that information to put it into a shell script to adequately set `CUPS_SERVER` and `PULSE_SERVER` on the remote host? * * * ## Dead Ends The only easy thing I could find was increasing verbosity of the `sshd` until that information can be read from the logs. This is not viable as that information discloses a lot more information than is sensible to make accessible by non-root users. I was thinking about patching OpenSSH to support an additional escape sequence which prints a nice representation of the internal struct `permitted_opens`, but even if that is what I want, I still can't script accessing the client escape sequences from the server side. * * * ## There must be a better way The following approach seems very unstable and is limited to one such SSH session per user. However, I need at least two concurrent such sessions and other users even more. But I tried ... When the stars are aligned properly, having sacrificed a chicken or two, I can abuse the fact that `sshd` is not started as my user, but drops privileges after successful login, to do this:   * get a list of port numbers for all listening sockets that belong to my user `netstat -tlpen | grep ${UID} | sed -e 's/^.*:\\([0-9]\\+\\) .*$/\1/'`   * get a list of port numbers for all listening sockets that belong to processes my user started `lsof -u ${UID} 2>/dev/null | grep LISTEN | sed -e 's/.*:\\([0-9]\\+\\) (LISTEN).*$/\1/'`   * All ports that are in the first set, but not in the second set have a high likelyhood to be my forwarding ports, and indeed subtracting the sets yields `41273`, `55710` and `6010`; cups, pulse and X, respectively.   * `6010` is identified as the X port using `DISPLAY`.   * `41273` is the cups port, because `lpstat -h localhost:41273 -a` returns `0`.   * `55710` is the pulse port, because `pactl -s localhost:55710 stat` returns `0`. (It even prints the hostname of my client!) (To do the set substraction I `sort -u` and store the output from the above command lines and use `comm` to do the substraction.) Pulseaudio lets me identify the client and, for all intents and purposes, this may serve as an anchor to separate SSH sessions that need separating. However, I haven't found a way to tie `41273`, `55710` and `6010` to the same `sshd` process. `netstat` won't disclose that information to non-root users. I only get a `-` in the `PID/Program name` column where I would like to read `2339/54` (in this particular instance). So close ...


title: What is the correct partition type for a geli-crypted partition on FreeBSD?

text: I am currently in the process of setting up an encrypted homeserver with zfs and geli.   However I am not sure what the correct partition type for geli-crypted filesystems are. Do I just take 'freebsd-zfs' like I would do for a noncrypted zfs partition?   Do I go with the more generic 'freebsd'? All I want to know in the end is what value to pass as the '-t' parameter when calling 'gpart add'.


title: How to use $? and test to check function?

text: #!/bin/sh          function checkExit(){         if test "$?" != "0"; then           echo Command $1 exited with abnormal status           exit 1;         else echo $?         fi     }          function echoThenRun () { # echo and then run the command       echo $1       $1       ret=$?       echo $ret       return $ret     }     file=test_file     echo > $file     echoThenRun "test -f $file"     checkExit $file     echo "all right!"      The output of executing the script:               $  ~/Downloads/test.sh      test -f test_file     0     1 # why 1 here??     all right!


title: Kill process spawned by ssh when ssh dies

text: This is a question that has been addressed several times, not only here, but also in other sites of the stack exchange network (e.g. http://stackoverflow.com/questions/331642/how-to-make-ssh-to-kill-remote- process-when-i-interrupt-ssh-itself?rq=1). However, I cannot make any of the solutions work for me. So, here's the deal. I'm running a command through ssh. I want that whenever I exit ssh, the command dies as well. This command is a deamon called ktserver, that's running indefinitely until you press Ctrl-C. I run it as follows: `ssh -t compute-0-1 ktserver` and, indeed, when I press Ctrl-C, the process ends gracefully and the ssh session ends. However, if instead of pressing Ctrl-C, I kill the ssh process using the `kill` command (for example, sending SIGINT or SIGHUP), the `ktserver` process stays alive. How can I make the `ktserver` always die independent on how `ssh` is killed? **EDIT** : If, instead of `ktserver` I run something completely different, such as `gedit`, everything works like a charm (i.e. gedit dies when the connection dies). Therefore there might be something wrong with the process itself. For example, I thought that it might be ignoring SIGHUP or SIGINT. However, when I run `kill -1 ktserver` or `kill -2 ktserver`, the process dies as expected. **EDIT2** : As Mark Plotnick points out, the issue is related to the fact that there is no communication circulating on the ssh channel. I've confirmed by running `ssh -t <host> read` and killing the ssh process afterwards. `read`was still alive and kicking.


title: tslib: mouse cursor moves in the opposite direction to selection box

text: I'm using tslib/xf86-input-tslib on an ARM box with Debian 7. **ts_calibrate** and **ts_test** are working properly. The problems occur in Xfce. When I touch the screen and move the finger, I see, that mouse cursor is following my finger, but a selection box occurs with some offset to the Y-axis and then moves towards mouse cursor. My xorg.conf:               Section "InputDevice"         Identifier "tslib"         Driver "tslib"         Option "Device"    "/dev/input/event1"         Option "ScreenNumber"  "0"         Option "Width" "0"         Option "Height"    "0"         Option "Rotate"    "NONE"         Option "EmulateRightButton"    "1"     EndSection          Section "ServerLayout"          Identifier      "Default Layout"          InputDevice     "tslib" "CorePointer"     EndSection            tslib version is 1.1 and xf86-input-tslib from Ubuntu: https://code.launchpad.net/~ubuntu-branches/ubuntu/saucy/xf86-input- tslib/saucy An USB mouse is working as expected. cat /proc/bus/input/devices               I: Bus=0018 Vendor=0000 Product=fe2e Version=0100     N: Name="TPS6507x Touchscreen"     P: Phys=1-0048/input0     S: Sysfs=/devices/platform/omap/omap_i2c.1/i2c-1/1-0048/input/input1     U: Uniq=     H: Handlers=mouse0 event1     B: EV=b     B: KEY=400 0 0 0 0 0 0 0 0 0 0     B: ABS=1000003      How can I fix this behavior?


title: How do I delete all lines with ".png" in a file?

text: I've a list of urls of which some point to images:               http://s.thebrighttag.com/iframe?c=A5lqOqP     http://s.wordpress.com/imgpress?resize=136,136&url=http%3A%2F%2Fdata.whicdn.com%2Fimages%2F2833524%2F4thofJuly-collage_large.jpg%3F1278084193      How do I remove those lines from the file?


title: Bash- Help modify code for a custom output statement

text: The script will read the contents of a user-input file and count the number of employees with a specific job. Ex file line:               Sophia Lewis, 542467, Accountant       The script I have so far is:               if [ -s $1 ]     then          cat $1 | tr -s ' ' | cut -d' ' -f4- | sort | uniq -c          else             echo "ERROR: file '$1' does not exist."          fi      Output:               4 Sales      2 Accountant      1 CEO       But I want the output to appear as:               There are 4 ‘Sales’ employees.      There are 2 ‘Accountant’ employees.      There is 1 ‘CEO’ employee.      There are a total of 7 employees in the company      Should I take out the cat and put in echo statements so I can customize each line? And is there a way for it to know if it should be "is/are" x employees?


title: Can not execute some shell command from php

text: I want to execute phpcs commands from phpcode using shell_exec function. During execution it gives error `/usr/bin/php: relocation error: /usr/bin/php: symbol X509_free, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference`. How can I solve this issue??


title: Test automation tools for desktop application

text: Is there any GUI / functionality test automation tools for testing QT3 based GUI applications? I went through LDTP, dogtail, Squish, and Sikuli but all dependent on specific QT versions. Also, Sikuli is not reliable. Any others?


title: What's the right way to shutdown Arch Linux through dbus interface?

text: I'm running `openbox` with Arch Linux, and looks like the old console kit interface has been long gone,               %> dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop     Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files      So what's the interface to use now?


On CentOS, when I try to use `yum`, I keep getting:                   Loaded plugins: fastestmirror, priorities     Could not create lock at /var/run/yum.pid: [Errno 28] No space left on device: '/var/run/yum.pid'      Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:00 ago         State  : Running, pid: 21381     Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:02 ago         State  : Running, pid: 21381     Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:04 ago         State  : Running, pid: 21381     Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:06 ago         State  : Running, pid: 21381      My disk space is definitely more than enough. The `/var/run/yum.pid` file is also missing. How can I fix `yum`?


title: Why do Linux and OSX require no driver to connect to an Android device?

text: I asked the dual question at superuser and didn't really get an answer - thought I might have better luck here. I've started down the path of tinkering with my Android phones. What's curious to me is that during the bootloader unlocking process if you're on Windows you are required to download and install drivers while on OS X or Linux drivers are not required. This is true for my Evo 4G, Evo 3D, and most recently the Galaxy Nexus. Why do *nix based systems not require drivers?


title: Can you have multiple lost and found directories?

text: I was unaware of the `mklost+found` command until I read this question. The `mklost+found` command will make a new lost+found directory in the pwd.   1. Why would you ever need to run this command? The lost+found directory already exists in / on every distro I've checked.    2. What would happen if you have multiple lost and found directories? Would recovered data fragments go to the lost+found dir in / , or would it go to the most recently created lost+found dir?  I'm not sure how I could deliberately create a data fragment to test this.


title: debian lenny ftp not working?

text: I've installed ftp in my debian lenny virtual server with apt-get install ftp and it uses the archive ftp_0.17-18_amd64.deb. But when I type ftp command into my shell there isn't any response? When I want to connect to a ftp site it's not working? I get not any response? ftp --help gives me this:               Aufruf: ftp [ignorierete Kommandozeilenargumente]     oder:  ftp OPTION      Exit with a status code indicating failure.            --help     diese Hilfe anzeigen und beenden       --version  Versionsinformation anzeigen und beenden          BEMERKUNG: Ihre Shell hat möglicherweise eine eigene Version von false,      welche normalerweise die hier beschriebene Version ersetzt. Bitte greifen Sie     auf die Dokumentation der Shell zurück, um die dort unterstützten Optionen     in Erfahrung zu bringen.          Melden Sie Übersetzungsfehler an      <translation-team-de@lists.sourceforge.net>, Programmfehler dagegen (auf      Englisch, mit LC_ALL=C) an <bug-coreutils@gnu.org>.


title: Does alsa depend on the kernel version?

text: Lately I had nothing but trouble with my sound setup. The full chain looks like this:               alsa (pulse plugin)-> pulseaudio (jack plugin) -> jackd -> firewire soundcard      This works fine, except for flash in firefox and Chrome. I have reason to believe that the tail end of the chain is okay, because every other source of audio, using pulse or jackd directly works fine. On the front end I made some experiments, like connecting alsa directly to jackd, but this also causes trouble with flashplayer: playback stops after like 20 seconds and firefox freezes. This made me believe that there is something wrong with the alsa stuff. Now I do have a custom kernel (3.8.2) but the rest of the system uses regular debian "stable" stuff. Can it be that the kernel is "too new" for the alsa libs?


title: Arch Linux: I get 500 error when trying to open PHP file

text: I get the `HTTP Error 500 (Internal Server Error)` error with Chrome when trying to open a simple PHP file. I have installed Apache and PHP correctly as instructed in this article. Including the PHP specific part of it. I get this error when I try going to the URL `http://localhost/~eduan/php_info.php`, I made sure and this file has correct syntax and everything, here's it's contents:               <?php     php_info();     ?>      It contains nothing else and nothing less. I also have a test install of Statamic under `http://localhost/~eduan/statamic`, and that works and doesn't. It loads correctly, but all the styles and stuff of it is missing, meaning (from what I understand) that it couldn't load the theme which is done with PHP if I'm not mistaken. That's all, any help is greatly appreciated!


title: OpenVPN: Push a route to client with a different gateway

text: I would like my OpenVPN server to push a route down to the client with a different default gateway. Specifically, my OpenVPN server has an internal IP address of `10.0.0.1`, and I would like it to push a route of `10.10.10.1/24` using gateway `10.0.0.2`. Is it possible to do this by specifying a push route in the server config file?


title: Trying to record a screencast using ffmpeg but my mouse pointer is invisible

text: I'm trying to record a screencast using ffmpeg but my mouse pointer is invisible. What am I doing wrong? This is the command:               ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le \         -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output.mkv


title: How do I get current keyboard layout?

text: I'm wondering is there any command line tool, that returns current keyboard layout. I have `XkbLayout` set to `us, ru`. **Update:** `setxkbmap` returns layout settings, not selected layout. E.g.:               $ setxkbmap -print | grep xkb_symbols     xkb_symbols   { include "pc+us+ru:2+inet(evdev)+capslock(grouplock)+terminate(ctrl_alt_bksp)"   };      It will return same result no matter what current layout is.


title: Detect if mouse button is pressed, then invoke a script or command

text: Is there any way to get mouse button state from bash? Xdotool can only get mouse location. I'd like to set something up where I can define a rule where when a mouse button is pressed, a script can get executed.