SSH config file + shell script help

Well, what I want to do seems a bit convoluted but its the only way I can think of to get the result I want. So here goes. I want to automate ssh to my Pi, in the following fashion:   1. My Pi boots up and auto-starts 4 separate instances of screen running bfgminer.   2. Have a shell script on my laptop to ssh into the Pi and open 4 terminals. 1 per screen instance. So I can monitor them all AND control the terminals. I have looked into tmux, but at this point I'm lost. So I'm thinking something along these lines:   1. Pi boots and runs 4 screen instances named USB0, USB1, USB2, USB3 (This is already completed)   2. On my laptop, open terminal and start my shell script. Something like this:              gnome-terminal -e <ssh into pi and open 'screen -d -r USB0'>     gnome-terminal -e <ssh into pi and open 'screen -d -r USB1'>     gnome-terminal -e <ssh into pi and open 'screen -d -r USB2'>     gnome-terminal -e <ssh into pi and open 'screen -d -r USB3'>        3. This will then open 4 terminal windows each automatically connecting to a separate screen instance.  I think this is possible with ssh config file. But I don't know how to do it. I know it should be possible to get ssh to auto login with username and password, and make it call up screen. Maybe have ssh autologin and run a script on the pi to begin screen? I have tried using screen's split screen but its not what I want. And tmux scares me.


What is being cached?

I have an embedded system with a low amount of memory. The system has allocation issues. Maybe due to fragmentation: Memory allocation issue on NOMMU? The platform is a NOMMU platform and so I suspect that the linux caching is the cause of this fragmentation. Maybe it is, maybe it isn't. The thing is, I can't really see what my system would gain from caching. The system is built from the following partitions:   1. RAM partition. (Kernel, user space fs, etc.)   2. SPI Flash. (Some config data. Maybe a few kb.)   3. SD Card. (Logged data. Will never be read.) Here's the output from my top command:               Mem: 23376K used, 5912K free, 0K shrd, 1624K buff, 8404K cached     CPU:  10% usr  42% sys   0% nic   0% idle  47% io   0% irq   0% sirq     Load average: 1.07 1.00 0.96 2/68 4299     ...      My system has 15M free ram when booted. Within a few minutes more than 60% is used for cache. Normally that wouldn't matter, except if it causing fragmentation issues due to NOMMU difficulties. Now, what is it that the kernel wants to cache anyway? The RAM partition? (Bit foolish.) The SPI Flash? (Good idea. But there's only a few kb there.) The SD card? (It doesn't need caching in this particular scenario.) How do see what is being cached? And how do I reduce the caching scheme? (I really don't need that much caching. There's no gain.) I've tried to mount the sd card and the spi flash with -o sync. But it doesn't make a difference.


Postfix unable to send mail from mydomain only

My domain DNS is served by the domain registrar. I am able to send mail successfully from any address with postfix but not from mydomain.com From this machine - I only want to be able to send mail. I know it must have something to do with DNS and my domain registrar. When postfix main.cf configuration has               mydestination = localhost, localhost.localdomain      I am getting:               status=bounced (mail for mydomain.com loops back to myself)      When I add mydomain.com to the mydestination (as suggested on the internet)               mydestination = mydomain.com, localhost, localhost.localdomain      I get               status=bounced (unknown user: )      Now I know I am missing something very obvious here, I just can't figure what that is.


What information about a process is retrievable after it is terminated?

After a process has been terminated, is it possible to retrieve any information about it, such as when it started and finished, &c. Is it possible to enable logging of this information?


Unable to install bsddb185, Python library for opening Berkeley DB version 1.85 files on Ubuntu

I am writing a python program that makes use of some legacy Berkeley DB 1.85 files. Unfortunately I am unable to install the `bsddb185` Python package, either for Python version 2.x and for Python 3. What I got, using `pip`, is the following error message:               root@ubuntu:~# pip install bsddb185     Downloading/unpacking bsddb185       Downloading bsddb185-1.0.tar.gz       Running setup.py (path:/tmp/pip_build_root/bsddb185/setup.py) egg_info for package bsddb185         Didn't find db.h with HASHVERSION == 2     Cleaning up...     No files/directories in /tmp/pip_build_root/bsddb185/pip-egg-info (from PKG-INFO)     Storing debug log for failure in /home/stab/.pip/pip.log      It appears that I am missing the `db.h` file which should have the constant `HASHVERSION` set at value `2`. I tried to install several Ubuntu packages that include `db.h`, such as `libdb5.3-dev` and `libdb6.0-dev`, getting the same error. After realizing that I need a specific version for opening my files, I discovered that a package I need was actually included in a Debian distribution, but it does not exist anymore under Ubuntu. I also tried to open the database using `bsddb3`'s `hashopen` function, but I suspect that the given format is not the one `bsddb3` is expecting:                 ...       File "./read_db.py", line 9, in open_db         f = db.hashopen(FILENAME)       File "/usr/lib/python2.7/dist-packages/bsddb3/__init__.py", line 347, in hashopen         d.open(file, db.DB_HASH, flags, mode)     bsddb3.db.DBInvalidArgError: (22, 'Invalid argument -- BDB0210 ././entries.db: metadata page checksum error')      The Ubuntu package `libdb1-compat` does contain tools that read from 1.85 format, but it does not contain any `db.h` header that I might use for compiling the python library `bsddb185`. How would you solve this problem? I am short on ideas right now.


How to get free memory on AIX?

How can I see the free memory on an AIX? There is no `free -m` under it. AIX oslevel: `6100-03-03-0943`


couldn't update git via git clone comand

I am just a beginner in Git. Was following through the documentation and installed Git using source code package. Now, after installing Git, I want to update it (Though it might be unnecessary at this time, I simply want to try and make sure it works). I ran the command `git clone git://git.kernel.org/pub/scm/git/git.git` and it returned error `-bash: /usr/bin/git: No such file or directory`. Reason might be obvious, since for installing git, I used the command `make prefix=/usr/local install` which installed Git in `/usr/local/bin/git` Now, how to fix this? I tried the same git clone command with `\--git-dir=/usr/local/bin/git` which returned the same error `-bash: /usr/bin/git: No such file or directory`


Installing a new OpenBSD kernel "safely": why does `make install` go through these extra hoops?

After building a new OpenBSD kernel, the `install` target of the kernel `Makefile` does the following:               rm -f /obsd     ln /bsd /obsd     cp bsd /nbsd     mv /nbsd /bsd      I understand that the first two lines remove the old backup kernel `/obsd` and create a hard link `/obsd` pointing to the currently running kernel `/bsd`. In particular, the running kernel is not moved at all. This makes sense to me. However, what is the purpose of moving the newly built kernel `./bsd` first to `/nbsd` and then renaming it to `/bsd`? Why not replace the third and fourth line by the apparently simpler `cp bsd /bsd`? If this should matter: the default partitioning scheme of OpenBSD places the kernel build tree in a different filesystem (disklabel) than the root filesystem.


What does running "< ./somefile.txt" in shell do?

So I just executed `< ./somefile.txt` in a shell, and it doesn't appear to do anything (the text file has valid linux commands). So where are the contents of the text file being redirected to? I'm just guessing null, but I am not sure. OS: Ubuntu 12.04


Kill a Process for a User

chomp $choice;     if ($choice == 5) {        print "**********************************\n";        print " Enter the User Name\n";        $user_name = <STDN>;             sub kill_processes {           $user_name = <STDN> ;           @process_list = `ps -u $user_name| awk ' { print $2 ;} ' `;           print @process_list;           print "Are you sure you want to kill all of these processes? (Y|N) >";           $resp = <STDIN> ;           chomp $resp;           if ( $resp eq "Y" || $resp eq 'y' ) {              foreach (@process_list) {                 if ( ! /PID/ ) {                    @process = split / /, $_;                    print "Killing Process $process[1]\n";                    `kill -09 $process[1]`;                 }              }           }        }                    }      This is only part of the code I can't get to work. Everything works fine when I select choice 5 but it doesn't do anything when I enter the user name? How can I get this this to work?


Logrotate no longer reads symlinked configuration file due to non-root ownership

