Peculiar lack of RHEL 5.8 service management documentation

I am needing to see the status of some services on some of our RHEL 5.8 hosts on which I am not an admin. Much to my surprise, I am not able to get any info how to do it (such as `chkconfig` or `systemctl` on Fedora) from Google. Neither `chkconfig` nor `systemctl` are accessible to me, not sure if it is because of permissions or they are just not available on the system but there are no man pages for either. Why is it that there is such a mysterious lack of service management documentation online for RHEL 5.8 and which commands can I use for simple service listings?


What is the status of HiDPI support in Xfce?

I'm looking for a new work laptop for development work on linux, and after testing way too many distros, I pretty much does not want to ever use anything other than Xubuntu or possibly some other Debian/Ubuntu based Xfce setup. What worries me is that most of the recent laptops with Haswell processors I have looked at also supports extremely high resolution, which would require the desktop to use higher DPI settings (HiDPI) in order to be usable. Thus I was wondering, what is the status for HiDPI support in Xfce? (I have found some sources claiming the support is not good at the moment, but I didn't find any info on whether it is being worked on or not!)


Simple Script to setenv tcsh or export bash

I am having problems with simple scripting, my Box is CentOS so bash is the default shell, now I wanted to send a line via setenv (tcsh) and would like to make a script that will ask me to input a string to setenv every time I login. By the way I am using teraterm logging in.


How can I first download KDE files and then install them offline on Ubuntu?

How can I first download **KDE** files and then install them offline on Ubuntu?


Why Debian CD has 52 CD

> **Possible Duplicate:**   >  31 Debian CDs -- Why? and which do I need for a vanilla desktop install? I am about to install Debian. But Debian has 52 CD Images \- how can Debian be so large? 52 CDs will equate to almost 36 GB! Am I mistaking something or what?


How to grep standard error stream (stderr)?

I am using ffmpeg to get the meta info of an audio clip. But I am unable to grep it.                   $ ffmpeg -i 01-Daemon.mp3  |grep -i Duration         FFmpeg version SVN-r15261, Copyright (c) 2000-2008 Fabrice Bellard, et al.           configuration: --prefix=/usr --bindir=/usr/bin            --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib           --mandir=/usr/share/man --arch=i386 --extra-cflags=-O2            ...      I checked, this ffmpeg output is directed to stderr.               $ ffmpeg -i 01-Daemon.mp3 2> /dev/null      So I think that grep is unable to read error stream to catch matching lines. How can we enable grep to read error stream? Using nixCraft link, I redirected standard error stream to standard output stream, then grep worked.               $ ffmpeg -i 01-Daemon.mp3 2>&1 | grep -i Duration       Duration: 01:15:12.33, start: 0.000000, bitrate: 64 kb/s      But what if we do not want to redirect stderr to stdout?


Find executable files recursively

I have got the directory called `Test` and a few directories inside it. Both `Test` and the directories inside it have executable files. I'd like to print them with `ls`. I'd use this command.               ls -l `find Test/ -perm /u=x,g=x,o=x -type f`      Is this a good/right/quick command or not? **My solution is:**               find Test/ -executable -type f -exec ls -l {} \;      and got the same result as _warl0ck_ and _pradeepchhetri_ offered.


How to add an alias without directly editing the `bash_aliases` file?

Is there a way to add an alias from the command line without directly editing the bash_aliases file? To clarify, how can I make a bash script do it without having to enter something along the lines of `nano bash_aliases` to add them?


Pass a list of directories to a find command

How can I pass a list of directories to a find command? Imagine you got the list as:               ls -d mydir*/      which would output mydir1, mydir2 and so on, but exclude otherdirs1, otherdirs2. I'd like to run the following command on the list:               find <put here the name of each dir>  -type f -name "*.mp3" -print0 | xargs -0 ...      Trying to run this command on each directory separately:               find -type f -name "*.mp3" -print0 |     xargs -0  mplayer -vo dummy -ao dummy -identify 2>/dev/null |      perl -nle '/ID_LENGTH=([0-9\.]+)/ && ($t +=$1) && printf "%02d:%02d:%02d\n",$t/3600,$t/60%60,$t%60' |      tail -n 1      That means: find the mp3s, run mplayer to obtain meta-data on each file, sum all ID_LENGTH of each mp3 file, output sum of all mp3s in directory.


Screen reptyring screen

Having recently discovered `reptyr`, my first action was to do everything I could to break it. This included `reptyr`ing screen into a screen session as follows:               $ screen     My zshrc cats some stuff here.     $ reptyr $(pgrep screen)      I thought that this would fail either gracefully or badly, but the failure had some interesting side effects:               zsh: suspended  screen                       %     Unable to attach to pid 24799: Operation not permitted     The kernel denied permission while attaching. If your uid matches     the target's, check the value of /proc/sys/kernel/yama/ptrace_scope.     For more information, see /etc/sysctl.d/10-ptrace.conf     $ jobs     zsh: command not found: jos     $ jobs     zsh: command not found: obs     $ jobs     [1]  + running screen     $ exit      My input is thoroughly garbled here, I'm not really sure what's going on with that process, and the exit command doesn't warn me about any jobs. What is the explanation for this?


RT2800USB wireless adapter stops scanning

I have a Linux machine, and I'll switch between using an RTL8187 based card, and a RT2800USB based card (the cards are both USB dongles by the same manufacturer). I've loaded the drivers for both cards:               modprobe rtl8187     modprobe rt2800usb      I can run an iwlist scan against the RTL8187 card until I'm blue in the face, but after a few minutes of doing the same with the RT2800USB card, it stops working, and displays the following:               $ sudo iwlist wlan0 scan     wlan0     No scan results      What can I do to get the card to work 100%?


How can I clean out duplicate entries from my PATH?

Currently, my $PATH has two identical entries for `/usr/local/bin` and I'm curious whether there's a way to clean that up, or if I should just not worry about it. It looks like this (broken up into a readable list):               /Users/myself/.rvm/gems/ruby-2.0.0-p353/bin     /Users/myself/.rvm/gems/ruby-2.0.0-p353@global/bin     /Users/myself/.rvm/rubies/ruby-2.0.0-p353/bin     /usr/local/bin <--( Here )     /usr/bin     /bin     /usr/sbin     /sbin     /usr/local/bin <--( Here )     /opt/X11/bin     /usr/texbin     /Users/myself/.rvm/bin


Transposing rows and columns

I have a file with the lines like below.               title1:A1     title2:A2     title3:A3     title4:A4     title5:A5          title1:B1     title2:B2     title3:B3     title4:B4     title5:B5          title1:C1     title2:C2     title3:C3     title4:C4     title5:C5          title1:D1     title2:D2     title3:D3     title4:D4     title5:D5 How can I achieve this?               title1    title2     title3    title4     A1         A2         A3         A4     B1         B2         B3         B4     C1         C2         C3         C4     D1         D2         D3         D4 `


Command to transpose (swap rows and columns of) a text file

Is there currently a generic command that will "pivot" input. e.g.               #labeled.file     name: bob     title: code monkey          name: joe     title: pointy haired      is converted to:               name title     bob  code monkey     joe  pointy haired      and vice-versa


Postfix mail how to debug transmission to mail handling agent

I have a postfix server running on Ubuntu (and Debian previously). The server is configured to read users and groups from an OpenLDAP server and delivers mail first the spam filter and then to a Zarafa dagent which makes the mail available in the Zarafa groupware. This works pretty well, however when sending mail to groups, only one member of the group receives the mail. For example I got a group mail "info@example.com" (domain names have been replaced), this is set up to deliver mail to "user1@example.com" and "user2@example.com". When I look at the log files, it actually looks pretty good:               Jan 19 10:03:30 nx01 postfix/smtpd[24603]: connect from dub0-omc2-s32.dub0.hotmail.com[157.55.1.171]     Jan 19 10:03:30 nx01 postfix/smtpd[24603]: 98188112027D: client=dub0-omc2-s32.dub0.hotmail.com[157.55.1.171]     Jan 19 10:03:30 nx01 postfix/cleanup[24606]: 98188112027D: message-id=<DUB123-W355AE0C8CE96FD543E9078DBA0@phx.gbl>     Jan 19 10:03:30 nx01 postfix/qmgr[1001]: 98188112027D: from=<derkork@xxxxxxx.com>, size=1515, nrcpt=2 (queue active)     Jan 19 10:03:30 nx01 spamd[12448]: spamd: connection from localhost [127.0.0.1] at port 42219     Jan 19 10:03:30 nx01 spamd[12448]: spamd: setuid to spam succeeded     Jan 19 10:03:30 nx01 spamd[12448]: spamd: processing message <DUB123-W355AE0C8CE96FD543E9078DBA0@phx.gbl> for spam:997     Jan 19 10:03:30 nx01 postfix/smtpd[24603]: disconnect from dub0-omc2-s32.dub0.hotmail.com[157.55.1.171]     Jan 19 10:03:30 nx01 spamd[12448]: spamd: clean message (-0.5/6.0) for spam:997 in 0.2 seconds, 1469 bytes.     Jan 19 10:03:30 nx01 spamd[12448]: spamd: result: . 0 - BAYES_00,HTML_MESSAGE scantime=0.2,size=1469,user=spam,uid=997,required_score=6.0,rhost=localhost,raddr=127.0.0.1,rport=42219,mid=<DUB123-W355AE0C8CE96FD543E9078DBA0@phx.gbl>,bayes=0.000000,autolearn=ham     Jan 19 10:03:30 nx01 spamd[1519]: prefork: child states: II     Jan 19 10:03:31 nx01 postfix/pickup[20834]: 044AF1120847: uid=997 from=<derkork@xxxxxxxx.com>     Jan 19 10:03:31 nx01 postfix/pipe[24607]: 98188112027D: to=<user1@example.com>, orig_to=<info@example.com>, relay=spamfilter, delay=0.43, delays=0.18/0/0/0.25, dsn=2.0.0, status=sent (delivered via spamfilter service)     Jan 19 10:03:31 nx01 postfix/pipe[24607]: 98188112027D: to=<user2@example.com>, orig_to=<info@example.com>, relay=spamfilter, delay=0.43, delays=0.18/0/0/0.25, dsn=2.0.0, status=sent (delivered via spamfilter service)     Jan 19 10:03:31 nx01 postfix/qmgr[1001]: 98188112027D: removed     Jan 19 10:03:31 nx01 postfix/cleanup[24606]: 044AF1120847: message-id=<DUB123-W355AE0C8CE96FD543E9078DBA0@phx.gbl>     Jan 19 10:03:31 nx01 postfix/qmgr[1001]: 044AF1120847: from=<derkork@xxxxxxx.com>, size=1829, nrcpt=2 (queue active)     Jan 19 10:03:31 nx01 postfix/pipe[24617]: 044AF1120847: to=<user1@example.com>, relay=zarafa, delay=0.26, delays=0.11/0/0/0.15, dsn=2.0.0, status=sent (delivered via zarafa service)     Jan 19 10:03:31 nx01 postfix/pipe[24617]: 044AF1120847: to=<user2@example.com>, relay=zarafa, delay=0.26, delays=0.11/0/0/0.15, dsn=2.0.0, status=sent (delivered via zarafa service)     Jan 19 10:03:31 nx01 postfix/qmgr[1001]: 044AF1120847: removed      Problem is: only user2@example.com actually finds the mail in his mailbox, but user1@example.com does not, even though the log file clearly shows that two mails have been handed over to Zarafa. I think postfix is working correctly here, but I am not sure whether or not Zarafa is. In my master.cf I have configured a pipe to the zarafa dagent:               zarafa unix -   n       n       -       10      pipe flags= user=vmail argv=/usr/bin/zarafa-dagent ${user}      Question is: Is there some way to debug the communication between postfix and Zarafa done over the pipe? If possible, show stdout, stdin and any error messages and exit status of the zarafa dagent? Oh and clinging to a straw: has anyone had such an issue with Zarafa before and solved it? If not, any debugging aids would be welcome as well :)


datetime stamp when running history command in zsh shell

When I run the history command on my ubuntu server, I get output as follows:                  history        ...        25  cd ~        26  ls -a        27  vim /etc/gitconfig        28  vim ~/.gitconfig      I want to view the datetime of a particular user. However when I assume them:               su otheruser     export HISTTIMEFORMAT='%F %T  '     history     ...     25  cd ~     26  ls -a     27  vim /etc/gitconfig     28  vim ~/.gitconfig      It still doesn't show datetime. I am using zsh shell.


Remove numbers from filenames

I've a problem modifying the files' names in my `Music/` directory. I have a list of names like these:               $ ls     01 American Idiot.mp3     01 Articolo 31 - Domani Smetto.mp3     01 Bohemian rapsody.mp3     01 Eye of the Tiger.mp3     04 Halo.mp3     04 Indietro.mp3     04 You Can't Hurry Love.mp3     05 Beautiful girls.mp3     16 Apologize.mp3     16 Christmas Is All Around.mp3     Adam's song.mp3     A far l'amore comincia tu.mp3     All By My Self.MP3     Always.mp3     Angel.mp3      And similar and I would like to cut all the numbers in front of the filenames (not the 3 in the extension). I've tried first to `grep` only the files with the number with `find -exec` or `xargs` but even at this first step I had no success. After being able to `grep` I'd like doing the actual name change. This is what I tried by now:               ls > try-expression     grep -E '^[0-9]+' try-expression      and with the above I got the right result. Then I tried the next step:               ls | xargs -0 grep -E '^[0-9]+'     ls | xargs -d '\n' grep -E '^[0-9]+'     find . -name '[0-9]+' -exec grep -E '^[0-9]+' {} \;     ls | parallel bash -c "grep -E '^[0-9]+'" - {}      And similar but I got error like 'File name too long' or no output at all. I guess the problem is the way I'm using `xargs` or `find` as expressions in separate commands work well. Thank you for your help


How to disable system beep for non-privileged user

How to disable system beep on Linux? I don't have superuser powers so I cannot recompile kernel/unload module.


When will the support end for SLES 9.4?

I just can't find any description when will the support end for SLES 9.4? **QUESTION** : can someone point me to an URL/anything that says that SLES 9.4 support will end on XXXX.XX.XX?


grep: display filename once, then display context with line numbers

Our source code has error codes scattered throughout. Finding them is easy with grep, but I'd like a bash function `find_code` that I can execute (eg. `find_code ####`) which will provide output along these lines:               /home/user/path/to/source.c          85     imagine this is code     86     this is more code     87     {     88         nicely indented     89         errorCode = 1111     90         that's the line that matched!     91         ok this block is ending     92     }     93 }      Here is what I have currently:               find_code()     {         # "= " included to avoid matching unrelated number series         # SRCDIR is environment variable, parent dir of all of projects         FILENAME= grep -r "= ${1}" ${SRCDIR}         echo ${FILENAME}         grep -A5 -B5 -r "= ${1}" ${SRCDIR} | sed -e 's/.*\.c\[-:]//g'     }      Problems: 1) This doesn't provide line numbers 2) it only matches .c source files. I'm having trouble getting sed to match .c, .cs, .cpp, and other source files. We do use C, though, so simply matching - or : (the characters that grep appends to the filename before each line of code) matches `object->pointers` and messes everything up.


