title: Cent OS 6.3 Hidden files in shell

text: I need help, I want to be able to check whether a file is hidden or not in Cent OS 6.3. These are often referred to as (dot) files but I can clearly see Cent OS 6.3 handling these by appending a ~(tilde) to the end EG: myfile (not hidden) myfile~ (hidden) Now, I can tell that a file is "hidden" if it's a dot file, but what is going on with this tilde (~) terminating character - is this particular to Cent OS 6.3? Is this something I can simply check for in the file name (EG: starting with a dot or ending with a tilde) I would appreciate help on this as, I would assume "hidden" is a file attribute rather than a "naming convention" as I wrong?


title: Install grub on hard disk used in another system

text: So I have a 512MB flash chip used in an embedded system with the following partition table:               p1: 32MB boot partition     p2: 200MB recovery partition     p3: 200MB normal partition      I'm using buildroot on my ubuntu (development) box to compile the 200MB ext2 image for the "normal" parition. At this point on my dev box I dd the image created from buildroot to the flash chip (plugged in with an ide to usb connector on /dev/sdd):               dd if=./output/images/rootfs.ext2 of=/dev/sdd3      OK, fine this works and I can mount /dev/sdd3 and see the entire filesystem that the embedded device will use. Now, I want to install grub on this flash chip and am lost on how to do this. I've tried:               grub-install /dev/sdd      But when I plug the flash chip into my embedded device and turn it on, grub won't load (just sits at a black screen with blinking cursor--no error).


title: Is locking the screen safe?

text: See USB driver bug exposed as "Linux plug&pwn", or this link * * * Two choices [GNOME, Fedora 14]:   1. Use the `gnome-screensaver`   2. Use the "switch user" function [gnome menu -> log out -> switch user] So the question is: which one is the safer method to lock the screen if a user leaves the pc? Is it true that using the [2] method is safer? The way I see it, the `gnome- screensaver` is just a "process", it could be killed. But if you use the log out/switch user function, it's "something else". Using the "switch user" function, could there be a problem like with the `gnome-screensaver`? Could someone "kill a process" and presto...the lock is removed? Could the GDM [??] "login windows process" get killed and the "lock" gets owned? ![Screenshot of the GDM login window process](http://www.labtestproject.com/files/screenshot/fedora12/042_fedora12_kde_login.png) * * * If the [2] method is safer, then how can i put an icon on the GNOME panel, to launch the "switch user" action by 1 click?


title: How to recover a crashed Linux md RAID5 array?

text: Some time ago I had a RAID5 system at home. One of the 4 disks failed but after removing and putting it back it seemed to be OK so I started a resync. When it finished I realized, to my horror, that 3 out of 4 disks failed. However I don't belive that's possible. There are multiple partitions on the disks each part of a different RAID array.   * md0 is a RAID1 array comprised of sda1, sdb1, sdc1 and sdd1.   * md1 is a RAID5 array comprised of sda2, sdb2, sdc2 and sdd2.   * md2 is a RAID0 array comprised of sda3, sdb3, sdc3 and sdd3. md0 and md2 reports all disks up while md1 reports 3 failed (sdb2, sdc2, sdd2). It's my uderstanding that when hard drives fail all the partitions should be lost not just the middle ones. At that point I turned the computer off and unplugged the drives. Since then I was using that computer with a smaller new disk. Is there any hope of recovering the data? Can I somehow convince mdadm that my disks are in fact working? The only disk that may really have a problem is sdc but that one too is reported up by the other arrays. **Update** I finally got a chance to connect the old disks and boot this machine from SystemRescueCd. Everything above was written from memory. Now I have some hard data. Here is the output of `mdadm --examine /dev/sd*2`               /dev/sda2:               Magic : a92b4efc             Version : 0.90.00                UUID : 53eb7711:5b290125:db4a62ac:7770c5ea       Creation Time : Sun May 30 21:48:55 2010          Raid Level : raid5       Used Dev Size : 625064960 (596.11 GiB 640.07 GB)          Array Size : 1875194880 (1788.33 GiB 1920.20 GB)        Raid Devices : 4       Total Devices : 4     Preferred Minor : 1              Update Time : Mon Aug 23 11:40:48 2010               State : clean      Active Devices : 3     Working Devices : 4      Failed Devices : 1       Spare Devices : 1            Checksum : 68b48835 - correct              Events : 53204                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     0       8        2        0      active sync   /dev/sda2             0     0       8        2        0      active sync   /dev/sda2        1     1       8       18        1      active sync   /dev/sdb2        2     2       8       34        2      active sync   /dev/sdc2        3     3       0        0        3      faulty removed        4     4       8       50        4      spare   /dev/sdd2     /dev/sdb2:               Magic : a92b4efc             Version : 0.90.00                UUID : 53eb7711:5b290125:db4a62ac:7770c5ea       Creation Time : Sun May 30 21:48:55 2010          Raid Level : raid5       Used Dev Size : 625064960 (596.11 GiB 640.07 GB)          Array Size : 1875194880 (1788.33 GiB 1920.20 GB)        Raid Devices : 4       Total Devices : 4     Preferred Minor : 1              Update Time : Mon Aug 23 11:44:54 2010               State : clean      Active Devices : 2     Working Devices : 3      Failed Devices : 1       Spare Devices : 1            Checksum : 68b4894a - correct              Events : 53205                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     1       8       18        1      active sync   /dev/sdb2             0     0       0        0        0      removed        1     1       8       18        1      active sync   /dev/sdb2        2     2       8       34        2      active sync   /dev/sdc2        3     3       0        0        3      faulty removed        4     4       8       50        4      spare   /dev/sdd2     /dev/sdc2:               Magic : a92b4efc             Version : 0.90.00                UUID : 53eb7711:5b290125:db4a62ac:7770c5ea       Creation Time : Sun May 30 21:48:55 2010          Raid Level : raid5       Used Dev Size : 625064960 (596.11 GiB 640.07 GB)          Array Size : 1875194880 (1788.33 GiB 1920.20 GB)        Raid Devices : 4       Total Devices : 4     Preferred Minor : 1              Update Time : Mon Aug 23 11:44:54 2010               State : clean      Active Devices : 1     Working Devices : 2      Failed Devices : 2       Spare Devices : 1            Checksum : 68b48975 - correct              Events : 53210                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     2       8       34        2      active sync   /dev/sdc2             0     0       0        0        0      removed        1     1       0        0        1      faulty removed        2     2       8       34        2      active sync   /dev/sdc2        3     3       0        0        3      faulty removed        4     4       8       50        4      spare   /dev/sdd2     /dev/sdd2:               Magic : a92b4efc             Version : 0.90.00                UUID : 53eb7711:5b290125:db4a62ac:7770c5ea       Creation Time : Sun May 30 21:48:55 2010          Raid Level : raid5       Used Dev Size : 625064960 (596.11 GiB 640.07 GB)          Array Size : 1875194880 (1788.33 GiB 1920.20 GB)        Raid Devices : 4       Total Devices : 4     Preferred Minor : 1              Update Time : Mon Aug 23 11:44:54 2010               State : clean      Active Devices : 1     Working Devices : 2      Failed Devices : 2       Spare Devices : 1            Checksum : 68b48983 - correct              Events : 53210                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     4       8       50        4      spare   /dev/sdd2             0     0       0        0        0      removed        1     1       0        0        1      faulty removed        2     2       8       34        2      active sync   /dev/sdc2        3     3       0        0        3      faulty removed        4     4       8       50        4      spare   /dev/sdd2      It appears that things have changed since the last boot. If I'm reading this correctly sda2, sdb2 and sdc2 are working and contain synchronized data and sdd2 is spare. I distinctly remember seeing 3 failed disks but this is good news. Yet the array still isn't working:               Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md125 : inactive sda2[0](S) sdb2[1](S) sdc2[2](S)           1875194880 blocks          md126 : inactive sdd2[4](S)           625064960 blocks          md127 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]           64128 blocks [4/4] [UUUU]          unused devices: <none>      md0 appears to be renamed to md127. md125 and md126 are very strange. They should be one array not two. That used to be called md1. md2 is completely gone but that was my swap so I don't care. I can understand the different names and it doesn't really matter. But why is an array with 3 "active sync" disks unreadable? And what's up with sdd2 being in a separate array? **Update** I tried the following after backing up the superblocks:               root@sysresccd /root % mdadm --stop /dev/md125     mdadm: stopped /dev/md125     root@sysresccd /root % mdadm --stop /dev/md126     mdadm: stopped /dev/md126      So far so good. Since sdd2 is spare I don't want to add it yet.               root@sysresccd /root % mdadm --assemble /dev/md1 /dev/sd{a,b,c}2 missing      mdadm: cannot open device missing: No such file or directory     mdadm: missing has no superblock - assembly aborted      Apparently I can't do that.               root@sysresccd /root % mdadm --assemble /dev/md1 /dev/sd{a,b,c}2             mdadm: /dev/md1 assembled from 1 drive - not enough to start the array.     root@sysresccd /root % cat /proc/mdstat      Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md1 : inactive sdc2[2](S) sdb2[1](S) sda2[0](S)           1875194880 blocks          md127 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]           64128 blocks [4/4] [UUUU]          unused devices: <none>      That didn't work either. Let's try with all the disks.               mdadm --stop /dev/md1     mdadm: stopped /dev/md1     root@sysresccd /root % mdadm --assemble /dev/md1 /dev/sd{a,b,c,d}2     mdadm: /dev/md1 assembled from 1 drive and 1 spare - not enough to start the array.     root@sysresccd /root % cat /proc/mdstat                                Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md1 : inactive sdc2[2](S) sdd2[4](S) sdb2[1](S) sda2[0](S)           2500259840 blocks          md127 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]           64128 blocks [4/4] [UUUU]          unused devices: <none>      No luck. Based on this answer I'm planning to try:               mdadm --create /dev/md1 --assume-clean --metadata=0.90 --bitmap=/root/bitmapfile --level=5 --raid-devices=4 /dev/sd{a,b,c}2 missing     mdadm --add /dev/md1 /dev/sdd2      Is it safe? **Update** I publish the superblock parser script I used to make that table in the my comment. Maybe someone will find it useful. Thanks for all your help.


title: Postfix doesn't send mail, complaining about "Host or domain name not found"