We are currently upgrading from Ubuntu 12.04 LTS to 14.04 LTS on our ruby on rails application servers, and have noticed that the log files are no longer rotating. On both machines we have a file `/var/app-name/config/logrotate` owned by our unix user `deployer` which contains a valid logrotate file as follows:               /var/app-name/log/*.log {       daily       rotate 365       delaycompress       compress       dateext       dateformat -%Y%m%d       missingok       copytruncate     }      This is then symlinked into the `/etc/logrotate.d/` directory as `app-name` On our Ubuntu 12.04 server we have logrotate 3.7.8 which runs just fine. It goes into the `var/app-name/log/` directory and rotates all out log files But on Ubuntu 14.04 server we have logrotate 3.8.7 which doesn't rotate the logfiles for our application. When I debug this via `sudo logrotate -d -f /etc/logrotate/.conf` I get the following output:               Ignoring /etc/logrotate.d/app-name because the file owner is wrong (should be root).      Chasing this down in the code, it seems this change was added for the 3.8.x release stream: https://github.com/demands/logrotate/commit/b8ce386a969c60e5c8ee78023c24a1ba0aab1526 If I change the ownership of the file symlinked to `/var/app- name/config/logrotate` to `root` then it starts to work again. But given this file is part of my application, and created by the capistrano deployment framework we use in this state, I'd rather not have to alter it's ownership, when it used to work just fine. So are symlinked config files recommended / supported by logrotate ? And if so, should it's refusal to use my file (owned by `deployer`) which is symlinked into the `/etc/logrotate.d` directory, be seen as a bug ? Or is there another recommended approach for application-specific log rotation ? (also asked on superuser StackExchange)


Can not call a command

I have a script `/etc/init.d/tilestream` with:               TILESTREAM="/usr/bin/tilestream"     MAPPATH="/data"     HOST="host"     #HOST="localhost"     #UIPORT="9001"     UIPORT="8888"     #TILEPORT="9000"     TILEPORT="8888"     SUBDOMAINS="a,b,c,d"          case $1 in     start)         echo "Starting TileStream"        $TILESTREAM --tiles=$MAPPATH --host=$HOST --uiPort=$UIPORT --tilePort=$TILEPORT&         ;;      This works fine. But when I tried running it from the command line:               /usr/bin/tilestream --tiles=/data --host=host --uiPort=8888 --tilePort=8888      It didn't start; I couldn't see it in `top`. What can be wrong?


pipe line with non-deterministic output

I have happened upon a command that sometimes works and sometimes does not, even when executed multiple times in rapid succession in a `bash` shell (I have not tested the behavior in other shells). The problem has been localized to the reading of a variable in the `BEGIN` block of an `awk` statement at the end of the pipe line. During some executions, the variable is correctly read in the `BEGIN` block and during other executions, the operation fails. Supposing this aberrant behavior can be reproduced by others (and is not a consequence of some problem with my system), can its inconsistency be explained? Take as input the following file called `tmp`:               cat > tmp <<EOF     a   a     b   *     aa  a     aaa a     aa  a     a   a     c   *     aaa a     aaaa    a     d   *     aaa a     a   a     aaaaa   a     e   *     aaaa    a     aaa a     f   *     aa  a     a   a     g   *     EOF      On my system, the pipe line                awk '{if($2!~/\*/) print $1}' tmp | tee >(wc -l | awk '{print $1}' > n.txt) | sort | uniq -c | sort -k 1,1nr | awk 'BEGIN{getline n < "n.txt"}{print $1 "\t" $1/n*100 "\t" $2}'      will either produce the correct output:               4   28.5714 a     4   28.5714 aaa     3   21.4286 aa     2   14.2857 aaaa     1   7.14286 aaaaa      or the error message:               awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted      How can a command _possibly_ give different output when run twice in succession when no random number generation is involved and no change to the environment is made in the interim? To demonstrate how absurd the behavior is, consider the output generated by executing the above pipe line ten times consecutively in a loop:               for x in {1..10}; do echo "Iteration ${x}"; awk '{if($2!~/\*/) print $1}' tmp | tee >(wc -l | awk '{print $1}' > n.txt) | sort | uniq -c | sort -k 1,1nr | awk 'BEGIN{getline n < "n.txt"}{print $1 "\t" $1/n*100 "\t" $2}'; done     Iteration 1     awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted     Iteration 2     4   28.5714 a     4   28.5714 aaa     3   21.4286 aa     2   14.2857 aaaa     1   7.14286 aaaaa     Iteration 3     4   28.5714 a     4   28.5714 aaa     3   21.4286 aa     2   14.2857 aaaa     1   7.14286 aaaaa     Iteration 4     awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted     Iteration 5     awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted     Iteration 6     awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted     Iteration 7     4   28.5714 a     4   28.5714 aaa     3   21.4286 aa     2   14.2857 aaaa     1   7.14286 aaaaa     Iteration 8     awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted     Iteration 9     4   28.5714 a     4   28.5714 aaa     3   21.4286 aa     2   14.2857 aaaa     1   7.14286 aaaaa     Iteration 10     awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted      Note: I have also tried closing the file (awk `close`) after reading the variable, in case the problem relates to the file being left open. However, the inconsistent output remains.


Summing up an array inside of awk?

I have the following piece of code:               sum1=     sum2=         declare -a a     echo $temp | awk '{split($0,a,","); name=a[1] ; for(i=2;i<=4;i++) sum1+=a[i] ; for(i=5;i<=7;i++) sum2+=a[i] }'      This code is not working. Here temp is a string of type:               abc,1,2,3,4,5,6      I am beginner and need some suggestions. Actually I am parsing data from a file. The input file is like:               abc,1,2,3,4,5,6     de,3,5,7,8,4,2     xyz,6,5,3,7,8,2      I am reading it using               while  read temp     do      #do something     done < sample.csv      And expected output is of the form:               Name   Sum1  Sum2     abc      6    15     de      15    14     xyz     14    17


Is there a downside to deleting all of the broken symbolic links in a system?

I was running a script that iterated over all the files on my Linux system and created some metadata about them, and it threw an error when it hit a broken symbolic link. I am newish to *nix, but I get the main idea behind linking files and how broken links come to exist. As far as I know, they are like the equivalent of litter in the street. Things that a program I'm removing wasn't smart enough to tell the package manager existed, and belonged to it, or something that got left behind in an upgrade. At first, I started to tweak the script I'm running to skip them, then I thought, 'well we could always delete them while we're down here...' I'm running Ubuntu 14.04 (Trusty Tahr). I can't see any reason not to, but before I go ahead and run this over my development system, is there any reason this might actually be a terrible idea? Do broken symlinks serve some purpose I am not aware of?


Cannot access HDD files through Linux Mint Live USB

I have valuable info on my Ubuntu partition, but it crashed, and I tried to get to it through Live USB with Mint 14, but it says it's read only. Can I make it writable too? So I can put it on my flash drive?


kill a group of processes with negative PID

kill -TERM -PID       is supposed to kill PID and all its child processes.   but this doesn't work on openSUSE, it always tell me that no such process -PID no matter what PID i use.   So if the negative PID option is not supported by this particular version of kill, what is the best way to kill a group of processes? background:   I have a shell script running. inside the script, I use wget to download things. So the script is the parent process, wget is the child process. I want to kill them both using kill -TERM -PID_OF_SCRIPT


starting server with nohup and redirecting input, output

I have a init.d script that starts a python socket server. Because I want this to run as a daemon, I use nohup to start it. I also want to redirect stdout and stderr to a log file. My problem is that I am also trying to capture the PID of the process to save to a file, which I can't seem to do.               # Start server     echo "Starting server."     nohup ${PROGDIR}/${PROGNAME} -l $IPADDR >>${LOGDIR}/${OUTLOG} 2>>${LOGDIR}/${OUTLOG} </dev/null &     PID=$!      This was able to capture the PID, but redirection did not work. (Was I redirecting nohup rather than the program?) Next I tried something like:               nohup /bin/bash -c '...'      But I lost the PID. At this point, I seemed to be getting the PID of `nohup /bin/bash -c`. As I am not very familiar with shell scripts, I thought I would ask for help before I shoot myself in the foot. So my question is, how can I capture the PID and redirect the server output to the logfile? I am on a debian (raspberry pi) and am writing an init script using rc-update.d.


Using Ctrl+[0-9] to cycle between windows using tmux

I have started using `tmux` but I feel that using `Ctrl``b``0-9` is very annoying, because it's used so often. How do I bind the keyboard so I only need to do `Ctrl``0-9` for changing windows (like in Chrome)? I have tried to configure it in the `.tmux.conf`, but without any success. this is my current .tmux.conf file               bind C select-pane -t :.+     set -g status-bg black     set -g status-fg white


Using a differencing, aka overlay, aka union, file-system with commit capability

I work in two PCs and I sync all my files from my primary PC to a USB flash memory. In my second PC, I mount the USB flash memory to the same path to work on my files as I were on my primary PC. Now for the sake of performance and flash memory lifetime, I need to use any type of differencing, aka overlay, aka union, file-system (like unionfs or aufs) to let me use the USB flash disk as read-only and write changes to a temp directory and at the end allows me to write the changes back to the USB flash at once. Any help? Any hope? **Update:** Thanks for all your answers and comments. I am interested in Linux and my question is: **Does any of the above file-systems allow committing the writes to the lower file-systems when required? If yes, how?**


Commandline tool for comprehensive and integrated testing of internet connectivity

Is there a commandline tool for GNU/Linux which will analyse download and upload speed, packet-loss, latency and other factors which will indicate internet connectivity status?


Does fetchmail support these IMAP features? If so, how?

I'm studying and learning about how mail is handled in linux systems, and one thing has become a source of confusion for me. On my iPhone, via IMAP, I can mark a message in my Gmail inbox as read, or I can move it to another folder ("label" in Gmail speak). Then when I later view my Gmail account via web interface, these changes have percolated to the Gmail server. However, given my linux client, I have read that all fetchmail does is fetch mail (pun unintended), rather than deliver it. The delivery part would be the responsibility of procmail or postfix. But if fetchmail just hands off the delivery part to procmail or postfix, it doesn't seem like it would have any way of knowing whether that email was later marked as read or saved to a specific IMAP folder. In fact, it seems like the idea of an "IMAP folder" wouldn't even seem to exist any longer at that point! Does fetchmail actually do some creation or marking of "IMAP folders"? So is it possible to use fetchmail to get local copies of mail from the server, yet still keep the IMAP features of marking messages as read and moving them to specific folders? If so, how?


Arch linux booting into rescue shell by default

I just installed Arch in my PC alongside windows 7 but for some reason it boots directly into the rescue shell, this is how it looks It doesn't show any errors though, and if I press Ctrl+D it just shows me my display manager like normal, how can I make it so it boots directly into the display manager? Thanks in advance.


Shutdown from login prompt in tty

Suppose I boot a Linux machine without GUI. When it displays a tty login prompt, can I shutdown the machine with a keyboard sequence? Of course I could type in my username and password and then `sudo shutdown -h now`; however, is it possible to shut it down before the login using a keyboard shortcut?


Validate AIX Password for root from script

Looking for a way in a shell script to validate the password for for root on an (AIX) matches a standardized plain text password. This query is similar to another one on this site. I have access to root and can compile a c Program if needed. I have been abel to find standard libraries to do this for HP-UX and Linux. Now I am working on AIX and I have been hitting nothing but road blocks. I have been able to extract the salt and the hash and I know the plain text password. I am wanting to input the salt and password and get back the password hash so the I can compare it to what is stored on the server.


mutt: mark as read and delete

