How can I make sense of wpa_supplicant's different signal level outputs?

I'm using wpa_supplicant 2.0 on Linux x64 with a USB wifi adapter (rtl8192cu). When I do a scan from wpa_cli, I get wildly different numbers (alternating between positive and negative) even for the same access point without moving anything. I'm trying to show this data to the user in a GUI, so I need it to be in a consistent format, preferably something I can ultimately convert to a percentage with. For example, SSID "one" sometimes has a signal level of around -40, and sometimes it's just the number 10. Even if it was consistently outputting regular dBm (negative) numbers, I have no idea what the scale is in this case, as every OS/application seems to handle it a little differently. Some documents on the web suggest valid values as -50 to -100, some say something totally different, and some make up their own numbers. Here it doesn't even seem to follow any standard:               bssid / frequency / signal level / flags / ssid     XX:XX:XX:XX:XX:01       2437    -38     [WPA2-PSK-CCMP][WPS][ESS]       one     XX:XX:XX:XX:XX:02       2427    -38     [ESS]   \x00\x00\x00\x00\x00\x00\x00          bssid / frequency / signal level / flags / ssid     02:00:00:00:01:01       2437    10      [WPA2-PSK-CCMP][ESS]    two     02:00:00:00:00:01       2437    10      [WPA2-PSK-CCMP][ESS]    three     XX:XX:XX:XX:XX:01       2437    10      [WPA2-PSK-CCMP][WPS][ESS]       one     XX:XX:XX:XX:XX:02       2427    -39     [ESS]   \x00\x00\x00\x00\x00\x00\x00          bssid / frequency / signal level / flags / ssid     02:00:00:00:01:01       2437    10      [WPA2-PSK-CCMP][ESS]    two     02:00:00:00:00:01       2437    -40     [WPA2-PSK-CCMP][ESS]    three     XX:XX:XX:XX:XX:01       2437    10      [WPA2-PSK-CCMP][WPS][ESS]       one     XX:XX:XX:XX:XX:02       2427    -39     [ESS]   \x00\x00\x00\x00\x00\x00\x00          bssid / frequency / signal level / flags / ssid     02:00:00:00:01:01       2437    10      [WPA2-PSK-CCMP][ESS]    two     02:00:00:00:00:01       2437    10      [WPA2-PSK-CCMP][ESS]    three     XX:XX:XX:XX:XX:01       2437    -42     [WPA2-PSK-CCMP][WPS][ESS]       one     XX:XX:XX:XX:XX:02       2427    -41     [ESS]   \x00\x00\x00\x00\x00\x00\x00          bssid / frequency / signal level / flags / ssid     02:00:00:00:01:01       2437    10      [WPA2-PSK-CCMP][ESS]    two     02:00:00:00:00:01       2437    10      [WPA2-PSK-CCMP][ESS]    three     XX:XX:XX:XX:XX:01       2437    10      [WPA2-PSK-CCMP][WPS][ESS]       one     XX:XX:XX:XX:XX:02       2427    -41     [ESS]   \x00\x00\x00\x00\x00\x00\x00      Is there a way to convert these signal levels into a consistent scale I can present to the user? Also, if the user uses a different wifi adapter/driver, will the signal level be in an even different format that I need to worry about?


How to create user credentials / policies allowing a certain number of cores / CPUs on a linux cluster

We are having a cluster, and on that cluster we have number of users, some users are important and some are temporary or not having that same importance. Is it possible to assign users so that they can be restricted to use only the number of cores/CPUs allotted to them and not more than that?


loop to paste specific files in different directories

I some directories that contain a similarly named file eg (*Sample_name*.base.coverage.txt). And I would like to paste all of the *base.coverage.txt files together. I have something written, but its not quite right as I don't think I am actually pasting them together.               cd /g/bo/vir/analysis     find -type d  |     while read dir; do     if [ -f $dir/*.base.coverage.txt ]; then         paste  $dir/*.base.coverage.txt >> paste_all_l30.p90.base.cov.norm          fi     done      I am also thinking of a different loop method, but I am unsure how to get the list of directories into an array.               for x in $dir; do cat /$x/*.base.coverage.txt;done > paste_all_l30.p90.base.cov.norm      Any help? thanks


ssh-agent: don't forward authentication for the whole keyring