text: I followed these instructions in order to send mail and here's the Postfix log:               Sep 26 00:46:24 tshepang postfix/smtpd[5728]: 8EE2464931: client=localhost[127.0.0.1]     Sep 26 00:47:44 tshepang postfix/cleanup[5810]: 8EE2464931: message-id=<20110925224624.8EE2464931@tshepang>     Sep 26 00:47:44 tshepang postfix/qmgr[5772]: 8EE2464931: from=<tshepang@gmail.com>, size=350, nrcpt=1 (queue active)     Sep 26 00:48:04 tshepang postfix/smtp[5859]: 8EE2464931: to=<tshepang.test@gmail.com>, relay=none, delay=127, delays=107/0.01/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)     Sep 26 00:48:39 tshepang postfix/smtpd[5728]: disconnect from localhost[127.0.0.1]      Also, this may be relevant (from " **/etc/postfix/main.cf** "):               myhostname = tshepang     mydestination = tshepang, localhost     relayhost =      mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128     inet_interfaces = all     inet_protocols = all      I am running this on Debian 6.


title: Split is not available?

text: I've just tried to run a simple shell script on my Readynas server running Debian, and it appears that the `split` command is not available. This is a server which I can't fiddle too much with, so if there's a way to get `split` running without risk of breaking other native ReadyNAS features, I would be super happy. Thanks


title: Why can't I use arrow keys in terminal on Debian 6? (nonroot)

text: When I am on a non-root user I cannot use `↑`/`↓` to list my previous commands, and if I am typing I can't use `←`/`→` to say, add in a directory or to correct the spelling. Worse, I can't use `Tab`. I could write `/var/www/mylongsitena` and pressing `Tab` will not autocomplete it. It's _extremely_ annoying. How can I change this? IIRC Debian etch and lenny didn't do this. How can I unto this change?


title: Gedit cannot save in shared folder (Virtualbox)

text: I'm getting the "Cannot save **_** Unexpected error: Error renaming temporary file: Text file busy" in Gedit 2 when I try to save in a shared folder with Virtualbox (Debian). I've searched and apparently it's a Gedit problem. None of the solutions seem ideal or work for me. Would it be possible to create a shell script (external tools plugin) that saves the file somewhere else, then copies it back in shell? So I'll need to grab wherever Gedit's stored the temporary (live?) file. Or if this is not possible/won't work/bad practice, does anyone know a good way to get around this? I really like Gedit and prefer to use it. * * * Currently, this is my script. I tell external tools not to save but pass the document as input (stdin)               bin=""     while read LINE; do         echo ${LINE}    # do something with it here         bin="${bin}${LINE}\n"     done          echo $bin > /home/me/data2/test.txt      It works fine except it doesn't preserve tabs. I'my only editing plain text files. Edit: this also seems to skip the last line


title: Why does Debian sometimes ask me to insert the (installation?) cd when I install packages?