Why can't list file/directory relative to .. from a symbolic link directory (No such file or directory)?

I have a `/usr/tomcat6/logs` directory linked to `/var/log/tomcat6`. When I changed directory to `/usr/tomcat6/logs` and try to `ls` files using a relative pathname `../conf/Catalina/localhost`, a **No such file or directory** error occurs. However, `cd ../conf/Catalina/localhost` works. See the following:               [root@fedora ~]# ll /usr/tomcat*     lrwxrwxrwx. 1 root root 21 Jun 17 15:00 /usr/tomcat6 -> apache-tomcat-6.0.32/     lrwxrwxrwx. 1 root root 21 Jun 17 13:03 /usr/tomcat7 -> apache-tomcat-7.0.16/     [root@fedora ~]# cd /usr/tomcat6     [root@fedora tomcat6]# ll logs     lrwxrwxrwx. 1 root root 16 Jun 17 14:51 logs -> /var/log/tomcat6     [root@fedora tomcat6]# cd logs     [root@fedora logs]# cd ../conf/Catalina/localhost     [root@fedora localhost]# pwd     /usr/tomcat6/conf/Catalina/localhost     [root@fedora localhost]# cd /usr/tomcat6/logs     [root@fedora logs]# ll ../conf/Catalina/localhost     ls: cannot access ../conf/Catalina/localhost: No such file or directory      How could this happened? Is it a bug or special behaviour of symbolic link?


What causes cron to continuously send mail and how can I disable it?

I have a problem on CentOS 6.3 system where the crond process tries to unsuccessfully send mail over and over (at least I think this is what its doing) until the OS eventually generates a "too many files open" error. This computer is not connected to a network. ### Symptoms After running overnight, the system produces a "too may files open" error when a user tries to log in.   If I examine the process list after it has been running for a few hours, I see this trio of processes listed several times (the number or repetitions continue growing as time goes on):               CROND     /usr/sbin/sendmail -FCronDaemon -i -odi -oem -i -t ...     /usr/sbin/postdrop -r      ### Attempted fixes   * I disabled the postfix process, which seems to be related to the mail sending features    * I modified `/etc/crontab` and `/etc/anacrontab`, and changed the line:              MAILTO=root      to              MAILTO=""      Neither of these attempted fixes have resolved the problem. It appears that it's actually the `postdrop` process that is hanging. If I kill it, the other two processes also die. Barring some more elegant solution, my next plan of attack is to replace `postdrop` with a bash script that does nothing and exits to prevent these processes from accumulating. Any advice is appreciated!


Allow users administrative access to some of the KVM VM's

I am running a KVM virtualization server on CentOS 6. How can I allow certain users administrative access (reboot, reinstall, erase) to only _some_ virtual machines, but not other? I am using buth command-line interface and `virt-manager`, and I'd like the access restrictions work for both, but I suppose it won't require additional configuration anyway? If it will, Id be ok with letting restricted users use just `virt-manager`.


How to compile Chromium OS

I know that there is this guide, but every time I tried to compile Chromium OS I never finished. I need some clear instructions to compile Chromium OS project and install it on my machine. There is an abandoned project on GitHub, here: https://github.com/dz0ny/lightdm-login-chromeos


Dual booting with Windows 7 and Fedora 20

I am creating a dual boot system for Windows 7 & Fedora 20. While installing to hard drive I get this error **Installation destination** `Error checking storage configuration`. I have shrunk my hard drive partition to have 30 GB of space. But the installer only shows 1.99 MB available. Now 1.99 MB is the amount of space on my Pen Drive, but the drive the installer picks is my hard drive listed as 479 GB. How do I proceed with my installation of Fedora 20? **using Parted -l** **output::**               Model: ATA WDC WD5000AAKX-0 (scsi)     Disk /dev/sda: 500GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos     Disk Flags:           Number  Start   End    Size    Type      File system  Flags      1      1049kB  106MB  105MB   primary   ntfs         boot      2      106MB   210GB  210GB   primary   ntfs      3      210GB   294GB  84.2GB  primary   ntfs      4      294GB   500GB  206GB   extended               lba      5      294GB   500GB  206GB   logical   ntfs               Model: Kingston DataTraveler G2 (scsi)     Disk /dev/sdb: 4011MB     Sector size (logical/physical): 512B/512B     Partition Table: msdos     Disk Flags:           Number  Start   End     Size    Type     File system  Flags      1      4129kB  4011MB  4007MB  primary  fat32        boot               Model: Linux device-mapper (snapshot) (dm)     Disk /dev/mapper/live-osimg-min: 4295MB     Sector size (logical/physical): 512B/512B     Partition Table: loop     Disk Flags:           Number  Start  End     Size    File system  Flags      1      0.00B  4295MB  4295MB  ext4               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/live-base: 4295MB     Sector size (logical/physical): 512B/512B     Partition Table: loop     Disk Flags:           Number  Start  End     Size    File system  Flags      1      0.00B  4295MB  4295MB  ext4               Model: Linux device-mapper (snapshot) (dm)     Disk /dev/mapper/live-rw: 4295MB     Sector size (logical/physical): 512B/512B     Partition Table: loop     Disk Flags:           Number  Start  End     Size    File system  Flags      1      0.00B  4295MB  4295MB  ext4      still problem is persist here are screen shots DOC link


Advanced logrotate on huge number of files when single instance of logrotate cannot keep up

I'm managing a server which works as a remote log repository for huge number of files. Currently a single `logrotate` instance cannot keep up with this number of logs. What's the best way to accelerate log rotation, possibly running many instances in parallel? Below is the addendum for the clarification:   * Disk I/O is not the problem; also, I'm not losing any logs or entries.   * System is a beast when compared to this job (it's a quad core Xeon with sufficient power) the bottleneck is at compression. One core tops up w/ 1.00 load and cannot finish its compression queue.   * Logfiles are not copied. Only a daily backup is taken to another disk, but again is not a bottleneck.   * I can group the logfiles by patterns. Files are not huge, only they are a lot. I just don't know how to parallelize the logrotate altough I have ideas but unable to find any resources for it. Actually, the core of the question is _does logrotate spawn a child process for every stub in the config file or configuration file?_   * I'm a computer engineer and an experienced Linux user and developer. I also manage a cluster but somehow I'm new at "old school system management" issues. So you can go as technical / hardcore as you can get. I'll do my best to understand it.


What happens to UIDs upon mount of file system