I discard some messages without reading them. After deleting said messages, however, I am soon alerted to the presence of unread mail in my trash can. Is there a way to either:   * disable the alert (`set beep_new`) when a new message is found in the trash can; or   * simultaneously mark a message as read and delete it? I imagine the former could be implemented with a trash folder hook and the latter could be implemented using a macro. However, in the case of the latter, after marking a message (`Wn`) or entire thread (`^R`) as read, the selected entry may or may not change, depending on the position of the message in the folder. One must then use a conditional to determine how to restore the selection by use of the entry navigation commands. After restoring the selection, the message can be deleted. According to the official documentation, the configuration files do not support conditionals, so a macro-based solution might involve piping through a shell script. Perhaps there is a simpler solution to this problem that I have overlooked?


Debian 6 VM server - network connectivity problem

I'm having a problem with a Debian 6 VM server where it looses network connectivity and doesn't come back (server does not respond to pings, and can't connect to any services). This is a wired network connection in a data center where the network is up when the problem occurs. When logged into the console, I confirm that the server doesn't seem to have network conectivity (can't ping ip 8.8.8.8 for example). All services are running though (mysql, Apache, SSH, etc). There are some errors in /var/log/kern.log, but not sure these are related to the problem:               Jan  5 01:43:41 vm2 kernel: [12179513.252191] INFO: task mysqld:1369 blocked for more than 120 seconds.     Jan  5 01:43:41 vm2 kernel: [12179513.253230] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Jan  5 01:43:41 vm2 kernel: [12179513.254237] mysqld        D ffff8801b46de9f0     0  1369   1179 0x00000000     Jan  5 01:43:41 vm2 kernel: [12179513.254243]  ffff8801b46de9f0 0000000000000286 ffff8801fd105e18 000000010000000e     Jan  5 01:43:41 vm2 kernel: [12179513.254250]  ffff8801f750f478 ffff8801fd105e18 000000000000f9e0 ffff8801fd105fd8     Jan  5 01:43:41 vm2 kernel: [12179513.254253]  00000000000157c0 00000000000157c0 ffff8801fd1c5bd0 ffff8801fd1c5ec8     Jan  5 01:43:41 vm2 kernel: [12179513.254259] Call Trace:     Jan  5 01:43:41 vm2 kernel: [12179513.254270]  [<ffffffff810b61e1>] ? wait_on_page_writeback_range+0xce/0x11b     Jan  5 01:43:41 vm2 kernel: [12179513.254282]  [<ffffffffa001fe20>] ? log_wait_commit+0xbf/0x112 [jbd]     Jan  5 01:43:41 vm2 kernel: [12179513.254288]  [<ffffffff81066332>] ? autoremove_wake_function+0x0/0x2e     Jan  5 01:43:41 vm2 kernel: [12179513.254296]  [<ffffffff8130f142>] ? _spin_unlock_irqrestore+0xd/0xe     Jan  5 01:43:41 vm2 kernel: [12179513.254303]  [<ffffffffa00303f8>] ? ext3_sync_file+0x94/0xc8 [ext3]     Jan  5 01:43:41 vm2 kernel: [12179513.254309]  [<ffffffff8110d6e0>] ? vfs_fsync_range+0x73/0x9e     Jan  5 01:43:41 vm2 kernel: [12179513.254312]  [<ffffffff8110d78a>] ? do_fsync+0x28/0x39     Jan  5 01:43:41 vm2 kernel: [12179513.254316]  [<ffffffff8110d7b9>] ? sys_fsync+0xb/0x10     Jan  5 01:43:41 vm2 kernel: [12179513.254319]  [<ffffffff8130f6fa>] ? error_exit+0x2a/0x60     Jan  5 01:43:41 vm2 kernel: [12179513.254323]  [<ffffffff81011b42>] ? system_call_fastpath+0x16/0x1b       When the problem happens, the network interfaces are up (I checked ifconfig, all interfaces looked normal). I also check iptables, and verify there were no rules that would block anything. I also try running /etc/init.d/networking/restart, but that does not fix the problem. The only thing I've found that fixes the problem is rebooting. Hoping for some advice on things I can check to help troubleshoot this problem.


What distributions work out of the box with tablet computers?

I recently got my hands on a tablet computer. I tend to at least dual boot my systems. While doing some research about tablet computing and *nix most of the information was from the 2004-2008 era light years ago in computing time. What is the current state of tablet computing? I want something that works out of the box with minimal fuss - I'm way past the point that futzing with things is worth the time I spend on it. Specifically I'm looking to have features comparable to windows 7 + office:   * Virtual Keyboard - selectable handwriting / touch keyboard   * OneNote replacement   * Navigation via pen What distribution out there has really good tablet support of the box in 2010? (also bonus points for fun tablet apps in linux)


How to pause listing long text file with cat in command prompt after 10lines then press any key. for example:               cat myfiles.txt          bla     bla     bla     bla     bla     bla     .     .     .     bla     press enter to continue


Can Linux support Mirror Bootable Disk with LVM like IBM-AIX/HP/Solaris UNIX?

I have searched a lot in Google and Linux sites, but it seems that only UNIX, especially HP-UX supports mirror bootable disk configuration. Can anyone tell me whether Linux (I am using SuSE 10) can support this or not, and how to if can? I have found one shell scripts of HP-UNIX config about this, please see here


Sending music directly from MIC to LS

How can I tell linux to send directly from my microphone to my loudspeaker?


Debian server on a Intel Core i3 and Intel Q57 Chipset - will it work?

I want to build a Debian server (running samba, postfix, apache - without X11) on a Intel Core i3 / Intel Q57 Chipset system. I'm relativly new to the Linux- World but had driver issues already within my desktop (ATI GPU) that I wasn't able to solve. Will the following components work fine with Debian Linux?   * Intel Core i3-530 2x2.93GHz 4MB VideoHD Sock1156 (Clarkdale) BOX   * Gigabyte GA-Q57M-S2H GL/SATA/R/DVI/HDMI/DP Q57 HD Graphics mATX Sock1156   * Raid: Samsung SpinPoint F3 HD502HJ - 500GB 7200rpm 16MB 3.5zoll SATA300


Heartbeat 3 binding socket error

I've been tying to install Heartbeat3.0.5+Pacemaker1.0.12 on CentOS 6.3 64bit via yum. The installation seems to be successful, but there is a problem when starting Heartbeat. I put some info related to this issue below. Node Info               Active  : hm5     Standby : hm6      Package Info               [root@hm5 rpm]# rpm -qa | grep -i heartbeat     heartbeat-libs-3.0.5-1.1.el6.x86_64     heartbeat-3.0.5-1.1.el6.x86_64          [root@hm5 rpm]# rpm -qa | grep -i pacemaker     pacemaker-1.0.11-1.2.el6.x86_64     pacemaker-libs-1.0.11-1.2.el6.x86_64      ha.cf Info               [root@hm5 rpm]# cat /etc/ha.d/ha.cf      pacemaker on     logfacility local1          debug 1     udpport 694          keepalive 2     warntime 20     deadtime 24     initdead 48          bcast eth1          node hm5     node hm6     watchdog /dev/watchdog      Interface Info               [hm5]     eth0      Link encap:Ethernet  HWaddr 54:52:00:18:DE:97                 inet addr:192.168.122.35  Bcast:192.168.122.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1791 errors:0 dropped:0 overruns:0 frame:0               TX packets:361 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:121033 (118.1 KiB)  TX bytes:58678 (57.3 KiB)          eth1      Link encap:Ethernet  HWaddr 54:52:00:6F:E3:74                 inet addr:192.168.123.5  Bcast:192.168.123.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1238 errors:0 dropped:0 overruns:0 frame:0               TX packets:3 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:68171 (66.5 KiB)  TX bytes:126 (126.0 b)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)          [hm6]     [root@hm6 ~]# ifconfig -a     eth0      Link encap:Ethernet  HWaddr 54:52:00:40:7D:BE                 inet addr:192.168.122.36  Bcast:192.168.122.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1345 errors:0 dropped:0 overruns:0 frame:0               TX packets:49 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:77115 (75.3 KiB)  TX bytes:6223 (6.0 KiB)          eth1      Link encap:Ethernet  HWaddr 54:52:00:72:DB:F1                 inet addr:192.168.123.6  Bcast:192.168.123.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1286 errors:0 dropped:0 overruns:0 frame:0               TX packets:3 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:70729 (69.0 KiB)  TX bytes:126 (126.0 b)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)      Error Log After Starting Heartbeat by Root User               Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(udpport,694)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(keepalive,2)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(warntime,20)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(deadtime,24)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(initdead,48)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(bcast,eth1)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(node,hm5)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(node,hm6)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(watchdog,/dev/watchdog)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+hacluster, gid+<null>     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+hacluster, gid+<null>     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+<null>, gid+haclient     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+root, gid+<null>     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+<null>, gid+haclient     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Beginning authentication parsing     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: 16 max authentication methods     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Keyfile opened     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Keyfile perms OK     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: 16 max authentication methods     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Found authentication method [sha1]     Jul 30 19:12:52 hm5 heartbeat: [1448]: info: AUTH: i+1: key + 0x215bf40, auth+0x7fdb7ac89db0, authname+sha1     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Outbound signing method is 1     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Authentication parsing complete [1]     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(cluster,linux-ha)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(hopfudge,1)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(baud,19200)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(auto_failback,legacy)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(hbgenmethod,file)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(realtime,true)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(msgfmt,classic)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(conn_logd_time,60)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(log_badpack,true)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(syslogmsgfmt,true)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(coredumps,true)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(autojoin,none)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(uuidfrom,file)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(compression,zlib)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(compression_threshold,2)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(traditional_compression,no)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(max_rexmit_delay,250)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Setting max_rexmit_delay to 250 ms     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(record_config_changes,on)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(record_pengine_inputs,on)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(enable_config_writes,on)     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(memreserve,6500)     Jul 30 19:12:52 hm5 heartbeat: [1448]: WARN: Logging daemon is disabled --enabling logging daemon is recommended     Jul 30 19:12:52 hm5 heartbeat: [1448]: info: **************************     Jul 30 19:12:52 hm5 heartbeat: [1448]: info: Configuration validated. Starting heartbeat 3.0.5     Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: HA configuration OK.  Heartbeat starting.     Jul 30 19:12:52 hm5 heartbeat: [1448]: info: Heartbeat Hg Version: node: 7e3a82377fa8c88b4d9ee47e29020d4531f4629a     Jul 30 19:12:52 hm5 heartbeat: [1449]: info: heartbeat: version 3.0.5     Jul 30 19:12:52 hm5 heartbeat: [1449]: info: Heartbeat generation: 1343634035     Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: uuid is:8724b422-87c2-4056-9433-7be507f2efb3     Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: FIFO process pid: 1452     Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: opening bcast eth1 (UDP/IP broadcast)     Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: glib: SO_BINDTODEVICE(r) set for device eth1     Jul 30 19:12:52 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:12:52 hm5 heartbeat: [1452]: debug: pid 1452 locked in memory.     Jul 30 19:12:52 hm5 heartbeat: [1452]: debug: Limiting CPU: 6 CPU seconds every 60000 milliseconds     Jul 30 19:12:53 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:12:54 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:12:55 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:12:56 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:12:57 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:12:58 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:12:59 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:13:00 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:13:01 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:13:02 hm5 heartbeat: [1449]: ERROR: glib: Unable to bind socket (Permission denied). Giving up.     Jul 30 19:13:02 hm5 heartbeat: [1449]: info: glib: UDP Broadcast heartbeat closed on port 694 interface eth1 - Status: 1     Jul 30 19:13:02 hm5 heartbeat: [1449]: ERROR: make_io_childpair: cannot open bcast eth1     Jul 30 19:13:02 hm5 heartbeat: [1449]: debug: Exiting from pid 1449 [rc+4]     Jul 30 19:13:03 hm5 heartbeat: [1452]: CRIT: Emergency Shutdown: Master Control process died.     Jul 30 19:13:03 hm5 heartbeat: [1452]: CRIT: Killing pid 1449 with SIGTERM     Jul 30 19:13:03 hm5 heartbeat: [1452]: CRIT: Emergency Shutdown(MCP dead): Killing ourselves.     Jul 30 19:13:03 hm5 heartbeat: [1452]: debug: Process 1452 processing SIGTERM     Jul 30 19:13:03 hm5 heartbeat: [1452]: debug: Exiting from pid 1452 [rc+15]      The main problem seems to be related to               Jul 30 19:13:01 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.     Jul 30 19:13:02 hm5 heartbeat: [1449]: info: glib: UDP Broadcast heartbeat closed on port 694 interface eth1 - Status: 1      But I haven't found the precise cause of this yet, I really do need help.


gnome-dictionary no-window option does not work

I would like to have a bash dictionary so I found `gnome-dictionary`. However, just typing `gnome-dictionary` will bring up a GUI box. In `gnome-dictionary --help`, and in the man file, it says a `-n` or `\--no-window` flag will disable the GUI popup and print the result on stdout. But this does not work. Instead, it says you should see the help for whatever cool things to do. The man page refers to gnome-utils 2.13.4. **Edit** Some "extra material" to the accepted answer.               # for `.bz2`; for `.gz`, drop `j` for `z`     # create (`sudo mkdir -p ...`) path if not there     add-dict () {       sudo tar -xvjf $1 -C /usr/share/stardict/dic     }          alias sd="sdcv"          wd () {       sdcv $1 | /usr/bin/fold --spaces --width=73     }


How can I send stdout to multiple commands?

There are some commands which filter or act on input, and then pass it along as output, I think usually to `stdout` - but some commands will just take the `stdin` and do whatever they do with it, and output nothing. I'm most familiar with OS X and so there are two that come to mind immediately are `pbcopy` and `pbpaste`- which are means of accessing the system clipboard. Anyhow, I know that if I want to take stdout and spit the output to go to both `stdout` and a file then I can use the `tee` command. And I know a little about `xargs`, but I don't think that's what I'm looking for. I want to know how I can split `stdout` to go between two (or more) commands. For example:               cat file.txt | stdout-split -c1 pbcopy -c2 grep -i errors      There is probably a better example than that one, but I really am interested in knowing how I can send stdout to a command that does not relay it and while keeping `stdout` from being "muted" - I'm not asking about how to `cat` a file and `grep` part of it and copy it to the clipboard - the specific commands are not that important. Also - I'm not asking how to send this to a file and `stdout` - this may be a "duplicate" question (sorry) but I did some looking and could only find similar ones that were asking about how to split between stdout and a file - and the answers to those questions seemed to be `tee`, which I don't think will work for me. Finally, you may ask "why not just make pbcopy the last thing in the pipe chain?" and my response is 1) what if I want to use it and still see the output in the console? 2) what if I want to use two commands which do not output `stdout` after they process the input? Oh, and one more thing - I realize I could use `tee` and a named pipe (`mkfifo`) but I was hoping for a way this could be done inline, concisely, without a prior setup :)


Is it possible to obtain the current name of the xterm window?

This LDP Howto demonstrates how to change the title of an xterm. I know that this is also possible using the `xtitle` command. Before invoking a long-running action, my script uses such techniques to change the title of its xterm window. I would like to extract the name of the xterm window prior to changing it so that, once the long-running action is completed, I can restore the title to its previous value. It would sort of be an inverse to xtitle... Is this even possible?


Installing Grub 2 on a USB flash drive

MultiBootISOs is a tool that let you install Grub on a USB flash drive. I really like it because it lets me boot from ISO files and let me put a bunch of ISOs on my USB and choose which one to boot. The problem is, this is a Windows tool, and I don't know how to do it through the command lines. I would also like to know how to install Grub (2) this way, Grub Legacy seems to be easier... EDIT: I'm not asking for a tool (and definitely not a Windows tool). I want to know the commands that I have to execute to have the same effects. I'm having Ubuntu in my mind right now, but if there is a general way that I can boot any ISO in the USB then that would be better.


problem dhcp3-server ubuntu server 11.04

I installed dhcp3-server in ubuntu server 11.04               apt-get install dhcp3-server      However, an error message during installation:               Traitement des actions différées (« triggers ») pour « man-db »...     Traitement des actions différées (« triggers ») pour « ureadahead »...     Paramétrage de isc-dhcp-server (4.1.1-P1-15ubuntu9.1) ...     Generating /etc/default/isc-dhcp-server...     * Starting ISC DHCP server dhcpd                                                * check syslog for diagnostics                                   [fail]     invoke-rc.d: initscript isc-dhcp-server, action "start" failed.     Paramétrage de dhcp3-server (4.1.1-P1-15ubuntu9.1) ...      * * * `tail -f /var/log/syslog` says:               Sep  2 03:29:20 srv dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1     Sep  2 03:29:20 srv dhcpd: Copyright 2004-2010 Internet Systems Consortium.     Sep  2 03:29:20 srv dhcpd: All rights reserved.     Sep  2 03:29:20 srv dhcpd: For info, please visit https://www.isc.org/software/dhcp/     Sep  2 03:29:20 srv dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1     Sep  2 03:29:20 srv dhcpd: Copyright 2004-2010 Internet Systems Consortium.     Sep  2 03:29:20 srv dhcpd: All rights reserved.     Sep  2 03:29:20 srv dhcpd: For info, please visit https://www.isc.org/software/dhcp/     Sep  2 03:29:20 srv dhcpd: Wrote 0 leases to leases file.     Sep  2 03:29:20 srv dhcpd:      Sep  2 03:29:20 srv dhcpd: No subnet declaration for eth0 (192.168.1.1).     Sep  2 03:29:20 srv dhcpd: ** Ignoring requests on eth0.  If this is not what     Sep  2 03:29:20 srv dhcpd:    you want, please write a subnet declaration     Sep  2 03:29:20 srv dhcpd:    in your dhcpd.conf file for the network segment     Sep  2 03:29:20 srv dhcpd:    to which interface eth0 is attached. **     Sep  2 03:29:20 srv dhcpd:      Sep  2 03:29:20 srv dhcpd:      Sep  2 03:29:20 srv dhcpd: Not configured to listen on any interfaces!     Sep  2 03:29:23 srv kernel: [ 1625.286737] type=1400 audit(1314930563.298:18)            apparmor="STATUS" operation="profile_replace" name="/usr/sbin/dhcpd" pid=2045     comm="apparmor_parser"      when I try to access the file `/etc/dhcp3/dhcpd.conf` I can not find it. the package `dhcp-server` is installed.               root@srv:/etc/dhcp3#ls -l     total 4 drwxr-xr-x 2 root root 4096 2011-09-01 06:42 dhclient-enter-hooks.d


How do I change file associations from the command line?

The system in question is Solaris, using the Gnome type interface (Java Desktop Environment). We have occasional issues with users managing to mess up their file assocations (most notably .tif). Trying to find out what files to edit from a command line to change those file associations. (as logging in graphically as them to use the desktop utilities can be a bit of a problem remotely).


Where can I find a download of Darwin from Apple?

Where can I find a ISO download of Darwin? I downloaded Darwin at one time (even after they stopped releasing the ISOs) off of Apple's website. Unfortunately, I have no idea where the link went. I had it at one time.


User logged in by sftp does not show up in `w`

My server is Centos 5. I have a chroot environment set up with the following in my sshd_config               Match group sftponly         ForceCommand internal-sftp         ChrootDirectory %h         AllowTcpForwarding no         PasswordAuthentication yes     Match      When a user connects by sftp, a line is added to /var/log/secure:               Sep  3 15:30:20 servername sshd[26548]: pam_unix(sshd:session): session opened for user test by (uid=0)      However they are not present when executing `w`:               [root@servername home]# w      15:30:47 up 156 days,  1:00,  3 users,  load average: 0.05, 0.18, 0.32     USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     mike     pts/1    12.34.56.78      Fri16    0.00s  0.10s  0.03s sshd: mike [priv]      But when users connect by SSH (like the user above), they are present. Is this standard behavior?


Debian - install missing man pages?

I run RaspBMC - a distro based on Raspbian, that's a custom minimal Debian for the Raspberry Pi. If I recall correctly, the `man` utility is NOT installed by default with RaspBMC (although I may be mistaken). The problem is, packages installed prior to installing the actual `man` utility do not install their man pages. This includes the packages that come pre-installed with the system. Example: I tried with udisks-glue (which comes pre-installed)               $ man udisks-glue     No manual entry for udisks-glue      After re-installing that package, the man page is there.               $ apt-get remove udisks-glue     $ apt-get install udisks-glue     $ man udisks-glue     [Man page gets displayed]      **The question is: can I somehow install _all_ the missing man pages easily?** From what I can see, installing the man pages is a step that's run for each `apt-get install` command:               Unpacking udisks-glue (from .../udisks-glue_1.3.4-1_armhf.deb) ...     Processing triggers for man-db ...     [...]      Using divide-and-conquer, I assume this could be obtained by:   1. getting a list of all installed packages ( `dpkg -l | grep ??? | cut ??? | ???` )   2. finding a way to tell apt-get to re-install a package without messing with the config (a `remove + install` kinda fits the bill, but I don't think it plays nice with dependencies)   EDIT: this should do it:   `sudo apt-get install --reinstall packagename`   3. run 2. over each item in 1. Is this the (simplest) way to go? **Update** I remembered I bricked RaspBMC once doing `apt-get upgrade`, so I want to make sure the packages are NOT upgraded to newer versions when reinstalling (which seems to be the case with `apt-get install --reinstall` by default.


Executing user defined function in a find -exec call

I'm on Solaris 10 and I have tested the following with ksh (88), bash (3.00) and zsh (4.2.1). The following code doesn't yield any result:               function foo {         echo "Hello World"     }          find somedir -exec foo \;      The find does match several files (as shown by replacing `-exec ...` with `-print`), and the function works perfectly when called outside from the `find` call. Here's what the `man find` page say about `-exec`:                -exec command       True if the executed command  returns  a                          zero  value  as  exit status. The end of                          command must be punctuated by an escaped                          semicolon (;).  A command argument {} is                          replaced by the current pathname. If the                          last  argument  to  -exec  is {} and you                          specify + rather than the semicolon (;),                          the command is invoked fewer times, with                          {} replaced by groups of  pathnames.  If                          any  invocation of the command returns a                          non-zero  value  as  exit  status,  find                          returns a non-zero exit status.      I could probably get away doing something like this:               for f in $(find somedir); do         foo     done      But I'm afraid of dealing with field separator issues. Is it possible to call a shell function (defined in the same script, let's not bother with scoping issues) from a `find ... -exec ...` call? I tried it with both `/usr/bin/find` and `/bin/find` and got the same result.


Name Lookup takes a long time

I was using a script that uses curl. Quite often curl fail. The error is name lookup timed out I tried to ping google.com and and other sites. Indeed dns (or whatever do the translation from domain name to IP takes a few seconds to do that. How to make my dns server (/resolver, or what is it anyway) work faster? How to test this without a program? How to test dns resolution time?


Install Ghostscript v 9.05 (or newer) on CentOS

I need to use the **ghostscript inkcov device** on my **CentOS** server. The device is said to be available on GS versions **9.05 and newer**. However, `yum install ghostscript` installs version **8.70**. **What is the easiest way to get the inkcov device to work?**


How to test DNS speed?

I am using google open DNS now. I want to test it's speed. How can I? I can ping and see that it gets faster. I need some faster way.


Solaris ptree style tool for Linux

I'm looking for the Linux tool that will print the same output as the Solaris ptree. For example:               # ptree 538     538   /usr/lib/ssh/sshd       889   /usr/lib/ssh/sshd         890   /usr/lib/ssh/sshd           1498  -sh             1649  bash               1656  -sh                 1660  bash                   13716 ptree 538      I'm aware that pstree exists, but I don't like its output format. Does anyone know any similar tools?


Cannot login to KDE

Last time I booted and logged into my Kubuntu account, I was surprised not to end up on my desktop but in XBMC, which I already installed some months ago. I repeated this several times with the same result. I was able to switch to a virtual terminal, where I uninstalled xbmc, but this did not help. After I enter my login data, I end up seeing nothing but the background of my login screen and my mouse cursor. What can I do? I am completely stuck...


Dump process's stdin and stdout

I have two processes, let's say Parent and Child. Parent launches the Child and communicates with it through child's stdin and stdout.               Parent <-> Child      These processes use text protocol and I need to investigate it. I would like to create a bash script which will be launched by the Parent instead of child. This script will launch the Child and in addition will dump stdin and stdout streams to a log files.               Parent <-> MyProcess <-> Child                 |                 v               log.txt      Is there a way in bash to do what I need or do I need to use C?


X goes black when using SimpleScreenRecorder

When using `SimpleScreenRecorder`, `X` goes black all the time when I do anything more trivial than typing in a terminal session. I have to switch to another `tty` and back to `X` for it to show again. Does someone know a fix for this, or at least what is causing it? EDIT: System info               Linux localhost 3.12.9-1-t520 #1 SMP PREEMPT Fri Jan 31 14:38:45 CET 2014 x86_64 GNU/Linux     X.Org X Server 1.15.0     i3 version 4.7.2     SimpleScreenRecorder 0.1.2


Cannot rotate screen with xrandr

OS: Linux Mint The output of `inxi -xG`:               Graphics:  Card: NVIDIA GF108 [GeForce GT 440] bus-ID: 02:00.0                X.Org: 1.13.0 drivers: vesa (unloaded: fbdev) Resolution:      800x600@0.0hz               GLX Renderer: Gallium 0.4 on llvmpipe (LLVM 3.3, 128 bits) GLX     Version: 2.1 Mesa 9.2.0 Direct Rendering: Yes      Intend to flip the PC's screen. Above information about current graphics card and operating system.               $ xrandr     xrandr: Failed to get size of gamma for output default     Screen 0: minimum 320 x 400, current 800 x 600, maximum 800 x 600     default connected 800x600+0+0 0mm x 0mm       800x600         0.0*        640x480        60.0         640x400         0.0         320x400         0.0       So far, I've tried to follow the available tips on the internet, unsuccessfully. My main suspicion is about the Nvidia driver. Can anyone shed light over this issue? This command: `xrandr -o rotate` doesn't work.


Mutt: select multiple messages

I am looking for a way to select multiple messages in Mutt. For example select the first and the last message would select a whole block of messages. Possible also to select by regexp for subject. I want then run a command on the selected messages, i.e. save them to a file.


setenv not working in tcsh

I am trying to install a program on my brand-new CentOs. The installation requires `setenv`, which apparently does not work, not even in the tcsh shell. Can anyone give me some advice?               [Anna@anna xd-demo] ./setup.csh          Configuring shell for the XD2006 :     ./setup.csh: line 7: setenv: command not found     ./setup.csh: line 8: setenv: command not found     ./setup.csh: line 9: setenv: command not found     ./setup.csh: line 10: setenv: command not found     ./setup.csh: line 11: syntax error near unexpected token `('     ./setup.csh: line 11: `set path=( $XD_ROOT/bin $XD_ROOT/lib/xd $XD_ROOT/lib/xdgraph $path )'     [Anna@anna xd-demo]$ echo $shell     /bin/tcsh


How to format a CF card by a terminal command?

I want to know the command for formatting a compact flash card from the terminal.


Linux kernel dropping custom keyboard scan codes

I have a vintage IBM 122 key model M keyboard that I am adapting for use on a modern computer. I am using a Teensy 2.0 to do the encoding and to handle the USB side of things. I borrowed the firmware from the Humble Hacker keyboard project (https://github.com/humblehacker/keyboard) and I added the extra keys in the build config. So far, so good. All of the "regular" keys work, but the kernel appears to be dropping the extra keys (`F13`-`F24`, etc.). Running `/lib/udev/keymap -i input/event0` shows the scan codes of all the normal keys, but nothing for the extra keys. Running `wireshark` to packet capture the USB port shows that the **keyboard IS sending** the scan codes, but it looks like the kernel is just dropping them on principle. I feel like this is something in the kernel drivers that is simply not delivering scan codes that it does not expect. I would think that there would be some sort of "master" key map in some `.h` file in the kernel source somewhere, but so far, I have not been successful in my efforts to find it. It is worth stressing that I am not asking about mapping the extra keys in X, like so many others before me. This is a low level, apparently kernel related, problem. Assume for the moment that I will not be using X at all. What I need is for the scan codes to show up when I run `/lib/udev/keymap -i`, I can do the rest from there.


Zsh theme guides

Does anyone know any good tutorials (or books) for what goes into writing a theme?


Pipe not picking up stdout

I am running a java program from a `OS X 10.8` bash terminal, and are trying to rederect the output it is producing. However, when either running this throug a pipe, or rederecting it to a file, the output is blank, however I see the output in the terminal. To illustrate this:               > java program.java     13/10/02 14:18:30 WARN some     13/10/02 14:18:30 INFO log     13/10/02 14:18:30 INFO messages     ...          > java program.java > log     > cat log     >      Can the java program be set up so that it is writing to another stream than `stdout`, but a stream that still produces output in the terminal. Is such a thing possible?


RHEL OS not visible anymore after installation of windows

I had a RHEL system with `/ - 40 GB`, `/boot - 100 MB` and `/swap - 2 GB` as primary partitions. The remaining space I used as secondary partition for `/home - 189 GB`. I needed to install `windows` in this system and so, I deleted the secondary partition and installed `Windows` on that partition. Now, after the `Windows` installation, I am not able to view my primary partitions anymore. Basically, when the system boots up, I am not able to see the option for `RHEL`. I see only `Windows 7`. The windows 7 size is 189 GB. So, I believe the primary partition is still intact. But I am not able to access it anymore. What should I do to view the `RHEL` OS?


How to preserve bookmarks when rearranging pages of a PDF file with tools like pdftk?

I am using `pdftk` to rearrange pages of a pdf file with bookmarks/outlines, but after that, the output file lost the bookmarks of the original. My command is `pdftk in.pdf cat 1-22 43 23-42 44-end output out.pdf`. I was wondering how I could keep the bookmarks while rearranging pages?


"Xlib: extension "Generic Event Extension" missing on display" warnings

How to fix `Xlib` warning: `Xlib: extension "Generic Event Extension" missing on display`? A Google search returns many results but I still can't fix it :(.   I Tried `sudo apt-get install libxcb-event0` but it didn't help. I am using Ubuntu on coLinux on Windows XP.


running a program located on my computer on a server

There is a server I can SSH into , but I can't use up a lot of the HDD space on it. I want to run a program, but this program is quite large, so I can't just copy it to the server. Is there a way to run a program that's located on my computer on the server via SSH? (both my computer and the server are on the same LAN, I'm running Linux Mint, and the server is running CentOS release 5.9 (Final)).


Detach a process from Sh (not Bash) or “disown” for Sh (not Bash)

Consider a shell script executed by Sh, not Bash (and I can't change it, and can't use a shebang, it's ignored). The `&` operator works, but `disown $!` does not and makes Sh complains “ _disown: not found_ ”. How do I detach a background process from specifically Sh? I mean, doing from Sh the same as `disown` do from Bash.


Whenever I type some wrong command, my terminal tries to run that command in the background

Something strange started happening to my terminal. Whenever I type some wrong command it tries to run that command in the background.               hegeek@colinux: ~# l        [9]+  Stopped   l       thegeek@colinux: ~# fdsl            [10]+  Stopped                 fdsl        What could be the issue? * * * EDIT: After restarting the system the issue is solved. But I am still curious what caused this issue. I think it has to do something with `command_not_found_handle` shell function. While trying to find the command, it was doing something weird.


Text processing: convert text of table of content into djvu bookmark format?

Usually in the table of content of a book, each line is for a chapter or section and ended with its page number, for example,               1 first chapter 10     1.1 first section 11     1.1.1 first subsection 12     1.2 second section 13     2 second chapter 14      2.1 first section 16     2.2 second section 13      The format of bookmark of djvu files for the above example is               (bookmarks      ("1 first chapter" "#10"       ("1.1 first section" "#11"       ("1.1.1 first subsection" "#12" ))      ("1.2 second section" "#13" ))      ("2 second chapter" "#14"       ("2.1 first section" "#16" )      ("2.2 second section" "#13" ))     )      where the main points are the paring of left and right parenthesis for tree- like organization of sections and chapters, double quote for each bookmark item and each page number is preceded by a `#`. The separation between lines and indention are just for convenience to manually view and edit the bookmark text file, and don't matter at all. ### My questions are:   1. I was wondering if there are some convenient ways to convert a plain text file of table of content into djvu bookmark format, which can reduce manual handling as much as possible? This may be achieved by text processing applications, or programming under some programming language, or combination of both.   2. As Suggested with a related reply by Dennis Williamson,  > What you're doing is starting to look a little bit like XML. Perhaps you > should use the real thing and use proper tools to manipulate it. > > a quick google turns up djvuxml. XML files can be easily manipulated using > the appropriate Python or Perl module or shell utilities such as xmlstarlet. I wonder if djvu bookmark format is similar to XML format (I admit I am not familiar with XML yet, but willing to learn it if it can help here)? Can XML tools be used to convert a text file of table of content into djvu bookmark format?


Limit rows max and min length

I have this input:               XX3083136|bla-bla texthere texttt|asfdasfd@safdsadf.com|SADFdsafsafd|ASDfasfdsafd|DSFSAFD|dsafasfd|sadfsad|     XX3083372|bla-bla-bla this is a text bla-bla|asdfsfda@lsadfasfdda.com|SDFsafas|SADFsa|DFSsdf|asdasdf|sadfdsafsaf|asdfsadf|      and I need this output:               XX3083136|bla-bla texthere textt|asfdasfd@safdsadf.com         |SADFdsafsafd|ASDfasfdsafd|DSFSAFD|dsafasfd|sadfsad|     XX3083372|bla-bla-bla this is a te|asdfsfda@lsadfasfdda.com      |SDFsafas|SADFsa|DFSsdf|asdasdf|sadfdsafsaf|asdfsadf|      So the difference is that I need to control the max text length between the "|". If it's shorter then given line lenght then " " need to be putted. In this example the second row is limited to max 24 chars and the third row has to be at least 30 chars. Different rows will need different max/min limits.. How can I do this in bash?


How to sed lines that contain only given form?

This is the input:               asdfZE3033141xycf     asdfINSFRHxycf      and I need this output:               asdfZE3033141          asdfINSFRHxycf      So I used a:               echo -e 'asdfZE3033141xycf\nasdfINSFRHxycf' | sed '/asdfZE3033141xycf/ s=xycf$=\n='      but I need this in GENERAL. So I need to sed every:               asdfZE[0-9][0-9][0-9][0-9][0-9][0-9][0-9]xycf      line in a textfile. I just can't put the "[0-9]" in sed. How can I do this?


Delete lines from a file using awk or sed based on the variable from previous command

I have a CSV file (say temp.csv) with strings and numbers. I need to delete the lines which contain a particular pattern of string at the beginning of the lines in the file. For example, here is my file -               req1,incl_patt1,excl_patt1,2,ind1     req1,incl_patt2,excl_patt2,1,ind1     req1,incl_patt3,excl_patt3,4,ind1     req2,inc_patt1,exc_patt1,1,ind2     req2,inc_patt2,exc_patt2,2,ind2     req2,inc_patt3,exc_patt3,3,ind2     req3,pattern3,expatt3,1,ind3     req4,pattern4,expatt4,1,ind4      I am writing a pattern to `req_file_curr` in a command `~ $ req_file_curr=req1` `echo "${req_file_curr}"` gives output as `req1` However when using it in a **`sed`** command, like below:               sed '/\"${req_file_curr}\"/d' temp.csv      gives output as               req1,incl_patt1,excl_patt1,2,ind1     req1,incl_patt2,excl_patt2,1,ind1     req1,incl_patt3,excl_patt3,4,ind1     req2,inc_patt1,exc_patt1,1,ind2     req2,inc_patt2,exc_patt2,2,ind2     req2,inc_patt3,exc_patt3,3,ind2     req3,pattern3,expatt3,1,ind3     req4,pattern4,expatt4,1,ind4      I am expeceting the output as               req2,inc_patt1,exc_patt1,1,ind2     req2,inc_patt2,exc_patt2,2,ind2     req2,inc_patt3,exc_patt3,3,ind2     req3,pattern3,expatt3,1,ind3     req4,pattern4,expatt4,1,ind4      How can I use the variable from a shell as a pattern to look for in **`sed`** or **`awk`**?


Seeing scons file like python file in vim. File dependent properties

I know I can `setf python` and then the file is recognized as python. However I must redo this everytime I reload the scons file. I have read some weeks ago that one could write in the last lines of a file with a special syntax and sets parameters that vim should read. In my case I would like `setf python` to be set anytime I open this scons file. However I don't remember the syntax, and I can't manage to find the web site where I read it was possible to have file dependent properties. `#:setf python` on the last line doesn't seem to suffice.


I tried to install MADWIFI on my OpenMediaVault-Server. Any more information needed? I get this error, every time i enter `make`:               root@NAS2024:/media/5703066A59887FF7/Dsys/madwifi-0.9.4# make     Checking requirements... ok.     Checking kernel configuration... ok.     make -C /lib/modules/2.6.32-5-amd64/build SUBDIRS=/media/5703066A59887FF7/Dsys/madwifi-0.9.4 modules     make[1]: Entering directory `/usr/src/linux-headers-2.6.32-5-amd64'       CC [M]  /media/5703066A59887FF7/Dsys/madwifi-0.9.4/ath/if_ath.o     /media/5703066A59887FF7/Dsys/madwifi-0.9.4/ath/if_ath.c:1: error: bad value (armv4) for -march= switch     make[5]: *** [/media/5703066A59887FF7/Dsys/madwifi-0.9.4/ath/if_ath.o] Error 1     make[4]: *** [/media/5703066A59887FF7/Dsys/madwifi-0.9.4/ath] Error 2     make[3]: *** [_module_/media/5703066A59887FF7/Dsys/madwifi-0.9.4] Error 2     make[2]: *** [sub-make] Error 2     make[1]: *** [all] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-5-amd64'     make: *** [modules] Fehler 2      Why has this error occured?


Does dropbear take care of hosts.allow and hosts.deny?

I'm running `dropbear` as SSH daemon on Debian (actually Raspbian). I tried setting               # /etc/hosts.allow     dropbear:192.168.1.1     # my static ip from which I SSH connect to the device      and               # /etc/hosts.deny     ALL:ALL     # block all others      Then I restarted the whole device. I could still SSH into the device from different IP addresses and even from remote. Did I configure the files wrong or does `dropbear` not support these two files?


Custom highlighting for gtksourceview not working

I am trying to write my own syntax highlighting for gtksourceview. If it's done it should highlight guitar chords in a text file. This is my unfinished file:               <?xml version="1.0" encoding="UTF-8"?>     <language id="tab" _name="Tab" version="2.0" _section="Others">       <metadata>         <property name="mimetypes">text/plain</property>         <property name="globs">*.txt;*.tab</property>       </metadata>            <styles>         <style id="chord" _name="Chord" foreground="blue" bold="true"/>       </styles>            <definitions>              <context id="chord" style-ref="chord" class="no-spell-check">           <match>[A-H]</match>         </context>              <context id="tab">           <include>             <context ref="chord"/>           </include>         </context>            </definitions>     </language>      I would expect every capital A to H to be blue and bold in the highlighted text. Is saved the file to `/usr/share/gtksourceview-3.0/language-specs` and I am able to select it in GEdit. But nothing is highlighted in the text. Can anyone tell me what I am doing wrong?


How to use the SVN CLI effectively

How can I make myself more productive with the SVN CLI? I need to complete repetitive tasks like these:   * find modified files in directory   * commit only SOME of them      * selecting them somehow other then remembering their names   * list unversioned files      * add only some using some efective way other then remembering them   * revert only some files in certain directory I was used to TortoiseSVN on Windows, but a switch to OSX (which is quite linux-like) forced me to use SVN's CLI, as other clients are bad or really expensive.


Why isn't there a truly unified package manager for Linux?

Why isn't there a unified package manager that acts as an interface between the end-user and the underlying low-level package manager (`apt`, `yast`, `pacman`, etc.)? Is it hard to do and therefore not practical, or is there a genuine obstacle making it impossible to do?


How would I auto click for a Centos server?

Is there any way to do auto clicking on CentOS? I have tried googling for a simple auto clicker and couldn't seem to find any (yet Ubuntu seemed to have promising results). Is there any well known auto clicker out there for CentOS? Or maybe is there a way to do it without even needing to install a program?


how to merge pdf files so that each file begins on an odd page number?

I need to merge a few dozed pdfs, and i want all of the input pdfs to start on an odd page in the output pdf. Example: A.pdf has 3 pages, B.pdf has 4 pages. I _don't want_ my output to have 7 pages. What i want is an 8-page pdf in which pages 1-3 are from A.pdf, page 4 is empty, and pages 5-8 are from B.pdf. How can i do this? I know about pdftk, but i didin't find such an option in the man page.


Send only one warning when the private key is not available

For added security, I would like to require a private key to use sudo on my Ubuntu Server box. I've added private key authentication for sudo as described at http://superuser.com/questions/164078/how-to-make-shared-keys-ssh- authorized-keys-and-sudo-work-together. I've also attempted to disable password-based authentication by making `/etc/pam.d/sudo` read as follows:               #%PAM-1.0          auth    required   pam_env.so readenv=1 user_readenv=0     auth    required   pam_env.so readenv=1 envfile=/etc/default/locale user_readenv=0     auth    [success=1 default=ignore]   pam_ssh_agent_auth.so file=/etc/security/authorized_keys     auth    requisite  pam_deny.so     auth    required   pam_permit.so     auth    optional   pam_cap.so          @include common-account     @include common-session-noninteractive      It seems to work, but I wanted to check to make sure that I wasn't overlooking a massive security hole. Also, if I try to use sudo without having a private key, it tries three times before failing:               Sorry, try again.     Sorry, try again.     Sorry, try again.     sudo: 3 incorrect password attempts      This isn't a terribly big deal, but I do get a security warning e-mail every time, so it would be nice to make it only try once.


Use rsync to just get a folder and its content with a pattern

I've looked all around the internet, looked in regexp sites and everything else, but I'm unable to write a rsync command to fetch what I want to. I need to mirror the FreeBSD release, but I don't need the RC versions and BETA versions, so I just need to rsync any folder with RELEASE in it's name with all files and subfolders of this folder. At this moment I've this command running without success:               rsync -vaz --delete --dry-run ftp2.br.freebsd.org::FreeBSD/releases/amd64 /usr/repos --include=".{0,}(RELEASE)" --filter="-! */"      Let's image the following folder structure:               amd64/8.3-RELEASE/     amd64/8.4-RC2/     amd64/amd64/10.0-RC5/     amd64/amd64/10.0-RELEASE/     amd64/amd64/9.1-RELEASE/     amd64/amd64/9.2-BETA1/     amd64/amd64/9.2-BETA2/     amd64/amd64/9.2-RC1/      In this case rsync should only get:               amd64/8.3-RELEASE/     amd64/amd64/10.0-RELEASE/     amd64/amd64/9.1-RELEASE/


Solaris default install (user tools)

Many questions on this forum as well as other places really boils down to somebody coming from Linux environment and then not being able to use the equivalent command on Solaris. Often this is because of different options supported, etc. This question intends to document (Q&A style) of what a reasonable Solaris install should always include. Never again should a user be frustrated because something isn't available. We focus on the packages most often asked for by Solaris newbies/visitors in questions. This is about standard userland tools such as `find`, `grep` and what have you. If you are looking for a similar posting about development tools (e.g. compiler, make, etc) then you should look here.


Setting up apache axis client on centos

I have below codes.               import java.util.*;     import java.io.*;     import java.net.URLConnection;     import java.net.MalformedURLException;          import org.apache.axis.client.Call;     import org.apache.axis.client.Service;     import org.apache.axis.encoding.XMLType;     import javax.xml.namespace.QName;     import javax.xml.rpc.NamespaceConstants;     import javax.xml.rpc.ParameterMode;     import java.net.URL;          public class doWebService     {           public      static void doWebService()           {                 try                 {                       ////////////////////////////////////////////////////////////////////                       // Responds the same with or without the ?WSDL                       String      strEndPoint       = "http://www.deeptraining.com/webservices/weather.asmx";                       String      strSoapAction     = "http://litwinconsulting.com/webservices/GetWeather";                       String      strSchemaURL      = "http://litwinconsulting.com/webservices/";                       String      strParamName1     = "City";                       String      strParameterVal1= "Murfreesboro";                       String      strFunctionName   = "GetWeather";                            //Call      call   = (Call) new Service().createCall();//Works                       Call  call   = new Call(strEndPoint);//Works same                            ////////////////////////////////////////////////////////////////////                       // first parameter in QName seemingly takes ANYTHING                       call.setOperationName(new QName(strSchemaURL, strFunctionName));                            ////////////////////////////////////////////////////////////////////                       // Set the name of the parameter and the return type                       call.setReturnType(XMLType.XSD_STRING);                       call.addParameter(new QName(strSchemaURL,strParamName1), XMLType.XSD_STRING, ParameterMode.IN);                       //                       ////////////////////////////////////////////////////////////////////                       // Catch the result and print it                       // Parameter count is now ONE (1).                       call.setSOAPActionURI(strSoapAction);//Yes Necessary                       String      strResult = (String) call.invoke(new Object[] {strParameterVal1});                       System.out.println("Result='" + strResult + "'");                 }                 catch (Exception e)                 {                       e.printStackTrace();                       System.err.println(e.toString());                 }           }                public static     void main(String[] args)           {                 ////////////////////////////////////////////////////////////////////////                 //    6 Call a Web service (with parameters)                 doWebService();           }     }      As I compile I got this errors. I know because I am missing the library. So I downloaded from here http://axis.apache.org/axis2/java/core/download.cgi the binary distribution. Normally all my library I put .jar file all in /usr/java/jdk1.7.0_03/jre/lib/ext. So which .jar file should I put in there. How about the xml rpc where to get those library ?               doWebService.java:6: error: package org.apache.axis.client does not exist     import org.apache.axis.client.Call;                                  ^     doWebService.java:7: error: package org.apache.axis.client does not exist     import org.apache.axis.client.Service;                                  ^     doWebService.java:8: error: package org.apache.axis.encoding does not exist     import org.apache.axis.encoding.XMLType;                                    ^     doWebService.java:10: error: package javax.xml.rpc does not exist     import javax.xml.rpc.NamespaceConstants;                         ^     doWebService.java:11: error: package javax.xml.rpc does not exist     import javax.xml.rpc.ParameterMode;                         ^     doWebService.java:30: error: cannot find symbol                       Call  call   = new Call(strEndPoint);//Works same                       ^       symbol:   class Call       location: class doWebService     doWebService.java:30: error: cannot find symbol                       Call  call   = new Call(strEndPoint);//Works same                                          ^       symbol:   class Call       location: class doWebService     doWebService.java:38: error: cannot find symbol                       call.setReturnType(XMLType.XSD_STRING);                                          ^       symbol:   variable XMLType       location: class doWebService     doWebService.java:39: error: cannot find symbol                       call.addParameter(new QName(strSchemaURL,strParamName1), XMLType.XSD_STRING, ParameterMode.IN);                                                                                ^       symbol:   variable XMLType       location: class doWebService     doWebService.java:39: error: cannot find symbol                       call.addParameter(new QName(strSchemaURL,strParamName1), XMLType.XSD_STRING, ParameterMode.IN);                                                                                ^       symbol:   variable ParameterMode       location: class doWebService


Send a command to a running tmux session (like screen -X)

I'm looking to switch from screen to tmux for my terminal multiplexing needs, but there's a feature of screen that I need to replicate in tmux: the -X option, which allows one to run arbitrary screen commands inside an existing screen session. This allows me to modify a running screen session's environment to point to a new X server, since my screen sessions tend to live longer than my X11 logins. For example, I could put something `screen -X setenv DISPLAY $DISPLAY` in my X11 startup scripts. Anyway, is there a way in tmux to send arbitrary commands to a running tmux session? Alternatively, a way to update environment variables in a running tmux would be acceptable.


Linux 3.x: what wireless chipsets will support a bridged connection?

I have asked a similar question on the Ubuntu pages but this is likely a generic Linux issue: what variety of wireless cards/drivers will support being placed in a bridged connection? I have been using very old Prism II hardware as it worked while I believe more recent cards did not, but the old hardware died, killing the bridge.


Killing multiple instances of the script from the script itself

I've couple instances of script.sh running in parallel, doing the same thing, running in background. I'm trying to use a function to kill all the current running scripts when executed. So, for example, ./script.sh -start will start the script (which I can run few in parallel) and when I execute ./script.sh -kill will kill all instances of the script.               f() {                  procName=`basename $0`                  pidsToKill=`ps -ef | grep $procName | grep -v grep | awk '{ print $2 }'`                  if [[ $pidsToKill ]]; then                         for i in $pidsToKill; do                              kill -9 $i                         done                         echo "Killed running scripts."                  else                         echo "No opened scripts to kill"                  fi     }      For some reason, sometimes it kill couple of the scripts and sometimes returns an error. I've figured a way to solve this, but I wanna understand why this one doesn't work. Any ideas?


Battery standby

I am using a lenovo z570 laptop. In windows I am able to use the laptop for around 2.30 hrs in normal usage.But when I use any Linux distro the battery drains a lot faster. I am able to use only for 40mins or so.where could the problem be?


xfs_quota Quota always zero

I run this command: `xfs_quota -x -c 'report -h' /eamorr/home` Here is the output               User quota on /eamorr/home (/dev/mapper/mpathe)                             Blocks                   User ID      Used   Soft   Hard Warn/Grace        ---------- ---------------------------------      root          48K      0      0  00 [------]     user1         20K  97.7G 107.4G  00 [------]     user3         16K  97.7G 107.4G  00 [------]     user4      944.5M 488.3G 488.3G  00 [------]     73827392      16K      0      0  00 [------]     78473948      16K      0      0  00 [------]     user2       37.4G  97.7G 107.4G  00 [------]     user5         16K  97.7G 107.4G  00 [------]          Group quota on /eamorr/home (/dev/mapper/mpathe)                             Blocks                   Group ID     Used   Soft   Hard Warn/Grace        ---------- ---------------------------------      root            0      0      0  00 [------]     staff       38.3G      0      0  00 [------]     student       32K      0      0  00 [------]      user1, user2, user3, etc. are in the "staff" group 73827392 and 78473948 are in the "student" group. I can set a soft/hard quota for any staff member: `xfs_quota -x -c 'limit bsoft=500m bhard=550m user4' /eamorr/home` Works perfectly However, when I do the same for a student member: `xfs_quota -x -c 'limit bsoft=500m bhard=550m 73827392' /eamorr/home` Their quota stays stuck at zero! **What am I doing wrong?** I'm using autofs. Here is /etc/auto               admin           -fstype=xfs     UUID=8bcd7348-a419-4c93-bdbe-47638d129a3e9dfde5fab0f8     software        -fstype=xfs     UUID=59edae56-f3ad-4ea6-ad56-9dfde5fab0f8     home            -fstype=xfs,uquota,gquota       UUID=df943889-273d-d9-aaf5-5e707ecdaf87     scratch         -fstype=xfs     UUID=bac6837c-afa2-431a-a032-5e707ecdaf87      I tried `service autofs reload`. Doesn't work either. Quotas for students still come up as zero. Is it because the username is numerical? I tried `xfs_quota -x -c "limit bsoft=500m bhard=550m '73827392'" /eamorr/home` I got: xfs_quota: invalid user name: '73827392' However when I do: `xfs_quota -x -c "limit bsoft=500m bhard=550m 73827392" /eamorr/home` It looks like it works, however the quota is still reported as "0".


How can I generate a DEB from an installed package?

I've done this in the past before but I can't remember how. I'd like to take an installed package on one machine, create an installable deb from it, then send that deb over to another machine. How can I generate the deb?


Why are rmdir and unlink two separate system calls?

Here's something that kept me wondering for a while:               [15:40:50][/tmp]$ mkdir a     [15:40:52][/tmp]$ strace rmdir a     execve("/usr/bin/rmdir", ["rmdir", "a"], [/* 78 vars */]) = 0     brk(0)                                  = 0x11bb000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff3772c3000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=245801, ...}) = 0     mmap(NULL, 245801, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff377286000     close(3)                                = 0     open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3     read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\36\3428<\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=2100672, ...}) = 0     mmap(0x3c38e00000, 3924576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3c38e00000     mprotect(0x3c38fb4000, 2097152, PROT_NONE) = 0     mmap(0x3c391b4000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b4000) = 0x3c391b4000     mmap(0x3c391ba000, 16992, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3c391ba000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff377285000     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff377283000     arch_prctl(ARCH_SET_FS, 0x7ff377283740) = 0     mprotect(0x609000, 4096, PROT_READ)     = 0     mprotect(0x3c391b4000, 16384, PROT_READ) = 0     mprotect(0x3c38c1f000, 4096, PROT_READ) = 0     munmap(0x7ff377286000, 245801)          = 0     brk(0)                                  = 0x11bb000     brk(0x11dc000)                          = 0x11dc000     brk(0)                                  = 0x11dc000     open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=106070960, ...}) = 0     mmap(NULL, 106070960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff370d5a000     close(3)                                = 0     rmdir("a")                              = 0     close(1)                                = 0     close(2)                                = 0     exit_group(0)                           = ?     +++ exited with 0 +++     [15:40:55][/tmp]$ touch a     [15:41:16][/tmp]$ strace rm a     execve("/usr/bin/rm", ["rm", "a"], [/* 78 vars */]) = 0     brk(0)                                  = 0xfa8000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3b2388a000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=245801, ...}) = 0     mmap(NULL, 245801, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3b2384d000     close(3)                                = 0     open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3     read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\36\3428<\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=2100672, ...}) = 0     mmap(0x3c38e00000, 3924576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3c38e00000     mprotect(0x3c38fb4000, 2097152, PROT_NONE) = 0     mmap(0x3c391b4000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b4000) = 0x3c391b4000     mmap(0x3c391ba000, 16992, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3c391ba000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3b2384c000     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3b2384a000     arch_prctl(ARCH_SET_FS, 0x7f3b2384a740) = 0     mprotect(0x60d000, 4096, PROT_READ)     = 0     mprotect(0x3c391b4000, 16384, PROT_READ) = 0     mprotect(0x3c38c1f000, 4096, PROT_READ) = 0     munmap(0x7f3b2384d000, 245801)          = 0     brk(0)                                  = 0xfa8000     brk(0xfc9000)                           = 0xfc9000     brk(0)                                  = 0xfc9000     open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=106070960, ...}) = 0     mmap(NULL, 106070960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3b1d321000     close(3)                                = 0     ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0     newfstatat(AT_FDCWD, "a", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0     geteuid()                               = 1000     newfstatat(AT_FDCWD, "a", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0     faccessat(AT_FDCWD, "a", W_OK)          = 0     unlinkat(AT_FDCWD, "a", 0)              = 0     lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)     close(0)                                = 0     close(1)                                = 0     close(2)                                = 0     exit_group(0)                           = ?     +++ exited with 0 +++      Why are there separate system calls for removing a directory and files? Why would these two operations be semantically distinct?


Debian disables IRQs

It's been two days that my Debian Wheezy 7 randomly disables IRQs apparently with no reason. After the IRQs are disables, I'm unable to mount hard disks and I have to reboot. This is the output of syslog:               Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438414] irq 18: nobody cared (try booting with the "irqpoll" option)     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438419] Pid: 0, comm: swapper/0 Tainted: G           O 3.2.0-4-amd64 #1 Debian 3.2.57-3+deb7u2     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438421] Call Trace:     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438422]  <IRQ>  [<ffffffff81092bad>] ? __report_bad_irq+0x2c/0xb5     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438429]  [<ffffffff81092f6a>] ? note_interrupt+0x170/0x1f2     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438431]  [<ffffffff8109132c>] ? handle_irq_event_percpu+0x15f/0x17d     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438432]  [<ffffffff8109137e>] ? handle_irq_event+0x34/0x52     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438435]  [<ffffffff8106c189>] ? arch_local_irq_save+0x11/0x17     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438437]  [<ffffffff810936e1>] ? handle_fasteoi_irq+0x7c/0xaf     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438440]  [<ffffffff8100f9e1>] ? handle_irq+0x1d/0x21     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438442]  [<ffffffff8100f5ba>] ? do_IRQ+0x42/0x98     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438445]  [<ffffffff8134feee>] ? common_interrupt+0x6e/0x6e     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438446]  <EOI>  [<ffffffff811b0d34>] ? timerqueue_add+0x80/0xa0     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438450]  [<ffffffff811eec0d>] ? intel_idle+0xea/0x119     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438452]  [<ffffffff811eebec>] ? intel_idle+0xc9/0x119     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438455]  [<ffffffff81270851>] ? cpuidle_idle_call+0xec/0x179     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438457]  [<ffffffff8100d242>] ? cpu_idle+0xa5/0xf2     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438460]  [<ffffffff816abb36>] ? start_kernel+0x3b8/0x3c3     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438462]  [<ffffffff816ab140>] ? early_idt_handlers+0x140/0x140     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438463]  [<ffffffff816ab3c4>] ? x86_64_start_kernel+0x104/0x111     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438464] handlers:     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438487] [<ffffffffa00f5cfd>] ata_bmdma_interrupt     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438490] [<ffffffffa0051b0b>] sil24_interrupt     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438492] Disabling IRQ #18      What could be the source of the problem? What's the path to follow to solve it?


Is there a difference between setting an environment variable to the empty string and unsetting it?

Is there any practical difference between unsetting an environment variable and setting it to the empty string?


Pull a file from a Docker container?

I can see that it's possible to insert a file into a Docker container via `insert`:               docker insert IMAGE URL PATH      Is there a way to fetch the contents of a file in a Docker container and save them somewhere on the host operating system? I'd like to extract the value of a configuration file and store it on my host operating system.


Adding MySql Workbench to favorites in Fedora 19

I'm using Fedora 19 64 bit on my Samsung Series 9 Ultrabook and I have installed MySQL workbench 6 (mysql-workbench-community-6.0.7-1.fc18.x86_64) via the RPM downloaded from the MySQL website. I'm unable to pin this application to favorites. I have tried creating the `mysql-workbench.desktop` at `/usr/share/applications/` and copied the `mysql- workbench.png` icon into `/usr/share/pixmaps/` file as follows:               [Desktop Entry]     Name=MySQL Workbench     Comment=MySQL Database Design, Administration and Development Tool     Exec=mysql-workbench     Terminal=false     Type=Application     Icon=mysql-workbench     MimeType=application/vnd.mysql-workbench-model;     Categories=GTK;Database;Development;      Any pointers would be appreciated.