text: I've noticed sometimes when I do `apt-get` Debian asks me to insert [the installation cd I used] (6.0.6 amd64 dvd1). Sometimes it doesn't, although maybe it's because I've already mounted it earlier; I can't notice a definite pattern. Why is this? Does this happen with other flavors too? And I've searched for stuff like "virtualbox apt-get installation cd" with no luck (can't find a good query).


title: Where can you find the answer to the following question: “How do you get the NUMLOCK key to default to on for the GUI console?”

text: This is on a fedora machine. I have to look in man pages first to find the answer, if not then in an info page. If the answer is not there then I have to use the internet to find the answer. It is on a school server. I thought it was numlockx but that program is not installed on the server and it is suppose to be something that is on the server. I don't know of any other program that it could be.


title: Can't make a copy of /var/lib/mysql/ibdata1

text: I have a RedHat Linux server and I'm trying to make a copy of `/var/lib/mysql/ibdata1`, but I'm receiving an error saying permission denied and the file cannot be opened. I'm logged in as root user and tried to use `sudo cp`... Any idea of what I'm doing wrong? Sorry for my ignorance, but I don't know much about Unix systems. I was trying `sudo su mysql` to make the copy, then it asks for a password that should be the one I have, but it is saying it's wrong!


title: GNU Screen weird characters on click

text: I have a small problem in GNU screen. A GNU screen session runs on my RaspberryPi. Now sometimes, when I join it, if I click in the terminal (I'm using terminator on Fedora) I see weird characters written. These characters depend on the coordinates of my mouse… Seems like a wrong decoding of the click event sent to GNU Screen. These characters include things like               kM#kM -  Z3#Z3  -  q-#q-      etc… I first thought it was a problem with my `tty` so I went and opened a new GNU Screen session on my RaspberryPi: no problem at all.   I did a `stty -a` on both session and saw there were difference. I then did a `stty -g > ~/stty-good-settings` on the good session and loaded it on the bad one with `stty `cat ~/stty-good-settings`` (I compared the values after that, the settings were successfully loaded) but I still have the problem in one of the screen sessions and not the other! I'm not sure what's happening, if this is due to my `TERM` value (same in both), my `tty` settings, my terminal…


title: How can I find all files that do NOT contain a text string?

text: What **concise** command can I use to find all files that do NOT contain a text string? I tried this (using -v to invert grep's parameters) with no luck:               find . -exec grep -v -l shared.php {} \;      Someone said this would work:               find . ! -exec grep -l shared.php {} \;      But it does not seem to work for me. This page has this example:               find ./logs -size +1c  > t._tmp     while read filename     do          grep -q "Process Complete" $filename          if [ $? -ne 0 ] ; then                  echo $filename          fi     done < t._tmp     rm -f t_tmp      But that's cumbersome and not at all concise. ps: I know that `grep -L *` will do this, but how can I use the find command in combination with grep to excluded files is what i really want to know. pss: Also I'm not sure how to have grep include subdirectories with the `grep -L *` syntax, but I still want to know how to use it with `find` :)


title: z in bash script returns zero

text: #[ -z "" ]           #echo $?      returns 0               #[ -a "" ]           #echo $?      returns 1 except z all other alphabets throw 1 What might be the reason?


title: Redirecting output when I execute "bash -c ..." from a C program

text: Say I have a C program and in it I want to execute a shell command and redirect its output to file, by using the stdlib system function.               system("bash -c \"echo $HOME\" > a.txt");      Now this is for illustration, it actually doesn't work. How do I make the output redirection work? Because I'm calling bash from a function I need the process itself to do the redirecting.


title: Network naming on Arch Linux

text: I've just installed Arch Linux on my old PC, to do the installation I used `wifi-menu wlan0`, now I've reboot but if I type:               ifconfig wlan0 up      I have as a result:               wlan0: ERROR while getting interface flag: no such device      I read that after the installation Arch changes the name of `wlan`, how can I find the new name and how could I change it?


title: What format is the file /var/mail/username mail utilities

text: I need a sample file where `mail` utility stored messages. What I mean is:               Return-path: <user@example.domain>     Received: from anton by nflogs.domain with local (Exim 4.80)             (envelope-from <user@example.domain>)             id 1VuiP9-0006js-Fa; Sun, 22 Dec 2013 19:45:11 +0700     To: man@nflogs.domain     Subject: test     Cc: textCC@example.domain     Message-Id: <E1VuiP9-0006js-Fa@example.domain>     From: Anton <user@example.domain>     Date: Sun, 22 Dec 2013 19:45:11 +0700      But I'm not sure that it's right.


title: Script to search inside non-root and tmp directories

text: I have a script:               egrep -R -s -c '([^0-9a-zA-Z_-]|^)(5[1-5][0-9]{2}( |-|)([0-9]{4})( |-|)([0-9]{4})( |-|)([0-9]{4}))([^0-9a-zA-Z_-]|$)' $searchpath | egrep '\:[^0]' > $logfilename      It needs to be modified to search only `/home` non-root and `/tmp` directories.               Home directories (off root)     Temp directories (off root listed as tmp)      *Websphere logs: Getting Specs for these logs  *Apache logs: Getting Specs for these logs  The output file should include the server name. The search results should be empty, please create a log file, showing start, stop time and server name, no records found.


title: Partitions same size but different block

text: I tried to backup my partition using dd on another disk and I created a partition of the same size. When I finished the copy I had problems mounting the partition since I got `bad geometry: block count` . I noticed that in order to create a correct backup (avoid bad geometry error) not only the two partitions must have the same size in MB but also the same number of blocks (The number in blocks you can check using fdisk -l). I also noticed that the number of blocks varies if I create the partition starting from the beginning or starting from the end . Can someone explain me the behaviour and how to create two partition with the exact the same block size?


title: Copy files based on date/time from subset of directories

text: I'm teaching a class where (~80) students are submitting assignments that I can access via webdav, organized by student in directories named by their unique identifier. The students are split into two groups that submit assignments on different days of the week. I'd like to create a bash script to automatically download files for each subset of students into a local directory. What I don't know how to do is the following:   1. Select a specific subset of folders by name to copy files from.      * Edited based on comments: The webdav server I connect to has 80 directories named by student, these 80 directories are made up of two groups of students.     * I would like to select files from directories in each group, i.e., Group1 contains directories `StudentA/ StudentC/ StudentD/`. Group 2 would contain the directories `StudentB/ StudentE/ StudentF/`.   2. Specify the beginning date/time of files to be copied. End date/time would be useful to since I take deductions for late assignments. Any help on either of these would be appreciated.


title: OS X virtualization for software development

text: I am a OS X user and I work on multiple platforms for which I need multiple dependencies. I want to separate my different development dependency packages in virtual environments so they are all isolated and also can be purged easily later on. General workflow can be described as follows   1. Create a virtual machine   2. Install dependencies and setup work environment (preferably from a config file)   3. Do whatever you want in this environment   4. Purge virtual machine In Linux we have LXC Containers which can do this thing I guess (never used it but will surely try). May be that's similar thing. May be not. I have used Vagrant which is exactly what am I looking for but for OS X. Please suggest me if do you know of any technology that can do this.


title: YUM: How to prevent EPEL from upgrading packages installed from other repos?

text: I would like to leave EPEL enabled and configure it to allow updating only the packages that were installed from EPEL itself in the first place (packages which were manually installed from EPEL because of specific needs). **Is there a yum conf directive to allow this?**   * CentOS 6.4   * Yum 3.2.29


title: fstab not mounting VirtualBox shared folder?

text: I have a virtual machine here which I use for development, so as not to mess anything up in my existing environment. I've made a share named "web" available to the guest OS (Ubuntu 12.10 Server) from the host OS (Ubuntu 12.04 Desktop). I have configured it to automatically mount in `/etc/fstab` with the following line:               web    /var/www    vboxsf    defaults,uid=1000,gid=1000    0    0      However, when I reboot, it's definitely not mounted, the `/var/www` folder shows the default install's `index.html` file, not the contents of the shared folder. If I run `sudo mount`, I see the mount in the output:               web on /var/www type vboxsf (uid=1000,gid=1000,rw)     web on /media/sf_web type vboxsf (gid=1001,rw)      It seems to also be mounted in a different location which I didn't setup. If I try to remount all the mounts in `/etc/fstab` by running `sudo mount -a`, it still is not mounted. I can only get it mounted by manually mounting it using `mount`. Where is this other mount location coming from and why is what I'm doing not working?


title: How to setup a scanner in crouton chroot?

text: I have ubuntu 12.04 installed on my hp chromebook using crouton but I'm not sure how to access a usb device from inside the chroot. I'm trying to access a brother DS-720D scanner with xsane. From outside the chroot I can do lsusb and see the device is listed. I installed the driver inside the chroot and followed these instructions to load my udev rules at login. https://github.com/dnschneid/crouton/wiki/udev:-manage-inserted-devices But the device doesn't show up to sane-find-scanner or scanimage -L I'm stumped at where to go from here. How do I get this scanner working?


title: Ubuntu 12.04 won't boot, asks for low graphics mode, cant run apt-get because file system is read-only

text: My computer won't boot anymore I think because it ran out of disk space. It asks to boot in low graphics mode and then gets stuck checking battery state. When I boot in recovery mode I run clean and it says it's okay and gets stuck. I go to root terminal and try to delete things or run `apt-get` and I can't because I can't delete the lock file or anything else. Any ideas?


title: gtar fails to perform incremental backup

text: The following script fails to perform incremental backup, but creates full backup instead. On another FreeBSD server exactly same script works just fine (creating incremental backups). Servers are identical, same FreeBSD 10.0-RELEASE on both machines. Script it exactly the same. Version of gtar is identical. File system is identical. Not sure what's going on. Searched for days! Please help.               #!/bin/sh          sourcedir="/home"     targetdir="/backup/home"          now=$(date +"%Y%m%d%H%M")          cd $sourcedir     for dir in */     do       base=$(basename "$dir")       gtar -cz -g "$targetdir/.gtar-incremental" -f "$targetdir/${base}-$now.tar.gz" "/home/$dir"       chmod 600 "$targetdir/${base}-$now.tar.gz"     done


title: badblocks and "end_request: I/O error" in output

text: I have 500GB disk in my toshiba laptop, I tried to do backup of files in this HDD but it failed few times (ubuntu just closed copying operation or unmounted disk during copying files). So I boot my laptop from ubuntu 12.10 on USB, and I didn't mount that harddrive (it's /dev/sda1) and I run:               sudo badblocks -nvs /dev/sda1      and output is:               [3277.882968] end_request: I/O error, dev sda, sector 825437      and milion of similar lines but with different numbers Should I mount this disk before I run badblocks? Why it's returning so many I/O errors? Do you know other applications to check disk? I still can mount this disk and browse files on in, but it looks like I have bad sectors or something is wrong with this HDD, so I'd like to check it.


title: How to check if all of dns resolvers are working?

text: How can I check if all of dns resolvers are working under linux console?


title: What does the line $(rpm -E %fedora) mean?

text: I'm trying to add a new repository to my Fedora and was asked to introduce the following command:               su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm'      I'm trying to understand what every part of the command means, and almost have it all, except for the line `$(rpm -E %fedora)`. I googled it but found nothing, so I decided to ask here.


title: Obtaining PID of command earlier in Pipeline

text: I'm writing a bash script to use `inotifywait` to monitor a directory and kick off actions when changes are detected. Something like:               inotifywait -m ... | while read f; do something; done      Since `inotifywait` doesn't terminate by itself, this script will not halt. So my plan was to get the PID of the inotifywait process, save it to a file and have a different process kill it later, say like:               inotifywait -m ... | { echo ??PID?? > pid-file; while ... }      But I don't know how to get the PID. Is there a simple way to achieve this? Another way is just to save the PID of the shell-script `$$` to the file and kill the entire shell-script but I wanted to do some cleanup after the while loop. I have tried using `coproc` and I think it will work but it seems like more complication than necessary.


title: Can't find lib which provides libneon.so.25

text: I'm running `yum whatprovides libneon.so.25`, but can't find any library that provides this. Am I missing something?


title: Cannot login to svn server

text: I have a SVN server on my Raspberry Pi (Raspbian). It has a project under the directory `/welcome`, I want to add users to it. My users would be `admin` with password `admin` and `user2` with password `tempuser2` This is my `authz` file:               ### This file is an example authorization file for svnserve.     ### Its format is identical to that of mod_authz_svn authorization     ### files.     ### As shown below each section defines authorizations for the path and     ### (optional) repository specified by the section name.     ### The authorizations follow. An authorization line can refer to:     ###  - a single user,     ###  - a group of users defined in a special [groups] section,     ###  - an alias defined in a special [aliases] section,     ###  - all authenticated users, using the '$authenticated' token,     ###  - only anonymous users, using the '$anonymous' token,     ###  - anyone, using the '*' wildcard.     ###     ### A match can be inverted by prefixing the rule with '~'. Rules can     ### grant read ('r') access, read-write ('rw') access, or no access     ### ('').          [aliases]     # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/C$          [groups]     # harry_and_sally = harry,sally     # harry_sally_and_joe = harry,sally,&joe          # [/foo/bar]     # harry = rw     # &joe = r     # * =          [/welcome]     admin = rw     user2 = rw      This is my `passwd` file:               ### This file is an example password file for svnserve.     ### Its format is similar to that of svnserve.conf. As shown in the     ### example below it contains one section labelled [users].     ### The name and password for each user follow, one account per line.          [users]     # harry = harryssecret     # sally = sallyssecret          admin = admin     user2 = tempuser2      The `svnserve.conf`:               ### This file controls the configuration of the svnserve daemon, if you     ### use it to allow access to this repository.  (If you only allow     ### access through http: and/or file: URLs, then this file is     ### irrelevant.)          ### Visit http://subversion.apache.org/ for more information.          [general]          password-db = passwd     auth-access=write          realm = repository-rpi     authz-db=authz      I can't commit to that server, it always says "Unauthorized". What am I missing? (passwd and authz are both in the same directory as svnserve.conf)


title: diskio/diskiograph in Conky only understands physical device names?

text: In case this is so, it can be a huge downer in modern Linux distros, since the device names are very often assigned arbitrarily. So if you have no more than two HDDs in your system, but two USB flash drives sticking in their ports, things might look like this after bootup:               /dev/sda .. HDD #1     /dev/sdb .. USB flash drive #1     /dev/sdc .. USB flash drive #2     /dev/sdd .. HDD #2      I have searched high and low and tried various hacks for my `.conkyrc` to no avail. It just does not seem to work. I even thought about "creating" the format required for conky by executing a system command, but even this failed. In `bash`, this can be achieved by               $ basename $(readlink /dev/disk/by-label/mydisklabel)      Though conky DOES allow execution of system commands, it seems that in {diskio}/{diskiograph} options, this is not possible.   So the following will NOT work:               ${diskio /dev/${execp basename $(readlink /dev/disk/by-label/mydisklabel)}}      Neither would the variant with the UUID work (not shown here).   Has anyone of you guys ever managed to "teach" this to conky? It's so insanely versatile, but it's almost unbelievable that (compared to the good old days) `udev` and friends will no longer keep drives in a certain order, but scramble them again on each bootup sequence, while tools (GKrellM is none the better!) stubbornly insist on physical drive/device names.


title: Is there a way to give emacs the KDE look and feel?

text: I'm using emacs for most of my work. I'm switching from gnome desktop to KDE (checking things out) and it bother me that emacs look soo diferent from the rest of the desktop. Is there a way to give emacs the KDE properties? I was sure there was a qt frontend for emacs but couldn't find any.


title: Click a link to download file using curl

text: I have an HTML page on which several links are there, I want to click one link and that will download relevant file for me. How do I simulate this using curl. All links have different name attribute


title: Enable Compiz Fusion at startup kde

text: Compiz is "temporarily disabled" by default, I have to enable Compiz by pressing `Alt`+`Shift`+`F12` every time I start my computer. Can somebody please tell me how it can be enabled automatically at startup? I am using Compiz Fusion on Kubuntu 10.10.


title: Ethernet does not work at all

text: I haven't used my NIC for some time, and now it doesn't work anymore, at all. I can assign IP addresses to it manually (`sudo ip addr add 192.168.2.155/24 broadcast 192.168.2.255 dev eth0`, for example), but I cannot even ping hosts in the same network. Very suspicious in my eyes is that ethtool (`ethtool -S eth0`) displays some transmitted packets, but always exactly zero received bytes & packets. Something is clearly wrong. Here is a list of the things I tried   * rebooting   * tried other cable   * tried other port (this laptop has one port on it's docking station and one on the laptop itself ; they're internally connected to the same NIC)   * tried other switch (switch A: 8 port GbE, switch B: 5 port 100 MbE)   * Downgraded kernel and linux-firmware to older versions (3.13 and mid-2013 respectively)   * booted latest arch linux live medium ; didn't work, same symptoms   * booted Ubuntu 14.04.1 live medium ; didn't work, same symptoms   * In every setup mentioned above I tried accessing the network by manually assigning an IP address, by using wicd. In the start I also tried NetworkManager, same results   * At this point I suspect the NIC may be broken, if so, how could I validate this or rule it out? This is the NIC in question (Thinkpad X200):                   00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)                 Subsystem: Lenovo Device 20ee                 Flags: bus master, fast devsel, latency 0, IRQ 44                 Memory at f2600000 (32-bit, non-prefetchable) [size=128K]                 Memory at f2625000 (32-bit, non-prefetchable) [size=4K]                 I/O ports at 1840 [size=32]                 Capabilities: [c8] Power Management version 2                 Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+                 Capabilities: [e0] PCI Advanced Features                 Kernel driver in use: e1000e                 Kernel modules: e1000e      ethtool -S eth0:                NIC statistics:           rx_packets: 0           tx_packets: 90           rx_bytes: 0           tx_bytes: 8113           rx_broadcast: 0           tx_broadcast: 70           rx_multicast: 0           tx_multicast: 20           rx_errors: 0           tx_errors: 0           tx_dropped: 0           multicast: 0           collisions: 0           rx_length_errors: 0           rx_over_errors: 0           rx_crc_errors: 0           rx_frame_errors: 0           rx_no_buffer_count: 0           rx_missed_errors: 0           tx_aborted_errors: 0           tx_carrier_errors: 0           tx_fifo_errors: 0           tx_heartbeat_errors: 0           tx_window_errors: 0           tx_abort_late_coll: 0           tx_deferred_ok: 0           tx_single_coll_ok: 0           tx_multi_coll_ok: 0           tx_timeout_count: 0           tx_restart_queue: 0           rx_long_length_errors: 0           rx_short_length_errors: 0           rx_align_errors: 0           tx_tcp_seg_good: 0           tx_tcp_seg_failed: 0           rx_flow_control_xon: 0           rx_flow_control_xoff: 0           tx_flow_control_xon: 0           tx_flow_control_xoff: 0           rx_csum_offload_good: 0           rx_csum_offload_errors: 0           rx_header_split: 0           alloc_rx_buff_failed: 0           tx_smbus: 0           rx_smbus: 0           dropped_smbus: 0           rx_dma_failed: 0           tx_dma_failed: 0           rx_hwtstamp_cleared: 0           uncorr_ecc_errors: 0           corr_ecc_errors: 0      Using tcpdump -i eth0 I don't see any traffic at all.


title: pattern search and display the last occuring pattern?

text: I have a log file containing **startup** and **shutdown** times for everday. I want to see the last pattern pattern for startup and shutdown(which is located at the end of the file being updated everyday). Also I dont want all the lines between the startup and shutdown.I want only few(say 3) lines after the last startup and few(say 3 lines) after the last shutdown. Any suggestions for a one liner.


title: Unable to use aa-genprof without compatibility patch

text: I run 3.6.10 kernel, It seems like apparmor compatibility patch were dropped in latest kernel, so aa-genprof won't work anymore, any suggestions? Looks like aa-status or other aa- commands were trying to access a non- existence location `/sys/kernel/security/apparmor/profiles` P.S securityfs was mounted, `securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)`


title: How to change a keycode using setkeycodes

text: I have a Thinkpad Edge E130 running Sabayon (a Gentoo-based distro), and I'm fighting the well-know bug **Xorg 255 keycodes limit**. My laptop has the Fn+F4 hotkey for _Mic Mute/Unmute_. This is the problem:   * `showkey -k` shows keycode **248** on Fn+F4 keypress   * `showkey -s` shows nothing on keypress   * `xev` shows nothing on keypress (because 248+8 [added by kernel] is bigger than 255) If a key has a keycode, it must have a scancode too. With getscancodes program indeed I got 26 as scancode:               # ./Sabayon/getscancodes/getscancodes /dev/input/event6      Input driver version is 1.0.1     Input device ID: bus 0x19 vendor 0x17aa product 0x5054 version 0x4101     Input device name: "ThinkPad Extra Buttons"     26 (0x1a)     26 (0x1a)      According to this thread, my guess is simply to change the keycode of the hotkey with a smaller, unused one. For example 120 seems to be unused according to my `$ xmodmap -pke` I have tried with               # setkeycodes 0x1a 120      but without success, the keycode is always 248 checking with `showkey`. How is the proper way to change keycodes?


title: Create swap partition after install

text: I already have parititon contain data under lvm enviroment with centos 5.8 output of fdisk -l root@server [~]# fdisk -l               Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1          25      200781   83  Linux     /dev/sda2              26      121601   976559220   8e  Linux LVM      output of lvdisplay               # lvdisplay       --- Logical volume ---       LV Name                /dev/sysvg/ROOT       VG Name                sysvg       LV UUID                6oy3Rj-ka3K-mL9s-vjjG-1Iqw-dniq-UbWzvJ       LV Write Access        read/write       LV Status              available       # open                 1       LV Size                919.44 GB       Current LE             29422       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           253:0            --- Logical volume ---       LV Name                /dev/sysvg/TMP       VG Name                sysvg       LV UUID                jTKLBt-eNz0-KxmV-E5Nk-jjC0-FlRb-qny62p       LV Write Access        read/write       LV Status              available       # open                 1       LV Size                9.88 GB       Current LE             316       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           253:1            --- Logical volume ---       LV Name                /dev/sysvg/SHM       VG Name                sysvg       LV UUID                NpKjhl-tzzn-Dk3G-A6dl-4QJB-QCc2-IkbDH5       LV Write Access        read/write       LV Status              available       # open                 1       LV Size                2.00 GB       Current LE             64       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           253:2      output of df -h               root@server [~]# df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/sysvg-ROOT                           891G  125G  721G  15% /     /dev/mapper/sysvg-TMP                           9.6G  153M  9.0G   2% /tmp     /dev/mapper/sysvg-SHM                           8.0G  8.0K  8.0G   1% /dev/shm     /dev/sda1             190M   19M  162M  11% /boot     tmpfs                 8.0G  8.0K  8.0G   1% /dev/shm      output for /etc/fstab               root@server [~]# cat /etc/fstab     /dev/sysvg/ROOT /       ext3    usrjquota=quota.user,jqfmt=vfsv0        1       1     /dev/sysvg/TMP          /tmp                    ext3    defaults        1 2     /dev/sysvg/SHM  /dev/shm        ext3    defaults,usrquota       1       2     LABEL=/boot             /boot                   ext3    defaults        1 2     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0     /tmp             /var/tmp                    ext3    defaults,bind,noauto        0 0      I don't have any idea how to create swap partition , and i worried about creating cause any DATA LOSS


title: Tell ffserver which track to use

text: I want to stream videos via ffserver. My videos are in container formats like mkv and avi and sometimes have multiple audio/video tracks. How can I tell ffserver which track to use? It seems to always take the first one.


title: How can be monitored I/O stream in a particular Linux directory or file?

text: I have a problem with monitoring of i/o stream in the particular directory(amount of read and written bytes during specified period). I have been trying to use iostat, inotifywait and inotifywatch, but unfortunately they measure only activity upon directory (open, close, modify, etc.) but not gives info about read and written bytes.


title: tar cvf or tar -cvf ?

text: I have learned to use tar without '-' for options, like `tar cvfz dir.tar.gz Directory/` but I recently came accross the slightly different `tar -czvf` syntax (I think the 'f' must be the last option in this case). Both work on linux and Mac OS. Is there a recommended syntax, with ou without '-' which is more portable accross unix flavors ?


title: How to clear memory cache in Linux

text: ![TOP](http://i.stack.imgur.com/auNr7.png) Is there any command that by using I can clean the cache in RHEL? I used this command:               sync; echo 3 > /proc/sys/vm/drop_caches      but it didn't work.


title: How to view the output of a running process in another bash session?

text: I have left a script running on a remote machine from when I was locally working at it. I can connect over SSH to the machine as the same user and see the script running in `ps`.               $ ps aux | grep ipcheck     myuser  18386  0.0  0.0  18460  3476 pts/0    S+   Dec14   1:11 /bin/bash ./ipchecker.sh      It is simply outputting to stdout on a local session (I ran `./ipchecker.sh` form a local terminal window, no redirection, no use of `screen` etc). Is there anyway from an SSH session I can view the output of this running command (without stopping it)? So far the best I have found is to use `strace -p 18386` but I get hordes of text flying up the screen, its far too detailed. I can stop `strace` and then sift through the output and find the text bring printed to stdout but its very long and confusing, and obviously whilst it's stopped I might miss something. I would like to find a way to see the script output live as if I was working locally. Can anyone improve on this? The obvious answer is to restart the script with redirection or in a `screen` session etc, this isn't a mission critical script so I could do that. Rather though, I see this as a fun learning exercise.


title: Compiling driver for RNX-MiniN2 on kernel 3.X

text: I'm trying to compile an open source driver for my new USB Rosewill RNX-MiniN2 wireless adapter, and I'm running into the following error:               make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.0.0-14-generic/build M=/home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922  modules     make[1]: Entering directory `/usr/src/linux-headers-3.0.0-14-generic'       CC [M]  /home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/core/rtw_cmd.o     In file included from /home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/core/rtw_cmd.c:24:0:     /home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/include/osdep_service.h:49:29: fatal error: linux/smp_lock.h: No such file or directory     compilation terminated.     make[2]: *** [/home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/core/rtw_cmd.o] Error 1     make[1]: *** [_module_/home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-3.0.0-14-generic'     make: *** [modules] Error 2     Compile make driver error: 2, Please check error Mesg      Evidently, due to recent kernel changes, `smp_lock.h` doesn't exist anymore. How can I kludge this together and make it work? I just paid for this USB stick and I'd like to be able to use it and not have to ship it back.


title: Best way to set serial port speeds on boot?

text: I've got instruments hooked up to /dev/ttyS1 through ttyS9 on a machine running Debian Wheezy. The various instruments communicate at various speeds. Is there a better way to set the baud rates than to have a bunch of lines like               stty -F /dev/ttyS1 19200 raw -echo     stty -F /dev/ttyS2 4800  raw -echo     etc...      in rc.local?


title: Can I limit the number of inotify watches available to a process or cgroup?

text: I am consistently running out of inotify resources, leading to errors along the lines of:               # tail -f /some/files     tail: inotify resources exhausted     tail: inotify cannot be used, reverting to polling      This eventually happens even if I grow the value of `fs.inotify.max_user_watches`. I suspect a locally installed Java application is consuming the resources, but I don't have the option of either fixing it or removing it. Is there a way to set a limit on the number of inotify watches that can be consumed by a process?


title: Securing a script a little more

text: I currently have the following script which works fine:               #!/bin/sh     user="$(zenity --entry --title="Username" --text="Username")"     pass="$(zenity --password --title="Password" --text="Password")"          xfreerdp /cert-ignore /f /v:farm.company.com /d:company.com /g:rds.company.com /u:${user} /gd:company.com /gu:${user} /gp:${pass} /p:${pass}      This is apparently not very secure as the username and password can easily be seen by using `ps axu` Is there a more secure way of creating this script?


title: Shell Script to isolate files scattered in different folders

text: I need to write a shell script that traverses a given directory structure in multiple levels, recognizes the video files scattered in the folders and copies all of them to another single folder. The video files are really Macromedia Flash data files (saved in my browser's cache) and they do not have any particular extension like .MP4 or .FLV just aplhanumeric names. Now, I managed to make a start:               #!/bin/bash     #This script checks if the given folder contains video file and copies them another folder     filePath=$1                 #the argument(The folder Path)     if [[ -z "$filePath" ]]; then  #empty argument check         echo "Please input the folder to search"         exit 1     fi     if [ -d "$filePath" ]; then       if [ -L "$filePath" ]; then #check if the input folder is a valid folder       echo "directory $file does not exist"       exit 1      fi      else  #improper input given by the user           echo "$filePath is either not a valid directory or it is a file.Please enter a valid directory address"       exit 1     fi     find $filePath type -d | \ #the find here list all the files and directories in the given folder     while read i      do         if [[ -d "$i" ]]; then             idDirectory    #Call the function         elif [[ -f "$i" ]]; then     #check if its the file in the expected format     #do the copy work         fi     done     exit 0               idDirectory(){ # A recursive function to go multiple levels of the directory tree         #the function which tells if the path is directory or file         #If its a directory then it will call itself, till it gets a file         #need some help here!!!!!     }         I need help to write the recursive function that identifies and traverses directories.Also corrections are welcome. I tried this. but it was not successful.   Please Forgive my ignorances as i'm new to shell scripting.


My file consists of the the following; roughly:               username:username:username:username:username       The above line continues to about 600 characters. I use the `awk` command in order to use it as an argument in a API/HTTP request sent from the command line. I'm using my script to get a list of user accounts 'following' me, and every 24 hours or so, comparing the original list on my hard disk to the newly outputted username list (and **echo'ing out who is no longer following me**. I will have to encapsulate my logic into a loop using bash.. testing each username. My current script:               user=$(awk -F: '{ print $1 }' FILE)  # Grab $User to use as an argument.       following=$(exec CURRENT_FOLLOWERS) # Outputs the new file          echo "X amount of users are following you on 78B066B87AF16A412556458AC85EFEF66155"                      SAVE CURRENT FOLLOWERS TO NEW A FILE.                 if [[ DIFFERENCE IS DETECTED ]] ; then                        echo -ne "$User NO LONGER FOLLOWING YOU\r"             else echo -ne "This user is following you still.\r"     fi      My question is;   **How can I output the difference between 2 files?**


title: ( /etc/sysconfig/iptables ) "Manual customization of this file is not recommended." Why?

text: Editing this file directly               /etc/sysconfig/iptables       can save me so much headaches so much time and so on... and yet on the very top of the file it says..               Manual customization of this file is not recommended.      here is the '/etc/sysconfig/iptables' that just came with a brand new centos 6.4 cloud server.               # Firewall configuration written by system-config-firewall     # Manual customization of this file is not recommended.     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     COMMIT      to open port 80 i can simply clone the line..                   -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT      and then change "22" to "80" and then save this file and then reboot the whole system. this will open port 80 for me. this is pretty simple operation. and yet the file says manual editing is not recommended. why should i follow the advice ?


title: what does mean crond[2113] : (*system*) RELOAD (/etc/cron.d/mycron)

text: crond[2113] : (*system*) RELOAD (/etc/cron.d/mycron)      My cron job is not working and I got the error above in log, What does mean that, how can I know what is going on. My cron job code:               SHELL=/bin/bash     PATH=/sbin:/bin:/usr/sbin:/usr/bin     MAILTO=root     HOME=/     * * * * * root php /var/www/html/app/checkUserAction.php


title: How to setup a proxy server like WatchGuard HTTP Proxy server?

text: I have an application which works mostly but since I went to test it in Enterprise networks it simply never works, because there all local computers have to use a proxy server. So to do all those testing I decided to simulate a Proxy Server ( http://www.waronerrors.com/kb/request-denied-by-watchguard-http-proxy.aspx ) And then test behind that proxy server my application. Which Linux tools I can use to simulate a watchguard http like proxy server?


title: merge csv files, escape comma inside quotes

text: I have 3 csv files I want to join by first column (id column) Each file has the same 3 columns Row example :               id        | timestamp       |  Name          3792318, 2014-07-15 00:00:00, "A, B"      When I join the 3 csv files with               join -t, <(join -t, csv1 csv2) csv3 > out.csv      The `out.csv` file doesn't have the same number of columns for each row, probably because the delimiter is a comma and some rows (like in the example above) have commas in the contents of the cell.


title: Sorting the output of "find"?

text: I need to be able to alphabetically sort the output of `find` before piping it to a command. Entering `| sort |` between didn't work, so what could I do?               find folder1 folder2 -name "*.txt" -print0 | xargs -0 myCommand


title: What does the (-) in 'abi_x86_32(-)' signify in an ebuild?

text: In the process of updating my Gentoo system, I've run into something I don't understand. Wine is requesting `app-emulation/emul-linux-x86-soundlibs`, which in turn requests `>=media-plugins/alsaequal-0.6-r1[abi_x86_32(-)]`, which then in turn requests `>=media-plugins/caps-plugins-0.9.11[${MULTILIB_USEDEP}]`. `caps-plugins` turns around and depends on `!<=app-emulation/emul- linux-x86-soundlibs-20130224-r2` and `!app-emulation/emul- linux-x86-soundlibs[-abi_x86_32(-)]`. Most of these are using (-) to mean something. What does the trailing `(-)` mean?


title: How to install rastertoezpl on Pardus?

text: I bought a barcode printer as Godex. I have to install its drivers. I did it on Ubuntu. However, I have some problems about it.For example: In README file:               $ sudo aptitude install libcupsimage2-dev      But shell says me `sudo:aptitude: command not found` Moreover when i write `sudo apt-get install aptitude it` says               sudo:apt-get: command not found      And then, When I write `./configure` shell says followings.               ./configure          checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for a thread-safe mkdir -p... /bin/mkdir -p     checking for gawk... gawk     checking whether make sets $(MAKE)... no     checking for gcc... no     checking for cc... no     checking for cl.exe... no     configure: error: no acceptable C compiler found in $PATH     See `config.log' for more details.      How can i fix it ? How can i install this package? Thanks for your help already now.


title: Leave remote command running storing output

text: Scenario; I have SSH'ed to a machine, opened a new screen session, and fired off a script. Some days later I SSH back to that machine, re-attach the screen session and look at the output that has been generated, however; I can't scroll back through the output. From what I can see, screen stores one "screens worth" of stdout output. If my script has generated 100 lines of output in 48 hours, I can't see it all, just the last 40 odd lines or so. Is there a way to make `screen` store all stdout from the script I leave running, so I can re-attach the screen and PgUp/PgDn through it as if it were a script running on my local machine? Perhaps `screen` isn't the most optimal way to do this? Is there a better method for leaving scripts running on remote machines after log out, and being able to re-attach to that process at a later date and view all the output?


title: Unable to build id3lib on Crunchbang

text: I'm trying to install `id3lib` in my new Crunchbang distro. So, I downloaded the tar.gz file and executed `configure` command which ran good. And when I run `make` I'm getting the following error:               make[2]: *** [c_wrapper.lo] Error 1     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/src'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/home/gts/downloads/id3lib-3.8.3'     make: *** [all] Error 2      I've also added the full output below for reference.               make  all-recursive     make[1]: Entering directory `/home/gts/downloads/id3lib-3.8.3'     Making all in .     make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3'     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3'     Making all in m4     make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/m4'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/m4'     Making all in zlib     make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib'     cd . \           && CONFIG_FILES= CONFIG_HEADERS=config.h \              /bin/bash ./config.status     config.status: creating config.h     config.status: config.h is unchanged     config.status: executing default-1 commands     make  all-recursive     make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib'     Making all in .     make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib'     make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib'     Making all in include     make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/include'     make[4]: Nothing to be done for `all'.     make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/include'     Making all in src     make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/src'     source='adler32.c' object='adler32.lo' libtool=yes \         depfile='.deps/adler32.Plo' tmpdepfile='.deps/adler32.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o adler32.lo `test -f adler32.c || echo './'`adler32.c     mkdir .libs     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c adler32.c -MT adler32.lo -MD -MP -MF .deps/adler32.TPlo  -fPIC -DPIC -o .libs/adler32.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c adler32.c -MT adler32.lo -MD -MP -MF .deps/adler32.TPlo -o adler32.o >/dev/null 2>&1     mv -f .libs/adler32.lo adler32.lo     source='compress.c' object='compress.lo' libtool=yes \         depfile='.deps/compress.Plo' tmpdepfile='.deps/compress.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o compress.lo `test -f compress.c || echo './'`compress.c     rm -f .libs/compress.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c compress.c -MT compress.lo -MD -MP -MF .deps/compress.TPlo  -fPIC -DPIC -o .libs/compress.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c compress.c -MT compress.lo -MD -MP -MF .deps/compress.TPlo -o compress.o >/dev/null 2>&1     mv -f .libs/compress.lo compress.lo     source='crc32.c' object='crc32.lo' libtool=yes \         depfile='.deps/crc32.Plo' tmpdepfile='.deps/crc32.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o crc32.lo `test -f crc32.c || echo './'`crc32.c     rm -f .libs/crc32.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c crc32.c -MT crc32.lo -MD -MP -MF .deps/crc32.TPlo  -fPIC -DPIC -o .libs/crc32.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c crc32.c -MT crc32.lo -MD -MP -MF .deps/crc32.TPlo -o crc32.o >/dev/null 2>&1     mv -f .libs/crc32.lo crc32.lo     source='deflate.c' object='deflate.lo' libtool=yes \         depfile='.deps/deflate.Plo' tmpdepfile='.deps/deflate.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o deflate.lo `test -f deflate.c || echo './'`deflate.c     rm -f .libs/deflate.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c deflate.c -MT deflate.lo -MD -MP -MF .deps/deflate.TPlo  -fPIC -DPIC -o .libs/deflate.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c deflate.c -MT deflate.lo -MD -MP -MF .deps/deflate.TPlo -o deflate.o >/dev/null 2>&1     mv -f .libs/deflate.lo deflate.lo     source='gzio.c' object='gzio.lo' libtool=yes \         depfile='.deps/gzio.Plo' tmpdepfile='.deps/gzio.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o gzio.lo `test -f gzio.c || echo './'`gzio.c     rm -f .libs/gzio.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c gzio.c -MT gzio.lo -MD -MP -MF .deps/gzio.TPlo  -fPIC -DPIC -o .libs/gzio.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c gzio.c -MT gzio.lo -MD -MP -MF .deps/gzio.TPlo -o gzio.o >/dev/null 2>&1     mv -f .libs/gzio.lo gzio.lo     source='infblock.c' object='infblock.lo' libtool=yes \         depfile='.deps/infblock.Plo' tmpdepfile='.deps/infblock.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o infblock.lo `test -f infblock.c || echo './'`infblock.c     rm -f .libs/infblock.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infblock.c -MT infblock.lo -MD -MP -MF .deps/infblock.TPlo  -fPIC -DPIC -o .libs/infblock.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infblock.c -MT infblock.lo -MD -MP -MF .deps/infblock.TPlo -o infblock.o >/dev/null 2>&1     mv -f .libs/infblock.lo infblock.lo     source='infcodes.c' object='infcodes.lo' libtool=yes \         depfile='.deps/infcodes.Plo' tmpdepfile='.deps/infcodes.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o infcodes.lo `test -f infcodes.c || echo './'`infcodes.c     rm -f .libs/infcodes.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infcodes.c -MT infcodes.lo -MD -MP -MF .deps/infcodes.TPlo  -fPIC -DPIC -o .libs/infcodes.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infcodes.c -MT infcodes.lo -MD -MP -MF .deps/infcodes.TPlo -o infcodes.o >/dev/null 2>&1     mv -f .libs/infcodes.lo infcodes.lo     source='inffast.c' object='inffast.lo' libtool=yes \         depfile='.deps/inffast.Plo' tmpdepfile='.deps/inffast.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o inffast.lo `test -f inffast.c || echo './'`inffast.c     rm -f .libs/inffast.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inffast.c -MT inffast.lo -MD -MP -MF .deps/inffast.TPlo  -fPIC -DPIC -o .libs/inffast.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inffast.c -MT inffast.lo -MD -MP -MF .deps/inffast.TPlo -o inffast.o >/dev/null 2>&1     mv -f .libs/inffast.lo inffast.lo     source='inflate.c' object='inflate.lo' libtool=yes \         depfile='.deps/inflate.Plo' tmpdepfile='.deps/inflate.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o inflate.lo `test -f inflate.c || echo './'`inflate.c     rm -f .libs/inflate.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inflate.c -MT inflate.lo -MD -MP -MF .deps/inflate.TPlo  -fPIC -DPIC -o .libs/inflate.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inflate.c -MT inflate.lo -MD -MP -MF .deps/inflate.TPlo -o inflate.o >/dev/null 2>&1     mv -f .libs/inflate.lo inflate.lo     source='inftrees.c' object='inftrees.lo' libtool=yes \         depfile='.deps/inftrees.Plo' tmpdepfile='.deps/inftrees.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o inftrees.lo `test -f inftrees.c || echo './'`inftrees.c     rm -f .libs/inftrees.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inftrees.c -MT inftrees.lo -MD -MP -MF .deps/inftrees.TPlo  -fPIC -DPIC -o .libs/inftrees.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inftrees.c -MT inftrees.lo -MD -MP -MF .deps/inftrees.TPlo -o inftrees.o >/dev/null 2>&1     mv -f .libs/inftrees.lo inftrees.lo     source='infutil.c' object='infutil.lo' libtool=yes \         depfile='.deps/infutil.Plo' tmpdepfile='.deps/infutil.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o infutil.lo `test -f infutil.c || echo './'`infutil.c     rm -f .libs/infutil.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infutil.c -MT infutil.lo -MD -MP -MF .deps/infutil.TPlo  -fPIC -DPIC -o .libs/infutil.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infutil.c -MT infutil.lo -MD -MP -MF .deps/infutil.TPlo -o infutil.o >/dev/null 2>&1     mv -f .libs/infutil.lo infutil.lo     source='trees.c' object='trees.lo' libtool=yes \         depfile='.deps/trees.Plo' tmpdepfile='.deps/trees.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o trees.lo `test -f trees.c || echo './'`trees.c     rm -f .libs/trees.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c trees.c -MT trees.lo -MD -MP -MF .deps/trees.TPlo  -fPIC -DPIC -o .libs/trees.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c trees.c -MT trees.lo -MD -MP -MF .deps/trees.TPlo -o trees.o >/dev/null 2>&1     mv -f .libs/trees.lo trees.lo     source='uncompr.c' object='uncompr.lo' libtool=yes \         depfile='.deps/uncompr.Plo' tmpdepfile='.deps/uncompr.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o uncompr.lo `test -f uncompr.c || echo './'`uncompr.c     rm -f .libs/uncompr.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c uncompr.c -MT uncompr.lo -MD -MP -MF .deps/uncompr.TPlo  -fPIC -DPIC -o .libs/uncompr.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c uncompr.c -MT uncompr.lo -MD -MP -MF .deps/uncompr.TPlo -o uncompr.o >/dev/null 2>&1     mv -f .libs/uncompr.lo uncompr.lo     source='zutil.c' object='zutil.lo' libtool=yes \         depfile='.deps/zutil.Plo' tmpdepfile='.deps/zutil.TPlo' \         depmode=gcc3 /bin/bash ../../depcomp \         /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -c -o zutil.lo `test -f zutil.c || echo './'`zutil.c     rm -f .libs/zutil.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c zutil.c -MT zutil.lo -MD -MP -MF .deps/zutil.TPlo  -fPIC -DPIC -o .libs/zutil.lo     gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c zutil.c -MT zutil.lo -MD -MP -MF .deps/zutil.TPlo -o zutil.o >/dev/null 2>&1     mv -f .libs/zutil.lo zutil.lo     /bin/bash ../libtool --mode=link gcc  -g -O2   -o libz.la -rpath /usr/local/lib -version-info 1:0:0 adler32.lo compress.lo crc32.lo deflate.lo gzio.lo infblock.lo infcodes.lo inffast.lo inflate.lo inftrees.lo infutil.lo trees.lo uncompr.lo zutil.lo       rm -fr .libs/libz.la .libs/libz.* .libs/libz.*     gcc -shared  adler32.lo compress.lo crc32.lo deflate.lo gzio.lo infblock.lo infcodes.lo inffast.lo inflate.lo inftrees.lo infutil.lo trees.lo uncompr.lo zutil.lo   -Wl,-soname -Wl,libz.so.1 -o .libs/libz.so.1.0.0     (cd .libs && rm -f libz.so.1 && ln -s libz.so.1.0.0 libz.so.1)     (cd .libs && rm -f libz.so && ln -s libz.so.1.0.0 libz.so)     ar cru .libs/libz.a  adler32.o compress.o crc32.o deflate.o gzio.o infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o trees.o uncompr.o zutil.o      ranlib .libs/libz.a     creating libz.la     (cd .libs && rm -f libz.la && ln -s ../libz.la libz.la)     make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/src'     Making all in lib     make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/lib'     make[4]: Nothing to be done for `all'.     make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/lib'     Making all in prj     make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/prj'     make[4]: Nothing to be done for `all'.     make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/prj'     make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib'     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib'     Making all in doc     make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/doc'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/doc'     Making all in include     make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/include'     Making all in id3     make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/include/id3'     make[3]: Nothing to be done for `all'.     make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/include/id3'     make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/include'     make[3]: Nothing to be done for `all-am'.     make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/include'     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/include'     Making all in id3com     make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/id3com'     Making all in Sample     make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/id3com/Sample'     make[3]: Nothing to be done for `all'.     make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/id3com/Sample'     make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/id3com'     make[3]: Nothing to be done for `all-am'.     make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/id3com'     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/id3com'     Making all in src     make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/src'     source='c_wrapper.cpp' object='c_wrapper.lo' libtool=yes \         depfile='.deps/c_wrapper.Plo' tmpdepfile='.deps/c_wrapper.TPlo' \         depmode=gcc3 /bin/bash ../depcomp \         /bin/bash ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include/id3 -I../include -I../zlib/include    -g -O2 -Wall -Wno-unused -Wno-inline -Woverloaded-virtual -Wmissing-declarations  -c -o c_wrapper.lo `test -f 'c_wrapper.cpp' || echo './'`c_wrapper.cpp     mkdir .libs     g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include/id3 -I../include -I../zlib/include -g -O2 -Wall -Wno-unused -Wno-inline -Woverloaded-virtual -Wmissing-declarations -c c_wrapper.cpp -MT c_wrapper.lo -MD -MP -MF .deps/c_wrapper.TPlo  -fPIC -DPIC -o .libs/c_wrapper.lo     In file included from ../include/id3/utils.h:37:0,                      from ../include/id3/tag.h:34,                      from c_wrapper.cpp:30:     ../include/id3/id3lib_strings.h: In static member function 'static std::char_traits<unsigned char>::char_type* std::char_traits<unsigned char>::move(std::char_traits<unsigned char>::char_type*, const char_type*, std::size_t)':     ../include/id3/id3lib_strings.h:87:72: error: 'memmove' was not declared in this scope     ../include/id3/id3lib_strings.h: In static member function 'static std::char_traits<unsigned char>::char_type* std::char_traits<unsigned char>::copy(std::char_traits<unsigned char>::char_type*, const char_type*, std::size_t)':     ../include/id3/id3lib_strings.h:91:71: error: 'memcpy' was not declared in this scope     c_wrapper.cpp: In function 'void ID3TagIterator_Delete(ID3TagIterator*)':     c_wrapper.cpp:350:7: warning: deleting object of abstract class type 'ID3_Tag::Iterator' which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]     c_wrapper.cpp: In function 'void ID3TagConstIterator_Delete(ID3TagConstIterator*)':     c_wrapper.cpp:370:7: warning: deleting object of abstract class type 'ID3_Tag::ConstIterator' which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]     make[2]: *** [c_wrapper.lo] Error 1     make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/src'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/home/gts/downloads/id3lib-3.8.3'     make: *** [all] Error 2