I have a very basic question and still failed to find the answer after ~10 google requests and skimming through my unix textbook, so: Consider a system with 2 hard drives, having root file system at `/dev/sda1` and /home partition at `/dev/sdb1`. Now, a process with UID=1000:GID=1000 wants to mount `/dev/sdb1` file system at `/mnt/backup`. I can imagine 2 scenarios of how it happens: ![enter image description here](http://i.stack.imgur.com/D8peg.png) I wonder, under what UIDs and GIDs he freshly mounted file system is visible: **1.** The UIDs and GIDs might be preserved, as on the picture. ![enter image description here](http://i.stack.imgur.com/Lhcml.png) **2.** The UIDs and GIDs on the mounted file system might be set to the mounting process's UID and GID=1000. If there were no UIDs and GIDs in the file system at all, this case takes place: ![enter image description here](http://i.stack.imgur.com/7WgQL.png) My questions are:   1. In what situations cases 1 and 2 take place? What parameters of `mount` _system call_ determine, which of them takes place?   2. In case 2, how do I determine the actual UIDs and GIDs of the files. In my example both `/mnt/backup/john` and `/mnt/backup/jane` in the mounted filesystem are set to UID=1000, but in fact their UIDs were 1002 and 1003. How do I know them?   3. In case 1 what happens if the Jane's UID=1003 doesn't exist on the system?


How to know which firmware is loaded by kernel?

I have an Intel wireless card driven by `iwlwifi`, and I can see the following message in dmesg:               iwlwifi 0000:03:00.0: loaded firmware version 17.168.5.3 build 42301      But how do I know which firmware is loaded?


why cannot read /dev/console after reboot AIX

I use `< /dev/console` when running Micro-Focus cobol programs in background cron jobs instead of `< /dev/null` because then we don't get an warning about the input file not supporting ioctl. The warning about the input file not supporting `ioctl` means that the script is not able to differentiate between this and a real error as the program returns the same value. Usually (on many different AIX servers) I set up these jobs to run as root because other users do not have permissions to read `/dev/console`. Over several years, I've had several problems that I just don't understand, and searching the internet for many hours hasn't helped. E.g.   1. a server changed, for no apparent reason, from where only root could use `< /dev/console` to where only a non-root user could use `< /dev/console`   2. a server where a non-root user was able to use `< /dev/console` changed after reboot so that only root could use `< /dev/console` The 2nd example is my most recent case. `lscons` shows the console is assigned to `/dev/tty0` and you can login on `/dev/tty0` fine. I don't think anyone has used `swcons` or `chcons` to reassign the console before the reboot. I've tried changing permissions on `/dev/console` & `/dev/tty0` to `666` but still only root can do, without error:               echo TEST < /dev/console      Does anybody understand what is happening or know how to change it so non-root users can read `/dev/console` ? Any suggestions for another device that supports `ioctl` and could be used as a dummy stdin by non-root users? (I suspect that the cobol program only opens stdin but doesn't actually read it when in the background). Permissions now:   crw-rw-rw- 1 root system 4, 0 Aug 20 1999 /dev/console   crw-rw-rw- 1 root system 16, 0 Aug 09 13:39 /dev/tty0 Before I did: `chmod 666` :   crw--w--w- 1 root system 4, 0 Aug 20 1999 /dev/console   crw------- 1 root system 16, 0 Aug 09 13:39 /dev/tty0


What do the device files in /dev actually do?

(Not a duplicate of Understanding /dev and its subdirs and files) I was browsing around my filesystem and for the first time I took a second to analyze my `/dev` directory. I was surprised by the amount of devices files in it, and couldn't make sense of all of them:               max@linux-vwzy:/dev> ls     adsp             disk      fd0u1760  initctl  mem                 root  sg0       tty    tty21  tty35  tty49  tty62    vboxdrv     vcsa2     audio            dri       fd0u1840  input    mixer               rtc   sg1       tty0   tty22  tty36  tty5   tty63    vboxnetctl  vcsa3     autofs           dsp       fd0u1920  kmem     mixer1              rtc0  sg2       tty1   tty23  tty37  tty50  tty7     vboxusb     vcsa4     block            dvd       fd0u360   kmsg     net                 scd0  sg3       tty10  tty24  tty38  tty51  tty8     vcs         vcsa5     bootsplash       dvdrw     fd0u720   log      network_latency     sda   sg4       tty11  tty25  tty39  tty52  tty9     vcs1        vcsa6     bsg              fb0       fd0u800   loop0    network_throughput  sda1  sg5       tty12  tty26  tty4   tty53  ttyS0    vcs10       vcsa7     btrfs-control    fd        fd0u820   loop1    null                sda2  sg6       tty13  tty27  tty40  tty54  ttyS1    vcs2        vga_arbiter     bus              fd0       fd0u830   loop2    nvram               sda3  sg7       tty14  tty28  tty41  tty55  ttyS2    vcs3        xconsole     cdrom            fd0u1040  full      loop3    oldmem              sdb   shm       tty15  tty29  tty42  tty56  ttyS3    vcs4        zero     cdrw             fd0u1120  fuse      loop4    port                sdc   snapshot  tty16  tty3   tty43  tty57  ttyS4    vcs5     char             fd0u1440  fw0       loop5    ppp                 sdc1  snd       tty17  tty30  tty44  tty58  ttyS5    vcs6     console          fd0u1600  hidraw0   loop6    psaux               sdd   sr0       tty18  tty31  tty45  tty59  ttyS6    vcs7     core             fd0u1680  hidraw1   loop7    ptmx                sde   stderr    tty19  tty32  tty46  tty6   ttyS7    vcsa     cpu              fd0u1722  hidraw2   mapper   pts                 sdf   stdin     tty2   tty33  tty47  tty60  uinput   vcsa1     cpu_dma_latency  fd0u1743  hpet      mcelog   random              sdg   stdout    tty20  tty34  tty48  tty61  urandom  vcsa10      I know that the `sd*`'s are my disks and filesystems, but what are `loopx`, `fd0uxxxx`, `sgx`, `vcsxxx` and all the other single files. Most of them are device files according to `ls`. I understand that fully answering this question would require a ton of information, so unless someone can provide a link with a great rundown of the different devices files in `dev` and what they are all used for, I propose we make a CW answer.


Hauppauge TV Tuner Card with Motorola STB and LIRC

I have a MythTV PV VM under Xen which I've spent about 2 weeks getting up and running. Everything seems to be working fine; PCI passthrough gives the card to the guest OS (OpenSUSE 11.4), the digital tuner works fine (I've successfully streamed Live HD TV to my PC), and I've very close to being very happy. BUT, I cannot get LIRC configured for the life of me. I've spent the past 3 nights googling and reading tutorial and how to after another. I've found the firmware (HVR-1600 card), and got it loaded with the lirc_zilog module. It's recognized, and configured (by the Kernel/LIRC). I cannot, however, get it to do the following:   1. I was able to capture IR signals from the stock Hauppauge Remote, but not the one from my DCT-700 STB (when I tried, I simply get a message that the gap length could not be determined, and no dots are shown).   2. I have not been able to get it to transmit ANYTHING. So, here's a quick example of some outputs: `dmesg` output:               ~ # dmesg | grep lirc     [   15.242456] lirc_dev: IR Remote Control driver registered, major 251      [   15.277047] lirc_zilog: module is from the staging directory, the quality is unknown, you have been warned.     [   15.277882] lirc_zilog: Zilog/Hauppauge IR driver initializing     [   15.282904] lirc_zilog: chip found with RX and TX     [   15.283556] i2c i2c-0: lirc_dev: driver lirc_zilog registered at minor = 0     [   15.338267] lirc_zilog: Zilog/Hauppauge IR blaster firmware version 2.1.0 loaded     [   15.339013] lirc_zilog: chip found with RX and TX     [   15.339638] i2c i2c-0: lirc_dev: driver lirc_zilog registered at minor = 1     [   15.369278] lirc_zilog: Zilog/Hauppauge IR blaster firmware version 2.1.0 loaded     [   15.369296] lirc_zilog: initialization complete      An `irsend` test:               ~ # irsend --device=/var/run/lirc/lircd SEND_ONCE dct700 OK     irsend: command failed: SEND_ONCE dct700 OK     irsend: transmission failed      The corresponding `/var/log/messages`               ~ # tail /var/log/messages     Jul 29 10:16:36 lal lircd-0.8.7[1090]: accepted new client on /var/run/lirc/lircd     Jul 29 10:16:36 lal lircd-0.8.7[1090]: write failed     Jul 29 10:16:36 lal lircd-0.8.7[1090]: Protocol error     Jul 29 10:16:36 lal lircd-0.8.7[1090]: error processing command: SEND_ONCE dct700 OK     Jul 29 10:16:36 lal lircd-0.8.7[1090]: transmission failed     Jul 29 10:16:36 lal kernel: [  227.063942] lirc_zilog: failed to get data for code 0, key 9050 -- check lircd.conf entries     Jul 29 10:16:36 lal lircd-0.8.7[1090]: removed client      Relevant portion of `/etc/lirc/hardware.conf`:               #Chosen IR Transmitter     TRANSMITTER="HVR 1600"     TRANSMITTER_MODULES="lirc_zilog"     TRANSMITTER_DRIVER=""     TRANSMITTER_DEVICE="/dev/lirc0"     TRANSMITTER_SOCKET=""     TRANSMITTER_LIRCD_CONF="/etc/lirc/lircd.conf"     TRANSMITTER_LIRCD_ARGS=""          #Enable lircd     START_LIRCD="true"          #Don't start lircmd even if there seems to be a good config file     #START_LIRCMD="false"          #Try to load appropriate kernel modules     LOAD_MODULES="true"      I'm quite sure the `dct700.conf` file is wrong. I copied it from a forum of someone who claimed to have this STB working, but it's for a USB MCE transmitter. Since I cannot get the receiver to record the signal from the remote, I cannot generate my own. SO, if anyone has a similar combination working, or knows someone who does, or sees something wrong and has a suggestion, I would be eternally grateful for any help.


What does dash "-" at the end of a command mean?

Given the following command:               gzip -dc /cdrom/cdrom0/file.tar.gz | tar xvf –      What does the `-` at the end of the command mean? Is it some kind of placeholder?


Which shell I am running on?

When I run `echo $SHELL` the output says `/bin/tcsh` which means that i am running tcsh. But for example when I issue the following command               alias emacs 'emacs -nw'       I get the following error:               bash: alias: emacs: not found     bash: alias: emacs -nw: not found      and when I issue `alias emacs="emacs -nw"` it runs fine! This is confusing since I am running tcsh but the commands are interpreted by bash. What could be the reason?


Virtualenv creation seems to do nothing

I have a problem setting up a Virtualenv on my web host server (to install python modules later on) So far I tried this (over SSH):               wget http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.5.2.tar.gz     tar xzf virtualenv-1.5.2.tar.gz     ~/usr/lib/python2.4 virtualenv-1.5.2/virtualenv.py ~/data/env      and               ~/usr/lib/python2.4 setup.py install      I don't get any errors or output and cannot find the ~/data/env-directory that should be created. What is going wrong? Or what is the next step?


Duplicate selected words with sed and replace it

I have to modify a document containing xml data; one modification I couldn't set up with `sed`. I have to modify the following expressions from:               <Bild href_fmt="Bilder/Bildschirmfoto%202012-06_fmt.jpeg"      href="file:///user/folder/Desktop/Bildschirmfoto%202012-06-18%20um%2013.17.45.png"></Bild>      to:                     My problem: I couldn't duplicate the `Bildschirmfoto%202012-06_fmt.jpeg` to generate the correct new entry. The HTML tag is somewhere in the line, therefore I can't duplicate the whole line... How can I do this with `sed` or other Linux commands?


Check SMTP server capabilities on the command line

I know an SMTP server's URL. I want to know about that SMTP server's capabilities: TLS, password encryption, etc. Evolution Mail knows how to report these. How can I get them from the command line? **UPD**. EHLO output               EHLO yandex.ru     250111.localdomain.ru Hello ac60.localdomain.ru [172.16.2.60] (may be forged), pleased to meet you     250-ENHANCEDSTATUSCODES     250-PIPELINING     250-8BITMIME     250-SIZE     250-DSN     250-ETRN     250-STARTTLS     250-DELIVERBY     250 HELP


If I rm -rf a symlink will the data the link points to get erased, too?

This is the contents of the `/home3` directory on my system:               ./   backup/    hearsttr@  lost+found/  randomvi@  sexsmovi@     ../  freemark@  investgr@  nudenude@    romanced@  wallpape@      I want to clean this up but I am worried because of the symlinks, which point to another drive. If I say `rm -rf /home3` will it delete the other drive?


How to know <root of the kernel source tree>

In https://github.com/facebook/flashcache/ there is a saying > `make KERNEL_TREE=<root of the kernel source tree>` > > This builds both the flashcache.ko and 3 utilities. > > flascache-sa-guide.txt has details on how to create and load flashcache > volumes. > > Mohan Srinivasan Paul Saab What should I wrote to replace ?


Initial delay in typing

I've noticed after I come back to my newly installed Fedora 20 system, there's a delay in typing. For example, if I have a terminal window open, and I leave it alone for a few minutes and return, when I type, it takes multiple seconds for my typing to manifest. It's fine after that, provided I don't wait too long between typing. This happens for any typing, not just the terminal. It could be the password on the lock screen, terminal sessions, web forms in FireFox, etc. My system has 32G of RAM, and it occurs with nothing active, except for a terminal or webpage, nothing significantly taxing. The keyboard is the build in laptop physical keyboard. The laptop is a Dell Inspiron 17R (17RM-16452sLV). Is there a known reason this occurs? How can I diagnose and fix the cause of the issue?


KVM with directory rootfs

I'm currently working on an embedded system design and my test development machine is currently a VM running in KVM. Is it possible to have KVM mount a directory (like a chroot) and use that as the root file system for the VM? I currently have the root filesystem in a single sparse file, and I can mount it via loop to a directory, but when making and testing changes it would be much easier to have the root fs in a directory structure on my local machine.


How can I solve segmetation fault on ns2.35

I am trying to compile `make` on ns2.35 after I add patch of codel algorithm and it gives me this error make[1]: Leaving directory `/home/ashraf/Ns2/ns-allinone-2.35/ns-2.35/indep- utils/webtrace-conv/ucb' Can you please help me?


Bash pipe output to more

I am wondering about some bash environment setting here: is it possible to set stdout of bash as a pipe to /bin/more? You know, like using vi as editor for your commands it should be possible to avoid using Ctrl-PgUp or Ctrl-PgDown for looking on all the output (by default). To be more specific: I _don't_ want to pipe the output of a _single_ command to more like:               $> ls | more     a b c     ...     --more--      BUT: pipe _any_ output of my current session to more, so to get either all output printet as usual just beneath the prompt - or if it's too much, screen- wise.               # automatically piped to more:     $> ls      a b c     ...     --more--      Is there any bash-built-in to accomplish this? EDIT: I wasn't specific enough, sorry for that: I am aware of "script" and command grouping like               (cmdA; cmdB) | less      What I really would like is to automatically avoid getting a 100 page output at once but instead have a more-like behavior of bash'es stdout. As could be accomplished by adding                2>&1 | more      to all commands entered on command promt - just automatically.


Samba daemon hammering CPU on CentOS 5.6 VM on bootup

I have a problem where my Centos 5.6 VM is running _very_ slow on my Win7 machine, and looking at `top` I can see that the Samba daemon `smbd` is sitting at the top of the list hitting the CPU big time, with anywhere up to 65% usage! I have done a stop and start of the service, but for some reason it just comes back and takes all CPU again. I have a Samba share setup on my Win7 machine that points to the CentOS VM to let me access my code, so I need Samba running.               top - 09:18:01 up 21 min,  1 user,  load average: 0.83, 0.95, 0.86     Tasks:  98 total,   3 running,  95 sleeping,   0 stopped,   0 zombie     Cpu(s): 10.3%us,  8.3%sy,  0.0%ni, 29.0%id,  0.0%wa,  8.0%hi, 44.3%si,  0.0%st     Mem:    749148k total,   493376k used,   255772k free,    44448k buffers     Swap:  2064376k total,        0k used,  2064376k free,   208660k cached            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      2728 crmpicco  16   0  133m 3544 1936 R 65.5  0.5   0:59.99 smbd      What would cause this? I use the NetBeans IDE for web development, so could this be hitting the Samba share excessively causing the Samba daemon to behave in this way?


Effect of compiling from source on already installed applications

I use Ubuntu 12.04. Say I have installed `package x` from the repository (with all its dependencies) at version 1.7 but I need some functionality that is only available in version 1.8, so I download the source tar and compile it:               ./configure       make       make install        * Does this overwrite the existing 1.7 binaries?    * If the existing binaries are overwritten, does the package manager reflect the new version (1.8) and can `package x` be updated by the package manager in the future?   * If `package y` has a dependency of `package x 1.8` - will it be satisfied? I have been trying to find a good source online that explains this. If you have any recommendations, please let me know.


How can I determine how directories/filesystems have been mounted?

I have access to a VM which on a different network at work using NIS. (Debian by the way) This VM has about 10 extra /directories in / when I log in. They do not exist on that VM alone, they are publicly hosted directories (I know where to access some of them via Windows shared drives as well). I'm trying to figure out how to create the same directory structure on my own VM where I have root access. But I've been unable to figure out how these were mounted (I'm kind of a beginner at Linux config). I searched the config and init files as best I could and didn't find anything useful, just some dead ends. Using the mount command I only see 3 mounts listed, all in deeper /sub/directories (ie. /home/myuser). Any ideas?


cannot find what has used all the memory

The server has about 24GB memory. By running `free -g` I find the memory is used up                            total       used       free     shared    buffers     cached     Mem:            23         23          0          0          0         18     -/+ buffers/cache:          4         19     Swap:           56          2         53      Then I did some research into what has used up all these memory by `top` then `M`. But it seems the memory is quite free in the `%MEM` column. What can I do to free some memory? This is a server for calculation so it is better not to restart the computer.


Creating and updating the packages for many Debian systems

I'm using a Lenny (Debian 5) for remotely controlled PC's (around 100 PC's) which will be pinging to my apache server. I'm developing a patch twice in a week to keep updated with the latest versions of my code and running it manually in all those PC's. Since they are controlled remotely, for some or the other reasons I will not be able to login and update in few of the PC's and hence the older version will not be present. I wanted to know how can I keep updated my PC with all the patches/ packages getting updated from the server automatically. Thought of using rsync and executing the *.run file in rsync folder from cron for every 3days. But I'm looking one similar to apt-get update. How can this be achieved?


Linux mutex spins

On Solaris I can use `mpstat` to see the `smtx` (i.e., spins on mutex or in other words locks not acquired on the first try) value. This value increasing indicates that swap is being hit too frequently and indicates that you need more RAM. The output of `mpstat` on Linux is not at all like Solaris. Is there any way I can see this (or an equivalent/related) value?


Whats the sense of dbus objects?

Despite reading through tons of Dbus - tutorials, I still struggle to understand the whole concept. In my opinion this was one of the best explanations so far: http://telepathy.freedesktop.org/doc/book/sect.basics.dbus.html The reason to use the DBus is because I want to exchange Data between different programs. In my opinion it would suffice to provide a server or, like named in Figure 2-2 a service. This service provides several methods over an interface, which I share with the client. The client then invokes a method and gets an answer. So what am I missing? Why is there a need of additional objects? _edit:_ I guess its just to stick to the Java conventions of objects respectively classes. Each object represents an instance. Would really like someone to confirm that. _edit2:_ Basically, what is the benefit of the first system over the second?: ![Diagram](http://img5.fotos-hochladen.net/uploads/dbus34r07npwzq.jpg)


What is the function/point of "config.sub"

I'm trying to install some software from the command line. There is a file called "config.sub". Am I supposed to use this for something? I haven't been able yet to find out by searching online what this file is supposed to do. I think part of the deal is I don't know how to ask the question correctly.


Installing Arch on VM - DNS Issues

I have been following the Install Wiki and I have arrived at the part where I need to install X Server. My issue is that I cant install X because my DNS doesnt work. I can ping 8.8.8.8 just fine, google.com does not respond. Running Arch as a VM through Hyper-V               # nano /etc/resolv.conf     nameserver 8.8.8.8     nameserver 8.8.4.4          # systemctl stop dhcpcd.service     #ip link     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noquene state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT mode DEFAULT group default qlen 1000 link/ether 00:15:5d:00:0f:03 brd ff:ff:ff:ff:ff:ff          # ip link set eth0 up          # ip addr add 10.100.0.25/24 dev eth0          # ip route add default via 10.100.0.25      Where should I start in troubleshooting this? I dont mind working out the problem I just dont know what to do.


How to scan for heartbleed vulnerability with nmap from Ubuntu 12.04?

[root@notebook ~] lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.4 LTS     Release:    12.04     Codename:   precise     [root@notebook ~] dpkg -l nmap | grep ^ii     ii  nmap                                          5.21-1.1ubuntu1                            The Network Mapper     [root@notebook ~] wget -q https://svn.nmap.org/nmap/scripts/ssl-heartbleed.nse -O /usr/share/nmap/nselib/ssl-heartbleed.nse     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/tls.lua -O /usr/share/nmap/nselib/tls.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/sslcert.lua -O /usr/share/nmap/nselib/sslcert.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/asn1.lua -O /usr/share/nmap/nselib/asn1.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/stdnse.lua -O /usr/share/nmap/nselib/stdnse.lua     [root@notebook ~] nmap -p 443 --script ssl-heartbleed www.ssllabs.com          Starting Nmap 5.21 ( http://nmap.org ) at 2014-06-25 07:49 CEST     NSE: failed to initialize the script engine:     /usr/share/nmap/nselib/stdnse.lua:59: attempt to index field 'socket' (a nil value)     stack traceback:         /usr/share/nmap/nselib/stdnse.lua:59: in main chunk         [C]: in function 'require'         /usr/share/nmap/nse_main.lua:95: in main chunk         [C]: ?          QUITTING!     [root@notebook ~] cat /usr/share/nmap/nselib/stdnse.lua     ...       50 --- Sleeps for a given amount of time.       51 --       52 -- This causes the program to yield control and not regain it until the time       53 -- period has elapsed. The time may have a fractional part. Internally, the       54 -- timer provides millisecond resolution.       55 -- @name sleep       56 -- @class function       57 -- @param t Time to sleep, in seconds.       58 -- @usage stdnse.sleep(1.5)       59 _ENV.sleep = nmap.socket.sleep;     ...      **My question** : What is the problem? The many "wget's" before the nmap is because nmap said before it's missing modules.


How to get text at start up of terminal

![Just as the name shown in this image](http://i.stack.imgur.com/0G7G9.jpg) How to get text at start up of terminal as shown in this image.It should show whenever i open terminal.


Double port forwarding - SSH

**NOTE:** _I'm not explaining why I want to do this. But here is the requirement._ **There are 4 hosts. Host A, Host B, Host C, Host D**   1. Host A is running some application which can be accessed at port 8001   2. I forwarded port 8001 of Host A to 8002 of Host B.   3. Host B is accessible only using Host C. So, again, I forwarded port 8002 of Host B to 8003 of Host C. Now, from Host D...when I say: `https://HostC:8003` -- it should take me to the application running on Host A. But I'm not able to do that. But what I could do was, I forwarded port 22 of Host A to port 7777 of Host B. Then, from Host C, I ran:               $ ssh Host B -p 7777 -L 6666:localhost:8001      Doing this, `ssh Host B -p 7777`, took me to a command line on Host A. Hence port 8001 of Host A was directly forwarded to 6666 of Host C. Now, from Host D, `https://Host C:8001` worked! But, I want to do it using the former way.   * How can I do that?   * What am I missing here?


How to build a tool with specific libraries without breaking Fedora?

This is probably a noob question, but so far never needed to deviate from the standard Fedora 16 core development components. I am needing to build clutter- mx project, but this library requires glib-2.0.32. Along with this, glib-2 needs libffi-3.0.11. I can download the source and build these libraries, however, I am concerned that installing them will break the rest of the system. The clutter-mx project uses autotools and looks for the glib-2 version. The questions are:   1. If I build and install the new components, and something goes wrong, can you get back using yum, or something similar?   2. Is there a way of getting autotools to look in another directory for the installed headers? Thanks.


GUI log viewer for logs produced by Apache log4j

I'm looking for a good graphical tool for view and analyze log files (local and remote) that works on Fedora 15.


awk to split the input file into 2 files(one for duplicated values and one for unique values)

I have an input file like below.               file.txt     14 2.692022 author1 0     14 2.57826 author2 1     229 2 author3 2     323 2 author4 3     514 2.0625 author5 4      I am trying to split the file with the duplicated values as one file and the rest of values as another file. So, for the above input, I am trying to generate files like,               file1.txt     14 2.692022 author1 0     14 2.57826 author2 1          file2.txt     229 2 author3 2     323 2 author4 3     514 2.0625 author5 4      I am not able to figure out how to use awk for this purpose.               awk '{print $1}' file.txt | uniq -d > file1.txt      The above command gives me only the duplicated values in a file. Also, it gives me only the field1 but not all the 3 fields.


Is there a way to check which process terminates first during reboot

Assuming I have 2 processes running. Is there any way for me to check which process terminates first during reboot/shutdown? From this link, it tells about appending boot to a file. Yet, I still don't know which process is terminated first between my 2 processes. Is there any way for me to do find out? Maybe a bash script or a .conf file. I'm applying this to CentOS, Redhat, Ubuntu, Solaris, HPUX.


Is there a way to demux a h264 video stream from an flv (h264, aac)?

Using `ffmpeg` to demux an h264 stream from a .flv video always gives me a stream which I cannot remux into a .mp4 container (using either `MP4Box from package *gpac),` or `ffmpeg`). Here is the demuxing command which produces the "invalid" stream.. ( _Unknown format_ )               ffmpeg -i "(h264-aac).flv"  # get stream info       # Stream #0.0: Video: h264, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 259 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc          ffmpeg -y -map "0.0" -vcodec copy -an -i "(h264-aac).flv" \                                              "(h264-aac).flv.h264"       I've also tried it with: -f h264, but get the same error. The above command works when run against a video in a `.mp4` container, so maybe this is something specific to `flv`(?). The closest I've come to isolating the h264 video stream is with the following command; but it wraps the stream in an `flv` container which has lost its aspect ratio....               ffmpeg -y -map "0.0" -vcodec copy -an -i "(h264-aac).flv" \                                              "(h264-aac).flv.NEW.flv"       Is there some way to grab this video stream? PS. I've treid with several different input .flv vids, ...same error.


Distro with pip and npm as package managers?

Is there an attempt of distro around that for Python and Node code ( and Ruby , Lua ) would use Pip, NPM and rubygems and luarocks respectively ? It could simply work as a passthrough from native package manager. Say, for example, if i did "aptitude install" on a python package, apitude would be smart enough to go and fetch it using pip from pypi.python.org or a distro specific mirror with "stable" versions ( with an option to use the latest )


How to match stream against white-list and black-list?

How can I duplicate a pipe stream (output from another program) so that for every line, I can check whether it matches independent regular expressions (ideally, reuse a `grep` command with options like `-i` etc.) but process results of each expression separately? I want to define exit code from my `check` function as follows:   * no line in stream matches `blacklist`; AND   * at least one line in stream matches `whitelist` I want to process lines in memory without storing them to file, report exit code and pass original stream to another program using pipes (logging `whitelist` matches to `stderr` or elsewhere would be useful too). Usage would look like:               fetch-big-stream | check whitelist blacklist | cat     exitcode=$?      where `fork` duplicates lines, `whitelist` and `blacklist` are functions and `check` passess copy of stream to each separately and terminates once exitcode can be determined before `EOF`. There is also a problem with `|` implementation that does not propagate non-zero code.


Mac 10.9.1 // Gerris installation //

I am trying to install Gerris . The website is : http://gfs.sourceforge.net/wiki/index.php/Mac_OSX_Installation I followed the instructions. But I could not install Gerris Dependencies. I installed Xcode, Command line tools, Xquartz as the page suggests, but about brew not quite sure because of what terminal says for the steps below.As page says I make a directory.               % cd     % mkdir soft      As page says :Paths               For installed software to be properly localized, various environment variables have to be set accordingly in ~/.bashrc     % export PATH=$PATH:$HOME/soft/bin     % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/X11/lib:$HOME/soft/lib     % export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/X11/lib/pkgconfig/:$HOME/soft/lib/pkgconfig     Note: make sure that the file ~/.profile contains the line     source ~/.bashrc     for these changes to be taken into account.      I created `nano ~/.bashrc` and included the lines:                   % export PATH=$PATH:$HOME/soft/bin         % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/X11/lib:$HOME/soft/lib         % export       and pressed ctrl+X and then I created `nano ~/.profile` and include `source ~/.bashrc` on the last line and pressed ctrl+X. But at this stage below I stuck. Gerris dependencies Now that brew is installed, almost every dependency needed by gerris can be installed in just a single command line:               % brew install gtkglext     % brew install gnuplot     % brew install gawk     % brew install gsl     % brew install gfortran     % brew install open-mpi     % brew install proj     % brew install netcdf     % brew install ode     % brew install fftw     % brew install ffmpeg --with-theora     % brew install coreutils     % brew install autoconf     % brew install libtool     % brew install automake      When I type brew install gtkglext the terminal says               samires-mbp:~ samirebalta$ brew install gtkglext     -bash: brew: command not found      I did `~/.bashrc` and `~/.profile` what is wrong I do not know?


Calling a script on machine shutdown

I want to call a script on machine shutdown and restart. I have written code like               #! /bin/bash     #chkconfig: 0 6 1 1     #description: Description of the script     # processname: killfoo     # this script starts and stops foo          # Some things that run always     LOG_FILE="/tmp/killfoo.log"          log() { while IFS='' read -r line; do echo "$(date) $line" >> "$LOG_FILE"; done; };     exec > >(tee >(log))     # Carry out specific functions when asked to by the system     case "$1" in       start)         echo "Nothing to done"         ;;            stop)         echo "Stopping script killfoo"         pkill   -9 foo >> $LOG_FILE 2>&1              ;;       *)         echo "Usage: /etc/init.d/killfoo {stop}"         exit 1         ;;     esac          exit 0      I created file /etc/init.d/killfoo having executable permission. I have enable this script for run level 0,6.               chkconfig --add killfoo     chkconfig --level 6 killfoo on      But script is not getting executed on machine restart. What could be the problem ?


Have to run Repair-Boot after booting windows

I have grub installed as my boot loader for dual booting windows 8 and Ubuntu. It works fine as long as I'm only booting Ubuntu but as soon as I boot windows, something stops working. The next time I reboot my machine, there is no grub menu, nothing. My BIOS seems to think there is no operating systems installed. I am working around this using the bootable USB I used to install Ubuntu to run repair-boot. After running it, I have the grub menu back and I'm back at the start. I know very very little about anything Linux so please keep it simple.


How to install drivers for intel GMA 3600 intergrated graphics system?

I am currently using crunchbang 11 32bit, on a laptop with Atom D2500/GMA3600. Does anyone know how to install a more modern driver - rather than the gma500? Is this even possible?


Debian/kfreebsd VirtualBox guest additions

I'm trying and failing to install the virtualbox guest additions for a unstable Debian/kfreebsd virtual machine running in VirtualBox. Without the guest additions, the idle process pegs one of my CPU cores. I've tried to install the `virtualbox-guest-additions-dkms` package, but that depends on `virtualbox-guest-utils` which apparently isn't packaged for Debian/kfreebsd. I've grabbed the `virtualbox-guest-additions-iso` package and tried to compile that but no luck there either, even with the kernel-headers installed. I've also tried install `kfreebsd-9.2-source` and compile the iso package and the source package that way but I only get "no targets found". VirtualBox does not come with FreeBSD guest additions, but there are guest additions for FreeBSD in the `emulators/virtualbox-ose-additions` port on FreeBSD. I'm looking for the equivalent of this port on Debian. Anyone have any thoughts?


Ubuntu use compiled package instead of apt-get

I have a compiled binary specifically sun Oracle java that I am using instead of Ubuntu`s apt-get version of java ( what ever it may be ). I am installing an apt-get package ( maven ) and would like apt-get to use the version of java I have manually installed I can not install any more packages or tools on the system. I have what ever Ubuntu LTS 12.04 comes with.


Path independent shebangs

I have a script that I want to be able to run in two machines. These two machines get copies of the script from the same git repository. The script needs to run with the right interpreter (e.g. `zsh`). Unfortunately, **both** `env` and `zsh` live in different locations in the local and remote machines: ### Remote machine               $ which env     /bin/env          $ which zsh     /some/long/path/to/the/right/zsh      ### Local machine               $ which env     /usr/bin/env          $which zsh     /usr/local/bin/zsh      How can I set up the shebang so that running the script as `/path/to/script.sh` always uses the `Zsh` available in `PATH`?


Strange message at Debian login. What does it mean?

In an attempt to learn more on the command-line I added Debian-7.4-Standard to my Acer-Aspire-One laptop. I am not sure as to what I did exactly, but after I managed to install the non-free firmware and manually installed network- manager to get a wired connection that worked well enough to use `apt-get update` and `apt-get dist-upgrade`, I started to see a strange message on my login prompt after I had booted into my Debian OS. I wrote out a copy of it and it looks like this on my login prompt:               Debian GNU/Linux 7 debian tty1          debian login: [   17.63024] ieee80211 phy0: brcm_ops_config: change monitor mode: false (implement)     [   17.630399] ieee80211 phy0: brcms_ops_config: change power-save mode: false (implement)     [   17.631562] ieee80211 phy0: brcms_ops_bss_info_changed: qos enabled: false (implement)      What does this mean? Is this a problem I need to worry about? If I hit enter the login prompt returns to just the usual `debian login:` prompt and I can login normally. * * * **Update:** I just noticed that when there is no WiFi signal my login prompt acts in the normal way. I am only seeing these messages when a WiFi signal is available.


Is there a system call to bind a file descriptor directly into another?

A read() & write() loop would probably be as good as what I'm looking for, but nevertheless is anything like that around or is it impossible because of an obstacle I didn't envisage ? I'm curious


How can I force the use of a specific binary when running a script

How can I force a specific binary to be used when executing a bash script? I have a bash script which uses the "php" binary. There are several php versions on my computer. The main php binary, as configured via the PATH variable, is not the one to be used in this case. Normally the script will be executed like this:               ./script.sh      I need something like this:               php=/usr/bin/php ./script.sh      NOTE: It is not an option to temporary change the PATH variable just for this command, because this will affect other dependencies. Hardcoding it in the script is also not an option, because the script is used by multiple people. So when other people execute the script it should just use the main php binary as specified in the PATH variable. I don't want it to be accessible via a variable. I actually want to specify the exact location to look for the binary. Just like it would normally do by using PATH, only now for one single binary with the absolute path to it. If this script calls another script, that second script also needs to use that php version. –


Find files that were not installed by the package manager

I'd like to get a list of all files in my Gentoo Linux system that were not installed by the package manager (Portage). This is because I want to keep my system as clean as possible, removing all useless files lying around. Let me tell you what I've tried until now. First of all, I generate the list of all files that belong to some package tracked by Portage:               equery files "*" | sort | uniq > portage.txt      Then I generate the list of all files on my system, except those that I don't care about:               find / \( -path /dev -o -path /proc -o -path /sys -o -path /media \               -o -path /mnt -o -path /usr/portage -o -path /var/db/pkg \               -o -path /var/www/localhost/htdocs -o -path /lib64/modules \               -o -path /usr/src -o -path /var/cache -o -path /home \               -o -path /root -o -path /run -o -path /var/run -o -path /var/tmp \               -o -path /var/log -o -path /tmp -o -path /etc/config-archive \               -o -path /usr/local/portage -o -path /boot \) -prune \               -o -type f | sort | uniq > all.txt      Finally, I get the list of all files that are not tracked by Portage:               comm -13 portage.txt all.txt > extra.txt      Some statistics:               wc -l portage.txt all.txt extra.txt       127724 portage.txt        78371 all.txt         8438 extra.txt      As you can see I still get more than eight thousands extra files. I'd like to reduce that number, in order to focus more on files that really need to be deleted. I noticed that in `extra.txt` there are thousands of files in a small number of directories, such as `/usr/lib64/gcc`, `/usr/lib64/python2.7` and `/usr/lib64/python3.2`. The `/usr/lib64/gcc/x86_64-pc-linux- gnu/4.6.3/crtbegin.o` file, for example, is not in `portage.txt` because, in its place, there is `/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/crtbegin.o`. On my system `/usr/lib` is a symlink to `/usr/lib64`. So it seems that I need to properly handle symlinks to get better results. Perhaps by adding in `portage.txt` all files they point to. I don't really know how to do that. Also, why `portage.txt` is bigger than `all.txt`? Shouldn't be the opposite since files tracked by Portage are a subset of all files in my system? Finally, am I forgetting any other location in the `find` command that should be also excluded?


Why might tmux only be capable of attaching once per shell session?

I'm using tmux on a Fedora 8 server (workplace restriction) to monitor several boxes on a stress rack. I noticed that I can only attach to my detached `tmux session` once per shell session. In order to reattach, I must kill the terminal session and start another one, otherwise my `attach` command simply hangs (although, `Ctrl`-`b`,`d` detaches from the hung command). Has anyone seen behavior like this before? Any guidance or pointers to references would be greatly appreciated.


Xen, bridge and multiple IPs on CentOS

There's a new server that is assigned 5 IP addresses. I want to use Xen to run several VMs with various services. This is my first attempt to install Xen, I use this tutorial as a guideline. Stuck in the very beginning: they talk about replacing a single ip on an eth0 with a bridge `br0`. My server has 5: `eth1` and 4 aliases `eth1:1` .. `eth1:4`. How should the network config look like?   1. bridge that replaces eth1 completely, and then 4 aliases added to the bridge?   2. bridge can only replace a single IP out of the 5? Pardon my lame questions, first time in this forest.


Does Live Linux CD in general have safe handling of Windows NTFS files

I was reading this article - how do I Access or mount windows NTFS partition in Linux that mentions: > NTFS3G is an open source cross-platform, stable, GPL licensed, POSIX, NTFS > R/W driver used in Linux. It provides safe handling of Windows NTFS file > systems viz create, remove, rename, move files, directories, hard links, > etc. So, is it compulsory to have NTFS3G on a Live Linux CD so that when I am moving my files from one NTFS partitions to another NTFS partitions of a disk will ensure that it will not corrupt the files in the NTFS partitions? Or in another words, does a Live Linux CD or DVD in general (without NTFS3G) provide safe handling of Windows NTFS file operations (such as moving files)? Also does it apply on a certain version of NTFS too?


Delete everything not matching this pattern 'something.swf' in txt file

Can `sed` or `awk` do this, what I want do to is delete everything not matching this pattern `'something.swf'` It doesn't need to be these commands. And im kind off new the text processing via the terminal so I would prefer if it didn't just display the output but save it to a txt file. ### Example. On an input like:               Hey stackoverflow im 23 years old 'lol.swf' and '33.swf'      It should output:               'lol.swf'     '33.swf'


How to mount a filesystem from a given USB bus:device

Recently I bought a new smartphone (with Android). When I connect it to my laptop, the (gui)file manager (PCManFM) recognize it and show me the filesystem at route `gphoto2://[usb:001,003]`. But I can't found it in a terminal (nothing in `/mnt` nor in `/media`). But this is the output of `lsusb`:               Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 002: ID 046d:c05a Logitech, Inc. Optical Mouse M90     Bus 002 Device 002: ID 04f2:b1d8 Chicony Electronics Co., Ltd      Bus 001 Device 003: ID 0fce:0171 Sony Ericsson Mobile Communications AB       How can I mount it knowing the bus and device numbers?. (001:003 in this case). My OS is Debian Wheezy. The output of the `mount` command:               sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)     proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)     udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=497357,mode=755)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)     tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=405696k,mode=755)     /dev/disk/by-uuid/ec90e556-b90e-467c-80b6-bde9048e6686 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)     tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)     tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=2486440k)     rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)


Prevent focus stealing in Awesome WM, especially from Skype

When I use KDE with Awesome WM and get a new message in Skype, Plasma Desktop steals the focus. This drives me crazy as I cannot just continue typing in my current window. Is there some way to prevent this for any open window? It seems that such a focus steal is prevented by Awesome WM or Plasma, but the window switcher from Plasma still highlights the window. Therefore, the Plasma control bar (the one at the bottom) is un-hidden and therefore stealing the focus itself. When I did a `killall plasma-desktop`, the focus stealing stopped. However, I also killed `plasma-nm` and other things that I'd like to use.


Set difference from two files in unix

I am looking for an efficient way to achieve set difference from 2 files. I do know that `grep -vxF -f setA setB` gives me B - A. This is what I want, but my files are as follows:               setA:     2     4     5     6          set B:     1 123     2 abc     3 def     4 hij      I want the set difference to be calculated based on the first column of set B; hence the expected output for B - A would be:               1 123     3 def      Any pointers on how to achieve this?


Linux equivalent to ReadyBoost?

Is there a kernel module or some other patch or something similar to Windows' ReadyBoost? Basically I'm looking for something that allows disk reads to be cached on a Flash drive.


Is there a web based converter between rwx and the octal version?

I can never remember what the conversion is from something like `rw-r--r--` to `644`. Is there a simple web based converter between the 2?


Remove all files without a keyword in the filename

I have a list of files in the following fashion:               > file1.jpg      > file1_orig.jpg      > file2.jpg      > file2_orig.jpg      I want to keep all the files with the extension _orig.jpg and discard those without. How can this be achieved using bash?


Why does 'find -delete ' delete all files in a directory recursively

So the following behaviour of unix find just cost me dearly:               > touch foo     > touch bar     > ls       bar  foo     > find . -name '*oo' -delete     > ls     bar     > touch baz     > ls     bar  baz     > find . -delete -name '*ar'     > ls     > #WHAAAT?      How does this make sense?


Availability of software during update?

Imaging I am running a mail server, e.g. exim4 (or a database, a syslog daemon...). Now, while updating this package I would assume the application has to be stopped or at least restarted after update. If one would send an email during this time, it would fail. Is this case considered during updates, are there any countermeasures taken or is it up to a software sending mails to send the mail again later?


What is "System Memory " displayed in nmon in AIX?

I have a host with AIX 6.1 (6100-04-02-1007) upgraded from AIX 5.1 with Veritas Storage Foundation 5.1. Since the upgrade from AIX 5.3 to 6.1, Run vx services means a lots of memory consumed that I can not explain. This memory appears in 'nmon' as System (see below System 41.2%). If I do not start Veritas it is <20%. Whay does mean that "System" memory? How can I know what is consuming this memory?                Memory ───────────────────────────────────────────────────────────────────────               Physical  PageSpace |        pages/sec  In     Out | FileSystemCache      % Used       93.9%     10.7%  | to Paging Space   0.0    0.0 | (numperm)  3.4%      % Free        6.1%     89.3%  | to File System    6.0    0.0 | Process   49.3%      MB Used    7695.0MB   871.5MB | Page Scans    20430.7        | System    41.2%      MB Free     497.0MB  7304.5MB | Page Cycles       1.5        | Free       6.1%      Total(MB)  8192.0MB  8176.0MB | Page Steals       0.0        |           ------                                   | Page Faults   10066.8        | Total    100.0%      ------------------------------------------------------------ | numclient  3.4%      Min/Maxperm     237MB(  3%)  7105MB( 87%) <--% of RAM        | maxclient 86.7%      Min/Maxfree     960   1088       Total Virtual   16.0GB      | User      49.7%      Min/Maxpgahead    2      8    Accessed Virtual    7.5GB 47.2%| Pinned    41.3%


possible spots to configure BIND-DNS forwarders

i'm investigating our BIND's configuration and can not figure out how it is aware of it's next name server to ask for some domain he's not authorative server for... e.g. home domain is 'workgroup.lan'   lookup `dig www.google.com` answer > ;; QUESTION SECTION:   >  ;www.google.com. IN A > > ;; ANSWER SECTION: [...] > ;; AUTHORITY SECTION:   >  google.com. 87465 IN NS ns1.google.com. [...] > ;; Query time: 4 msec   >  ;; SERVER: 127.0.0.1#53(127.0.0.1)   >  ;; WHEN: Tue Aug 28 15:56:08 2012   >  ;; MSG SIZE rcvd: 220 But who / what told him to ask other name servers? Or does it is the default behaviour? May it have something to do with that 'root.hint'-file that is responsible for the '.'- (root-) zone containing IPs of root-nameservers?


Screen: Resuming most recent screen? Making selection easier?

I have a couple of questions regarding screen: When I type `screen -r`, I get the following:               There are several suitable screens on:         25154.tracks    (Detached)         29278.mywork    (Detached)         29138.mywork    (Detached)         30915.mywork    (Detached)         20065.mywork    (Detached)     Type "screen [-d] -r [pid.]tty.host" to resume one of them.      I'm not sure, but I believe most of these screens are old, since I haven't used screen in some time, and I just accidentally detached from one. With this, my questions are:   * Is there a way to resume the **most recently** detached screen?    * How do I "delete" older screen sessions?   * Is it possible to display the date and # of screens within each session?   * Is there a way to temporally associate aliases to the screens listed by `screen -r` to facilitate their choice? For example, it would be great if `screen -r` listed screens as follows: > >     There are several suitable screens on: >     [1] 25154.tracks  (Detached) >     [2] 29278.mywork  (Detached) >     [3] 29138.mywork  (Detached) >     [4] 30915.mywork  (Detached) >     [5] 20065.mywork  (Detached) >     Choose  one to resume: >   And then I could just type 1,2,3,4 or 5 without having to type the full `pid` of the screen I want to resume. Is there anything that would do the trick?


How to disable gzip compression with wget?

There are other questions asking how to _enable_ gzip compression with wget, and lots of web pages out there telling how to do this, but I need the opposite. I'm trying to locally mirror a site, and I'm just getting the home page as a gzipped file, which in turn breaks the recursion, so I can't get the whole site. I can gunzip that file, but that still doesn't give me a recursive download of the whole cotton-pickin' site. How do I turn off or prevent gzipping? _**EDIT_** : The exact command I issued is               wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com --reject png,jpg,jpeg,gif  --progress=dot --wait=7


Linux SSH logging via PUTTY

I have Linux console, managed from Windows. Can login to Linux console from `MSTSC` service of Windows, as `xrdp` is installed on Linux.   However I cannot login via Putty with SSH connection. It's displaying error as 'Access denied'. This error started to occur after I abruptly stopped the execution of `rsync` operation with `Ctrl`+`C` which I started from Putty. Logging in as user: root   Operating System: Fedora 13 What might have gone wrong?


Why doesn't NTP increase polling interval when using a GPS/PPS receiver and internet servers?

I have a Debian system that is used as an NTP server. It queries several servers on the internet and also has a GPS receiver with PPS output for precision timekeeping. If I don't use the GPS receiver, NTP gradually increases the polling interval from the initial interval of 64 seconds up to the default maximum of 1024 seconds, typically within an hour or two. This is normal behavior and generally considered polite since it minimizes the amount of queries made to the internet servers while still keeping the local clock in sync. However, when I connect the GPS receiver and add the appropriate lines to the `ntp.conf` file to allow NTP to use it as a source, the behavior changes: even though I have not changed any of the individual `server` entries for the internet servers, their polling interval does not increase and remains fixed at 64 seconds even after days go by. The PPS signal keeps the local clock well-disciplined (`ntpq -p` reports an offset of 0.000 ms with a jitter of 0.002 ms, with all the internet servers within about 2 ms), while the tally codes in `ntpq -p` confirm PPS discipline and show, as expected, that most of the internet servers are selected as "truechimers" while there are occasionally a few outliers. **In short** : everything appears to be working normally as expected, with the exception that the polling intervals for the internet servers do not increase. Why not? I can manually force the polling interval longer by putting, for example, `minpoll 10` in the `server` lines for the internet servers, but I'd much rather have NTP auto-manage the polling interval of internet servers when PPS is enabled, just like it does when PPS is not used. I currently have NTP set to check the PPS driver with `minpoll` and `maxpoll` of `4` (16 seconds). However, I have tested the configuration without the forcing `minpoll` or `maxpoll` on any `server` line, including that for the PPS driver. Here is the relevant portion of my `ntp.conf` file:               # Drift file     driftfile /var/lib/ntp/ntp.drift          # PPS Driver (check every 16 seconds)     server 127.127.22.0 minpoll 4 maxpoll 4     fudge 127.127.22.0 refid PPS          # Internet servers. Use iburst to get quick sync on startup.     # Server is located in Switzerland, so choose Swiss or German     # primary time servers and members of the Swiss NTP pool.     #     # At least one "prefer" server is needed for PPS to work properly.     # See <http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver22.html>     # "This driver is enabled only under one of two conditions..."     server ntp.metas.ch iburst prefer     server ptbtime1.ptb.de iburst prefer     server ptbtime2.ptb.de iburst prefer     server ptbtime3.ptb.de iburst prefer     server 0.ch.pool.ntp.org iburst     server 1.ch.pool.ntp.org iburst     server 2.ch.pool.ntp.org iburst     server 3.ch.pool.ntp.org iburst


How to install patterns and packages at the same time?

How can I install package patterns (e.g. "C/C++ development tools") and packages (e.g. "mercurial") at the same time? Currently, two commands are necessary; for example, the installation instructions I wrote for `sketch- frontend` are,               sudo zypper install -t pattern "devel_C_C++" "devel_java"     sudo zypper install java-1_6_0-openjdk-devel mercurial      [ link ]. _(motivation)_. It's true one only needs two commands, but on machines with slower internet connections (or slower processors), not having the second command automatically continue is annoying. Also, the user _does_ need to be prompted for package resolution, so just adding the `\--non-interactive` flag is not an option. Thanks!


Configure the fields of the Rmail summary

How do I configure the fields of the Rmail summary? The code is in `rmailsum.el`, but I just can't find the place! For example, the first column in the Rmail summary seems to indicate... mail number? I can't say I need this information ;) so how do I specify not to show it? Or, if there is no such option, can you find the place that actually prints it, in the code?


