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

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


Country flags icons

Is there any standard in *nix systems for country flags? Like, icon theme specification.


How to install OpenBSD/vax 4.7 on multiple disks?

I've got an old VAXstation 3100 Model 76, and I'd like to install OpenBSD/vax 4.7 on it. I've got two drives in it, an RZ23 (104MB) and a another 1.09GB. Now, since the 1.09GB is too large for an operating system to boot from (VAXen have that "magical 1.072GB boundary"), I'd like to use the 104MB drive as `/` partition, and all other partitions, including swap should go on to the other drive. But how do I do this with the OpenBSD install, since it lets me chose one disk only? I tried installing NetBSD/vax 5.0.2 beforehand, but `sysinst` segfaults right after I give the OK to install the sets. The VAXstation has the both hard drives I mentioned above and 16MB RAM (which I'd like to expand some day). The machine is otherwise in perfect working order, expect the NVRAM and RTC don't work any more, I'll change them (new chip is already ordered). In case you'd advice another OS (aside from OpenVMS), you might give me hints here, too.


tunneling VNC/rdesktop over ssh

I'm having a friend behind a firewall, with a windows computer. I'm having a Linux machine at home which is not behind a firewall. I want to have an rdesktop connection to his machine, without using any intermediate service such as `LogMeIn`. My plan is:   1. Have him SSH to my machine (SSH is allowed by the firewall), and set the appropriate tunnel.   2. Activate rdesktop/vnc on my machine, on the currently ran `X` server. What I don't like about it, is the hassle of running programs as his user on the currently running `X` server. I'd rather have him set the tunnel somehow for _my_ user, so that I'll just be able to `rdesktop localhost:1234` as long as he's connected to me. Any smarter way?


Will enabling Hyper-Threading create two virtual half-speed processors?

If I enable Hyper-Threading for my netbook which has an Intel Atom (1.6 GHz) will the kernel see two virtual 800 MHz processors?


In /etc/group what is the meaning of the second field?

A sample `/etc/group` file contains the following entries:               root:*:0:     adm:!:4:logcheck     antoine:x:1000:      The man pages I've read (Debian & OSX) says the second field is to store a group password. As they are rarely used, an asterisk `*` or a `x` is usually placed in it rather than leaving it blank. The `shadow` man page also says that this second field should store the result of the `crypt` function. And if an invalid result is stored (such as `*` or `!`) it means the password cannot be used as authentication method. Does that hold true for the `group` file as well? Why do I end up with 3 different characters in my `group` file all having the same meaning? Can I safely change all to `*`?


Set starting directory for gnome-terminal profile

In gnome-terminal if I choose File->"Open Terminal" or "Open Tab" I get a new window in the same directory as the current window. I would like to create a gnome-terminal profile that starts in a particular directory. I have experimented with the "run a custom command" option in the "Title and Command" section of the profile's properties, but so far all my attempts result in the terminal immediately exiting. Is there a way to do this?


possible spots to configure BIND-DNS forwarders

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


How do I tell if a folder is actually a symlink and how do I fix it if it's broken?

How do I tell if I have a symlink, a shortcut of some sort, or a folder in Linux? Please see following screenshot. ![symbolic link in linux shell](http://i.stack.imgur.com/yciav.png) As you can see, the `ls` command lists objects where some are colored in dark blue while others are colored light blue (cyan). What are these cyan colored objects? Are these actual symbolic links? As you can see, I cannot `cd` to the one called hdd.               root@dm500hd:/# cd hdd     -sh: cd: can't cd to hdd      I think it has to redirect to `/media/hdd` and I have noticed that the hdd folder is missing. Is there a way to fix this? **Update:** Here are results of the `ls -al` command. ![symbolic link in linux shell 2](http://i.stack.imgur.com/lTR1A.png) As you can see it says `hdd -> /media/hdd` and it's colored in red. Does this mean that it's broken or that it is automounted, i.e. when a physical hdd is connected? **Update:** Here is result of the `grep media /etc/auto*` command. ![symbolic link in linux shell 3](http://i.stack.imgur.com/lJLCL.png) What do these `/etc/auto.master:/media/net` and `/etc/auto.network` entries do? Here are results of `ls -Fal /media` command. ![symbolic link in linux shell 4](http://i.stack.imgur.com/m1Zrh.png) Is this of any help?... Here are results of `stat` and `file` commands, as well as listings of /usr and /bin. ![symbolic link in linux shell 5](http://i.stack.imgur.com/X4ER5.png) Does this help me in any way?... does it help you help me?... As a side not, what you should know is that this is a Linux based STB with BusyBox, it's an embedded system. So not all commands might be supported. **Update:** Last screenshot, showing files and supported commands in /sbin and /usr/sbin. ![symbolic link in linux shell 6](http://i.stack.imgur.com/tBpCE.png) **Update:** New share added... I have now removed that old share and recreated one with the same name as before and also added a second share now. So now I have two of them.               SHARES     remote share   local share     mydream        dream1     mydream2       dream2          LOCATIONS     remote        local     C:\mydream    /media/net/dream1     C:\mydream2   /media/net/dream2      The recordings are placed in /media/net/dream1/movie. Also, for the share dream2 I have chosen not to mount it as a HDD replacement in the Mount Manager, as I suspect that it's not possible to have more than one act as a HDD. Where would it record? To both locations? With double the data rate?... I don't think it's possible. So for this reason there is no subfolder named movie for the dream2 share. Only the ones that are specified as HDD replacement when created get the movie subfolder. If I `cd` to hdd from root it goes to `/media/net/dream1`. If I `cd` to `..` (parent) it goes back to `root (/)`. At root `ls -al` gives `hdd -> media/hdd`. `ls -al hdd` gives `hdd -> media/hdd`. `ls -al media` gives `/media/net/dream1`. Also, if I `cd` to `/media` there is another `hdd` symlink. I have not noticed it before. I think this is created automatically when a share is mounted. And if I `cd` to this hdd it goes to `/media/net/dream1`. A symlink `hdd` (/hdd) that points to another `hdd` symlink (/media/hdd), which in turn points to the share folder (/media/net/dream1)?..... I'm getting dizzy... It was not like this before version 3.2.3 or at least 3.2.0 of the Enigma2 image. _Edit:_ By settings the second share to act as a HDD replacement it becomes the active share for recording. At the same time the share that was previously set to act as a HDD replacement is no longer active, even if it is still set to "yes" (act as HDD replacement). If dream1 was first used as HDD replacement ("yes" to act as replacement) and then dream2 is set to act as HDD replacement, it becomes the new share for recording. I can still see and view video files stored in dream1 but I can no longer record to it. If I want to go back to use dream1 for recording I first have to set dream2 to "no" (stop acting as HDD replacement) and then reset dream1 to "yes". So no, it cannot record to two shares at the same time. One of them has to go. So it's either dream1 or dream2, not both. Although I should mention that it's possible to record more than one service (tv channel) if they are both on the same transponder, if not you get the "no free tuner" message. This is a STB with only one tuner.


bash script to verify rhel patching

we have several redhat servers which we patch from redhat satellite. To avoid confusion, I'll use the term "host" to denote the server which is being patched. We have a script, say, **_patch.sh_** , which we'll schedule to run in all redhat hosts (virtual machine) using "Remote command" option in **Redhat satellite**. This **_patch.sh_** script runs " ** _yum update_** " followed by " ** _vmware-config-tools -d_** " and **_reboot_**. There's more to it, but this is just the outline. My understanding is, " ** _yum update_** " downloads all packages to **_/var/cache/yum/_** of the host, under various sub-directories that are named based on the channels the hosts are subscribed to, and then installs the packages and remove them from there. Have pasted the output of command " ** _ls -lt /var/cache/yum_** " below for better understanding.               [root@xyzdev01]#ls -lt /var/cache/yum     total 64     drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit     drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit-supplementary     drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit-rhn-tools      Here under these directories, for example, say under **rhel-5-64bit** , there are few files along with a sub-directory called **_packages_** , where packages from this channel gets downloaded to. Per my understanding, this **_packages_** sub-directory is empty in servers where the patching is successful. Sometimes, what happens is, the package gets downloaded to the host, but due to some intermittent connectivity issue between **Redhat satellite server** and host where patching is happening (i.e) where the **_patch.sh_** script is being run, it doesn't gets installed. But when Redhat satellite server re- establishes the connection with the host, it thinks that the host is patched and proceeds with the reboot and these servers gets listed under "Completed Systems" in Redhat satellite, whereas actually the host is not patched. Here, the package stays in the **_/var/cache/yum/channel_name/packages_** without being installed. To avoid this corner case, we're planning to implement an additional check in the **_patch.sh_** script. I have 2 questions. 1) Is my understanding right? 2) If yes, then if i place an additional check in the script to check for ****.rpms*** under **_/var/cache/yum_** before it actually performs the next steps (i.e) **_vmware-config-tools -d_** and **_reboot_** , would it work? Appreciate any suggestions and clarifications. Thank you.


How to use scanner drivers api in Linux shell script

Usually when scanning any page using Canon DR- 2050C scanner in windows it rotates vertical text paged to horizontal automatically for the easy reading of the user. In Linux we are manually scanning pages using same scanner but it doesn't rotate the pages, but how to use drivers routines to perform this rotation automatically.


Screen: Resuming most recent screen? Making selection easier?

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


Securely reading and parsing a string from a parameter or file in bash

I've been writing a number of bash scripts lately which get variables from a parameter or from a file. Some of the scripts run as root (using sudo) This is on my notebook, so there aren't any other users to cause security problems in this situation, but ... I'd like to be able to write a script I can release into the wild. Probably, what this question does is make a strong case for not writing anything in bash where root/sudo is involved and input/parameters can't be trusted. Other than locking everything down with sudoers, is there a way to read an arbitrary string into a bash program and parse it _without_ allowing bash to expand it, potentially executing something along the way? I don't see any solution for defending against a rogue parameter. For a file, there might be a way, but it's not simple. The string could be safely input to the script using read, but once it's in one or more variables, I can't see any method of accessing it that wouldn't involve potentially dangerous variable expansion. I think it would be possible to read from a file using read -n 1 to get one character at a time in a loop into an array. That ought to defang just about anything, but it's a bit cumbersome having to reassemble everything character by character later. I'm thinking of input like: '$(rm -rf ./*)' or 'eval shutdown -h now' or similar given as input which would run when a variable containing it was referenced. If the script was running as root, this could be a real problem! Any ideas on how to address this other than, "Get a real programming language"?


How to disable gzip compression with wget?

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


How to list files and directories with directories first

I have two questions. First, which command lists files and directories, but lists directories first? Second question: I want to copy a list of files into a single directory, but make the target directory the first filename in the command.


How can I write a "idempotent" .Xmodmap

Currently I have an `.Xmodmap` file that changes my `Command` to `Ctrl`, then changes my `Ctrl` to `Super` (I'm running Linux on a Mac). It works quite well, when only run once but on successive runs (for example when I restart my desktop environment (Cinnamon) it reloads the `.Xmodmap` file) it basically resets the settings by reverting the changes. Effectively toggling between my desired setup and the original setup. How can I write an `.Xmodmap` file that only sets the settings one time, but doesn't change them back on successive runs? Here is my existing `.Xmodmap` file:               clear control     clear mod4          keycode 105 =     keycode 206 =          keycode 133 = Control_L NoSymbol Control_L     keycode 134 = Control_R NoSymbol Control_R     keycode 37 = Super_L NoSymbol Super_L          add control = Control_L     add control = Control_R


How do you integrate a media player with the Xfce taskbar i.e. for play/stop controls?

In a Debian sid Xfce set-up I'm trying to get the volume control in the taskbar to show the media player controls like it does in some more preconfigured distros. How do I do that? Searches in synaptic and Google have so far turned up nothing.


Convert .ISO to .IMG in terminal (Mac) (Linux)

I am trying to make a bootable flash drive with Linux on it for my Mac. I have Ubuntu desktop downloaded, and it is in my downloads. The instructions on the Ubuntu website tell me I need to convert the ISO to IMG (of course, because its a Mac, and I cannot boot otherwise, so converting is necessary). This is the terminal command they tell me to run: `hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso` I understand I need to replace both paths, and I know I need to change the ubuntu.iso path to the file located in my downloads, but what path do I put in the place of `~/path/to/target.img`? Can someone give a specific example? I tried putting `~/Users/Gurpreet/Desktop/target.img`, but it says no such file or directory. I understand that there is not a file named target.img on my desktop. What path do I use? Specific example and help will get 10 points.


Installing Debian on an SSD

Does the Debian installer work out of the box for SSDs? I.e. I heard that you need to align the partitions to 32bit virtual clusters (is it actually true?). Are there any other things I need to take into account while installing Debian on SSD? I already have some general pointers on running from an SSD: Optimal SSD configuration In this question I would just like to ask about the actual installation procedure.


Debian on 64 bit Intel Core 2 Quad

I just ordered a new SSD, and so I am planning to reinstall my Debian system. I have an Intel Core 2 Quad CPU (Q9450). Does it make sense to install the 64bit version (I have just 4GB of RAM, plus 1GB on the graphics card if it makes any difference, but I am considering increasing this amount). Which architecture should I choose? Also I am using the proprietary nvidia drivers, do they work at all and are they stable on the 64 bit systems?


Linux SSH logging via PUTTY

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


Use EncFS to encrypt files so that a particular user or process can access them, but root cannot

I have a process which I would like to have access to an encrypted file system. This is very easy to do with EncFS, but this requires a user mounting the encrypted file system, therefore giving any user who has access to the mounting user access to the data, e.g. root. Is it possible to have the process mount the file system so that only it has access to the data? If not, is there another way to prevent those who do not know the passphrase from accessing the data?


How can I match a ttyUSBX device to a usb serial device

option driver correctly matched USB ID and loads driver for this device. For example               # lsusb     Bus 001 Device 002: ID 19d2:0031 ONDA Communication S.p.A. ZTE MF636     Bus 001 Device 003: ID 12d1:14ac Huawei Technologies Co., Ltd.      It also creates ttyUSBX devices for managing the hardware               crw-rw---- 1 root uucp 188, 0 Jul  4 13:48 /dev/ttyUSB0     crw-rw---- 1 root uucp 188, 1 Jul  4 13:49 /dev/ttyUSB1     crw-rw---- 1 root uucp 188, 2 Jul  4 13:35 /dev/ttyUSB2     crw-rw---- 1 root uucp 188, 3 Jul  4 13:37 /dev/ttyUSB3     crw-rw---- 1 root uucp 188, 4 Jul  4 13:37 /dev/ttyUSB4     crw-rw---- 1 root uucp 188, 5 Jul  4 13:37 /dev/ttyUSB5     crw-rw---- 1 root uucp 188, 6 Jul  4 13:37 /dev/ttyUSB6     crw-rw---- 1 root uucp 188, 7 Jul  4 13:37 /dev/ttyUSB7      However, I have more then one usb serial devices and I want to know which ttyUSB is for which USBID. Ex. /dev/ttyUSB1 -> 19d2:0031 Do you know any point where I can get this information?


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

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


Serial Communication on DD-WRT stty config not sticking

I am attempting to control a serial device (in this case a projector) using a Fonera router with DD-WRT on it. I've got the serial port on the fonera wired through a level shifter and then into my projector's serial port. I've made the following stty command to configure the serial device according to my needs:               stty 19200 -F /dev/tts/0 cs8 -crtsdts -parenb -cstopb -ixon clocal echo      The projector's documentation says it should be a 19200 baud rate, 8-bit length, No parity, one stop bit, and "None" for X on/off. However when I run that command and then run               stty -F /dev/tts/0 -a      to list the config, I get different results:               root@DD-WRT:/dev# stty -F /dev/tts/0 -a     speed 115200 baud; rows 24; columns 80;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;     swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;     min = 1; time = 0;     -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff -iuclc -ixany -imaxbel     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke      Notice the speed is wrong. What am I doing wrong?


cd ${DIR_PATH} returns 'No such file or directory'

OS = `MacOS 10.8.5`/`Darwin Kernel Version 12.5.0`. In my `.bash_profile` I have:               export DIR_PATH=~/concrete/path      At the terminal               >echo ${DIR_PATH}     ~/concrete/path      Also explicit cd works:               >cd ~/concrete/path     >pwd     /Users/myuserid/concrete/path      But when I do               >cd ${DIR_PATH}     -bash: cd: ~/concrete/path: No such file or directory      What is the problem?


How can I fake sending -time when sending email with Mutt?

Suppose a student is two hours late in returning an assignment. Now the assignment needs to travel a long way in internet so there is a good excuse that it got lost in somewhere or got jammed (well ok, fails but one always needs to find good reasons to return things a bit late in a funny way). Now is there some way you can make it look like the email was sent much earlier than it was actually sent? Look I have strict timelines like 23.59, I am uncertain which clocks they use the measure that -- sending or arrival time and in which time-zone. Could I change the time-zone so my email becomes "on time"?


How to install patterns and packages at the same time?

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


MySQL permission denied error even after setting security context for SELinux on VM

I have MySQL installed on CentOS (detail versions given below). My OS is a VM machine and not a physical machine, the directory `/data/mysql` is a local disk (virtual). I suspect I might need to do some extra steps in a virtualized environment. This link has some information on SELinux & virtualization but not sure how to include it for MySQL. MySQL works fine with the data directory in `/var/lib/mysql` but the moment I move it to another directory on different disk it stops working. Whereas different directory on the same disk works. If I disable SELinux, MySQL works with different disk. SELinux is restricting different drive. I tried the solution given in the following two links   * SELinux and MySQL   * Re: Moved datadir and now get: ERROR! The server quit without updating PID file In particular the following two commands:               $ semanage fcontext --add --type mysqld_db_t '/data/mysql(/.*)?'     $ restorecon -r /data/mysql      When I run:               $ ls -dZ /data/mysql      I get the following:               drwxr-xr-x. mysql mysql unconfined_u:object_r:mysqld_db_t:SystemLow       Still I keep getting: > /usr/sbin/mysqld: Can't change dir to '/data/mysql/' (Errcode: 13 - > Permission denied) Is there anything else I need to do?   * MySQL : mysql Ver 14.14 Distrib 5.6.14, for Linux (x86_64) using EditLine wrapper   * OS : CentOS release 6.4 (Final)


ssh connection hangs when looking up a SERVFAIL domain

Scenario: I am browsing the internet through an `ssh -D` port-forwarding tunnel, both browsing (http, https, ...) connections and domain lookup queries are done using this `SOCKS 5` local proxy. The problem happens when I click a link to a domain that has a problem with its nameservers, at this point the ssh connection just stalls, all sockets using this proxy are paused, even the interactive shell session (ssh connection) is paused for about half a minute. Any idea on how to solve this issue (while still using the ssh connection to resolve the domain names)? Commands below are executed on the server, with an example domain that has this issue.               aularon ~ $  time dig kjdecor.com ANY          ; <<>> DiG 9.9.2-P2 <<>> kjdecor.com ANY     ;; global options: +cmd     ;; connection timed out; no servers could be reached          real    0m21.207s     user    0m0.008s     sys 0m0.009s     aularon ~ $  time nslookup kjdecor.com     ;; connection timed out; no servers could be reached               real    0m21.095s     user    0m0.005s     sys 0m0.008s


Mouse shortcut to copy the path to a file in the Gnome file manager

Is there a Linux equivalent of the Windows Shift+Right-click sequence? I use this a lot on files and directories to get the 'hidden' "Copy as path" option in the pop-up menu. It saves a lot of typing (and typos) when using the command line. I'm hoping that Linux has something similar, so I can go to the 'Files' window in a GUI (Gnome3 in my case) and just copy a file or directory location as a path and then paste it in a terminal window. This function would be especially handy in Linux given the heavy reliance on the terminal! Is this possible?


How can I get my external IP address in bash?

I need to find my external IP address from a bash script. At the moment I use this function:               myip () {          lwp-request -o text checkip.dyndns.org | awk '{ print $NF }'     }      But it depends on `perl-libwww`, `perl-html-format`, `perl-html-tree` installed. What other ways can I get my external IP?


How to get IP Address using shell script?

Want to get the IP address using Shell script. Without knowing the eth0 or eth1 or eth2 How to get the particular IP address. I am not interest to get localhost address, want to get **private IP address**.


How to forward port after tunneling

Today I have read this question and answer (How does reverse SSH tunneling work?). I tried it out and it worked perfectly however I want to know one thing. Say I have a web server running on port 8000 and I forward that port to my receiving server. How do I then forward the port the receiving server gets to others on the network. E.g.: I have a Server 1(Ubuntu Server running with full port forwarding and no firewall). I have another server 2 (running WITH a firewall and without port forwarding). I use SSH tunnelling to put my web server onto Server 1 from server 2. How can I let clients who can connect to server 1 connect to the tunnelled service from server 2 via server 1 Client 1 Cannot Connect to Server 2 but can connect to server 1.


Globally replace Vi with Vim on Fedora

On Debian-based systems the alternatives system handles both the `vi` and `vim` executable. So if `vim` is installed and you execute `vi`, you also get `vim`, which I find very nice, because I absolutely hate classic `vi`. On Fedora 17 "Beefy Miracle", the alternatives system obviously doesn't handle none of the two. But there is a profile file in `/etc/profile.d/vim.sh` which adds a shell alias to make `vi` execute `vim`. For some reason it does not do that for system users, including root. But even if I set up an alias for all users manually, when I call `sudo vi` I'm starting classic `vi` instead of `vim`. That's probably because sudo doesn't start a shell or profile files are only executed in interactive shell sessions. What I'm looking for now is a way to uninstall classic `vi` completely to make a symlink that even survives system updates. How can I remove classic `vi` but not `vim` on Fedora 17? Or is there even a better way? **Update** : With `yum provides vi` I found out that `vi` is provided by the package `vim-minimal`. But I can't simply remove it because it automatically removes the package `sudo` with it. Even if I do remove it, and try to install `sudo` again afterwards, `vim-minimal` is then again installed as dependency. **Update** : As requested, output of `rpm -qf /usr/bin/vi`:               vim-minimal-7.3.444-1.fc17.x86_64      And `ls -l /usr/bin/vi`:               -rwxr-xr-x. 1 root root 782248 13. Feb 2012  /usr/bin/vi


Configure the fields of the Rmail summary

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


Can I use hdparm -B254 -S240 /dev/sda?

According `man hdparm`, `-B254` does not permit spindown. -B(1--127)`permits spindown. But`-B127 -S240` will makes **Load_Cycle_Count** increase too fast about 4/minute. How to set up hdparm parameter? I use laptop computer.


How to change the language for date command?

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


Pulseaudio and Pavucontrol very unstable

I've recently installed ArchLinux on my desktop, together witht the GNOME3 Desktop. I installed pulseaudio and pavucontrol, which both seem to be very unstable. First I couldn't get my headset to work, but after changing the settings, and reverting the changes, that seemed to be fixed. I still have a problem with Pavucontrol though. When I open pavucontrol, it usually takes a few seconds to connect to the pulseaudio server, and it'll only work for say a minute and then it'll simply crash without further notice. Often it has to reconnect to the pulseaudio server at random intervals, while using the program. Further, when I move the slider to adjust my volume, the sample being played is played very quickly, and when playing sound in Firefox through flash, it'll get played fast as well. Some sounds (not flash) will simply not get played at all, or get played for a second and than simply stopping. Is there a way I can fix this? What is causing this issue? Is it Pavucontrol, Pulseaudio, Alsa or even the kernel? * * * When I create a new (console-)session, and login as root, my headset volume will be terribly loud. (I press tab and the standard beep will play through the whole house, just from my headset). Adjusting alsamixer volumes has no effect on this. * * * **UPDATE:** After a reboot my headset simply stopped working. It is detected by Pulseaudio, but no sound can be heard. It is not muted in Alsamixer. My headset's microphone is also properly detected while plugged or not, but when it is unplugged, I can still select it (and it'll be marked as unplugged) and it'll still be receiving sounds. The sounds being received seem to be a weakened version of my internal microphone. When it is not plugged in the sound is properly received from the actual microphone. The restart also seems to have stabalized pulseaudio drastically.


ssh ncat keeps ncat process running after disconnect; how do I prevent that?

If I run the command               $ ssh othermachine ncat localhost 10000      that opens an `ssh` session to "othermachine" and pipes it into an `ncat` process. (There's something else listening on "othermachine" port 10000). Now if I disconnect the `ssh` session (with `Ctrl`+`C`) the `ncat` process on "othermachine" keeps running. How do I prevent that? I want `ncat` to die if its parent ssh exits.


Typical text files present on all (most) GNU/Linux systems?

I may need to develop some short snippets/examples involving reading text files; so I thought - why not use some files that are typically present on all (and since I sense "all" may be a stretch, then "most" is fine) Linux "vanilla" systems/distros? (primarily interested in Linux here) The only one I can think of for now is `/etc/fstab` - however, it should be owned by `root`, so I'm not sure whether that will interfere with my snippets later on - I'd like an average user to at least be able to read them (although, `fstab`'s permissions are `-rw-r--r--`, so I don't think read-only would be a problem; for instance, `cat /etc/fstab` works fine under my regular username). Another reason why I wouldn't like to use it, is because it contains potentially sensitive information... In any case, I was wondering - are there any other text-files that could be considered "standard" in typical GNU/Linux systems, that I could use for this purpose? (basically, something like example.com, but on your local filesystem)


Give a Root owned folder web read and write access

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


Checklist for a painless distro-migration for a workstation: what should I keep in mind?

I have long been frustrated and unsatisfied with the setup I have at work. I have been running OpenSuSE 11.3 with great joy, but as it phased out of official existence I tried out 11.4, got lots of bugs, jumped on 12.1 with great expectations only to run into the madness that is Gnome3. I have been using Mint 12 since then, but I feel it has certain odd bugs, even though I keep all packages up-to-date. I am considering Mint 13 or possibly switching back to OpenSuSE with XFCE, perhaps even trying out Fedora. Problem is that I can not keep fiddling around with my PC for days, in the middle of projects. I am not a guru but by no means a complete newbie to the tux world either. I have migrated to a different distro a couple of times before but I find it to be rather tricky business. You take backups of everything, repartition the hdd to make sure the old setup is not destroyed in case the new distro doesn't work, so you can at least boot into the old one etc. Is there a way to make the switch as painless and seamless as possible? How can I avoid losing my data both as documents etc, but also preferences/settings that I have fixed over the months/years?


CNAME: Mail address gets rewritten

I have a problem with receiving mails. I do not know if my server or the server of the sender is wrong configured. I have a domain daniel-marschall.de which has following DNS RR:               daniel-marschall.de.    86400   IN  CNAME   viathinksoft.com.      The domain viathinksoft.com has the MX RR to "mail.viathinksoft.com":               viathinksoft.com.   85651   IN  MX  0 mail.viathinksoft.com.      mail.viathinksoft.com runs Postfix, Cyrus and Debian Linux. When I send an email to webmaster (at) daniel-marschall.de e.g. using GoogleMail, the user "Daniel Marschall" at our system receives the email, which is correct. But when the server "startcom.org" sends an email to webmaster (at) daniel- marschall.de , the email gets "hard redirected" to webmaster (at) viathinksoft.com which is a different mail account. The relevant parts of the email headers are:               Received: from viathinksoft.de ([unix socket])          by viathinksoft.de (Cyrus v2.2.13-Debian-2.2.13-19+squeeze3) with LMTPA;          Tue, 06 Nov 2012 02:15:02 +0100     Received: by viathinksoft.de (Postfix, from userid 5001)         id AD83016CE112; Tue,  6 Nov 2012 02:15:01 +0100 (CET)     Received: from mta1.startcom.org (apache-7.startcom.org [192.116.242.7])         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))         (No client certificate requested)         by viathinksoft.de (Postfix) with ESMTPS id 90F5116CE107         for <webmaster (at) viathinksoft.com>; Tue,  6 Nov 2012 02:14:55 +0100 (CET)     Received: from localhost (com.internal.startcom.org [192.168.0.180])         by mta1.startcom.org (8.13.8/8.13.8) with ESMTP id qA61EbIS010233         for <webmaster (at) daniel-marschall.de>; Tue, 6 Nov 2012 03:14:37 +0200     From: ...     To: webmaster (at) viathinksoft.com (<-- WRONG!!!)      As you can see, the email was initially intended for "webmaster (at) daniel- marschall.de", but now it has the field "To: webmaster (at) viathinksoft.com", so my MTA dropped the mail to the owner of viathinksoft.com . I think the sender's MTA thinks that "CNAME" RR means that the address needs to be rewritten, but as far as I know, CNAME is only a soft redirect on DNS basis and should not force the MTA to rewrite the domain name. Or am I wrong? PS: The log entries are showing that my server already has the wrong address when the mail is incoming:               $ cat /var/log/mail.log | grep '90F5116CE107'     Nov  6 02:15:00 viathinksoft postfix/smtpd[18184]: 90F5116CE107: client=apache-7.startcom.org[192.116.242.7]     Nov  6 02:15:00 viathinksoft postfix/cleanup[19928]: 90F5116CE107: message-id=<c76cb951ea724270c94ff1b0e8d4de4e (at) startcom.org>     Nov  6 02:15:00 viathinksoft postfix/qmgr[9843]: 90F5116CE107: from=<certmaster (at) startcom.org>, size=1583, nrcpt=1 (queue active)     Nov  6 02:15:01 viathinksoft postfix/pipe[20419]: 90F5116CE107: to=<info (at) viathinksoft.de>, orig_to=<webmaster (at) viathinksoft.com>, relay=spamassassin, delay=6.2, delays=5.5/0/0/0.76, dsn=2.0.0, status=sent (delivered via spamassassin service)     Nov  6 02:15:01 viathinksoft postfix/qmgr[9843]: 90F5116CE107: removed


concatenate .out files

Can I combined multiple .out files with the cat command in bash or csh? Additionally I want only the header of first file to be concatenated and I was thinking of using the tail function for that. Anyone know if this is possible or of a way to do this?


Chromium with ~20 opened tabs freezes my laptop

As the title says, when I have about 20 opened tabs of Chromium I see the hard disk starts writing and everything start to freeze. I have to 'killall' Chromium. Previously I had installed google-chrome and the same was happening. Is it normal or it could be a bug? Someone experienced the same? My laptop is a Acer Aspire E1-571G with i5 processor 2.6GHz 8GB ram. gentoo distro with gnome as graphical system **UPDATE** : a big shame on me because I found out I didn't activate _HIGHMEM64_ config on my kernel (I don't know why) so I was running with ~2 Gb of ram instead of 8..


How to include %CPU usage in a notification?

I have the following script:               #!/usr/bin/env bash          sleep_period=8m          while true; do       if ps -eo %C --sort -%cpu | head -2 | awk 'NR==2 { exit !($1>8); }'; then           notify-send 'CPU alert!' '......'           xdotool key shift       fi       sleep ${sleep_period}     done      But I don't know how to get the notification to print the % CPU value instead of `'......'`. I'm using Lubuntu 13.10, fully updated.


Open ports for local samba server with iptables

I can't seem to connect from Windows 7 to my network share on Ubuntu (Samba). Why won't this work? Heres a bit of information, that would perhaps be useful.               user1@computer:/etc$ sudo iptables -L -n          Chain INPUT (policy ACCEPT)     target     prot opt source               destination          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.10            tcp dpt:8080     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.11            tcp dpt:80     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.12            tcp dpt:80     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.2             tcp dpt:22     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.13            tcp dpt:80          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination                    user1@computer:/etc$ sudo netstat -tulpn | egrep "samba|smbd|nmbd|winbind"          tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      8350/smbd     tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      8350/smbd     tcp6       0      0 :::445                  :::*                    LISTEN      8350/smbd     tcp6       0      0 :::139                  :::*                    LISTEN      8350/smbd     udp        0      0 10.0.0.255:137          0.0.0.0:*                           7833/nmbd     udp        0      0 10.0.0.1:137            0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.45.255:137      0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.45.250:137      0.0.0.0:*                           7833/nmbd     udp        0      0 0.0.0.0:137             0.0.0.0:*                           7833/nmbd     udp        0      0 10.0.0.255:138          0.0.0.0:*                           7833/nmbd     udp        0      0 10.0.0.1:138            0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.xx.xxx:138      0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.xx.xxx:138      0.0.0.0:*                           7833/nmbd     udp        0      0 0.0.0.0:138             0.0.0.0:*                           7833/nmbd


How to pipe the result of a grep search into a new vi file

I'm using `grep -e Peugeot -e PeuGeot carlist.txt` to search through carlist.txt and pull out some items and I presumed that `grep -e Peugeot -e PeuGeot carlist.txt | vi` would pipe it through for me but this is what I get:               Vim: Warning: Input is not from a terminal     Vim: Error reading input, exiting...     Vim: preserving files...     Vim: Finished.      Any advice on how this should be done is very appreciated


Mageia - how do I setup a KVM for Windows gaming?

Okay so I setup a KVM using Virt-Manager, Iset it to 7443 out of 8GB RAM, Got it to emulate my CPU fully, everything worked fine, but I cant get my GPU to unbind from the host to the guest, So is there any script that is around to help? I will post below all error codes I have encountered while attempting to create the machine.                Error starting domain: unsupported configuration: host doesn't support passthrough of host PCI devicesTraceback (most recent call last):  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper    callback(asyncjob, *args, **kwargs)  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 127, in tmpcb    callback(*args, **kwargs)  File "/usr/share/virt-manager/virtManager/domain.py", line 1260, in startup    self._backend.create()  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 866, in create    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)libvirtError: unsupported configuration: host doesn't support passthrough of host PCI devices      That above is when I attempt to run the KVM with a PCI device, no matter the device it still happens. My lspci output               [root@localhost xdroidie626]# lspci00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 04)00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)00:1f.0 ISA bridge: Intel Corporation Z77 Express Chipset LPC Controller (rev 04)00:1f.2 SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Barts XT [Radeon HD 6870]01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Barts HDMI Audio [Radeon HD 6800 Series]      Virsh output               [root@localhost xdroidie626]# virsh nodedev-dumpxml pci_0000_01_00_0<device>  <name>pci_0000_01_00_0</name>  <path>/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0</path>  <parent>pci_0000_00_01_0</parent>  <driver>    <name>radeon</name>  </driver>  <capability type='pci'>    <domain>0</domain>    <bus>1</bus>    <slot>0</slot>    <function>0</function>    <product id='0x6738'>Barts XT [Radeon HD 6870]</product>    <vendor id='0x1002'>Advanced Micro Devices, Inc. [AMD/ATI]</vendor>  </capability></device>[root@localhost xdroidie626]# virsh nodedev-dettach pci_0000_01_00_0error: Failed to detach device pci_0000_01_00_0error: invalid argument: neither VFIO nor kvm device assignment is currently supported on this system      And the output Virsh gives when I attempt to unbind the device               [root@localhost xdroidie626]# virsh nodedev-dettach pci_0000_01_00_0error: Failed to detach device pci_0000_01_00_0error: invalid argument: neither VFIO nor kvm device assignment is currently supported on this system      I do apologise about the small amount of information but I dont know what to do next. All I want the KVM for is to run games via windows, adding to that I can snapshot back if need be (Virus etc) My specs for the system are as posted   G1 Sniper M3 Z77 motherboard   i5 2500 3.3Ghz CPU   AMD 6870 1GB   8GB RAM   Samsung 840 SSD 120GB 500GB 7200.12RPM drive Any solutions to the errors posted, and to my entire problem?


How to make grub2 always boot into Windows by default? I'm using Fedora 20. I tried following a guide online, and it worked for a while, but was reverted by a kernel update. I'd like grub2 to default to Windows for good. Please write 'my solution will survive a kernel update' in your answer.


Cache all gpg subkey passwords at once? Prevent need for multiple gpg password entry?

Can I enter my gpg password just once and unlock all my sub keys (signing, decryption, authentication)? At the moment, I need to enter my gpg password three times (for signing, for decryption, for authentication). This is inconvenient. I tried to come up with a shell script.               #!/bin/bash     set -x     set -e     set +o history          signing_key=77BB3C48     encryption_key=CE998547          tempfile="$(mktemp)"     echo "test" > testfile          unset passphrase || exit 1     read -sp 'Enter password. ' passphrase ; echo          exec 3<<<"$passphrase"          gpg2 --no-tty --use-agent --batch --yes --passphrase-fd 3 --sign-with "$signing_key" --clearsign "$tempfile"     gpg2 --no-tty --use-agent --verify "$tempfile.asc"          gpg2 --no-tty --use-agent --yes --armor --recipient "$encryption_key" --encrypt "$tempfile"          exec 3<<<"$passphrase"     gpg2 --no-tty --use-agent --batch --decrypt --passphrase-fd 3 "$tempfile.asc"      But unfortunately, that way passwords gnupg-agent doesn't cache the password. Can this be fixed? System information:   * When not using that shell script, I have no issues with gnupg-agent. When I manually sign / decrypt a file in shell, pinentry asks for password twice, then caches it until reboot.   * Using Debian Wheezy.   * gpg version: `dpkg -l | grep gnupg`               ii  gnupg                                        1.4.12-7+deb7u3                    i386         GNU privacy guard - a free PGP replacement     ii  gnupg-agent                                  2.0.22-3                           i386         GNU privacy guard - password agent     ii  gnupg-curl                                   1.4.12-7+deb7u3                    i386         GNU privacy guard - a free PGP replacement (cURL)     ii  gnupg2                                       2.0.22-3                           i386         GNU privacy guard - a free PGP replacement (new v2.x)      I've asked on gnupg-users mailing list a while ago, but no reply. Perhaps this answer can help? Perhaps `gpg-connect-agent` is required?


closing the unwanted file descriptors

I am trying to understand how pipes work . This code snippet is from some website . So my understanding of the program goes like this : When we do `pipe(fd)` then `fd[0]=3` and `fd[0]=4` ( assuming only `0`,`1` & `2` are open till now ) . Now we fork the parent and then if a child is not created then we have error and it exits . But if it child is created successfully , are the file descriptors copied to the child , I mean is `fd[0]=3` and `fd[1]=4` for the child process also ? `fd[0]` and `fd[1]` are file handles to which files ( we have not specifically specified ) ? Let us suppose that we want child to read from parent then , parent should close `fd[0]` and child should close `fd[1]` but why ? What will happen if we do not close them ? And I didn't understand `On a technical note, the EOF will never be returned if the unnecessary ends of the pipe are not explicitly closed.` . > If the parent wants to receive data from the child, it should close fd1, and > the child should close fd0. If the parent wants to send data to the child, > it should close fd0, and the child should close fd1. Since descriptors are > shared between the parent and child, we should always be sure to close the > end of pipe we aren't concerned with. On a technical note, the EOF will > never be returned if the unnecessary ends of the pipe are not explicitly > closed.                   #include <stdio.h>         #include <unistd.h>         #include <sys/types.h>              main()         {                 int     fd[2];                 pid_t   childpid;                      pipe(fd);                      if((childpid = fork()) == -1)                 {                         perror("fork");                         exit(1);                 }                      if(childpid == 0)                 {                         /* Child process closes up input side of pipe */                         close(fd[0]);                 }                 else                 {                         /* Parent process closes up output side of pipe */                         close(fd[1]);                 }                 .                 .         }      I am newbie in learning OS , forgive me if my question is silly . Thanks in advance !


initiate ssh connection from server to client

We can easily connect via `ssh` to the remote machine that has public IP. But now I have a remote machine without public IP, and I need to connect to it from my machine that does have public IP. So that, remote machine should initiate this connection (add a client). I need it because there is my grandfather on computer without public IP, and he needs help with his system sometimes. In similar situation on Windows I've used VNC connection (by TightVNC), TightVNC server has an option "Add a client": user just entered client's IP (i.e. my public IP), my client is already in "listening mode", and when "server" adds a client, connection is initialized. So, is it possible to perform the same trick with SSH connection?


What is the term "Usage"?

I am seeing this a lot in the scripts. Is "usage" a command in unix ? I tried googling it but got ambiguous results. Here is an example `: ${1?"Usage: $0 ARGUMENT"}`


Sharing a project tree between environments

To save space and time I copied a large project tree on a network drive as hard links, i.e.               cp -a -r --link proj proj_B      (background: it's huge, needs to be rebuilt from two incompatible environments, and doesn't have good support for specifying intermediate and product locations. So this was a quick hack to get a rebuild in environment "B": after copying clean and rebuild from "proj_B/obj". Both environments are under LinuxMint 16) The problem with this approach is that edits won't be (reliably) shared between these trees, e.g. saving an edit to "proj/foo.cpp" will leave it pointing to a new inode and "proj_B/foo.cpp" will still point to the old one (maybe from the loss-avoidance pattern of "save temp; mv orig temp2; mv temp orig; rm temp2"). For sharing source I guess I need symbolic links for the source directories (but not simply a symlink of the project root, since the binary directories need to be kept apart), e.g. something like:               cp -a -r --symbolic-link proj proj_B      followed by unlinking the binary directories (except that recursive symlink copying fails with "can make relative symbolic links only in current directory". But something similar could be done with "find -exec", or just capitulating and writing a script) But before doing that I wanted a sanity check: is there a better tool for this all along (e.g. some warlock-grade combination of rsync flags)? Or is this sharing approach doomed to end in tears and lost data and I should resign myself to using two copies (and lots of cursing when I find I forgot to push/pull latest changes between them)?


Resizing LVM within a in KVM-based VPS

I have a VPS (based on KVM, not sure which storage technology) for about two years now. It's mainly a learning machine, a utility proxy, or a seldom-used VPN gate, or whatever--no real work, no problem with downtime for few days. So after I purchased it two years ago, I partitioned it using LVM with result like this:   * one 10GiB physical disk   * two partitions: /boot and LVM, together eating 100% of the disk space   * on the LVM partition, several "normal" partitions like /, swap and /home Now I have purchased additional space from the ISP. They did their magic so after reboot, there is another 10GiB of unpartitioned space. I'm not exactly sure what is the correct next step. What I did in hope I'll see what are my options is that I went and booted into a SysResCD , but the GParted version provided does not support LVM. (New SysResCD shipped with GParted, with LVM support, already exists.) Anyway, since I hear that LVM is supposed to make things _easier_ , I suspect that this is not the correct way in the first place. (Actually I even suspect that using LVM _within_ KVM might have been crazy idea in the first place, since well, at this moment, it might well looks like: partitions in LVM in KVM in another LVM on a set of physical disk in RAID...) So what to do next: should I ask ISP to provide new SysResCD and continue what I started? Or is it easier now to simply move everything out of the LVM and fix the installation?


Is it safe to use a bash script to create a daemon?

I would like to create an entirely automated box (based on something like a Raspberry-Pi or OLinuXino card). My box would run a Debian based system with a read-only filesystem and a ramdisk (to avoid SD card corruptions). I would like to create a script that automatically connects to a remote server (via ssh) each time the box is switched on or plugged to a network. To do so, I think my simplest solution is to create a shell script running as a daemon. This daemon will have to stay alive until the box is shut down or disconnected from network. The script should be able to reconnect when network is up or box restarts. The question: do you think a shell script is safe enough to perform this ? Or should I better use another (and safer) programming language (PERL, C, ...) ?


Run program after finish ssh connection

How do I connect to ssh debian and running a program and let it continue to run after you finish my connection through ssh.


What scopes can shell variables have?

I just ran into a problem that shows me I'm not clear on the scope of shell variables. I was trying to use `bundle install`, which is a Ruby command that uses the value of `$GEM_HOME` to do its work. I had set `$GEM_HOME`, but the command ignored that value until I used `export`, as in `export GEM_HOME=/some/path`. I read that this makes the variable somehow "global" (also known as an **environment variable** ), but I don't understand what that means. I know about globals in programming, but not across distinct programs. Also, given that my setting such variables applies only to the current shell session, how would I set them for, say, a daemonized process? **What scopes can shell variables have?**


How can I change my workspace switcher in Cinnamon?

In Cinnamon, you can move your pointer to the top left corner of the screen to activate the desktop switcher. This would be awesome...if I wasn't left- handed. I throw the pointer up there most of the time. It's massively frustrating. Is there a way to switch it to the top-right of the screen?


apply specific command for each git repository

I want compress all the git repositories on my computer (say in `~`). I.e., for each directory `{}`, that contains directory or file (in case of submodules) named `.git`, I want to execute `git gc --aggressive --git- dir={}`. I tried the following:               /bin/find /c/libs/boost/ -name '.git' -print -exec git --git-dir=dirname {} gc --aggressive \;      but output consist of plenty of `fatal: Not a git repository: 'dirname /c/libs/boost/.git'` etc. What should I do to use `dirname` command correctly? Or something else to achieve desired effect?


Crontab Triple Redirect

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


Printing through a Samba server without recording the password in plaintext

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


How can I make awk on Busybox treat the entire input with NULL character in between as a single record?

I wrote a base64 encode script for my Busybox system.               #!/bin/sh     base64encode()     {     /usr/bin/awk -- '     function asc(char,l_found)     {             l_found=0;             for (i=0;i<=255;i++){             if (sprintf("%c",i)==char) l_found=i;             }             return l_found;     }          function base64_and(var,x,l_res,l_i)     {             l_res=0;             for (l_i=0;l_i<8;l_i++){                     if (var%2==1 && x%2==1) l_res=l_res/2+128;                     else l_res/=2;                            var=int(var/2);                     x=int(x/2);             }             return l_res;     }          function base64_lshift(var,x)     {             while(x>0){             var*=2;             x--;             }             return var;     }          function base64_rshift(var,x)     {             while(x>0){             var=int(var/2);             x--;             }             return var;     }          BEGIN{     BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";     result="";     }          {             while (length($0)>0){     printf "Source: %s Length: %i\n",$0,length($0);                     if (length($0)==1){                             byte1=asc(substr($0,1,1));                             byte2=0;                             byte3=0;                     }                          if (length($0)==2){                             byte1=asc(substr($0,1,1));                             byte2=asc(substr($0,2,1));                             byte3=0;                     }                          if (length($0)>=3){                             byte1=asc(substr($0,1,1));                             byte2=asc(substr($0,2,1));                             byte3=asc(substr($0,3,1));                     }                          base1=base64_rshift(byte1,2);                     base2=base64_lshift(base64_and(byte1,3),4)+base64_rshift(base64_and(byte2,240),4);                     base3=base64_lshift(base64_and(byte2,15),2)+base64_rshift(base64_and(byte3,192),6);                     base4=base64_and(byte3,63);     printf "byte1=%i byte2=%i byte3=%i\n", byte1, byte2, byte3;     printf "base1=%i base2=%i base3=%i base4=%i\n", base1, base2, base3, base4;                     if (length($0)==1){                             result=result substr(BASE64,base1+1,1);                             result=result substr(BASE64,base2+1,1);                             result=result "==";                             $0="";                     }                          if (length($0)==2){                             result=result substr(BASE64,base1+1,1);                             result=result substr(BASE64,base2+1,1);                             result=result substr(BASE64,base3+1,1);                             result=result "=";                             $0="";                     }                          if (length($0)>=3){                             result=result substr(BASE64,base1+1,1);                             result=result substr(BASE64,base2+1,1);                             result=result substr(BASE64,base3+1,1);                             result=result substr(BASE64,base4+1,1);                             $0=substr($0,4);                     }     printf "Result=%s\n", result;             }                  printf "%s",result;     }     '     }     base64encode      But when there are NULL characters in the input, awk will seperate the input into different records and make the script output incorrectly. For example:               root@unknown:/tmp/test# echo -e "Hello \0 World!"|./base64encode.sh     Source: Hello  Length: 6     byte1=72 byte2=101 byte3=108     base1=18 base2=6 base3=21 base4=44     Result=SGVs     Source: lo  Length: 3     byte1=108 byte2=111 byte3=32     base1=27 base2=6 base3=60 base4=32     Result=SGVsbG8g     SGVsbG8gSource:  World! Length: 7     byte1=32 byte2=87 byte3=111     base1=8 base2=5 base3=29 base4=47     Result=SGVsbG8gIFdv     Source: rld! Length: 4     byte1=114 byte2=108 byte3=100     base1=28 base2=38 base3=49 base4=36     Result=SGVsbG8gIFdvcmxk     Source: ! Length: 1     byte1=33 byte2=0 byte3=0     base1=8 base2=16 base3=0 base4=0     Result=SGVsbG8gIFdvcmxkIQ==     SGVsbG8gIFdvcmxkIQ==root@unknown:/tmp/test#      While from Linux, we can tell the output was not correct because the above input was divided into two records and the NULL character in between is not processed.               [root@hp8 ~]# echo -e "Hello \0 World\!"|base64     SGVsbG8gACBXb3JsZFwhCg==     [root@hp8 ~]#      Can anyone please tell me how I can make the awk on my Busybox treat the entire input with NULL character in between as a single record?


Upstart reload does not work

On a virtualised Ubuntu, I used the command               $ foreman export upstart /etc/init -f Procfile -e conf/development.env -u ubuntu -a my_app -t upstart      And can now start my_app using               $ sudo start my_app      However the following command fails               $ sudo reload my_app     reload: Not running      despite both of the following working               $ sudo stop my_app     $ sudo restart my_app      Anyone have ideas on how to debug? `$ initctl list` also clearly shows my_app running


How to clean up unnecessary files

Please suggest me any particular unnecessary file that I can clean to back everything to normal condition(temporarily). (i.e. any log or archieve or anything ). My var/log has only 40MB and Home directory has 3GB of space(so I believe that's not a problem). Other than that what I can clean up to make space.               [user@host]$ df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/vg_inamivm-lv_root                            18G   17G     0 100% /     tmpfs                 1.9G     0  1.9G   0% /dev/shm     /dev/sda1             485M   71M  389M  16% /boot      I am in a debian machine. **UPDATE1:** output of `cd /; du -sxh *`               6.1M    bin     61M     boot     156K    dev     22M        etc     3.3G    home     306M    lib     18M     lib64     16K     lost+found     4.0K    media     4.0K    mnt     408K    opt     du: cannot access `proc/18605/task/18605/fd/4': No such file or directory     du: cannot access `proc/18605/task/18605/fdinfo/4': No such file or directory     du: cannot access `proc/18605/fd/4': No such file or directory     du: cannot access `proc/18605/fdinfo/4': No such file or directory     0       proc     208K    root     9.7M    sbin     0       selinux     4.0K    srv     0       sys     8.0K    tmp     536M    usr     187M    var      **Update2** Output of `ls -la /`               dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 .     dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 ..     -rw-r--r--.   1 root root     0 Aug  7 08:42 .autofsck     dr-xr-xr-x.   2 root root  4096 Mar 28 16:53 bin     dr-xr-xr-x.   5 root root  1024 Mar 28 16:54 boot     drwxr-xr-x.  16 root root  3580 Sep  9 03:13 dev     drwxr-xr-x.  69 root root  4096 Aug 23 09:19 etc     drwxr-xr-x.   9 root root  4096 Jun 29 16:10 home     dr-xr-xr-x.   8 root root  4096 Mar  7  2012 lib     dr-xr-xr-x.   9 root root 12288 Mar 28 16:53 lib64     drwx------.   2 root root 16384 Mar  7  2012 lost+found     drwxr-xr-x.   2 root root  4096 Sep 23  2011 media     drwxr-xr-x.   2 root root  4096 Sep 23  2011 mnt     drwxr-xr-x.   3 root root  4096 Mar  7  2012 opt     dr-xr-xr-x. 355 root root     0 Aug  7 08:42 proc     dr-xr-x---.   5 root root  4096 Aug 17 18:27 root     dr-xr-xr-x.   2 root root  4096 May  2 09:13 sbin     drwxr-xr-x.   7 root root     0 Aug  7 08:42 selinux     drwxr-xr-x.   2 root root  4096 Sep 23  2011 srv     drwxr-xr-x.  13 root root     0 Aug  7 08:42 sys     drwxrwxrwt.   3 root root  4096 Sep 13 03:37 tmp     drwxr-xr-x.  13 root root  4096 Mar 28 17:53 usr     drwxr-xr-x.  18 root root  4096 Mar  7  2012 var


How to use lockstat.txt on Ubuntu 12.04?

I have Ubuntu 12.04 installed on my machine. I want to use lockstat. I have looked at `Documentation/lockstat.txt` but I am not getting how to use it, if possible please help me out. I am working on a project adapting system software like the Linux kernel. I read one paper titled _"Experience on Comparison of Operating Systems Scalability on the Multi-core Architecture"_ that tells how to detect bottlenecks using bench-marking. I am following their experimental approach and am able to generate a profiling report using the profile tool, but I am not able to detect bottlenecks from this profiling report. Basically, I am not able to explore the `no-vmlinux` part, and I am not able to find `no-vmlinux` functions related to bottlenecks. Also I am not able to use _lockstat.txt_ as there is no file in `/proc/sys/kernel/lock_stat`.


How to make UEFI bootable usb disk from bios bootable iso

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


How to check Today's Day and Search Files

Problem: I need to find out today's date and search a file which contain's today's date in the name. Also another file which contains Yesterday's date. I was able to do so by something like:               TODAY=$(date +"%m%d%Y")        YESTERDAY=$(date --date="yesterday" +"%m%d%Y")     SNAPSHOT=SnapshotIR${YESTERDAY}\*.csv          for snapshotfile in $SNAPSHOT     do             if [ -f "$snapshotfile" ]             then                     SNAPSHOTFOUND="$snapshotfile"               echo Snapshot Report $SNAPSHOTFOUND is available      But there is a condition here that, if today is Monday I have to check one file which has last Friday's date and another file which has Saturday's date in their names unlike Today and Yesterday. Can anyone suggest.


Why does Firefox refuse to die despite killing it with pkill -9?

I am issuing the following command to kill Firefox on my Red Hat Linux box:               [subhrcho@slc04lyo ~]$ pkill -9 -f firefox     [subhrcho@slc04lyo ~]$       However, when I try to invoke Firefox through Applications -> Internet -> Firefox, it says: > Firefox is already running, but is not responding. To open a new window, you > must first close the existing Firefox process, or restart your system.


Multi kernel usage in Linux PC(UBUNTU)

I have 2.6.32-21-generic , 2.6.32-38-generic and 3.0.0-20-generic. My current kernel is:-               $ uname -r     2.6.32-38-generic      I want to use different kernel that is 2.6.32-21-generic. How can I do that?


How to change the default TTY after boot?

Normally when system starts you have all output printed on the TTY1, and that's ok, but I start X-server via `startx` and achieve this by the following lines in the `~/.profile` file :               if [[ $(tty) = /dev/tty4 ]]; then         exec startx &> ~/.xsession-errors     fi      So, as you can see I use TTY4 to start X-server, and I want to switch to that console automatically after the boot is done. Is there a way to do this?


Unrecognized Type: for length of date string

I am getting current date and checking for length of date if non-zero then perform some action.               now=$(date)     echo "$now"     if [[ -n "$now" ]]; then     echo "not empty"     fi      Prints this to console-               Mon Feb 17 01:51:38 CST 2014     Unrecognized Type: Mon     not empty      _if [[ -n "$now" ]]; then_ -> this line is causing shell to throw Unrecognized Type: warning, Is there something wrong with the check -n ?


How To Install PHP on CentOS by download packages?

I'm using CentOS 6.5 and I need to install PHP 4.3.11 i can't use "yum install php" because it'll install the latest version of PHP. So i use these command: wget http://museum.php.net/php4/php-4.3.11.tar.gz tar zxvf php-4.3.11.tar.gz cd php-4.3.11 make install => I got this error: "make: _*_ No rule to make target `install'. Stop." Anybody tell me what wrong i did? and how to fix it?


Recent install of ArchLinux not loading

I recently installed ArchLinux (because hey, why not) and used the Arch install script and installer located here https://github.com/helmuthdu/aui. After doing this, I got to the boot screen and it took a while, the first time it said "Loading kernel modules" and then the same message appeared again. waited for it for roughly half an hour, and it just hung there. Hardware is a Dell Inspiron 15R with intel i5, 6GB RAM, 64bit. It _is_ UEFI, if it matters. Does anyone know how to fix this so I could try and re-install it again?


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

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


PostgreSQL on FreeBSD - 'Kerberos 5 authentication not supported'

I've been trying to get a FreeBSD machine to talk to a networked postgreSQL database. I assumed that the machine had kerberos installed, as it's what I use to log in, and I was told that FreeBSD has it built in(?). I tried to connect to my remote database with `psql -h pgteach` (the alias for the server, which works fine, as I can ping the machine). I get the message               psql: Kerberos 5 authentication not supported      Googling the problem seems to suggest that I should install one of the ports for Kerberos. Does the postgresql client (version 9.1) specifically need MIT or Heimdal kerberos, or can I just add some config flags to point to the default kerberos libraries? `pg_config` returned the following lines (edited for relevance, I think). Let me know if more info is needed.               CONFIGURE = '--with-libraries=/usr/local/lib' '--with-includes=/usr/local/include' '--enable-thread-safety' '--with-openssl' '--with-libxml' '--enable-nls' '--with-gssapi' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.2' 'build_alias=amd64-portbld-freebsd8.2' 'CC=cc' 'CFLAGS=-O2 -pipe -fno-strict-aliasing' 'LDFLAGS= -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -lgssapi' 'CPPFLAGS=' 'CPP=cpp' 'LDFLAGS_SL=-lgssapi'     LDFLAGS = -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -lgssapi -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -Wl,--as-needed -Wl,-R'/usr/local/lib'     <snip>     LDFLAGS_EX =      LDFLAGS_SL = -lgssapi     LIBS = -lpgport -lintl -lxml2 -lssl -lcrypto -lz -lreadline -lcrypt -lm      **EDIT:** I _have_ to use Kerberos, as it's a univeristy-managed server. I've since tried checking the 'Use Heimdall kerberos' in `make config`, but trying to do `sudo make clean install` then complains it can't find `krb5_sendauth`. I know kerberos is installed, as kinit and klist both work fine.


How to search and replace strings matching a replacement list for multiple files

I have a file, say `map.txt`, containing a list of search strings and corresponding replacements:               search -> replacement     bigBone -> bb     fishMarket -> fm     dogCollar -> dc     ...      I need to perform search and replacement of all strings matching the above for all files recursively in a folder except symbolic links. I know how to do it one at a time like this:               $ find /some/folder -type f -exec sed -i 's/old_text/new_text/g' {} \;      How can I perform this on a massive scale using the above mapping? I have read this question, but do not quite get it.


Killing other user processes

There are certain user environments in which we have to login during certain performance testing and and kill all the process running in that environment. The environment names are like `rswrk01`, … up to `rswrk98`. and this is how we login.               sudo su - rswrk96      It doesn't prompt for any password and straightaway logs in. Is it possible to automate a script for killing all the running processes in all the environments, instead of logging in manually and killing the processes? I am not the root user by the way.               $ uname -a     HP-UX rcihp145 B.11.23 U 9000/800 3683851961 unlimited-user license


Sharing code between dpkg scripts

What is the standard way to share code between the dpkg scripts (preinst, postinst, prerm, postrm)? I can see how to share code between just postinst and prerm (by installing it as part of the package), but can't see any way to share with preinst and postrm.


Fedora15/Gnome3 - Exit elevated priviliges mode

While using Fedora 14 (Gnome2), Each time if I was doing some privileged task (ex - mounting a new hard drive), I would be prompted for password and then there would appear an icon (like keys) on the taskbar. By clicking on it, I could exit the elevated priviliges mode. I do not see any such feature - to exit priviliged mode - in F15/G3. Is it possible to do so? How?


Using several independent instances of Thunderbird

As many people, I too have several email accounts. Until now, I have been using `Thunderbird` for my main account, and either used web interface for the other accounts, or used other email clients (`Sylpheed`, `Balsa`, ...). For some reason, I never liked the idea of having separate, independent accounts integrated in one email client, perhaps because the added complexity and possibility of confusion. When I used three different email clients, I had three truly independent email accounts. The only disadvantage is, the other (non-Thunderbird) email clients never worked as well as Thunderbird. Now I am wondering whether there is a possibility to use three independent instances of `Thunderbird`, so that I don't have to use inferior email clients. I know that when `Thunderbird` is already running, I cannot start another instance. Also, any additional instance would need its own (independent) config directory. Is there any way to achieve this? I am using `Thunderbird` (`Icedove 24.6.0`) on Debian Wheezy # UPDATE: I have found this article on MozillaZine, which suggests to use the `-no- remote` option and does not mention the option `-new-instance` at all. The `man page` lists both options, but does not explain what the difference is, if `-new-instance` is implied when `-no-remote` is used, or whether they should both be used at the same time.               thunderbird -P "profile_name" -no-remote     thunderbird -P "profile_name" -new-instance      # Side note: The refered article also says, that:               Multiple instances is intended for debugging, so use it at your own risk      Well, I don't intend to use it for debugging, I want to use it for my work. What can possibly go wrong when using multiple instances? How can I mitigate that danger?


GNU screen: print a detached session to stdout

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


How to install VGA2USB in ArchLinux?

How do I install VGA2USB in Arch Linux? I downloaded the driver `vga2usb-3.26.0.27-ubuntu-3.0.0-12-server_X86_64.tbz` I tried with latest kernel did not worked failed with same issue, now showing with the stable kernel, that also failed.               $ uname -a     Linux myhost 2.6.32-lts x86_64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz GenuineIntel GNU/Linux     $ lsusb | grep Epiphan     Bus 002 Device 004: ID 5555:1110 Epiphan Systems Inc. VGA2USB     $ cd /var/tmp/vga     $ ls     Config.mak      drvwrapper.o      vga2usb-3.26.0.27-ubuntu-3.0.0-12-server_X86_64.tbz     drvwrapper.c      Makefile      vga2usb_bins.o     drvwrapper.h      modules.order   vga2usb.ko     drvwrapper_lib.c  Module.symvers  vga2usb.mod.c     drvwrapper_lib.h  README      vga2usb.mod.o     drvwrapper_lib.o  v2u_id.h      vga2usb.o     $ make clean; make; make install     rm -f vga2usb.o vga2usb.ko drvwrapper.o drvwrapper_lib.o     ERROR: modinfo: could not open vga2usb.ko: No such file or directory     make -C /lib/modules/2.6.32-lts/build SUBDIRS=/var/tmp/vga modules     make[1]: Entering directory `/usr/src/linux-2.6.32-lts'       CC [M]  /var/tmp/vga/drvwrapper.o     In file included from include/linux/irq.h:29:0,                      from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper.c:21:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h: In function ‘set_irq_regs’:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h:26:2: warning: variable ‘tmp__’ set but not used [-Wunused-but-set-variable]     In file included from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5:0,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper.c:21:     include/linux/irq.h: In function ‘alloc_desc_masks’:     include/linux/irq.h:441:8: warning: variable ‘gfp’ set but not used [-Wunused-but-set-variable]       CC [M]  /var/tmp/vga/drvwrapper_lib.o     In file included from include/linux/irq.h:29:0,                      from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper_lib.c:21:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h: In function ‘set_irq_regs’:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h:26:2: warning: variable ‘tmp__’ set but not used [-Wunused-but-set-variable]     In file included from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5:0,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper_lib.c:21:     include/linux/irq.h: In function ‘alloc_desc_masks’:     include/linux/irq.h:441:8: warning: variable ‘gfp’ set but not used [-Wunused-but-set-variable]       LD [M]  /var/tmp/vga/vga2usb.o       Building modules, stage 2.       MODPOST 1 modules     WARNING: "kernel_stack" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "pv_lock_ops" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_int" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "__video_register_device" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "kthread_create_on_node" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_unlock_irqrestore" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "current_task" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irq" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irqsave" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_uint" [/var/tmp/vga/vga2usb.ko] undefined!       LD [M]  /var/tmp/vga/vga2usb.ko     make[1]: Leaving directory `/usr/src/linux-2.6.32-lts'     make -C /lib/modules/2.6.32-lts/build SUBDIRS=/var/tmp/vga modules     make[1]: Entering directory `/usr/src/linux-2.6.32-lts'       Building modules, stage 2.       MODPOST 1 modules     WARNING: "kernel_stack" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "pv_lock_ops" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_int" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "__video_register_device" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "kthread_create_on_node" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_unlock_irqrestore" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "current_task" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irq" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irqsave" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_uint" [/var/tmp/vga/vga2usb.ko] undefined!     make[1]: Leaving directory `/usr/src/linux-2.6.32-lts'     make -C /lib/modules/2.6.32-lts/build SUBDIRS=/var/tmp/vga modules_install     make[1]: Entering directory `/usr/src/linux-2.6.32-lts'       INSTALL /var/tmp/vga/vga2usb.ko       DEPMOD  2.6.32-lts     make[1]: Leaving directory `/usr/src/linux-2.6.32-lts'     depmod -a      Then I ran               $ cp -R vga2usb.ko /lib/modules/2.6.32-lts/     $ modprobe vga2usb     FATAL: Error inserting vga2usb (/lib/modules/2.6.32-lts/vga2usb.ko): Unknown symbol in module, or unknown parameter (see dmesg)      Here's the `dmesg` output:               …     [  539.531837] Linux video capture interface: v2.00     [  539.550998] vga2usb: Unknown symbol param_ops_uint     [  539.551222] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  539.551257] vga2usb: Unknown symbol _raw_spin_lock     [  539.551377] vga2usb: Unknown symbol _raw_spin_lock_irq     [  539.551875] vga2usb: Unknown symbol current_task     [  539.551911] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  539.551992] vga2usb: Unknown symbol kthread_create_on_node     [  539.552090] vga2usb: Unknown symbol __video_register_device     [  539.552249] vga2usb: Unknown symbol param_ops_int     [  539.552286] vga2usb: Unknown symbol pv_lock_ops     [  539.552323] vga2usb: Unknown symbol kernel_stack     [  559.145304] vga2usb: Unknown symbol param_ops_uint     [  559.145530] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  559.145565] vga2usb: Unknown symbol _raw_spin_lock     [  559.145686] vga2usb: Unknown symbol _raw_spin_lock_irq     [  559.146183] vga2usb: Unknown symbol current_task     [  559.146219] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  559.146300] vga2usb: Unknown symbol kthread_create_on_node     [  559.146399] vga2usb: Unknown symbol __video_register_device     [  559.146557] vga2usb: Unknown symbol param_ops_int     [  559.146594] vga2usb: Unknown symbol pv_lock_ops     [  559.146631] vga2usb: Unknown symbol kernel_stack     [  585.067274] xdotool[4437]: segfault at 44 ip 0000000000403177 sp 00007fffe40ce2b0 error 6 in xdotool[400000+f000]     [  594.228463] vga2usb: Unknown symbol param_ops_uint     [  594.228688] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  594.228724] vga2usb: Unknown symbol _raw_spin_lock     [  594.228845] vga2usb: Unknown symbol _raw_spin_lock_irq     [  594.229345] vga2usb: Unknown symbol current_task     [  594.229381] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  594.229462] vga2usb: Unknown symbol kthread_create_on_node     [  594.229561] vga2usb: Unknown symbol __video_register_device     [  594.229719] vga2usb: Unknown symbol param_ops_int     [  594.229756] vga2usb: Unknown symbol pv_lock_ops     [  594.229793] vga2usb: Unknown symbol kernel_stack     [  644.902176] xdotool[4453]: segfault at 44 ip 0000000000403177 sp 00007fff45cb8f10 error 6 in xdotool[400000+f000]     [  704.737153] xdotool[4466]: segfault at 44 ip 0000000000403177 sp 00007fff43b9f5c0 error 6 in xdotool[400000+f000]     [  764.572142] xdotool[4478]: segfault at 44 ip 0000000000403177 sp 00007fffe4399830 error 6 in xdotool[400000+f000]     [  824.407277] xdotool[4487]: segfault at 44 ip 0000000000403177 sp 00007fffff991f50 error 6 in xdotool[400000+f000]     [  884.242253] xdotool[4497]: segfault at 44 ip 0000000000403177 sp 00007fffbcea9110 error 6 in xdotool[400000+f000]     [  944.077293] xdotool[4776]: segfault at 44 ip 0000000000403177 sp 00007fff4cfae1b0 error 6 in xdotool[400000+f000]     [  995.783886] vga2usb: Unknown symbol param_ops_uint     [  995.784110] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  995.784146] vga2usb: Unknown symbol _raw_spin_lock     [  995.784267] vga2usb: Unknown symbol _raw_spin_lock_irq     [  995.784771] vga2usb: Unknown symbol current_task     [  995.784807] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  995.784888] vga2usb: Unknown symbol kthread_create_on_node     [  995.784986] vga2usb: Unknown symbol __video_register_device     [  995.785147] vga2usb: Unknown symbol param_ops_int     [  995.785185] vga2usb: Unknown symbol pv_lock_ops     [  995.785222] vga2usb: Unknown symbol kernel_stack     [ 1003.912353] xdotool[4785]: segfault at 44 ip 0000000000403177 sp 00007fffb5d8d370 error 6 in xdotool[400000+f000]     [ 1063.747218] xdotool[4794]: segfault at 44 ip 0000000000403177 sp 00007fff80af4400 error 6 in xdotool[400000+f000]     [ 1123.582226] xdotool[4802]: segfault at 44 ip 0000000000403177 sp 00007ffff5cd64a0 error 6 in xdotool[400000+f000]     [ 1183.417152] xdotool[4810]: segfault at 44 ip 0000000000403177 sp 00007fff9506ca40 error 6 in xdotool[400000+f000]     [ 1243.252171] xdotool[4818]: segfault at 44 ip 0000000000403177 sp 00007fffedd0db00 error 6 in xdotool[400000+f000]     [ 1303.087203] xdotool[4826]: segfault at 44 ip 0000000000403177 sp 00007fffb3573b30 error 6 in xdotool[400000+f000]     [ 1362.922212] xdotool[4834]: segfault at 44 ip 0000000000403177 sp 00007fffd5b34790 error 6 in xdotool[400000+f000]     [ 1422.757176] xdotool[4842]: segfault at 44 ip 0000000000403177 sp 00007fff1c936e40 error 6 in xdotool[400000+f000]     [ 1482.592118] xdotool[4850]: segfault at 44 ip 0000000000403177 sp 00007fffc2dad4d0 error 6 in xdotool[400000+f000]     [ 1542.427201] xdotool[4858]: segfault at 44 ip 0000000000403177 sp 00007fffb6fb85a0 error 6 in xdotool[400000+f000]     [ 1602.262153] xdotool[4866]: segfault at 44 ip 0000000000403177 sp 00007fff25223470 error 6 in xdotool[400000+f000]     [ 1662.097132] xdotool[4874]: segfault at 44 ip 0000000000403177 sp 00007fffc06ae8d0 error 6 in xdotool[400000+f000]     [ 1721.932100] xdotool[4882]: segfault at 44 ip 0000000000403177 sp 00007fffbe0d6be0 error 6 in xdotool[400000+f000]     [ 1781.767083] xdotool[4890]: segfault at 44 ip 0000000000403177 sp 00007fffe49a21d0 error 6 in xdotool[400000+f000]     [ 1841.602127] xdotool[5352]: segfault at 44 ip 0000000000403177 sp 00007fffd66862d0 error 6 in xdotool[400000+f000]     [ 1887.974458] vga2usb: Unknown symbol param_ops_uint     [ 1887.974683] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [ 1887.974718] vga2usb: Unknown symbol _raw_spin_lock     [ 1887.974839] vga2usb: Unknown symbol _raw_spin_lock_irq     [ 1887.975343] vga2usb: Unknown symbol current_task     [ 1887.975379] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [ 1887.975460] vga2usb: Unknown symbol kthread_create_on_node     [ 1887.975559] vga2usb: Unknown symbol __video_register_device     [ 1887.975718] vga2usb: Unknown symbol param_ops_int     [ 1887.975755] vga2usb: Unknown symbol pv_lock_ops     [ 1887.975793] vga2usb: Unknown symbol kernel_stack     [ 1901.437299] xdotool[5363]: segfault at 44 ip 0000000000403177 sp 00007fffba3bf0b0 error 6 in xdotool[400000+f000]      **Follow up:** (Ubuntu 11.04 its working now, did not continued in ArchLinux later)               distro="ubuntu"     version=$(sudo uname -r)     pkgdirectory=/var/tmp/capture     mkdir ${pkgdirectory}; cd ${pkgdirectory};     if [ ! -d "${pkgdirectory}/vga" ]; then       mkdir ${pkgdirectory}/vga       cd ${pkgdirectory}/vga       wget http://www.epiphan.com/downloads/linux/vga2usb-3.26.0.22-ubuntu-2.6.38-8-generic_X86_64.tbz       tar xvfj vga2usb-3.26.0.22-ubuntu-2.6.38-8-generic_X86_64.tbz         make clean       make       make install       cp -R vga2usb.ko /lib/modules/${version}/       depmod -a       modprobe vga2usb     else       cd ${pkgdirectory}/vga       make clean       make       make install        cp -R vga2usb.ko /lib/modules/${version}/       depmod -a       modprobe vga2usb     fi


Suspend/resume single process to/from disk

On occasion, we would like to suspend memory-intensive processes on our Ubuntu and OS X servers to temporarily free up some RAM for other jobs. If all we were worried about was CPU usage, a simple `Ctrl-Z` would work. However, we need to be able to free up the RAM (by writing it to disk) and then restart the process (disk -> RAM) or in other words "hibernate" a single process. Any clues on how to do this? (Preferably from CLI.) Thanks.


Bluetooth doesn't show up, Linaro

rfkill list all      Shows:               0: fxi_c210-bt: Bluetooth          Soft blocked: no          Hard blocked: no      And hcitool dev shows nothing except:               Devices:      Bluetooth didn't work, but at some start it didn't work anymore. I already tried to restart and tried to restart the bluetooth service. Problem is on a linaro-ubuntu version.


How do I encrypt the main partition of a SIFT (Ubuntu 9.10 variant) install?

I've got SIFT (based on Ubuntu 9.10) installed on a work laptop. We're trying to encrypt the entire installation (root partition and swap), which is apparently doable using LUKS, but I'm having some trouble getting it all to work. Here's where I'm at so far: I have an unencrypted /boot partition, one unencrypted root partition, and one encrypted partition. The encrypted partition contains an exact copy of everything in the unencrypted partition. I want to switch from booting into the unencrypted partition to booting into the encrypted one. I've added a '/dev/mapper/root' to /etc/fstab and a corresponding entry in /etc/crypttab. I also added a new menu item in GRUB which should point to the encrypted partition. When I select that menu item, I get an error saying that /dev/mapper/root doesn't exist. I'm guessing there's something I'm missing here. Can anyone help? (Oh, and the SIFT install ISO doesn't include the alternate installer, so I can't do a guided encrypted setup.)


How can I check if swap is active from the command line?

How can I check if swap is active, and which swap devices are set up, on the command line?