title: script for logging all the stats for a particular process

text: I want to monitor CPU usage, disk read/write usage for a particular process, say `./myprocess`. To monitor CPU `top` command seems to be a nice option and for read and write `iotop` seems to be a handy one. For example to monitor read/write for every second i use the command `iotop -tbod1 | grep "myprocess"`. My difficulty is I just want only three variables to store, namely read/sec, write/sec, cpu usage/sec. Could you help me with a script that combines the outputs the above said three variables from `top` and `iotop` to be stored into a log file? Thanks!


title: Unable to access website hosted on virtual machine

text: I'm on a mac (osx 10.9.3) running CentOS7 in virtualbox. I would like to access the website hosted on the virtual machine. Browsing to the Guest IP returns webpage not available. I'm able to `ping` and `ssh` to the VM.   I've set bridged adapter for the network settings in the VM.   I've given `/etc/httpd/conf/httpd.conf` Listen 80 and host IP address. `telnet` and `curl` to Guest IP returns connection refused. I'm guessing it's a firewall / iptables configuration problem where I need to allow the host. How do I configure CentOS firewall / iptables to allow host?


title: how to troubleshoot a network adapter on an AIX 4.3.3 machine

text: I'm trying to brush up my skills on AIX. I have an ancient RS/6000 43P-133 which I'm trying to resurrect before investing in anything more sophisticated. I used to do automation and scripting on AIX systems, but very little administration. The onboard PCI network adapter does not work. It may be dead, not sure. The diagnostics screens (SMS) reports "ok" for the adapter. On startup, the error:               if_en: ns_alloc(en0) failed with errno = 19      is produced   * lsdev shows ent0 as "Defined"   * errpt shows adapter errors   * errpt -j shows KENT_EEPROM_ERR for ent0   * en0 and et0 seem to be defined   * /dev/ent0 /dev/en0 and /dev/et0 do not exist (Am I just too Linux?)   * alog -o -t boot shows: .               attempting to configure device 'ent0'     Time:  16     LEDS: 0x742     invoking /usr/lib/methods/cfgkent -2 -l ent0     Number of running methods: 1     -------------     Completed method for: ent0, Elapsed time = 0     return code = 40     *************** no stdout ***************     *************** no stderr ***************     Method error  (/usr/lib/methods/cfgkent -2 -l ent0 ):                0514-040 Error initializing a device into the kernel.      When I try to bring up the interface using smitty communications               en0     aix     inet0 changed     Method error (/usr/lib/methods/chgif):         0514-068 Cause not known.     0821-510 ifconfig: error calling entry point for /usr/lib/drivers/if_en: The specified device does not exist.     0821-223 chgif: Cannot get records from CuAt.     ...      Are there any other tools or utilities which might provide insight as to where the problem might be? Is there something missing in my troubleshooting? The primary objective here is to learn more about AIX, so even if you don't know the answer, tips on troubleshooting would be much appreciated. * * * Some more outputs:               # lscfg -vpl ent0       DEVICE            LOCATION          DESCRIPTION            ent0              04-D0             IBM PCI Ethernet Adapter (22100020)     # lslpp -L | grep 22100020       devices.pci.22100020.diag  4.3.3.0    C    PCI Ethernet Adapter Diagnostics       devices.pci.22100020.rte   4.3.3.0    C    IBM PCI Ethernet Adapter