How to change the language for date command?

I'm using `vnstat` together with `conky`. To show the monthly traffic I'm mixing `vnstat` and `grep` to find the month. The command to collect the data is               ${execi 3600 vnstat -m -i wlan0 | grep "$(date "+%h")" | awk '{print $3 $4}'}      but the problem is that `vnstat` returns the month in English (Dec for December) and `date` returns it in Portuguese (Dez for Dezembro). So my command is not working for the monthly traffic. Any help?


Give a Root owned folder web read and write access

I have an Ubuntu server for a client I am working on, doing development work. I have root access and they created a new vhost `blog.domain.com` so when I log into it with WinSCP it list the files and there owners are `Root` user. So now my PHP scripts are not able to write or do anything, what can I do or change to make my PHP scripts be able to read and write in this directory as they need?


Crontab Triple Redirect

I have a very basic understanding of redirects, but I have come across a cronjob with redirects which I do not understand.               00 19 * * 1-5 /apps/app/scripts/doit.sh a np cron > /apps/app/scripts/doit.log > /dev/null 2>&1      I see three redirects. I was going to write down my best guess here, but I can't form a full picture. I would appreciate it if someone helped me understand in STDOUT and STDERR terms. My shell is ksh:               :> ps -p $$       PID TTY          TIME CMD     23947 pts/0    00:00:00 ksh