I have two private ssh keys :   * one to access my _personnal_ machines,    * one to access servers at my _job_.  I add those two keys to my ssh-agent with `ssh-add`. Now, when I do `ssh -A root@jobsrv` I would like to forward agent authentication only for my job key (the one I'm using to connect `jobsrv`). I want this because anyone having root access to `jobsrv` can use my agent to authenticate himself to my personnal machines. Is there a way to achieve this isolation?


What's the most appropriate directory where to place files shared between users?

Or: **where can I put files belonging to a group?** Suppose there are two users on a Unix system: _joe_ and _sarah_. They are both members of the _movies-enthusiast_ group. Where should I put their movie files?   * `/home/{joe,sarah}/movies` are not appropriate because those directories belongs to _joe_ / _sarah_ , not to their group;   * `/home/movies-enthusiast` is not appropriate too, because _movies-enthusiast_ is a group, not a user;   * `/var/movies-enthusiast` might be an option, but I'm not sure this is allowed by the FHS;   * `/srv/movies-enthusiast` might be an option too, however movies are not files required by system services.


dircolors on zsh: Unrecognized keywords: MULTIHARDLINK, RESET & CAPABILITY

I am trying to get the solarized color theme to work in my terminal. I read the instructions here but I get the following dircolors error:               dircolors: `/home/avazquez/.dircolors_zsh':90: unrecognized keyword RESET     dircolors: `/home/avazquez/.dircolors_zsh':94: unrecognized keyword MULTIHARDLINK     dircolors: `/home/avazquez/.dircolors_zsh':103: unrecognized keyword CAPABILITY      when running:               if [ -x /usr/bin/dircolors ]; then         test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"     fi      from my `.zshrc` in zsh (latest version) (which I remotely access `ssh -X` from `gnome-terminal` in Ubuntu). The path to the `.dircolors` file in question is here and the troubling lines seem to be some of the special files definitions:               ## Special files          NORMAL 00;38;5;244 # no color code at all     #FILE 00 # regular file: use no color at all     RESET 0 # reset to "normal" color     DIR 00;38;5;33 # directory 01;34     LINK 01;38;5;37 # symbolic link. (If you set this to 'target' instead of a      # numerical value, the color is as for the file pointed to.)     MULTIHARDLINK 00 # regular file with more than one link     FIFO 48;5;230;38;5;136;01 # pipe     SOCK 48;5;230;38;5;136;01 # socket     DOOR 48;5;230;38;5;136;01 # door     BLK 48;5;230;38;5;244;01 # block device driver     CHR 48;5;230;38;5;244;01 # character device driver     ORPHAN 48;5;235;38;5;160 # symlink to nonexistent file, or non-stat'able file     SETUID 48;5;160;38;5;230 # file that is setuid (u+s)     SETGID 48;5;136;38;5;230 # file that is setgid (g+s)     CAPABILITY 30;41 # file with capability     STICKY_OTHER_WRITABLE 48;5;64;38;5;230 # dir that is sticky and other-writable (+t,o+w)     OTHER_WRITABLE 48;5;235;38;5;33 # dir that is other-writable (o+w) and not sticky     STICKY 48;5;33;38;5;230 # dir with the sticky bit set (+t) and not other-writable     # This is for files with execute permission:     EXEC 01;38;5;64


Centos 6.4 (64) skype 4.2 no sound notification

Everything works fine. I can hear and others can hear me. But no sound notification. In options -> sound devices "Make a test sound" button is disabled. Other button show "PulseAudio server (local)". At the bottom:It appears your system has PulseAudio running: to change sound settings you need to use your desktop manager volume control or PulseAudio volume control. In gnome volume control alert is on and is unmuted. How can I fix that?


What is the purpose of Apache2's configuration files?

Why does Apache2 have multiple configuration files? What are their roles? I found some information about older Apache versions, but it's usually deprecated, and the official Apache documentation doesn't explain the logic of splitting up the configuration files and what they're for


Thunar doesn't auto-mount USB devices with default setup

After installing and configuring Thunar Volume Manager for Arch Linux it doesn't mount any USB devices automatically:               $ thunar     thunar-volman: Unsupported USB device type.     thunar-volman: Unsupported USB device type.     thunar-volman: Could not detect the volume corresponding to the device.     thunar-volman: Could not detect the volume corresponding to the device.      (Both messages are printed twice when inserting a single USB drive.) Polkit seems to be running as expected:               $ loginctl show-session $XDG_SESSION_ID     Id=c1     Timestamp=Tue 2013-11-19 20:54:41 GMT     TimestampMonotonic=33281762     VTNr=7     Display=:0.0     Remote=no     RemoteUser=root     Service=slim     Scope=session-c1.scope     Leader=308     Audit=0     Type=x11     Class=user     Active=yes     State=active     IdleHint=no     IdleSinceHint=0     IdleSinceHintMonotonic=0     Name=username      There are a bunch of random tips in this thread, but at least some of them seem at odds with the wiki: `gvfs` is mentioned, although the wiki only mentions it as a requirement for browsing remote locations. Manual mounting works fine:               $ sudo mount /dev/sde1 /media/foo     $ mount | grep sde1     /dev/sde1 on /media/foo type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)


How do I find out if my wireless card supports 5ghz?

I have the               03:00.0 Network controller: Intel Corporation Centrino Wireless-N 2200 (rev c4)      Hwo do I find out if that card/driver support 5 GHz?


Thunar crashes when trying to unmount removable devices

After manually mounting a USB device it shows up in Thunar with the standard "eject" icon next to the device name. However, clicking this invariably results in a crash with the following output:               $ thunar     (thunar:1906): GLib-CRITICAL **: g_source_attach: assertion 'source->context == NULL' failed     (thunar:1906): GLib-GObject-CRITICAL **: g_object_get_data: assertion 'G_IS_OBJECT (object)' failed     Segmentation fault (core dumped)      The device is _not_ unmounted. Nautilus simply informs me that it is "Unable to eject [device name] - Not authorized to perform operation," so that's clear enough. Is it necessary to configure Thunar to show such a message instead of crashing?


Splitting bash command line argument

Is this the best way to split up a colon separated bash command line argument?               #!/bin/bash     hostlist=`echo $1| awk '{split($0,Ip,":")} END{for (var in Ip) print Ip[var];}'`     for host in $hostlist      do       ....      done


Determine whether XBOX 360 is on

I want to determine in close to real-time (up to 5s lag would be OK) when my XBOX 360 is switched on or off over the network. The XBOX gets a static IP address which I know. However the XBOX seems to be very much like a black hole in that it does not respond to pings and seems to have no ports open all the time (TCP 1029 is open when in XBOX Home, but not when actually playing a game). What other ways could there be to find out whether the XBOX is online?


Group and lock certain windows to a workspace in Gnome 3

Is it possible to group certain windows to always occupy the same area and always be in the same workspace? If so, how? For example I'm using Eclipse and I have multiple detached windows and for some reason lots of times these windows get move between workspaces and moved around too. I would like to keep them all on workspace 1 for example.


How to generate new var names on the fly

I'm trying to generate dynamic var names in a shell script to process a set of files with distinct names in a loop as follows:               SAMPLE1='1-first.with.custom.name'     SAMPLE2='2-second.with.custom.name'          for (( i = 1; i <= 2; i++ ))     do       echo SAMPLE{$i}     done      I would expect the output:               1-first.with.custom.name     2-second.with.custom.name      but i got:               SAMPLE{1}     SAMPLE{2}      Is it possible generate var names in the fly?


Linux script or program to shorten filenames

I haven't had much success in finding a Linux version of namemangler, which I need to rename 1000 of files so they are readable on Windows. Does anyone know of a Linux program that can do this? If not, then a script might work as I only need to rename all files in a folder to, say, the first 16 characters. I suspect that the script route might be worth going down but not sure where to start.


Use `less` to view comma-aligned data

I have a _big_ CSV file. I would like to view my file using `less` or some command like it which doesn't have to read the whole file at once to show me part of it. Is there a command out there which can show me my file in comma-aligned columns?


How to pipe md5 hash result in shell

I am looking for a simple way to pipe the result of `md5sum` into another command. Something like this:               $echo -n 'test' | md5sum | ...      My problem is that `md5sum` outputs not only the hash of the string, but also an hypen, which indicates that the input came from stdin. I checked the man file and I didn't find any flags to control output.


TWAIN API support on FreeBSD

Does FreeBSD support in any way the TWAIN API? If not, what is the API that could be used to read data from imaging devices (webcams) - preferably in a portable way.


Run two commands based upon output of first

I'm new to unix commands but have a need. I have a mixed Win/Mac environment where I use Win AD for user accounts and the Mac as the file storage. There is a command on Mac that automatically creates the home folders for users and sets appropriate permissions 'createhomedir -s' in my situation. The output of this command is:               creating home directories for (cloud.mc.net.mackillop)     created (/Network/Servers/cloud.mc.net.mackillop/data/18goodki/files)     created (/Network/Servers/cloud.mc.net.mackillop/data/18langre/files)     created (/Network/Servers/cloud.mc.net.mackillop/data/16gibsga/files)     created (/Network/Servers/cloud.mc.net.mackillop/data/17gibssa/files)     created (/Network/Servers/cloud.mc.net.mackillop/data/99bowmam/files)     created (/Network/Servers/cloud.mc.net.mackillop/data/99newtal/files)     created (/Network/Servers/cloud.mc.net.mackillop/data/99daypa/files)      What I need to then also do is set additional permissions on these newly created home folders, to provide myself with read/write access as well as _www (Apache web host) as we use OwnCloud.org to supply web based cloud access to users files. These are the two commands I run to achieve this:               sudo chmod -R +ai "_www allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" data          sudo chmod -R +ai "ittech allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" data      Running these two commands over the entire 'data' folder of all users and subfolders takes ages (973 user accounts!) and really slows down the server. What I would like to to is only run these two commands on newly created users from the first command to greatly reduce time and overhead. I've been reading on grep, awk etc but not really sure how to achieve this. So basically I want to get `createhomedir -s` to run, then extract each username from the output of this command, then use these usernames to run the two chmods in place of the 'data' folder (/data/%USERNAME% instead).


using xargs to grep multiple patterns

I have a file that has terms I want to grep for, with each term being one line in the file. I was thinking I could do this with xargs. What I'm able to glean from examples from the man page like this               find ./work -print0 | xargs -0 rm      is that xargs appends the output of the pre-pipe command to the end of its arguments. So if the find returned `report.doc`, then xargs would construct `rm report.doc`. Is this understanding correct? So since I want the values in my file to be in the middle of the grep command, I need to specify a placeholder. In playing around, I tried `{}`, but it didn't work:               $> cat strings.txt | xargs grep {} subdirectory/*     grep: string1: No such file or directory     grep: string2: No such file or directory      Is xargs the right tool? If so, what is the syntax?


Slow down a process without affecting other processes

1. I have a program. When it is running, the CPU temperature raise from 50 to 80 Celcius, which is my major concern.  I can control the CPU frequency to slow it down, but other processes will be slowed down as well which I don't want. Is it possible to slow down a particular process without affecting other processes to keep the CPU cool? My OS is Ubuntu 10.10.   2. I tried to set the priority of the process by `nice -n 15 myprogram`, and am not sure if that will work. The CPU is 77 Celcius high.  Does `nice` only set relative priority of a process wrt other processes? I.e., if other processes are not running, will this niced process run fast? I would like to set the process to be running slow all through. Thanks and regards!


prepend digit to filenames which begin with digits (with zmv, please)

I have a directory with files named like `19.png`, `20.jpeg`, and `README00.txt` I want to rename these to `119.png`, `120.jpeg`, and `README00.txt`. I would like to do this with zmv as it works well in so many other cases, but I cannot get zmv to make an action based on the first character of a filename being a digit. I can easily get `1README00.txt`, but that is not what I desire.


Cygwin installation message

I want to ask about this error? The error states : > This is the first time you've installed Cygwin 1.7.x. Please be advised that > this is a major release. If you have not done so already, please check out > the documentation at http://cygwin.com/ to see how the upgrade could > potentially affect any existing Cygwin instalation.


Is there a way to get German text to speech in festival?

Searching for info about German text to speech, I came across a "Dialog-based Human-Technology Interaction by Coordinated Analysis and Generation of Multiple Modalities", as well as this page, which I can't really parse. I mean, it _mentions_ festival several times... Hm... I've loaded voices and languages into `festival` using `apt-get`, for Finnish, Spanish, Czech, and Russian. I've also loaded voices into `festival` by `wget`-ing some files and renaming them in accordance with festival's directory structure. So... is there a way to use either of those two methods to enable German text to speech on my machine?


Find web server group? Permissions problem

I'm trying to make Wordpress work. I currently have this error message: > Could not create directory. /var/www/html/wp-content/upgrade/theme_name when trying to upload a theme. This is the permissions set to /var/www/html/wp-content/upgrade/ > drwxrwxr-x 3 ec2-user apache 4096 Jun 21 00:30 upgrade chmod 777 upgrade makes the error go away. But that is not considered best practice. However, I think this should work too... why not? _I guess the web server may not be included by the above permissions. What group should I use to allow the web server to write?_ (My setup is Amazon EC2, Amazon Linux AMI with httpd)


How does the linux update manager work?

I want to know how the update manager for linux works. For instance, how does my linux distro check to see if there are any available updates for download and which servers to download these updates? If I am dealing with 3rd party software not apart of the main distro, how do those programs interact with my update manager to notify me that those programs have available updates? Lastly what would be some good literature on the subject?


grub-install no bias drive

While trying to fix this problem, I came up with tyring to use a live CD and running grub-install. I mount the directory holding my new linux install files (in /dev/sda7) with:               su -     mkdir /mnt/tmp     mount /dev/sda7 /mnt/tmp      Then I when I try grub-install I get this:               [root@localhost tmp]# grub-install --root-directory=/mnt/tmp/ /dev/sda     /dev/sda does not have any corresponding BIOS drive.      I read that the problem can be solved with the recheck flag, but I get:               Probing devices to guess BIOS drives. This may take a long time.     /dev/mapper/../dm-0 does not have any corresponding BIOS drive.      How can I fix this problem?


Resume mirroring via wget

I want to mirror all files for example KDEs to local directory. I used               $ wget -m -P ./kde http://alien.slackbook.org/ktown/current/4.12.1/x86_64/kde/      But after a while it broke. To continue I added `-c` option and tried again. As :               $ wget -c -m -P ./kde http://alien.slackbook.org/ktown/current/4.12.1/x86_64/kde/      But got the following error (I get error in second time I tried if it downloaded `index.html` previously): > Saving to: > './kde/alien.slackbook.org/ktown/current/4.12.1/x86_64/kde/index.html' > > [ <=> ] 0 --.-K/s in 0s > > Cannot write to > './kde/alien.slackbook.org/ktown/current/4.12.1/x86_64/kde/index.html' > (Success). Converted 0 files in 0 seconds. And downloading breaks again at this point. How should I continue a `wget` mirroring?


How can I create a "base" for other aliases to refer to and enable cd base/x command directories?

I have `.bash_aliases` with:               alias c1='cd /home/me/code/php'     alias c2='cd /home/me/code/jquery'     alias c3='cd /home/me/code/ruby'     alias c4='cd /home/me/code/c'      How can I DRY this up and loosen the coupling to that entire directory structure? I have tried:               alias code_base='/home/me/code/'     alias c1='cd code_base/php'     alias c2='cd code_base/jquery'     alias c3='cd code_base/ruby'     alias c4='cd code_base/c'      but I get the error 'is a directory' when I try and use `c1` through `c4`. I also tried:               alias c1='cd `code_base`/php'      but that didn't work; it gave me: > bash: cd: /php: No such file or directory I tried `alias c1='cd '+`work`+'/php'`, but that gave me the directory error too.


how to edit and color bash's tab completion list

Following is what i would like to have. When the tab completion is ambiguous, and bash prints the list of possibilities. I would like it to colour the next character I should press inside every word in the list. Following is what i have done so far. In my .bashrc i have defined the following function and have called the complete command               _colourunique() {         local word=${COMP_WORDS[COMP_CWORD]}         COMPREPLY=($(compgen -f -- "${word}"))         if [[ "$word" ]] && [[ ${#COMPREPLY[@]} -gt 1 ]]; then             local  w             local  i=0             for ((i=0;i<${#COMPREPLY[@]};i++)) ; do                 w=${COMPREPLY[$i]}                 n=${#word}                 COMPREPLY[$i]="${w:0:n}\033[91m${w:n:1}\033[0m${w:$((n+1))}"             done         fi     }          complete -D -F _colourunique      But it is not working... When i type               ls D[TAB]      It autocompletes as               ls D\033[91m      Instead of listing the possibilities Documents, Desktop etc. What could be going wrong here? Or is there some other direct way to accomplish this? ### UPDATE 1: I think i understand what is happening here. Since i add \033[91m to every word in COMPREPLY, bash sees this part is common to all, and autocompletes that common term into the command prompt itself. (instead of simply printing the list) So I don't think this method of editing COMPREPLY array is the way to do it. Is there any other method? ### UPDATE 2: To preserve the uniqness, i tried to add a $i and \b in the string.               COMPREPLY[$i]="${w:0:n}$i\b\033[91m${w:n:1}\033[0m${w:$((n+1))}"      Now it prints the possible tab completions as following.               D0\b\033[91mo\033[0mwnloads  D1\b\033[91me\033[0msktop      Which means, the list is printed as such. There is no evaluation of \b or \033[91m characters. :-( ### UPDATE 3: Since the replies looks like, there is no way to accomplish what i want in bash (unless i shift to zsh). I decided to settle for another option. I will try to append the next unique key stroke to end of every word, so that it stands out. Following is the code so far.               SanitiseString () {         local String="$1"         local j         for j in \\ \! \@ \# \$ \% \^ \& \* \( \) \+ \{ \[ \] \} \| \; \: \" \' \, \? \ ; do             String=${String//"$j"/\\"$j"}         done         echo "$String"     }          _colourunique() {         saveIFS=$IFS         IFS=$'\n'                                            local word=${COMP_WORDS[COMP_CWORD]}         COMPREPLY=($(compgen -f -- "${word}"))         if [[ "$word" ]] ; then             local  w             local  i=0             for ((i=0;i<${#COMPREPLY[@]};i++)) ; do                 w="${COMPREPLY[$i]}"                 n=${#word}                 w=$(SanitiseString "$w")                 if  [[ ${#COMPREPLY[@]} -gt 1 ]] ; then                     COMPREPLY[$i]="$w :${w:n:1}"                 else                     COMPREPLY[$i]="$w"                 fi             done         fi         IFS=$saveIFS     }          complete -D -F _colourunique      This will print the options with the next unique keystroke separated by : But the code still has two irritating issues. which i have to solve   1. It no longer appends the / at the end of autocompleted directories   2. It no longer does the intelligent spacing after the auto complete. Any suggestions?


Failed to check FreeRDP file descriptor

Using `xfreerdp` version 1.1.0:               oshiro@debian:~$ xfreerdp --version     This is FreeRDP version 1.1.0-beta1 (git n/a)     oshiro@debian:~$      I am getting the following error message:               oshiro@debian:~$ sudo xfreerdp /v:farm.company.com /d:company.com /g:rds.company.com /u:rds_username /p:rds_password /f     connected to rds.company.com:443     connected to rds.company.com:443     TS Gateway Connection Success     Got stub length 4 with flags 3 and callid 7     ...     Got stub length 4 with flags 3 and callid 192     WaitForSingleObject: unknown handle type 6715497     connected to rds.company.com:443     connected to rds.company.com:443     TS Gateway Connection Success     Got stub length 4 with flags 3 and callid 7     ...     Got stub length 4 with flags 3 and callid 22     Failed to check FreeRDP file descriptor     Got stub length 4 with flags 2 and callid 6     WaitForSingleObject: unknown handle type 0     oshiro@debian:~$       Anyone know how to stop the following error message coming up?               Failed to check FreeRDP file descriptor     Got stub length 4 with flags 2 and callid 6     WaitForSingleObject: unknown handle type 0      I have tried version xfreerdp 1.2.0, but that doesn't even load an rds window. xfreerdp 1.1.0 at-least shows the rds window for a short while until the above message is shown.


What's the difference between CONFIG_R8169 and CONFIG_R8169_VLAN?

.config from `/usr/src/linux-2.6.38.8` contains:               CONFIG_R8169=m     CONFIG_R8169_VLAN=y      What's the difference between `CONFIG_R8169` and `CONFIG_R8169_VLAN`?


Verify semantic integrity of filesystem

I just started up my linux box to find that one of my filesystem's had errors: I had to login as root to run `fsck` and hit `y` repeatedly. There were a _lot_ of errors. So many that I used silly putty and a Rubik's cube to hold down the `y` key (Using the auto-yes options isn't allowed in these kinds of cases). Even with with the `y` key held down, it took a couple of hours for it to finish the check, but when it did the system booted and I am able to access this file system. So as far as the computer is concerned, the file system in question is fine. But what I'd like to know is whether or not all of my files on it are fine. This particular filesystem has several thousand images on it, and I did a quick sanity check that I can view some of them, but I can't manually check every file to make sure its intact. Is there some way, either general or specific, that I can verify that none of the files on my filesystem were damaged? The filesystem is ext3.


When did directories stop being readable as files?

I have the 1st edition of The Unix Programming Environment book. In chapter 2, the authors state that directories are readable as files, and mention some facts about the format of these files. They give some usage examples such as `cat .` (in exercise 2-2). At least in Darwin, directories are no longer readable as files. At least, they appear to be zero-length files when read. When did this change occur, and is there any official documentation about it?


How to use 7z to compress via pipe?

I'm using this for creating backups securely (? - is it really secure? with a good password?):               # ENCRYPT     ORIGDIR="DIRECTORYNAMEHERE"; tar cvf - "${ORIGDIR}/" 2>/dev/null | gzip -9 - 2>/dev/null | openssl aes-256-cbc -salt -out "${ORIGDIR}.tar.gz.aes"          # DECRYPT     openssl aes-256-cbc -d -salt -in "ENCDIRECTORYNAMEHERE" | tar -xz -f -      **Q:** But how can I do this using 7z with max compression rate? Creating temporary files besides the only OUTPUT file is not good, because if I need to compress ~100 GByte sized files/directories on a 180 GByte FS I wouldn't have enough free space (if ex.: the compressed file would take ~60 GByte).


The Debian/Ubuntu package search pages are very useful to look up what version of a program is available in what distribution series, how programs are split along multiple packages etc. For example I want to investigate what version of `g++` is available in current Ubuntu: http://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names&suite=maverick&section=all I directly see that the default version is 4.4.4, also available is 4.5.1. In Natty it is 4.5.1: http://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names&suite=natty&section=all Via http://packages.ubuntu.com/natty/g++ you can browse coveniently through the dependencies and directly see which architectures are supported. You can also search the contents of the packages. For Fedora I've found https://admin.fedoraproject.org/pkgdb Searching for g++ returns nothing: https://admin.fedoraproject.org/pkgdb/acls/list/ _g++_ Ok, perhaps it is split differently: https://admin.fedoraproject.org/pkgdb/acls/list/?searchwords= _gcc_ This yields results and it seems that there is only one big `gcc` package which includes `g++`: https://admin.fedoraproject.org/pkgdb/acls/name/gcc But this is not true. Using `yum search` on a Fedora 14 system yields:                 gcc-c++      (which includes g++) Without access to an actual Fedora system, do I really have to somehow expect this and browse down into the package git tree to get the same information? I mean like this: http://pkgs.fedoraproject.org/gitweb/?p=gcc.git;a=blob;f=gcc.spec;h=683faf0cb3d528bd53fe6a4024fda3e84cc986d0;hb=HEAD (and then search for '%package' ?) The https://admin.fedoraproject.org/pkgdb/acls/name/gcc shows me that a gcc package is available in Fedora 13 and 14 but it does not show:   * the dependencies   * the actual versions   * the architectures   * sub-packages Ok, I can see the versions via going to https://admin.fedoraproject.org/updates/gcc Thus my question: What is the Fedora equivalent to the Debian/Ubuntu package search pages? What do you use to look similar information up? And what about getting this kind of information for other rpm based distros like Cent OS or RHEL?


Application-specific keymapping

In general, I want to make specific keymaps for application, that working only in it and doesn't affect any other app. For example, I already use my Caps key to toggle input language (via xorg.conf), but I want Capslock to behave like Esc in vim. Looks like xmodmap doesn't have any options related to that. I use Gnome and would also appreciate any third-party applications.


How to know the "level" of shells I am in?

If I open a terminal like `xterm` I will have a shell. Then if I use `ssh` or `zsh` I will have another "level" of shell. Is there a way to know how many times I have to `Ctrl+D` or type `exit` to exit all of them? My real intention is to exit everything except the "root" shell. It will also be nice to know what effect(s) terminal multiplexers (like `screen`) have on the solution. PS: Please feel free to change the title, I don't know if those are the correct terms.


Diff dpkg files with local copies

Is there a way of diffing the dpkg files with the one that are actually installed? Or barring that a way to find ones that have been modified?


ssh and character encoding

When I `ssh` into my VPS, I have `irssi` running in screen. When someone sends a unicode character (such as © or €), `irssi` displays garbage when I use it via the screen in a `ssh` session. If I connect to that `irssi` using irssi's proxy module, from irssi running on my local computer, it shows up correctly. Likewise, if I run ghci on my VPS (outside a screen) and enter in one of those characters, it crashes. So, obviously, there is a character encoding issue of some sort with my connection to my VPS, either in ssh or the system setup. How can I find out what is causing this, and solve it? Details: **Client system**   * Arch Linux x64    * UTF-8 encoding **VPS system**   * Ubuntu Server 10.04   * Unknown encoding used. How do I find this? (I just have to look in my /etc/rc.conf for Arch)


SSH reverse tunnel works except when I use a VirtualBox instance at one end. Why does VB break SSH?

VirtualBox seems to break my SSH ProxyCommand... here are the details: I want to open an SSH connection from my laptop to desktop over an SSH (reverse) tunnel. I want to do that in one step using ProxyCommand (and netcat). It works when run from the installed OS on my laptop. It fails when run from a VirtualBox guest on my laptop. My normal setup is that Kubuntu 12.04 is running in VirtualBox on the desktop and Kubuntu 12.04 is installed directly on my laptop. This works fine. However, if I try to do the exact same thing with a Kubuntu 12.04 VirtualBox instance on my laptop, it fails as I will detail below. Here's what my SSH tunnel looks like:               laptop--->nat--->middleman<--nat<--desktop      The desktop & laptop run Kubuntu 12.04 regardless of whether I'm using VirtualBox; and the middleman is Ubuntu 8.04. I'll describe my SSH tunnel in more detail. Regarding this leg:               middleman<--nat<--desktop      ...here is how it is established:               autossh -M 5234 -N -f -R 1234:localhost:22 user@middleman.com      That part is automatic and trouble-free. From the laptop:               laptop--->nat--->middleman      I can connect to middleman and then from the middleman to the desktop in two steps under all conditions:               me@laptop:~$ ssh -i ~/.ssh/id_rsa admin@middleman           admin@middleman:~$ ssh -i ~/.ssh/id_rsa localhost -p 1234      To do this in one step I use netcat ("nc") on middleman and I edit my SSH config file on laptop to use ProxyCommand and nc:               me@laptop:~/.ssh$ nano config      The contents are:               Host family_desktops       ProxyCommand ssh middleman_fqdn nc localhost %p       User admin       PasswordAuthentication no       IdentityFile ~/.ssh/my_id_rsa      Where `middleman_fqdn` is like "middleman.com" Then I just connect to "desktop" in one step:               me@laptop:~$ ssh family_desktops -p 1234      Here's the problem. This works when run directly from my laptop (where Kubuntu 12.04 is installed). But when I run it from VirtualBox instance of Kubuntu 12.04 (guest) on my laptop, it does not work. SSH asks for the password for middleman. There is no password set up, so I cannot connect. The strange thing is that running the two separate commands allows me to connect to my desktop and it doesn't ask for a password. The `ssh -vvv` option shows no errors and nothing helpful. I have been troubleshooting all day and I cannot find any difference in settings between the VirtualBox instance and the host OS on my laptop. I use the exact same id_rsa keys (public & private), the same user, and auth.log on the middleman server indicates it sees the same IP address in both cases. So why would running VirtualBox on my laptop make this SSH tunnel stop working (at least working in one step)?


Controlling process priorities

I have recently started trying to control stepper motors with the Raspberry Pi. I have succeeded in getting motion. The problem I am having though is that it seems the stepper motor is missing steps and operates very rough. I took my project to a local hacker space here in Chicago "Pumping Station One" to see if the CNC build club could help clue me in on the problem. Their opinion was that certain processes are taking priority and always executing that it may be causing the issue. I hooked my stepper up to an Arduino Uno and the stepper motor performed wonderfully. There was also mention of the Pi not having a RTC on it and the `delay()` function I use in my code for the pulse width might be getting out of sync. Has anyone experienced anything like this before? Is there anything you know of to test these theories? Maybe another explanation?


What is the simplest way to connect to wireless on a Debian system with nothing but essential?

I have a Debian Jessie system which, for reasons unrelated to this question, has nothing installed but the set of essential system packages. What is the simplest method for connecting to a wireless network? If it matters, my network is using WEP (yes, I know it's bad to use WEP). Bonus points if you suggest an answer requiring the _least number of packages needed_ (including dependencies), because I have to manually download every one of these. I've installed `wireless-tools`, `wpa_supplicant` and `isc-dhcp-client`, and messed around, but got nowhere. I've been able to set my link to up with `ip link set up wlan0`, but that doesn't actually get me to the point where I can input a password to connect to the router.


Alternative for "locate" on debian

I often use "locate" command on CentOs to find files. What's the alternative for this command on Debian ?


Booting from install disk, no USB keyboard

I'm trying to install Arch Linux on a new system with a Gigabyte GA-Z87N-WIFI board. Although I can use the USB keyboard (and mouse) in the BIOS, the keyboard doesn't seem to work at all once I boot off the boot DVD. There are several people who've solved this problem by enabling IOMMU in the BIOS. I couldn't find an option called IOMMU, but I found VT-d, which I believe is the same thing. It's enabled. Also, Arch detects my (wifi) network card and attempts to run DHCP on it. I don't know if this is relevant, but I think I remember reading that if IOMMU is disabled network cards aren't detected. EDIT: I tried disabling UEFI in the BIOS, just in case... No change. I still have no keyboard. EDIT 2: I think maybe appropriate kernel modules for my USB controllers aren't available (or aren't loading?) I went into hardware info from the install disk boot menu, and under PCI Devices, I can see three USB controllers. The "product" line reads: 8 Series/C220 Series Chipset Family EHCI Vendor is Intel Corporation. Module is unknown. Maybe this is the issue? Most other devices have modules listed. EDIT 3: This seems to be an issue with the install disk kernel, apparently it doesn't support the Logitech unifying receiver: https://bugs.archlinux.org/task/35991 The kernel mentioned in that bug report is in fact on the current 01/08/2013 install disk, and I have a unifying receiver. I managed to boot a Gentoo minimal install disk off a USB stick and the keyboard was fine. So I think I've answered my own question. Unless anyone has anything to add...?


Howto run interactive commands, as another user

I'm trying to write a bash script that   * context switches to another user (root, in this case)   * executes a set of commands to _i._ create a user (interactively prompting invoker for username) then _ii._ sets the password on that user    * gets a return value   * then carries on doing stuff, with that return value  I've so far tried an << EOF input ( _fig.1_ ), a function ( _fig.2_ ), and pulling / running a separate script ( _fig.3_ ). However I haven't gotten the results I need. Any help here? Hope I've explained it clearly.               sudo su - << 'EOF'     # do stuff...     EOF      _fig.1_               function myfunc()     {         local  myresult='some value'         echo "$myresult"     }      _fig.2_               sudo su - -c bash <(curl -fksSL https://<my-script-location>.sh)      _fig.3_


Zip folder without including path to folder and require only one argument

I'm trying to make a zip function that'll do all the steps I typically do when zipping a file or folder. Say my current directory is `~`, and I want to zip a folder named `Folder1`, whose file path is `~/Folder2/Folder1`. Issuing               cd ~/Folder2 && zip -r Folder1 Folder1 && cd -      does exactly what I want. Namely, it zips so that the output `Folder1.zip` does not contain folders that lead up to the folder I'm zipping (namely, `/home/user/Folder2`), it zips recursively, and it takes in the first argument of zip with the exact name as the file or folder I'm zipping (`Folder1.zip`). So I want to make a function in my `.zshrc` something akin to               coolerzip() { cd /path/to/file && zip -r file file && cd - }      where it need only take in one argument, which in this case, it will be `~/Folder2/Folder1`. Then `Folder1` will be the name for both `file`s in `coolerzip`, and I will `cd` right into `~/Folder2` so `Folder1` lies in my current directory before zipping. Is there any way I can achieve this so that `coolerzip` only requires one argument rather than three?


How to create a user with minimalistic permissions on OpenBSD?

I want to run the webbrowser (xxxterm) with a different user (XY) on an OpenBSD Desktop (different user from the one I use daily). I will reach the Browser with ssh -X in the local machine (or are there any better solutions?). The webbrowser needs NO audio, NO flash, NO html5, NO JAVA, NO plugins, NO JAVASCRIPT, etc. How can I create a user with the smallest possible permissions? Are there any tricks? (does the user only needs to be in his group, and not else?) Googled a few hours for keywords/tricks that I need to "expand" (mini howto to it) later:               mount /home with nodev, nosuid, noexec AND/OR with read-only option?     set high umask for users that are not XY     minimal groups needed for user     regularly check that the user isn't in the sudoers file     no o+rwx on the files in the system or suids     **restricted shell for the user?**     systrace restrictions? (or doesn't worth it?*)     pf limitations - user uid only needs http https ftp dns - no other network needed for any user besides root     put the webbrowsing in a qemu vm??     security/limits.conf - ulimit for the user?     chroot the xxxterm?     xxxterm as shell? (instead of ksh?)     only let a few dozen MByte quota for the user or zero?     guest session like? - start with a clear QEMU guest or chrome directory at every chrome exit/start?     privoxy for filtering chrome traffic? (proxy can be set to anything by the XY user..)     can pf limit that what process can use http https ftp dns?        * http://www.lightbluetouchpaper.org/2007/08/06/usenix-woot07-exploiting-concurrency-vulnerabilities-in-system-call-wrappers-and-the-evil-genius/ if this howto is completed it could be useful when having a ~~zombie~~ terminator apocalypse :D


Are Ubuntu PPA Repositories usable on Debian wheezy?

I'm using Debian wheezy and i wonder are Ubuntu PPAs hosted at Launchpad safe to be added & used on Debian?


Using URLs with parenthesis with Lynx

I often use Lynx on a remote computer to look at websites (faster than port- forwarding). Sometimes the URLs I want to go to have un-escaped characters (for example brackets) that Lynx seems to need encoded. for example `http://www.example.com/This(URL)is anExample.html` should be `http://www.example.com/This%28URL%29is%20anExample.html`. Is there an existing script for this? Alternatively is there some option for Lynx that would make it unnecessary?


How to have a pop-up window for password appear when opening application?

We have build `wireshark` adding some functionality related to our use, in Scientific Linux 6 system. After this when I start this using normal user, it will not allow me to use the network interface. I have to login via root to do the same. Is there any way that when I click on `wireshark`, and before the application starts a GUI will appear asking for the password for root? The same as when we open `Firewall`. Can I do this using a shell script?


How does ssh -X function?

When using `ssh -X` is the executable copied and run locally or is it run on the host machine. Since it is called X11 forwarding it makes me think that the window is drawn on my machine but running on the host.


What are the reasons Slackware still refuses to include PAM?

I know that Pat Volkerding didn't include PAM back in the day when it was considered by some to be messy or inconsistent, although that doesn't really seem to be the case today with PAM being standardized accross distributions. What are the reasons for Slackware not including PAM in recent versions of Slackware? Are there any other distributions that abstain from incorporating PAM?


Is there an alternative to CUPS?

When printing with Linux is there an alternative to using CUPS? After using it for a couple of weeks printing suddenly stopped working. The 'processing' light would come on and that would be the end. CUPS would list the job as finished. I cannot find any solution that works.


Automatic logging of scripts executed by users

That's a recurrent question of my workmates. We are a team of many people which works in the same Unix and Linux servers. The recurrent questions is if there are a log or something similar by default in the linux/unix OS where see when a user launch a sh/ksh script or any other executable program in the server. For example, Susan executes `write.ksh` at 10h23, Paul executes `files_rights.sh` at 11h03 and Yves executes `./rename_files` at 13h12. The sysadmin is on holidays but he will arrive tomorrow and want to see who execute what and when he/she did it.


Toggle touchpad in HP ProBook 4530s

I have a small problem. I installed Ubuntu 11.10 on my HP laptop and among some problems, I'm trying to solve a touchpad problem. It's working, but I can't toggle it on/off. In Suse Linux Enterprise Desktop (which was preinstalled) and Windows, the touchpad could be enabled/disabled by touching the left upper corner. In Ubuntu I touched that area many times, but nothing happened. I also tried to install SLED drivers from HP site using (first I converted the RPM package to a Debian package and then installed it, but that didn't fix the problem, I just have "Touchpad" in unity, when I'm typing "synaptics" but when I clicked - nothing happened.) How to fix this problem?


How can I bind multiple tmux commands to one keystroke?

Specifically I'm trying to give a notification after some command was completed. So, for example, if I reload my configuration file, I'd like to have some confirmation that it worked, which might be done something like this:               bind R source-file "$HOME/.tmux.conf" && display-message "Configuration reloaded."      _That_ , however, doesn't work. Nor do any other things I tried as ways of stringing commands together.


change owner of a file and it's parent directories

I have a file that has 10 parent directories. When I change the file's owner with `chown` command new owner still can't write to file because the file's parent directories still have a different owner. Is there a way to also change parent directories' owner? If not, what's the best way to temporarily grant a user permission to change a file inside nested directories?


Installing git "sudo: apt-get: command not found"

I am trying to install git. I run the following command: `sudo apt-get install git-core git-gui git-doc` But receive the following error: `sudo: apt-get: command not found` What should I do?


mode-specific emacs keybindings

I'm trying to get `emacs` (23.3 on Arch Linux) to map `Ctrl`+`F12` to the built-in "compile" function when in C-mode (actually CC-mode, which comes built-in as well). So far I've tried the following:               (defun my-c-mode-common-hook (define-key c-mode-map (kbd "C-<f12>") 'compile))     (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)      and:               (eval-after-load 'c-mode       '(define-key c-mode-map (kbd "C-<f12>") 'compile))      But neither works; I get `<C-f12> is undefined`. Based on what I've read here, here, and here, I can't see why it isn't working. Any thoughts?


How do I update IcedTea?

I've only been using Linux for about a month. I'm running Mint 13. I'm trying to use www.goproblems.com but it tells me that my IcedTea is out of date. I hoped there was a package but I can't find it. I tried building it from source but that failed. I read that it requires GTK+, but when I checked that out, the site said GTK+ is dependent on 5 other packages that I might have to install, from source. My question is: **If there is an IcedTea package, where is it?** (Also, can someone recommend an online resource that teaches me how to do this well?)


How to get mplayer to play from stdin?

Why doesn't this work?               cat /dev/video1 | mplayer -      If I could get that to work, then I could play & record video at the same time using 'tee' to feed mplayer and mencoder. I want to play live video (from /dev/video1:input=1:norm=NTSC) and record it at the same time without introducing lag. mplayer plays the video fine (no noticeable lag). mencoder records it fine. But I can't figure out how to "tee" the output from /dev/video so that I can feed it to both at the same time. (I know ways to encode it, then immediately play the encoded video, but that introduces too much lag). If mplayer and mencoder would read from stdin, then I could use 'tee' to solve this. How can I do it? [BTW, I'd be happy with ANY solution that plays & records at the same time, as long as it doesn't add lag - I'm not wedded to mplayer. But encoding first and then playing adds lag.]


Creating a Live USB for Crunchbang

I am looking to run one of my computers on Crunchbang Linux, but I cannot seem to be able to find a way to create a live USB of it.


mdadm; previously working; after "failure", cannot join array due to disk size

## Abstract I had a functional Raid 5 array, I rebooted the box, and then mdadm couldn't re-assamble one part. Seeing that it was only one part, I thought it would be easy to just re-sync. But that turned out not to work, because apparently now the device is not large enough to join the array!? ## Initial Raid Setup Sadly rather complicated. I have a Raid 5 combining two 3 TB disks with two linear raids (consisting of 1tb+2tb). I did not partition the disks, that is, the raid spans physical discs. In hindsight this is probably what caused the initial failure. ## After the fateful reboot mdadm would refuse to assemble one of the linear arrays, claiming that there existed no superblock (checking with mdadm --examine on both didn't return anything). Stranger yet, apparently they still had some partitiontable remains on them. At this point I thought that the quickest solution would be to just re-create the linear array, add it to the bigger raid5 array and then have it re-sync. Hence I opted to just remove those partition table entries, that is: partition them to freespace. And then I created a linear array spanning both of the disks.               # mdadm --create /dev/md2 --level=linear --raid-devices=2 /dev/sda /dev/sdc      However, when trying to add them back to the array, I get               # mdadm --add /dev/md0 /dev/md2             mdadm: /dev/md2 not large enough to join array      So I am I correctly guessing the disks shrank? ## Counting blocks I guess it's time for some block counts! The two components of the linear array:               RO    RA   SSZ   BSZ   StartSec            Size   Device     rw   256   512  4096          0   1000204886016   /dev/sda     RO    RA   SSZ   BSZ   StartSec            Size   Device     rw   256   512  4096          0   2000398934016   /dev/sdc      If mdadm's linear mode would have no overhead, the sum of the two sizes would be bigger than one of the 3tb drives (3000592982016). But that is not the case: /proc/mdstat reports that the linear array has size 2930015024, which is 120016 less than the required               # mdadm --detail /dev/md0 | grep Dev\ Size     Used Dev Size : 2930135040 (2794.39 GiB 3000.46 GB)      But that... is terribly fishy! Before rebooting (an albeit earlier incarnation) of this linear array was part of the bigger array! ## What I believe happend After the reboot, mdadm recognized that a part of the array was missing. Since it was the smallest member, the array device size was automagically grown to fill up the next smallest device. But that does not sound like uh, sensible behavior, does it? An alternative would be that for some reason I am no longer creating the maximum size linear raid, but... that's sort of nonsensical as well. ## What I have been pondering to do Shrink the degraded array to exclude the "broken" linear array and then try to --add and --grow again. But I am afraid that does not change the device size actually. Since I do not understand what exactly went wrong, I would prefer to first understand what caused this problem in the first place before doing anything hasty.


disable apt-listchanges (and other interactive stuff) during upgrades (reliably)

I have to admit, I really _really_ hate apt-listchanges. If I'm going to do a huge dist-upgrade, I want to just leave the computer there for a few hours. The asker of this serverfault question had a similar goal in mind, bu after implementing all of the suggestions in that post, I was still hit by `apt- listchanges`. Why is it so difficult to achieve non-interactivity with `apt`, an otherwise excellent program, given that the Unix philosophy aspires to it? I am hoping the changes I made to `/etc/apt/listchanges.conf` will help, but I want suggestions as to how to reliably do upgrades without any interaction whatsoever.               [apt]     frontend=none     email_address=root     confirm=0     save_seen=/var/lib/apt/listchanges.db     which=news      This is the command I used was               DEBIAN_FRONTEND=noninteractive \     apt-get \     -o Dpkg::Options::="--force-confnew" \     --force-yes \     -fuy \     dist-upgrade      I also added the following lines to `/etc/dpkg/dpkg.cfg`               force-confold     force-confdef


Fedora installer doesn't see my Windows 7 partitions

I tried to install Fedora 17 on the same disk I have Windows 7. First I got the message, that there are no free space to create partition, even in Windows part of disk was marked as unallocated. I spent two days to get to know that there's something like dynamic disc. OK. I converted it to basic one using EaseUs tool, which took about 20 hours. Ok, no problem. Now I have basic partition, but Fedora (also GParted) didn't see it. It acts like there was not any partition on my disk and wants to wipe it. I don't want to lose my Win7 partition and data. What should I do? This is how Win7 sees it (sorry for Polish language): http://i46.tinypic.com/259ansz.png This is how GParted sees it: http://i47.tinypic.com/i3c5dv.jpg Message from Fedora is: > "We could not detect partitions of filesystems on this device. This could be > because the device is blank, unpartitioned or virtual. If not, there may be > data on the device that can not be recovered if you use it in this > installation. We can remove the device from this installation to protect the > data." I'm getting really frustrated wasting my time on such stupid things. I have no idea what to do. Can anyone help?


Need help understanding to errors in /var/log/messages

Recently I've been checking my log and found two weird errors which I don't understand. The first one: `May 22 08:11:00 localhost dbus: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.25" (uid=42 pid=2827 comm="gnome-power- manager) interface="org.freedesktop.Hal.Device.LaptopPanel" member="GetBrightness" error name="(unset)" requested_reply=0 destination=":1.7" (uid=0 pid=2155 comm="hald))q` The second one (this one repeats a lot): `May 22 16:14:55 localhost NetworkManager[1991]: <warn> error requesting auth for org.freedesktop.NetworkManager.enable-disable-wwan: (6) Remote Exception invoking org.freedesktop.PolicyKit1.Authority.CheckAuthorization() on /org/freedesktop/PolicyKit1/Authority at name org.freedesktop.PolicyKit1: org.freedesktop.DBus.Error.NameHasNoOwner: Remote Exception invoking org.freedesktop.DBus.GetConnectionUnixUser() on / at name org.freedesktop.DBus: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get UID of name ':1.49': no such name` Does anyone know what those mean?


Intel 82845G Video Crash workaround

I have the Intel 82845G video card and trying to get X11 working with it. It routinely crashes with artifacts. I know the existing history with this driver and X11 and I am about to buy a replacement video card but decided I will check here first to see if anyone has had any success with it. I tried it with Linux Mint XFCE, and Crunchbang openbox. I made sure the BIOS onboard video memory is at max, and different options in `xorg.conf` like disabling DRI. Eventually I want to use awesome wm. Will changing the wm have any effect on video crashing, or is this solely a problem between Intel's driver and X11 ?


What exactly is PKGBUILD and should I edit it when installing packages?

Whenever I use `yaourt -Syua` in my Manjaro Linux system, it'll give me               Edit PKGBUILD ? [Y/n] ("A" to abort)      and sometimes               Edit chromium-pepper-flash.install ? [Y/n] ("A" to abort)      Somewhere I read to just say no to editing these files. The wiki : https://wiki.archlinux.org/index.php/PKGBUILD Says the `PKGBUILD` is just some switches to alter when installing, so is it alright to just leave it default? I haven't found information about the `.install` files, what are they?


Open/Libre Office: Restricting Impress to PowerPoint-compatible content?

Is there a way to restrict the Open/Libre Office presentation-program Impress to just PowerPoint-compatible content? Preferably in a way that "shadows-out" or removes non-compatible animations and trans(... whatever) between slides. I made a presentation and saved it as a ppt-file, only to discover that several of my animations and ... had been removed/replaced - I assume because they were unsupported by PowerPoint. Alternatively, is there a list of compatible content?


How to let sendmail preserve plus detail for .forward?

I have a normal sendmail installation. A user has a `.forward` like this:               # cat ~elrond/.forward     elrond@somewhere     # sendmail -bv elrond+extra@localhost     elrond@somewhere...  deliverable: mailer esmtp, host somewhere., user elrond@somewhere      Note that the `+extra` is lost. What do I need to change to make the `+extra` be preserved? The usual `%3` for hashmaps does not work in the `.forward`.


What happens when I press "Shut Down" from the GUI?

I have been banging my head against this for quite a while now. It's related to this question. I would like to find out exactly what happens when I choose to shut down my Linux box from the GUI. This seems to be poorly (if at all) documented. Ideally, I'm hoping for a DE- and OS-agnostic answer. Barring that, I'm interested in the specific case of Mandriva 2010.1 and Debian 6.x (Squeeze) and 7.0 (Wheezy) all running Gnome. (If you're paying close attention, yes that's Gnome 2 and Gnome 3) Basically, I would like to know which command/script/sequence of scripts is started when I press "Shut Down" or "Restart" so I can modify their behavior. Some forum posts I looked at suggest hacking `/etc/polkit-1/*` but this directory structure is only a skeleton on my Debian (Squeeze) box, for example. Can anyone help? * * * **EDIT** **What I have tried so far**   * Replaced the `shutdown` executable with a script of my own. This doesn't work: when I press `shutdown` Gnome logs out without executing my script.   * Tried editing the Gnome 2 menu. No joy: the "Shutdown", "Log out" and "Lock Screen" options do not appear in the menu editor.   * Looked at `/usr/share/menu`, nothing helpful there. **Possible avenues for the solution**   * `strace`ing the GUI options (is this even possible?)   * Looking at `shutdown`'s source code   * Looking at `gnome-session`'s source code * * * **Update** As per my comments on the answer below, I have looked into `polkit` actions under `/usr/share/polkit-1/actions/` and found (in the file `org.freedesktop.consolekit.policy`) an action called `org.freedesktop.consolekit.system.stop-multiple-users` that throws the message               System policy prevents stopping the system when other users are logged in      I'm thinking (due to the `org.freedesktop.*` naming convention) that this is some kind of signal sent to the DM via D-BUS. Moreover, this message appears when trying to shutdown graphically while other users are logged in, so the mechanism that triggers it must be the same mechanism triggered when "Shut Down" or "Power Off" is selected from the GUI. Can anyone confirm/refute? Is there a possibility of somehow intercepting this signal or modifying it?


How/why can Firefox packages work on all Linuxes?

How/why can a Firefox 64bit (or 32bit) package work on different Linux distributions since each Linux distribution has a different version for gcc, glibc, linux kernel, etc. ?


mdadm raid1 and what chunksize (or blocksize) on 4k drives?

I want to use two 3 TB drives in a mdadm raid1 setup (using Debian Sequeeze). The drives use 4k hardware sectors instead of the traditional 512 byte ones. I am a bit confused because on the one hand the kernel reports:               $ cat /sys/block/sdb/queue/hw_sector_size     512      But on the other hand `fdisk` reports:               # fdisk -l /dev/sdb     Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes     255 heads, 63 sectors/track, 364801 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes      Thus, it seems that the kernel has some idea that the drive uses 4k sectors. The `mdadm` man page is a bit cryptic about the chunk size and raid1: > >        -c, --chunk= >               Specify chunk size of kibibytes.  The default when  creating > an >               array  is 512KB.  To ensure compatibility with earlier > versions, >               the default when Building and array with no persistent > metadata >               is  64KB.   This  is  only  meaningful  for RAID0, RAID4, > RAID5, >               RAID6, and RAID10. >   Why is it not meaningful for raid1? Looking at `/proc/mdstat`, the raid1 device md8 has 2930265424 blocks, i.e.               3000591794176/2930265424/2 = 512      Does `mdadm` use then a blocksize of 512 bytes? (/2 because it a two-way mirror) And is chunk-size a different concept than blocksize? Trying to let `mdadm` _explain_ a device:               # mdadm -E /dev/sdb -v -v     Avail Dev Size : 5860531120 (2794.52 GiB 3000.59 GB)     Array Size : 5860530848 (2794.52 GiB 3000.59 GB)      Where               3000591794176/5860530848 = 512      With a default `mkfs.xfs` on the md device, it reports:               sectsz=512     bsize=4096      I corrected this with a call of `mkfs.xfs -s size=4096 /dev/md8` **Edit:** Testing a bit around I noticed following things: It seems that the initial resync is done with a block size of 128k (and not 512 bytes):               md: resync of RAID array md8     md: minimum _guaranteed_  speed: 1000 KB/sec/disk.     md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for resync.     md: using 128k window, over a total of 2930265424 blocks.      The displayed speed via `/proc/mdstat` is consistent for that blocksize (for 512bytes one would expect a performance hit):               [>....................]  resync =  3.0% (90510912/2930265424) finish=381.1min speed=124166K/sec      (For example when disabling the write cache the displayed speed immediately drops to 18m/sec) Under `/sys` there are actually some more relevant files besides `hw_sector_size`:               # cat /sys/block/sdb/queue/physical_block_size     4096     # cat  /sys/block/sdb/queue/logical_block_size     512      That means that the drive does not lie to the kernel about its 4k sector size and the kernel has some 4k sector support (as the output of `fstab -l` suggested). Googling a bit around resulted in a few reports about WD disks, which do not report the 4k size - fortunately this 3 TB WD disk does not do that - perhaps WD fixed their firmware with current disks.


What encryption to use for good performance?

I will install Ubuntu 11.04 to an encrypted VolumeGroup with the installer: http://i.stack.imgur.com/Skil9.png AES   Blowfish   Serpent   Which one is the fastest from these 3? Or Using AES with only a 128 bit key gives the best performance/speed? Does someone has a graph/statistics about them? (or e.g.: what is the performance/speed difference between using an encrypted VG or not using encryption at all.) If there aren't any statistics about this, then how could I do one? What tests are there on the "market"? Thanks.


Options for .hidden files?

What options exist for the `.hidden` file? I wanted to hide certain filetypes in a folder, but simply putting `*.out`, which I assumed would hide all files ending in `.out`, didn't work. :( I'm using Nautilus. UPDATE: I guess if this option doesn't exist, a bash shell could be created that, when executed in a directory, finds all files with matching endings and writes them to the `.hidden` file. I don't have any experience with the command-line but I'll try this :).


What is the fastest Virtualization solution for Linux?

Is it still XEN? Or is it VirtualBox, KVM, VmWare or else? With fastest I mean that the guest VM is fast (the smallest speed loss because of Virtualization)


Shell output help

What is the output of `date -u +%W$(uname)|sha256sum|sed 's/\W//g'` (on Arch Linux if it matters)?   How do I find that out?


Arch Linux installation- partitions help

While trying to set up partition from Arch Linux installation CD(using cfdisk) itself the following error showed up- > Bad primary partition 2: partition ends in final partial cylinder How do I fix it?


Kernel freezes on loading ramdisk. How to find out what's wrong?

I'm using an Ubuntu Server (13.04) Minimal installation (with the Xubuntu Metapackage as a desktop environment, if that matters) on x86_64 on my Samsung notebook. I'm currently forced to use the no-longer-maintained version of the proprietary AMD graphics driver (fglrx-legacy) as the open-source "radeon" driver heats the card 15°C more in idle. That's why I'd really like to try kernel 3.11 with the new power management features for AMD cards. The problem is, once I install a mainline kernel the system freezes after selecting the kernel in Grub with the messages:               Loading Linux 3.11.0-laptop ...     Loading initial ramdisk ...      And nothing happens. How can I find out whats wrong? Are there any logs from that early in the boot process stored somewhere? Some more information: The system works perfectly with the Ubuntu Raring Kernel self-compiled from Git (which is based on 3.8). It doesn't work with mainline Kernel 3.9 or 3.10 (same problem). I also tried a pre-compiled "generic" version of 3.10, doesn't work either. I have 4 partitions on the hard drive: `/boot` (unencrypted), `/`, `/home` and `swap` (all LUKS/dm-crypt encrypted). The notebook is a Samsung NP-R522H. The GPU is a Mobility Radeon HD 4650.


How do I add ncmpcpp search results to the current playlist?

Using the `ncmpcpp` MPD client, in the search function (F4) how can I add all the search results to the current playlist short of adding each item one-by- one? For example, say I search for all music where _genre == "instrumental"_. The help tells us to use `space` to add an item to the playlist, but what about the other 1,500 songs found? I'd like to add all search results to the playlist.


Is it safe to delete the quota.user file?

Is it okay to delete the `quota.user` file from the root directory? This file is 2.7GB in size and I need to wipe it from the system. I ran:               $ quotaoff -avug     $ mv quota.user quotaold.user     $ quotaon -avug     $ mv quotaold.user /another/place      So far all seems well. I was looking for a way to truncate this file but couldn't find anything so I decided to just try removing it instead. I am running _CentOS_ release 5 (Final) on Xen using cPanel.


Where have I set my bash PATH?

I want to remove `~/bin` from my PATH. I set it up months ago when Linux (Ubuntu) was very new to me, but I don't know how I added it... Nothing shows up when I search all the files listed below.   Where else could it be being set? It is being pre-pended after `$HOME/.profile` prefixes PATH with `$HOME/bin` If it makes any difference, I get the same PATH from both the command-prompt and a running script.               #!/bin/bash     {       echo "first dir of PATH is: '${PATH%%:*}'"       shopt -s nullglob       cat \         /etc/profile \         /etc/bash.bashrc \         /etc/profile.d/*.sh \         $HOME/.bashrc \         $HOME/.bash_aliases \         /etc/bash_completion \         $HOME/.bash_completion* \         $HOME/.profile \         $HOME/.profile_zap \         $HOME/.bash_profile* \         $HOME/.bash_login* \       | sed -rne '/~\/bin/p'     }      Output is:               first dir of PATH is: '~/bin'


Replacing multiline consecutive tags with a single line using sed and ignoring white spaces

I have a large XML file with several tags. One of the sub tag is as below:               <Products>       <SubProduct>    ----> this line is problem         <SubProduct>             <Name>One</Name>         </SubProduct>         <SubProduct>             <Name>One</Name>         </SubProduct>         <SubProduct>             <Name>One</Name>         </SubProduct>         <SubProduct>             <Name>One</Name>         </SubProduct>         <SubProduct>             <Name>One</Name>         </SubProduct>       </SubProduct>   ----> this line is problem     </Products>       As seen above, the Products tags will have multiple SubProduct tags. However, an extra SubProduct opening and closing tag is appearing as mentioned above (with comment 'this line is problem'). The solution would be to search for two consecutive open SubProduct tags and two consecutive close SubProduct tags and replace one in each with space. How can I achieve this using `sed`? How can I search for two consecutive tags where the tags are on separate lines as well as I do not know how many spaces will be present between the two consecutive tags (it could be 5 spaces or 10 spaces before or after the new line character).


How do I start a process with a nice value of -20 and not give it root privilege?

I would like to start a process with a nice value of -20. This requires me to use a command like - `sudo nice -n -20 matlab`. However, this starts matlab as root too. Is there a way to have matlab as non-root? My current approach is -`sudo nice -n -20 sudo -u myusername matlab` \- which, to me looks like a hack. Is there a direct approach to do this?


Using bash shell function inside AWK

Is it possible to use bash function inside AWK somehow? Example file (string, int, int, int) ` Mike 247808 247809 247810 ` Trying to convert values from decimal to hexadecimal. Function defined either in .bashrc or in shell script. `awk '{print $1 ; d2h($2)}' file` awk: calling undefined function d2h input record number 1, file file source line number 1


Strange temporary network outage in Linux

I'm facing a very annoying problem that I noticed a week from now and for which I can't find an answer: my network suddenly stops responding, usually coming back exactly 25 seconds later. I was using kernel 3.10.4 and now migrated to 3.11-rc4 to see if something changed, but no, the behavior is the same. And since it is a hard to spot problem due to the fact usual web surfing is in "bursts" and the outage is completely random, I can't really tell this problem was present in a previous kernel as well (I always use custom but unpatched kernels from kernel.org, all compiled by myself) I can't tell the kernel is the culprit either, but I can say there are no clues on the system logs (I checked both `/var/log/syslog` and `/var/log/messages` and there is nothing unusual there) and that hardware doesn't seem at fault, for the problem shows up using either one of my network cards: `lspci output:`               02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express (rev 01)     04:00.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev 30)      and I already tried to exchange the ethernet switch ports and still no one else where I work has a problem except me (although we use similar machines, I'm the only one using Linux, so I had to take some infamous jokes about it as well... hehe). I ran up wireshark on my machine and left it continuously pinging our gateway and another machine on the same network segment. Then, at the first sign of network malfunction I would check it and verify the gateway stopped responding pings, but the other machine was still there responding normally. Some other times is the other machine which stops responding and the gateway is fine, and some other times both stop responding. I don't know what else to do, so I'd like some help or tips on how to further debug this, since the system logs are completely normal. I have my kernel config file and a capture file from wireshark showing the situation. I can post here or at some pastebin site in case anyone finds it useful to understand the case, just please let me know the detail level I should use (I guess the packet level without the raw data would be enough).


Why do I get error "Could not chdir to home directory"

I work in support, and occasionally I'm given shell access to a remote Linux system. I frequently find that when the admin gives me remote access, that I get the following output upon login.               [joe@mycomputer ~]$ ssh bob+ldap@foo.edu     bob+ldap@foo.edu password:     Creating directory '/foobar/users/bob'.     Unable to create and initialize directory '/foobar/users/bob'.     Last login: Mon Jul 29 13:05:27 2013 from bar.edu     Could not chdir to home directory /foobar/users/bob: Input/output error     -bash: /foobar/users/bob/.bash_profile: Input/output error     -bash-4.1$          -bash-4.1$ echo $HOME     /foobar/users/bob      The admins I interact with know way more about Linux than I do. My questions are:   1. Why do I get "Unable to initialize directory"?     * Is that an error on their part, or is that intentional for security? I'm assuming they ran `useradd bob` without the -m option when they created my account.    2. Why is my shell name 'bash-4.1' and not 'bob'?  **Update**   I'm guessing that because I am not a normal user on the system, I don't have a network share foobar/users, just local storage. It seems strange that such a high percentage of servers I log into would configure their server the same way. * * * _Resources I have investigated_   * http://www.chc-3.com/charles/remote_access.htm   * http://www.nomachine.com/products.php   * http://superuser.com/questions/349142/remote-access-to-linux-server-from-windows


Pop-up event reminders in Korganizer, when synchronizing with Google Calendar

I have "connected" my Google Calendar with Korganizer. I create an event within my Google account. I want pop-up reminders to show up when I go home, even though the events weren't create by KOrganizer but were synced. I don't know if I did something wrong, but the events created by Korganizer don't have pop-ups either. I did check toggle reminder on. Any ideas?


Getting more details in ALSA volume

I've bought some new speakers, and they play much louder than my old ones. It's so much that I most of the time keep them at 1% to 3% in alsamixer, which is -103dB to -84dB. This obviously leaves little room for details in configuration. 3 options in total. What I would like is to be able to set them at 1.6% or 2.3%. Or even better: to tweak the function mapping percentages to dB, so I could make the load "area" take up less "room" in the percentage scale. Do you by any chance know if alsa supports this level of configuration?


How to setup default browser?

How to change default browser for opening url-s ? For sanity check, I tried:               xdg-open 'http://unix.stackexchange.com'      And it opens in other browser. I found information about assigning applications to filetypes with `xdg-mime default xpdf.desktop application/pdf` . However I don't know how to apply this knowledge for `url` ? Does `url` have mimetype ?


Where is the default icon used by Gnome when no icons are found?

Just to experiment, I moved the folder               /user/share/icons/      away, as in saved it on a USB drive and deleted it from Linux. Now, all icons are shown as the default "white" icon. Where is this icon stored? Can I modify it to change its appearance? I am using CentOS Linux desktop with gnome.


When looking at lsof output, what does "0t0" mean?


How to figure out where a link gets redirected

I currently working on a script that updates a file. The file has several versions. The important ones have static links. These get redirected to the actual file which then gets downloaded using `wget`. I have figured out that `wget` has a flag whcih prints the headers recived. There is a list of Locations. The last location meantoned in the header is the actual URL. I need to get that! My idea was to use `wget -S` to get the header (I need another flag that prevents the file from downloading and creating). Then use a pipe to parse the lines and catch the last line containing `location`. I guess this could be realized by using `grep -l -i "location:" | tail -l`. Then I should be left with a single line that can be easily parsed. So the command would look something like this:               # The -??? flag is the one that prevents the file from downloading. (I don't know it)     Location=$(wget -S -??? $URL | grep -l -i "location:" | tail -l)      My question what flag do I have to use to not download the file with `wget` or is there another way/command to accomplish this?


Granting SAMBA rights and privileges requires root password

Given a default Ubuntu installation, I get the following               myusername@EARTH:~$ sudo bash     root@EARTH:~# net rpc rights grant myusername SePrintOperatorPrivilege     Enter root's password:     Failed to grant privileges for myusername (NT_STATUS_ACCESS_DENIED)      Is there any workaround or do I really have to resort to unlocking the root account and setting its password?


Connect 2 laptops together in dualhead mode?

This probably isn't possible, but I thought I should ask just incase I'm wrong. Is it possible to connect 2 or more laptops together and drag files/folders from one screen to the other as if you were using a dual/triple/quad head graphics card on a single computer? I'm using Ubuntu 10.04.


eldoc makes emacs use 100% cpu

When I use eldoc, I add this to `.emacs`:                (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)      (add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)      (add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)      and then when I use Emacs, it uses 100% CPU. But when I delete this code in `.emacs`, my Emacs works. Does anyone have any idea about this? Or how to debug the problem. Or something else to substitute for eldoc?


samba security share && user

This is my smb.conf:               [global]     workgroup = myworkgroup     netbios name = mercurio     server string = fileServer     security = share     map to guest = Bad User          [Share]     comment = Carella di condivisione globale     path = /home/share     guest ok = yes     public = yes     writable = yes      Everyone has r/w access to this folder and it is ok. Now I need to share another folder but with only some users. I think I must change security options but it is in the global section! there are some other problem. here the config:               [secure folde]     comment = Secure folder     path = /home/secure     valid users = ignazioc      but from my mac i see this message http://dl.dropbox.com/u/31437518/Screen%20Shot%202012-02-10%20at%2015.50.15.png (file not found) and this is the folder               drwxrwxrwx  4 ignazioc ignazioc  4096 Feb 10 09:39 secure/


What is the recommended way to build an apt mirror with multiple versions of packages?

We have a local apt mirror built with `apt-mirror` and it's working nicely, but since it considers valid only the latest version of every package, if there's the need to downgrade one of them (because of a regression or whatever) we can't rollback to the previous one, we can only go back to the first version available. For example, we are having a problem with Thunderbird 24.5.0 and we'd like to go back to 24.4.0, but:               $ apt-cache show thunderbird | grep Version     Version: 1:24.5.0+build1-0ubuntu0.12.04.1     Version: 11.0.1+build1-0ubuntu2      What is the recommended way to build an apt mirror that keeps more versions of the same package available?


What is ".xsession" for?

What is the purpose of the `.xsession` file in the home folder? What should be put in there? The desktop environments don't use that file and for the X startup from the tty there is `.xinitrc`.


What tools can I use for PDF indexing?

In our working group we used Recoll on a Ubuntu PC to index all the PDF. For a while we moved everything to a Redhat server. Is there a Recoll alternative which doesn't requires a GUI adn support searching through a web interface?


apache2 gui / Comanche Replacement

I opened an OLD redhat book to the section about Apache configuration and it talked about the Comanche GUI. I thought "That's great! Why hasn't anyone suggested that before?" Then I found out that project is (apparently) dead. Is there anything else like it that is still in development? If the answer is "Google it", I'd appreciate a hint as to what search terms to try.


Where to put `setxkbmap` command in Xfce?

What is the proper place for `setxkbmap` command in Xfce? What is the proper place for it in general - other DEs and bare WMs? I have the following command:               setxkbmap -layout "us(colemak), ru(typewriter)" -option "grp:menu_toggle"      Putting it in `.xsession` didn't work. I want to make this command run, to make it work globally in GUI. **Edit (18.09.12):** I went `xfce4-settings-manager` -> `Session and Startup` -> `Application Autostart`, then clicked "Add". There i tried to put two commands to make it work.   1. The full `setxkbmap` command that i gave above verbatim under "Command".   2. Created an executable file with the command in my PATH, put the file name under "Command". Both variants didn't work. However the _full path_ to the executable file with the command under "Command" text field worked.


Software distribution

I have a set of servers with Red Hat on board and an internal software (it is set of many files with configs and so on) that is in permanent development. There are several types of servers:   * development   * testing   * post-testing   * production There are up to 10 servers in each category, but each server works separately and doesn't depend from others. Furtermore in each stream I can have a minor subversions that are tagged in cvs repository. So I can't just build an testing.rpm for all testing servers and prod.rpm for all productions. Anyway I can see several ways to do that:   * Make own rpm repository, automatically build a set rpm packages for every server type and its subversion and use a cron to update a package.   * Use a shell script with own config on each server to do that   * Make update manually :) Which one is better? Or all of them are completely wrong and there is another way? :)


Storing `find` parameters in a variable

I'm running the following bash command:               find . \( -iname '*.aif' -o -iname '*.pdf' -o -iname '*.exe' -o -iname '*.mov' \         -o -iname '*.doc' \) -exec rm -f {} \;      I'm running the same parameters in another call to `find` later on in the script. Is there any way to store the `\( -iname '*.aif' -o -iname '*.pdf' -o -iname '*.exe' \ -o -iname '*.mov' -o -iname '*.doc' \)` part in a variable?


Best place to get nVidia driver update for CentOS 5.5

What is the best place to get an updated nVidia video driver for CentOS 5.5? Is there a CentOS package available that will update it? Or is it best to download it directly from nVidia? Also, I do not have an internet connection on the machine, so it will have to be a manual download and installation. Thanks, DemiSheep


only display df lines that has more fs usage then 80%

root@SERVER ~$ df     Filesystem  512-blocks  Free    %Used   Iused   %Iused  Mounted on     /dev/YXCV   655360      365632  45% 6322    13% /     /dev/ASDF   3801088     670648  83% 41759   32% /usr     /dev/ASR    1048576     500496  53% 5555    9%  /var      how can I pipe the df commands output to only display lines that has more usage then 80%? e.g.: it would only display:               /dev/ASDF   3801088     670648  83% 41759   32% /usr


Can the menu of emacs still be accessible in terminal?

when running Emacs inside terminal emulator, there is a menu bar on the top. ![enter image description here](http://i.stack.imgur.com/6daxX.png) Can we select a menu item, expand it and select a sub-menu item? Under Xemacs, we can, but I haven't found a way under Emacs in terminal yet. Thanks.


Does Fish have a "magic space"?

I gather that bash has a "magic space" function, where if I do e.g. `sudo !!<space>` it will blow in `sudo ./my_last_command`. Does something similar exist in fish?


Excluding a directory when zipping files

I've got a bash script that does something like this:               zip -0 ../backup/backup.zip \     -r ./* \     -x \*CVS\* \     -x *Thumbs.db* \      The directory it's backing up is a SVN archive (it used to be CVS back in the day). I've been unable to get it to exclude .svn and it's contents. What's the cleanest way to exclude .svn (recursively through the entire tree)?


Get system notification at a certain time?

Is there a way, in Linux or FreeBSD, to receive notification from system at a specified time? I'm thinking something in like of what inotify in Linux does for filesystem events. There IS a way to that using cron, but I'm asking if there is a lower-level interface that can be called programatically. If cron is an 'official' Unix interface for this kind of task, I'd like to know that, too.


Using relative paths in recoll

I am using recoll to index my files locally and so far it works really well. However, I'd like to have the paths be relative to the recoll.conf or recoll index directory so that I can move the files around as I see fit. Is this possible?


How can I randomize file names in a given directory?

Ok, this may sound like an odd request but it really has a good purpose! I have a Panasonic Plasma TV with an SD card slot, via which I can display a slideshow of JPEG photos. This is useful for preventing burn-in, if I step away from the TV for a few moments while cooking, or if I answer the phone, or whatever, it's handy to just start the slideshow to prevent a static image from showing up, and also let me see photos while I do something else. The problem is the slideshow always starts from the first photo alphabetically, meaning I always see the same images and never get to the end. What I'd like to do is have a script on my Unix machine which I can run on the SD card (mounted at `/media/sdcard`) and have it randomize the names of all the files under that directory. Doesn't _really_ matter how it randomizes them but I'd _prefer_ purely numeric names (for no apparent reason) Is there an easy way to accomplish this? Something like `find /media/sdcard -exec mv {} rand() \;`? For bonus points, any way to prevent the script from _overwriting_ two files in the event that there's a collision? These are copies of photos so if I lose one I still have the original, but still that would be inconvenient...


Is transferring files between android phone and linux supposed to be a easy task?

I want to copy some movie files from my Linux PC to my Android phone, however, it is much more easy to copy from Windows to my Android phone. In Windows, my phone would mount its internal memory card and SD card automatically, allowing me to transfer files between them. With my Linux distro, it always shows an error whenever I plug my phone in to the PC with a USB cable, then it may take some minutes to mount the internal memory card and SD card. Sometimes it fails to mount them too. I am wondering is this really a pain to do files transfer in all Linux distros, or if some other distro would perform better. I am using Linux Mint 13 Mate. If a newer distro could make my day easier I might switch over to it. My phone is an HTC One SV without rooting. P.S. As I remember, the first error message is "Error initializing camera: -60: Could not lock the device". Really it said camera even I am connecting a phone to it. Then I need to wait for some minutes and hope the SD card would mount successfully.


Move Data from Partition to Partition on Same Drive

Moving data from one drive to another is slow. Copying data on a drive to it's self is slow. Moving data from one drive to it's self is fast. If I'm moving data on the SAME drive but a different partition, shouldn't it be fast? I assumed the move would be a fat table change and not an actual move (copy/delete) of the data on the disk. How can I make sure this is what happens? FYI I'm on mac osx and I'm dealing with two fat32 partitions on the same external.


after enabling Xinerama (in AMD condor Dual-Head Graphics Card) the system graphics hangs

I have a problem in my AMD Condor Dual-Head Graphics Card When I enable Xinerama from "System → Preferences → AMD Catalyst Control center (Administrative)" my RHEL Server 6.3 (x64) Graphics hangs. I need to choose disable it from console `Alt`+`Ctrl`+`F2`, login as root, off Xinerama from `xorg.conf`. While switching from initlevel 3 to initlevel 5 I got following error.               Loading TSI condorvc device driver moduleinsmod: error inserting '/lib/modules/video/condorvc-mod.ko'': -1 File exists


How to mount remote file system

I want to mount my Windows `NTFS` share C:\ to Linux `ext4` file system, so I can see the file system tree as part of my Linux file system and transfer my files. PS. I am using `rhel6`.


how to multiply column of one file by column of anothe file?

I want your help in multiplying columns of one file by column of other another file where both files have the same number of columns and rows. I want the script to multiply the first column of the first file by the first column of the second file, the second column of the first file and the second column of the second file and so on. Here is my sample data and the required output below file1               2 3 4 4 . . .      5 6 7 8 . . .     . . . . . . .      file2               3 4 8 10 . . .      5 10 5 9 . . .     . . . . . . .       Required output file will be file1.file2               6 12 32 40 . . .      25 60 35 72 . . .


bash ${VAR//search/replace} and weird regex behaviour

I am trying to do some searching and replacing on a variable using the ${VAR//search/replace} parameter expansion. I have a pretty long and evil PS1, that I want to work out the size of after expansion. To do so I have to remove a bunch of escape sequences I stuff into it. However on trying to remove all the ANSI CSI SGR sequences I've fell across an issue with my syntax. Given my PS1 of:               PS1=\[\033]0;[\h] \w\007\]\[\033[1m\]\[\033[37m\](\[\033[m\]\[\033[35m\]\u@\[\033[m     \]\[\033[32m\]\h\[\033[1m\]\[\033[37m\]\[\033[1m\])\[\033[m\]-\[\033[1m\](\[\033[m     \]\t\[\033[37m\]\[\033[1m\])\[\033[m\]-\[\033[1m\](\[\033[m\]\[\033[36m\]\w\[\033[1m     \]\[\033[37m\])\[\033[35m\]${git_branch}\[\033[m\]\n$      (yes it's sick I know...) I'm trying to do:               # readability     search='\\\[\\033\[[0-9]*m\\\]'     # do the magic     sane="${PS1//$search/}"      However these seems to be greedy at the point of `[0-9]` (almost like `[0-9]` is treated like a `.` instead):               echo "${PS1//$search/}"     \[\033]0;[\h] \w\007\]\n$       If I remove the `*`, and change `[0-9]` to `[0-9][0-9]` (as that is more illustrative) I get closer to the expected result:               $ search='\\\[\\033\[[0-9][0-9]m\\\]'     $ echo "${PS1//$search/}"     \[\033]0;[\h] \w\007\]\[\033[1m\](\[\033[m\]\u@\[\033[m\]\h\[\033[1m     \]\[\033[1m\])\[\033[m\]-\[\033[1m\](\[\033[m\]\t\[\033[1m\])\[\033[m\]-\[\033[1m     \](\[\033[m\]\w\[\033[1m\])$(git_branch)\[\033[m\]\n$       Why is the `*` (zero or more) doing crazy things? am I missing something here? If I pass the same regex through sed I get the expected result:               echo $PS1 | sed "s/$search//g"     \[\033]0;[\h] \w\007\](\u@\h)-(\t)-(\w)$(git_branch)\n$


How do I modify this Perl solution so that it will substitute embedded double quotes with single quotes?

Previously in this question: "string having doublequotes in between apart from the enclosing quotes" @BernieReiter asked a follow-up question where he wanted to take CSV entries such as the following:               $ cat test.csv     17,"abc","Testurteil "sehr gut"","08/15"     99,"xyz","Testurteil "vernichtend"","4711"      And convert them so that instead of having embedded double quotes (`"..."`) within, they were substituted to be single quotes (`'...'`). The results should look like this:               17,"abc","Testurteil 'sehr gut'","08/15"     99,"xyz","Testurteil 'vernichtend'","4711"      @BernieReiter had also asked how he could take @StephaneChazelas' solution that he provided to that question, where he used this Perl solution:               $ perl -pi.back -le 's/"(?:[^"]|"(?=[^,]))*"|[^",]*/($r=$&)=~       s@(^"|"$|\\.)|"@$1||"\\\""@ge;$r/ge' file.csv      So how would one modify Stephane's solution?


What happens if you edit a script during execution?

I have a general question, which might be a result of misunderstanding of how processes are handled in Linux. For my purposes I am going to define a 'script' as a snippet of bash code saved to a text file with execute permissions enabled for the current user. I have a series of scripts that call each other in tandem. For simplicity's sake I'll call them scripts A, B, and C. Script A carries out a series of statements and then pauses, it then executes script B, then it pauses, then it executes script C. In other words, the series of steps is something like this: Run Script A:   1. Series of statements   2. Pause   3. Run Script B   4. Pause   5. Run Script C I know from experience that if I run script A until the first pause, then make edits in script B, those edits are reflected in the execution of the code when I allow it to resume. Likewise if I make edits to script C while script A is still paused, then allow it to continue after saving changes, those changes are reflected in the execution of the code. Here is the real question then, is there any way to edit Script A while it is still running? Or is editing impossible once its execution begins?


Cannot boot to Windows 7 partition using Grub

Windows 7 BOOTMGR is missing when I try to boot into the OS from GRUB. Im not anywhere near being a pro when it comes to partioning or whatever so here's a image of gparted: ![gparted hdd](http://i.stack.imgur.com/CUU63.png) And a copy paste of `/boot/grub/menu.lst`:               # general configuration:     timeout   10     default   0     color light-blue/black light-cyan/blue          # boot sections follow     # each is implicitly numbered from 0 in the order of appearance below     #     # TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.     #     #-*          # (0) Arch Linux     title  Arch Linux     root   (hd0,4)     kernel /vmlinuz-linux root=/dev/sda4 ro     initrd /initramfs-linux.img          # (1) Arch Linux     title  Arch Linux Fallback     root   (hd0,4)     kernel /vmlinuz-linux root=/dev/sda4 ro     initrd /initramfs-linux-fallback.img          # (2) Windows     title Windows Seven 64bit     rootnoverify (hd0,2)     #makeactive     chainloader +1      Someone point me in the right direction to fix this problem... EDIT: I changed `rootnoverify (hd0,1)` to `rootnoverify (hd0,2)`, result is now a system that reboots immediately after attempted boot. (straight back to BIOS screen)....


Copying recursively files with spaces

At the moment I have a set of files of the form of:               /dir one/a picture.jpg     /dir two/some picture.jpg      What I want to do is copy and change the end to `-fanart.jpg` to the filename to:               /dir one/a picture.jpg             /a picture-fanart.jpg     /dir two/some picture.jpg             /some picture-fanart.jpg      I've manged to get it working for the situation where there are no spaces:               % for i in `find . -name "*.jpg"`; do cp $i "${i%.*}"-fanart.jpg ;done;      but I need help in getting it working where there are spaces.


Cannot access a website from  Firefox

I'm trying to access www.belgacom.be using Firefox from my Archlinux system and I get the following error:               Firefox can't find the server at www.belgacom.be      When I use Chromium, it works perfectly. I tried deleting the `~/.mozilla` directory, with no success. I've also tried running Firefox from another user session, with no luck. I'm running the latest version of Firefox. Any ideas?


I changed my hostname, rebooted and lost internet connection

I set a new hostname on my machine using:               sudo hostname NEWHOSTNAME      Then I restarted, and tried accessing the internet and nothing happened. I checked the hostname and it was set to `localhost.localdomain`. How can I reset my configurations so that I am again connected to the web? I'm running Red Hat Enterprise 6.0 (Santiago)