title: Recover rc.conf in FreeBSD

text: I'm using FreeBSD 9.1 and I accidentally deleted the file `/etc/rc.conf`. How can I recover it?


title: Extract certain column from CSV files

text: I have a directory with a group of CSV files. All files have the same column headers. I need to extract values in a certain column from all files. The common part in files names is `OCS_mobfwref-oam_d01_2014080*`


title: How to make netcat print colourful text?

text: on my Mac I have an peripheral that sends text data to `localhost:2332`. Some of them are coloured, like this: `"\e[1;31mRed text here\e[m normal text here"`, I use `nc loacal host` to monitor the data stream. However I noticed that the coloured text are not printed out properly, the output is like `[1;31mRed text here[m normal text here`. I am just wondering if there is some options I can use to make netcat parse the escape characters correctly.


title: replacement inside parallel command string

text: I want to download multiple files and save them to the md5 sum of its name:               cat list | parallel -j4 "md5=$(wget -O - {} | tee tmpfile_{#} | md5sum | cut -d ' ' -f 1); mv tmpfile_{#} $md5"      but the problem is that bash seems to execute the wget stuff before execution of parallel replaces `{}`... so wget wants to download from `http://{}` so how can parallel replace its variables before the execution of the subcommand?


title: Using OpenVPN with systemd