Printing through a Samba server without recording the password in plaintext

I need to access a printer through a Samba server. In CUPS, I could make it work by entering a device location such as `smb://username:password@hostname/printer_name`. However, it would mean for my password to be retained in cleartext in a configuration file, which I would like to avoid (even though it is not accessible to regular users). Is there a way to record my password through the KDE wallet, or to make the Samba server ask for a password everytime?


How to make UEFI bootable usb disk from bios bootable iso

Suppose you have an iso image that contains a bios bootable partition. You can write this image to a usb disk In linux you could do this for example with               dd if=pmagic_2013_02_28.iso of/dev/sdc1      Your USB disk is now bootable on computers with bios. However on my UEFI system, the usb disk does not boot. How can you make it EFI bootable?


Is there a way to add some info about time/date to TTY prompt?

If you have a graphical display manager, you can notice date and time there, but I haven't seen such a thing when it comes to TTY. If I want to check the current time (or date) I have to log in. It's a little bit annoying, especially in the morning. :) I know that I can add the two parameters `\t` and `\d` to `/etc/issue` file, for time and date respectively, but this solution doesn't refresh the time. I thought maybe there's a way to add a script to the /etc/issue , but I couldn't find anything useful. Is there a way to add time/date to the prompt?


GNU screen: print a detached session to stdout