text: Ok, so I've been searching the web for solutions to this problem with no answers seeming to work for me. Hopefully someone can help me. I'm only trying to configure the OpenVPN Client. I'm running `CrunchBang Linux 3.2.0-4-amd64 Debian 3.2.60-1+deb7u1 x86_64 GNU/Linux` and I just switched over to using `systemd`. The changeover went smooth enough but now I can't get my OpenVPN client to come up using systemd I've tried following these configuration tutorials, but nothing works.   * http://fedoraproject.org/wiki/Openvpn   * http://d.stavrovski.net/blog/how-to-install-and-set-up-openvpn-in-debian-7-wheezy   * And looked at a bunch of other different guides. I can bring up the tunnel from the command line with `openvpn /etc/openvpn/vpn.conf`. So I know the config file is good, it was working with sysvinit just fine so I'm not surprised. I then attempt to just do a status with `systemctl status openvpn@vpn.service` resulting in:               $ sudo systemctl status openvpn@vpn.service       openvpn@vpn.service       Loaded: error (Reason: No such file or directory)       Active: inactive (dead)      I realized that I need to do some setup for services. I want to be prompted for a password so I followed this guide to create an `openvpn@.service` in `/etc/systemd/system/`. But restarting the OpenVPN service still doesn't prompt for a password.               $ sudo service openvpn restart     [ ok ] Restarting openvpn (via systemctl): openvpn.service.      In the Fedora tutorials the go through steps of creating symbolic links, but don't create any of the .service files in the walk throughs. What piece am I missing? Do I need to create an openvpn@vpn.service? If so, where exactly do I place it? I feel like it shouldn't be this difficult, but I can't seem to find any solution that works for me. I'm happy to provide any more information that's needed. Thanks in advance. Edit:               -rw-r--r--  1 root root   319 Aug  7 10:42 openvpn@.service          [Unit]     Description=OpenVPN connection to %i     After=network.target          [Service]     Type=forking     ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.conf     ExecReload=/bin/kill -HUP $MAINPID     WorkingDirectory=/etc/openvpn          [Install]     WantedBy=multi-user.target     openvpn@.service (END)      Symlink:               lrwxrwxrwx  1 root root   36 Aug  7 10:47 openvpn@vpn.service -> /lib/systemd/system/openvpn@.service      ** Solution! **   Everything is working now, except for being prompted for a password to connect. I'm attempted this solution. I tweaked the file from above just a bit, and added an Expect script like in the example. Working like a charm! My files are below. Modified lines from the above `/lib/systemd/system/openvpn@.service`               ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --management localhost 5559 --management-query-passwords --management-forget-disconnect --config /etc/openvpn/%i.conf     ExecStartPost=/usr/bin/expect /lib/systemd/system/openvpn_pw.exp      Expect script `/lib/systemd/system/openvpn_pw.exp`. Make sure to do the following:   * `chmod +x` on the script.   * Have `telnet` installed `#!/usr/bin/expect`   `set pass [exec /bin/systemd-ask-password "Please insert Private Key password: "]`   `spawn telnet 127.0.0.1 5559`   `expect "Enter Private Key Password:"`   `send "password 'Private Key' $pass\r"`   `expect "SUCCESS: 'Private Key' password entered, but not yet verified"`   `send "exit\r"`   `expect eof`   **It should be noted that the above solution does log your password entered in plaintext in the following logs in`/var/log/syslog` and `/var/log/daemon.log`**


title: How to reach only an application in QEMU emulation without X?

text: I run an OpenBSD guest on an OpenBSD host (Desktop) with QEMU. Because I want to run a webbrowser in a separated environment. I can reach the QEMU machine via ssh -X so I can see the webbrowser. But that's not really safe (because AFAIK X wasn't designed by security in mind). **Q:** How can I reach the webbrowser (xxxterm) from the host OpenBSD machine safely and with good performance? ps.: question is based on this


title: How to monitor average stats of CPU and memory usage of a Solaris server using scripts?

text: I need to monitor average CPU and memory usage for a Solaris server. How can I automate the process using scripts to monitor daily CPU and memory usage and give it as an average over a month?


title: Extract value between double quotes

text: My query is to extract the value between double quotes "". Sample input is : > 10.219.41.68 - - - [11/Jun/2014:10:23:04 -0400] Sec:0 MicSec:1797 "GET > /balancer-manager HTTP/1.1" 200 28980 "-" "curl/7.15.5 (i386-redhat-linux- > gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" I have large log files, so values can be vary for each line, need to extract the value between first occurance of double quotes... expected output:               GET /balancer-manager HTTP/1.1      Anyone have any idea then please suggest.


title: Low-Contrast Color Scheme in xxxterm config file?

text: I know I can set a "Low-Contrast Color Scheme" with the "s" button in xxxterm. **Q:** but how can I set this Low-Contrast Color Scheme to be default? (in the .xxxterm.conf) So that "s" key doesn't need to be pressed. UPDATE: Using:               userstyle_global = 1      produces this: ![enter image description here](http://i.stack.imgur.com/IZLxJ.png) in ~/.xxxterm.conf. xxxterm version: 1:1.10.0-1 (according to dpkg)


title: Bash shell scripting basic question regarding the syntax and basename

text: Consider the script below:               myname=`basename $0`;     for i in `ls -A`     do      if [ $i = $myname ]      then       echo "Sorry i won't rename myself"      else       newname=`echo $i |tr a-z A-Z`       mv $i $newname      fi     done      1) I am aware that `basename $0` signifies my script name here. But how? the syntax explanation please. What does `$0` mean? 2) In what cases ";" is used at the end of statement in a script? For example, the first line of script ends with ; , whereas the 8th line doesn't. Also, i found that adding/removing semi-colons at the end of some lines (for example: 1st/6th/8th lines) doesn't really have any significance and script runs fine with or without it.


title: Compiling libqwplot3d on armhf