I just want to have a quick overview of my detached GNU `screen` sessions. Is it possible to dump the current content to stdout ? Something like               screen --print SESSION_NAME > file.txt


HPLIP spitting out raw data when I attempt to print

We got a new printer (HP m1212nf) as it was stated on the hplip site to be supported. Printer has been tested in windows so we know it works as well as it's network setup. Current system I am attempting to set this network printer up on is Debian 6 squeeze fully up to date. I downloaded the newest HPLIP from their site. Ran the .run file and followed directions. Installed the prerequisites and ran and hp-check to make sure all was included. hp-setup was ran where I added the printer. I tried a test page and it came out as raw pdf data. I then followed with a simple few words from gedit. Same thing, pages of rubbish. Tried a PDF file and I got 6 pages of junk(raw pdf). Not exactly sure what to do in this situation. My system does connect, but it seems the printing is getting distorted someplace. any ideaS?


Internet connection drop alert

What software is there that will play an alert (PC speaker) when there isn't any internet connectivity for 5 minutes? My switch/router seems to disconnect every few days, and I want to reset it when it happens.               PC          -- TP-Link switch/router -- FO     192.168.x.1 -- 192.168.x.2 / x.y.z.a -- a.b.c.d


Arch Linux cannot boot

I have a WD My Passport USB 3.0 500 GB HDD I have successfully installed various OSes like Ubuntu, Pinguy, Mint etc. but so far I'm unsuccesfull in installing Arch Linux. I used the net install CD and the installation is smooth, only when I reboot and boot off my hdd I get an error saying "cannot find filep" (something along similar lines) and when I try booting again (without a reboot), I get: `error 18 and and boot cylindar size exceeds maximum value type` error. I tried `rootdelay=8` from the Begginers' Guide on the Arch Wiki and after scavenging through forums even enabled usb in the hook file while installing. I still cant boot. If its of any further help I have dual boot windows 7 and Ubuntu on my laptop. My usb is partioned as following: ![enter image description here](http://i.stack.imgur.com/bOWTW.png) here is my menu.lst http://pastebin.com/FdAiHnXZ and the errors ![enter image description here](http://i.stack.imgur.com/uFe0I.jpg) ![enter image description here](http://i.stack.imgur.com/hC6Ov.jpg)


bash string extraction

I would like to extract the 2nd field from the last part of the following strings:               foo_1.103.debug_xx.ver21-inc-1          --> string extracted "debug_xx"     foo_1.103.1.0.release_32_xx.ver21-inc-1 --> string extracted "release_32_xx"     foo_1.103.1.0.release_xx.ver21-inc-1    --> string extracted "release_xx"      Any help will be appreciated.


How to read environment variables of a process

Linux's `/proc/<pid>/environ` does not update (as I understand it, the file contain the initial environment of the process). How can I read a process's _current_ environment?


How do I get GrindEQ (Latex plugin for Word) to work with Word in Wine?

GrindEQ is a plugin for MS Word. It allows one to type LaTeX code into a Word document, then export that into Word's formatting (converts equations into Equation Editor equations, and takes care of labelling). I want to get GrindEQ working in Linux under Wine. I have MS Word 2007 running in Wine, and I have installed GrindEQ into MS 2007 in Wine. However, GrindEQ does not work. I get an error "Can't find DLL entry point # in oleaut32.dll" I don't really know what to do! Any suggestions? GrindEQ's website says people have gotten GrindEQ to work with Wine+Linux but they do not provide support to do this. Thanks.


Configuring CUPS PDF writer for PDF/A output?

Can the PDF pseudo-printer in CUPS be configured to emit PDF/A files? If so, how to do it? I'm using CUPS 1.5.3-5 and CUPS-PDF 2.6.1-6 as provided by Debian Wheezy/7.0. Despite CUPS PDF Format - Documentation claiming that "CUPS PDF files (application/vnd.cups-pdf) are device-dependent PDF/A files that contain a job ticket information.", at least one online validator claims that a to-PDF print of itself from the web browser "does not conform to PDF/A".


allow user access via ssh to /var/www/

Context: I am creating a gitolite3 hook for a specific repo, which contains some logic and css foo of my website. so what essentailly happens is Content under `/var/www/nginx/` looks like:               drwxrwxr-x. nginx   git   system_u:object_r:httpd_sys_content_t:s0 foo      `.git` is special:               drwxrwxr-x. git     git   system_u:object_r:httpd_sys_content_t:s0 .git      To make sure all subdirs have the proper access rights I used:               chown nginx:git -Rf ./webfoo     chmod g+rw -Rf ./webfoo     chown git:git -Rf ./webfoo/.git      * * * [This is just bonus, you can skip this.] The gitolite3 hook               #!/bin/bash     cd /var/www/nginx/webfoo || exit     unset GIT_DIR     echo "where: $(pwd)"     git pull -f origin deploy-me-branch      * * *               remote: where: /var/www/nginx/webfoo     remote: From /home/gitolite/repositories/webfoo     remote:    c092ee2..07274a6  master     -> origin/master     remote: error: unable to unlink old '.gitignore' (Permission denied)     remote: error: unable to unlink old 'templates/fancypost.html' (Permission denied)     remote: error: unable to unlink old 'templates/layout.html' (Permission denied)      * * * `/var/log/audit/audit.log` does not contain any access denies. * * * **Update:** Even loging in `git` locally does not work either. So this is probably **unrelated to SELinux/file security context**. * * * **Why does this fail to work as I'd expect?**


Creating multiple proxies on a single VPS

I am trying to create SOCKS Proxies on my Debian Linux VPS. I was just wondering what is the best way to go about doing this? I have tried things like Dante and it doesn't support multiple Proxies.


How can I regenerate the default '/etc/' config files?

I've removed `nagios3` with `apt-get remove nagios3` and then removed the files in by using the command `sudo rm -R /etc/nagios*` Now when I run `apt-get install nagios3` the config files (`/etc/nagios3/*`) are not present. How can I regenerate them? This box is on Ubuntu 10.04.


Unix 11i v2 Script to detect new files within directory

I was hoping someone can point me in the right direction. I would like to create a script to check for new files (files with today's date) within a directory and then print the results to a text file. Could I use `cron` or `bash`? edit: Updated original thread. I tried the following on my Linux Mint VM and I got it to work. The only problem is: 1) when i create a new file (using "sudo vi newtextfile.txt" and then ":w") i receive the notification email _4 times_. 2) am i triggering multiple IN_CREATE events by creating a new file using the method i mentioned above?               /xyz/jon >>>     total 12     786436 drwxr-xr-x 2 root root 4096 Jul 13 20:43 .     786434 drwxr-xr-x 4 root root 4096 Jul 13 19:45 ..     786441 -rwxr-xr-x 1 root root 48 Jul 13 20:32 mylogger.sh     786437 -rw-r--r-- 1 root root 0 Jul 13 20:22 mylogtoday.txt               "incron.table-jonincron" >>>     /xyz/client IN_CREATE /xyz/jon/mylogger.sh               /xyz/jon/mylogger.sh >>>     sudo mail -s "testing script" emailaddress@domain.com


Problem getting Fedora to run in VirtualBox

I'm using Ubuntu 12.04 64-bit, trying to get Fedora 18 64-bit to run in the Oracle VM VirtualBox. I've got VirtualBox installed (via the .deb package available from the official site,) and I got the Fedora 18 64-bit DVD image downloaded. I then created a new virtual machine, with appropriate settings. When I try to boot the image, it displays a few options: "Install Fedora", "Test this media & install Fedora", and a "Troubleshooting" option. I chose one of the installation options, and it went to a grey screen. I assumed it was just a loading screen, but it wouldn't stop. I let it stay on that screen for a few hours, then killed it. None of the other options yielded any different results.


Letting NFS through a FreeBSD PF firewall

I'm trying to configure my firewall (PF) on FreeBSD to let NFS traffic through. I know that NFS uses both TCP and UDP to connect to the client along with a bunch of daemons that use random port numbers. Both the NFS server and client are Ubuntu 10.04. Instead of using port numbers for the filtering, I simply used the IP addresses of the client and server to allow the connection. The `pf.conf` rules pertaining to NFS are:               pass in log quick  from external to NFS     pass out log quick from NFS to external      As you can see, the external name is the client and NFS is the server. Both are resolved to their IP addresses. The problem is that some of the packets are being stopped by PF with the following error:               11:38:52.440123 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)     NFS-lan0.sunrpc > External-lan1.38390:  tcp 40 [bad hdr length 0 - too short, < 20]          What do I need to change to let these packets through?


Pipe output of jack_cpu_load through sed

In the shell, when I pipe `jack_cpu_load` through `sed`, or `cut`, no matter what options I use it stops printing just before the lines I want to see. `jack_cpu_load | sed -n 8p` will print:               Jack: JackClient::kActivateClient name = jack_cpu_load ref = 4      The very next line should read something like `jack DSP load 0.294772` which is what I'm looking for, but when I run `jack_cpu_load | sed -n 9p` which should print that line, there is nothing. Just a cursor, until I hit `Ctrl`+`C` and kill it. Unfortunately there is very little documentation on this command and I'm just a user, a musician no less, trying to hack together something that will let me see the dsp load at a glance in my status bar. Terminal Output:               tony@hydra ~ $ jack_cpu_load     Jack: JackClient::SetupDriverSync driver sem in flush mode     Jack: JackPosixSemaphore::Connect name = jack_sem.1000_default_jack_cpu_load     Jack: JackPosixSemaphore::Connect sem_getvalue 0     Jack: Clock source : system clock via clock_gettime     Jack: JackLibClient::Open name = jack_cpu_load refnum = 4     Jack: JackClient::Activate     Jack: JackClient::ClientNotify ref = 4 name = jack_cpu_load notify = 2     Jack: JackClient::kActivateClient name = jack_cpu_load ref = 4      jack DSP load 0.163633     jack DSP load 0.159914     jack DSP load 0.159449     jack DSP load 0.164087     jack DSP load 0.159971     ^CJack: jack_client_close        For this:               tony@hydra ~ $ jack_cpu_load 2>&1 | sed -n 8p     Jack: JackClient::kActivateClient name = jack_cpu_load ref = 4       And for this:               tony@hydra ~ $ jack_cpu_load 2>&1 | sed -n 9p        There's nothing. The output for strace -f jack_cpu_load http://justpaste.it/e7st


How to know what is trashing my Linux mint system?

My linux system is trashing occassionally. I have 4 GB of ram which is good even for Windows 8. All in all I have good specs. But occasionally the HDD light in the CPU is on for a long time and at the same time the system is not responding. I can't even kill processes. The whole system is hanging. I want to know what is causing this. * * * As requested:               $ cat /proc/sys/vm/swappiness     60


Where to find the error messages of Postfix

I cannot sent mail by using Postfix (SMTP) on Ubuntu Server 11.04. So, there must be some errors, But where to see the error message?


Disable/modify middle-click-to-paste in X11/Xorg

I am using Slackware 13.1 (kernel 2.6) with FVWM as my desktop manager. I have frequently had issues when coding where my over-sensitive mouse registers a middle-button (mouse-wheel) click while scrolling with the mouse- wheel. Is there any way to modify the shortcut so that middle-click no longer pastes using the built-in clipboard with X11/Xorg/Xfree86? I would prefer if it were re-mapped to something like +MiddleClick, or something similar. I have searched through the forums already, and have found some suggestions using XMODMAP, but none have worked so far. Thank you all in advance for your time and assistance.


How to change LCD intensivity/brightness

How to change brightness of LCD want image look deemed and soft the               xrandr --output LVDS1 --gamma 0.8:0.8:1.1      change only gamma but not the brightness of image. I have no option --brightness for xrandr


How do I prevent a program from playing sound?

I have a program which does not have an option to disable sound. I could mute the computer globally, but there are other programs for which I do want sound. Is there any way to locally disable sound?


Which arch linux should I download?

I'm going to install Arch linux yet I have to choose between several architectures my computer has. I have an aluminium macbook pro, with a 2.3 GHz Intel Core i5 processor. . The intel webpage tells me this is a dual core processor. running `uname -a` in the shell returns:               Darwin Romeos-MacBook-Pro.local 11.3.0 Darwin Kernel Version 11.3.0:     Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64      Which makes me believe I have an `x86_64` machine, yet when executing `arch` in the shell it returns `i386`. I'm a bit confused about what to pick:   * i686 CPU   * x86-64 CPU   * Dual Architecture What would you recommend?


merging files and getting column values based on id field

bash-3.2$ cat sample.log sample.log.1 sample.log.2     ID COL1 COL2 COL4     1  col1 col2 col4     2  c1   c2   c4     3  co1  co2  co4          ID COL3 COL1     1  col3 col1     2  c3   c1     3  co3  co1          ID COL1 COL2 COL3     1  col1 col2 col3     2  c1  c2   c3     3  co1  co2  co3      I need to write an awk script such that it gives me the values of the columns for a particular id like a select query on multiple tables in db. give me col1 col2 and col3 fields for id 1 and should not duplicate result. meaning the result should be like               The result should be     ID COL1 COL2 COL3     1  col1 col2 col3      but not               The result should be     ID COL1 COL2 COL3 COL3     1  col1 col2 col3 col3      Even a suggestion is also good.               awk ' BEGIN { while ( (getline line < "sample.log") > 0 ) {ids[substr(line,1,index(line," ")-1)];} } { // get the column values here based on the stored id's .. } ' sample.log sample.log.1 sample.log.2      I am trying to do something like that mentioned above. I am not sure if it is a good idea.