text: This started as an attempt to compile GNURadio on armhf (Pandaboard & Beagleboard). Thanks to the answer by Mike Larsen. I tried to compile libqwplot3d.               apt-get build-dep qwtplot3d     apt-get source qwtplot3d     cd qwtplot3d-*/     dpkg-buildpackage      And get the following result in the last step:               user@lord-xm:~/qwtplot3d-0.2.7+svn191$ dpkg-buildpackage     dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security     dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2     dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security     dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2     dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro     dpkg-buildpackage: source package qwtplot3d     dpkg-buildpackage: source version 0.2.7+svn191-5ubuntu2     dpkg-buildpackage: source changed by Scott Kitterman <scott@kitterman.com>     dpkg-buildpackage: host architecture armhf      dpkg-source --before-build qwtplot3d-0.2.7+svn191      fakeroot debian/rules clean     dh_testdir     dh_testroot     rm -f build-stamp     rm -rf build     dh_clean      dpkg-source -b qwtplot3d-0.2.7+svn191     dpkg-source: info: using source format `3.0 (quilt)'     dpkg-source: info: building qwtplot3d using existing ./qwtplot3d_0.2.7+svn191.orig.tar.gz     dpkg-source: info: building qwtplot3d in qwtplot3d_0.2.7+svn191-5ubuntu2.debian.tar.gz     dpkg-source: info: building qwtplot3d in qwtplot3d_0.2.7+svn191-5ubuntu2.dsc      debian/rules build     dh_testdir     mkdir -p build/qt4     cp -Rl `ls . |grep -v build|grep -v debian` build/qt4     cd build/qt4 && qmake-qt4 qwtplot3d.pro && /usr/bin/make     WARNING: doc.path is not defined: install target not created          make[1]: Entering directory `/home/user/qwtplot3d-0.2.7+svn191/build/qt4'     g++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQT_WEBKIT -DGL2PS_HAVE_ZLIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -Iinclude -I/usr/X11R6/include -Itmp -o tmp/qwt3d_axis.o src/qwt3d_axis.cpp     In file included from /usr/include/GL/glu.h:38:0,                      from include/qwt3d_openglhelper.h:11,                      from include/qwt3d_types.h:26,                      from include/qwt3d_drawable.h:7,                      from include/qwt3d_label.h:10,                      from include/qwt3d_axis.h:5,                      from src/qwt3d_axis.cpp:1:     /usr/include/GL/gl.h:162:17: error: conflicting declaration âtypedef double GLdoubleâ     /usr/include/qt4/QtOpenGL/qgl.h:85:17: error: âGLdoubleâ has a previous declaration as âtypedef GLfloat GLdoubleâ     In file included from /usr/include/GL/gl.h:2085:0,                      from /usr/include/GL/glu.h:38,                      from include/qwt3d_openglhelper.h:11,                      from include/qwt3d_types.h:26,                      from include/qwt3d_drawable.h:7,                      from include/qwt3d_label.h:10,                      from include/qwt3d_axis.h:5,                      from src/qwt3d_axis.cpp:1:     /usr/include/GL/glext.h:5327:19: error: conflicting declaration âtypedef ptrdiff_t GLintptrâ     /usr/include/GLES2/gl2.h:38:26: error: âGLintptrâ has a previous declaration as âtypedef khronos_intptr_t GLintptrâ     /usr/include/GL/glext.h:5328:19: error: conflicting declaration âtypedef ptrdiff_t GLsizeiptrâ     /usr/include/GLES2/gl2.h:39:26: error: âGLsizeiptrâ has a previous declaration as âtypedef khronos_ssize_t GLsizeiptrâ     In file included from include/qwt3d_types.h:26:0,                      from include/qwt3d_drawable.h:7,                      from include/qwt3d_label.h:10,                      from include/qwt3d_axis.h:5,                      from src/qwt3d_axis.cpp:1:     include/qwt3d_openglhelper.h: In function âbool Qwt3D::ViewPort2World(double&, double&, double&, double, double, double)â:     include/qwt3d_openglhelper.h:106:97: error: cannot convert âdouble*â to âGLdouble* {aka float*}â for argument â7â to âGLint gluUnProject(GLdouble, GLdouble, GLdouble, const GLdouble*, const GLdouble*, const GLint*, GLdouble*, GLdouble*, GLdouble*)â     include/qwt3d_openglhelper.h: In function âbool Qwt3D::World2ViewPort(double&, double&, double&, double, double, double)â:     include/qwt3d_openglhelper.h:122:95: error: cannot convert âdouble*â to âGLdouble* {aka float*}â for argument â7â to âGLint gluProject(GLdouble, GLdouble, GLdouble, const GLdouble*, const GLdouble*, const GLint*, GLdouble*, GLdouble*, GLdouble*)â     make[1]: *** [tmp/qwt3d_axis.o] Error 1     make[1]: Leaving directory `/home/user/qwtplot3d-0.2.7+svn191/build/qt4'     make: *** [build-stamp] Error 2     dpkg-buildpackage: error: debian/rules build gave error exit status 2     user@lord-xm:~/qwtplot3d-0.2.7+svn191$      How do fix this and proceed? I am using the Ubuntu 12.04 image for OMAP


title: Accent error on OpenWrt 12.09?

text: [user@localhost ~] ssh -x -a root@192.168.1.1     BusyBox v1.19.4 (2013-03-14 11:28:31 UTC) built-in shell (ash)      -----------------------------------------------------      ATTITUDE ADJUSTMENT (12.09, r36088)      -----------------------------------------------------     root@ROUTER:~# touch 'árvíztűrő tükörfúrógép'     root@ROUTER:~# ls -la     drwxr-xr-x    1 root     root             0 Aug 31 11:26 .     drwxr-xr-x    1 root     root             0 Jan  1  1970 ..     drwx------    2 root     root             0 Aug 15 16:09 .ssh     -rw-r--r--    1 root     root             0 Aug 31 11:26 ????rv??zt??r?? t??k??rf??r??g??p     root@ROUTER:~# ls -la áárvíztűrő\ tükörfúrógép      -rw-r--r--    1 root     root             0 Aug 31 11:26 ????rv??zt??r?? t??k??rf??r??g??p     root@ROUTER:~# rm áárvíztűrő\ tükörfúrógép       **Q:** Why? The accent handling was ok a few versions before.. What am I doing wrong? UPDATE: the same problem occurs if I put this in cron.


title: Wi-fi management & billing

text: I want to setup a wifi management & billing using linux server. But I don't know where to start. Is there any guide on how to do this? For example... When user connect to my access point, it will automatically redirect to login page. They have to login before using my internet connection. Thanks in advance, xcession.


title: Show only text between 2 matching pattern

text: I'm going to submit form using cURL, where some of the contents is come from other file, selected using `sed` If `param1` is line matching pattern from other file using `sed`, below command will works fine:               curl -d param1="$(sed -n '/matchpattern/p' file.txt)" -d param2=value2 http://example.com/submit      Now, go to the problem. I want show only text between 2 matching pattern excluding the matching pattern itself. Lets say `file.txt` contains:               Bla bla bla     firstmatch     It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.     secondmatch     The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.      Currently, lots of "beetween 2 matching pattern" `sed` command won't remove `firstmatch` and `secondmatch`. I want the result become:               It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.


title: Alias for directory listing sorted by time modified in reverse order

text: When I need to find my recently used files, this command: `ls -lt` lists in ascending order (by time), when there are lots files, I need to scroll to the top to see needed files, because wont fit in terminal screen. After finding out that `tac` inverses the output, I use: `ls -lt dir/ | tac` Is there more fun way of doing it, without using external scripts/utils?


title: What does this tcpdump line means?

text: Reading the manpage of `tcpdump` I found this example               tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet'      but I don't understand it, especially the last part. The `tcp[tcpflags] & (tcp-syn|tcp-fin) != 0` part filters all the packets having either the SYN or the FIN bit set. What does `not src and dst net localnet` filter? The explanation in the same manpage says > To print the start and end packets (the SYN and FIN packets) of each TCP > conversation that involves a non-local host. but in my opinion `src` is not an expression by itself.


title: Add a symbol before any letter

text: I have a text file with each line having some defined number of fields but they can differ from line to line. All I want to do is to add "=" sign in front of every value in the field in that line. For example INPUT FILE               A   B   C   D   E     P   Q   R   S   T   U     L   M   N   O      OUTPUT FILE               =A  =B  =C  =D  =E     =P  =Q  =R  =S  =T  =U     =L  =M  =N  =O      Also this is just an example, my file contains some lines where number of field are more than 20. How to do this efficiently.


title: Keeping Pushbullet for Chrome active with Chrome closed?

text: I'm using Elementary OS Luna (an Ubuntu 12.04 derivative) on an Acer C720 Chromebook with Firefox as my browser of choice. I'm a big fan of Pushbullet to mirror my Android notifications from my phone to my desktop and have found it to be my preferred method of doing so on Linux thus far, but the Chrome plugin is far superior to the Firefox one, IMO. At the present moment, I am running Chrome minimized at boot via Devilspie in order to get the Chrome Pushbullet plugin to actually run in the background, but this is an obviously ugly way of accomplishing this, as Chrome is eating RAM without actually being used for anything else. I am looking for a way to either: A) Get Pushbullet to actively run in the background and mirror notifications with Chrome closed, which I was under the impression was possible B) Run Chrome with the absolute minimum of resource consumption and/or processes, seeing as I am using it solely to power the Pushbullet extension Is there a way to do A? Is there a preferred method or set of flags/options I can use to accomplish B? Thanks.


title: What is CONFIG_BASE_SMALL=0

text: Looking at the config file of Linux (that is generated prior to build) I found the following line:               CONFIG_BASE_SMALL=0      What does it mean? If I want my linux kernel to be as small as possible shall I keep it 0?


title: Error with g++47 make compilation?

text: > ~/cddir>ls > > hw1 machine.cpp main.o makefile~ report2.txt user.cpp > > hw11submit.sh machine.h makefile report1.txt report2.txt~ user.h > > hw12submit.sh main.cpp #makefile# report1.txt~ soda.x > > ~/cddir>make > > make: _*_ No rule to make target `g++47', needed by`machine.o'. Stop. All of my files are there and they ran perfectly before. Now I re-log in and get this error. A day yesterday on Google didn't help, but maybe I am looking in the wrong place. Makefile:               soda.x: main.o machine.o user.o                                                              g++47 -osoda.x main.o machine.o user.o                                            user.o: user.h user.cpp                                                        \             g++47 -c -Wall -Wextra -I. user.cpp                                               machine.o: machine.h machine.cpp                                               \             g++47 -c -Wall -Wextra -I. machine.cpp                                 \          main.o: main.cpp                                                                             g++47 -c -Wall -Wextra -I. main.cpp      E-macs env.


title: What is the name of the formatting output from man?

text: Output from man command have bold and underline text that is recoginzed by less like `H\x08HE\x08EL\x08LL\x08LO\x08O` display **HELLO** or `H\x08_E\x08_L\x08_L\x08_O\x08_` as underline HELLO what is the name of this formatting?