Need help on this bash auto completion script

I'm trying to setup autocompletion for a command, which takes only one parameter, a folder name, In `/secure/kernel_builds/`, I have the three following subfolder: `3.5.6/ 3.6.2/ source/` Now I want auto completion, that lists all sub folder name possible, but not the one named `source`, right now I'm using a pretty stupid way to do it, by checking if the completion word is started with a number,               _avail_kernel_builds()     {         case $COMP_CWORD in             1)                 if [[ "${COMP_WORDS[COMP_CWORD]}" =~ ^[0-9] ]];then                     COMPREPLY=( /secure/kernel_builds/"${COMP_WORDS[COMP_CWORD]}"* )                 else                     COMPREPLY=( /secure/kernel_builds/"${COMP_WORDS[COMP_CWORD]}"[0-9]*/ )                 fi                 COMPREPLY=( "${COMPREPLY[@]#/secure/kernel_builds/}" )                 COMPREPLY=( "${COMPREPLY[@]%/}" )                 ;;         esac         }      Is there a better way of doing so?


What graphical programming language does OpenBox use primarily?

Is there a specific graphical language that OpenBox uses for most of it's apps, or one that it likes to run with? For example how KDE uses primarily QT for it's apps, and also includes a large numbers of libraries to run with it. The reason I ask, is that I have a program I wrote for KDE, and I would like it so people on OpenBox could also run it. I'm just not sure how well OpenBox would handle it, if at all.


Range of possible value returned by cksum

I am looking for the range of possible values that could be returned by `cksum`. E.g.               echo -n '/my/path/filename' | cksum | cut -d' ' -f1      returns `2379496500`. What is the range (min and max) of the possible values that can be returned? BTW, the parameter above is the string value of a fully qualified file path, not the contents of the file specified thereby.


OS X: how to keep the computer from sleeping during a http connection

An application I use downloads data from a specific server, and I need it to sleep after the download has finished and the socket is closed. However downloads take place at random days, the app that downloads checks for updates and only downloads if there is one               Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)         tcp4       0      0  192.168.1.29.51005     8.8.8.8.80      ESTABLISHED      Pretend 8.8.8.8 is server where data is downloaded from. Is there a way to prevent the computer sleeping while there is HTTP session to a specific server in progress? Now please excuse my pseduo script, but it's the best way I could try               netstat -anp tcp      IF Foreign Address = 8.8.8.8 & state = ESTABLISHED     then         WAIT AND CHECK IN 10 MINUTES     else         pmset sleepnow     fi


How can I upgrade pip on Ubuntu 10.04?

On Ubuntu 10.04 I've used `apt-get install pip` to install `pip` after which I installed `django`. Then I tried to uninstall `django` with `pip` via `pip uninstall django` which gives me:               pip: error: No command by the name pip uninstall      From doing some research that is because I'm using an older version.               $pip --version     pip 0.3.1 from /usr/lib/python2.6/dist-packages (python 2.6)      I first realized that this version of `pip` did not have uninstall when I installed the wrong version of `django` and tried to uninstall it with               pip uninstall django      and ended up with               pip: error: No command by the name pip uninstall      From another article: > pip 0.3.1 is over two years old, and indeed it does not include the > uninstall command. The current version of pip is 1.0.1. > > I presume you're using an OS-packaged version of pip; those tend to be quite > out of date. Quite a few bugs have been fixed and features added in the last > couple years. So what is the correct way to upgrade it on Ubuntu 10.04 so that I can gain access to the `uninstall` command?


How to change focus in X-window by terminal

I got the window id by using xwininfo command. I want to change the focus of this window by a terminal command. How can I do it?


Running a pbk file in Linux

To connect to my university's network, they provided me with a .pbk file. The file is made for windows of course and I have no idea how to use it in Fedora (I'm using Fedora 15)


Narrow characters

It would be awesome to modify spark to print narrow characters in for example Gnome Terminal. Is this at all possible with Bash / Python?


PS: what does "ps -o comm= -p $PPID" do

I have a script which does `ps -o comm= -p $PPID`. The explanation says this gets the parent process name. From the man page I found out `-o` means user defined format, `comm` means command and `-p` means select the process by the given PID - in this case `$PPID`, which means parent PID.   * What does `comm= -p $PPID` mean?   * How does this command work?


How to bind super key to Ctrl+Shift using xmodmap?

I have read the xmodmap documentation. I could only find information on how to bind one key to another. How do I bind one modifier key to a combination of other modifier keys? Can I do this using some other software (like autokey)?


NFS file with same name but different content depending on host

I have cluster using NFS with a program `myprogram` which writes to a fixed location, e.g. `/home/sharedfs/somedir/somefile.txt`. This means that if you run `myprogram` from each node, they all write to the shared `/home/sharedfs/somedir/somefile.txt`, but this is not desirable. So, I was thinking: is there a way to create a file for each node, and make a soft link in NFS such that the link on each node points to a different node- specific file? That is, having               /home/sharedfs/somedir/somefile.node0.txt     /home/sharedfs/somedir/somefile.node1.txt     /home/sharedfs/somedir/somefile.nodeN.txt      and               /home/sharedfs/somedir/somefile.txt -> link to somefile.node0.txt only on node0     /home/sharedfs/somedir/somefile.txt -> link to somefile.node1.txt only on node1     /home/sharedfs/somedir/somefile.txt -> link to somefile.nodeN.txt only on nodeN      Is this possible? Another option is to have different directories `somedir` which are mounted differently for each node, so that `somedir/somefile.txt` points to a different (non shared) directory on each node. Any idea is welcome!


How to remove all FIFO files with a shell command

I can't find a shell command to remove all the FIFO files inside a directory. In fact, for the removal of directories, the `rm` command offers the options `-d, --dir`, but for FIFOs it offers no option. For now, the only workaround found is to call the FIFO like `foo.fifo` so that it is easy to remove them with `rm *.fifo`.


Filetype and dereference when listing directory with LS command

I'm trying to combine arguments to the `ls` command to list a directory content. What I'm basically trying to achieve is listing the directory dereferencing all links, but showing explicitly that the item listed is a link. I've tried combining the `\--dereference` and `\--classify` options, but instead of showing the link symbol (`@`) I get a `*` since the link targets an executable file. Any thoughts on how I can get such result? I'm open to alternatives other than `ls` command. **EDIT:** I actually use other options from the `ls` command. My current command along with their options is the one bellow:               ls -ogq -LB --group-directories-first --time-style=long-iso      I intend to parse the output inside an application I'm building and can't use the default link output with the arrow (`->`). Other items on the directory (e.g. folders and files) must also be listed. **EDIT (2):** Just to clarify, I'm developing a Java apllication that uses a SSH2 API to connect to servers and list directories. The result from the listing is then used to populate a tree using the jsTree jQuery plugin . Currently The command I cited above give's me the following output:               felipe@simba:/mnt/drive$ ls -ogq --group-directories-first --time-style=long-iso      total 12     drwxr-sr-x 2 4096 2014-06-11 18:04 folder1     drwxr-sr-x 6 4096 2014-06-27 19:35 folder2     dr-Sr-s-wt 2 4096 2014-06-27 13:51 folderWithPermissions     -rw-r--r-- 1    0 2014-06-30 10:42 file.txt     lrwxrwxrwx 1   49 2014-06-30 11:36 linkTeste -> folder2/dir/otherfile.txt      By applying a regular expression I can identify what is a folder, file or link by looking at the permissions. But when I have a link I need to list only the link name, instead of `name -> destination`. If I use the `-L` option for the `ls` command only the link name is outputed and I get the referenced destination's permissions (what is a good thing), since the `-L` option dereferences the link, but this way I can't know that the link is actually a link.               felipe@simba:/mnt/drive$ ls -ogq -L --group-directories-first --time-style=long-iso      total 12     drwxr-sr-x 2 4096 2014-06-11 18:04 folder1     drwxr-sr-x 6 4096 2014-06-27 19:35 folder2     dr-Sr-s-wt 2 4096 2014-06-27 13:51 folderWithPermissions     -rw-r--r-- 1    0 2014-06-30 10:42 file.txt     -rwxr-xr-x 1    0 2014-06-27 18:40 linkTeste      I need to list only the link name, know it is a link and know what the destination is (file, folder or link). I can handle different kinds of output since I'm going to apply a regular expression anyway. Alternatives using `find` or `stat` are also welcome.


Memory reporting issues

When I view the system monitor it reports that I'm only using 48% of ram. Same with gkrellm. But all of the command line utilities report different. Here is the output to free and /proc/meminfo. The only reason I can think of is the graphical utilities neglect to count the cache. But isn't that still stored in physical memory. Why is there such a distinction between the two (graphical and cmd-line). Is cache not important? Thanks in advance free -o                            total       used       free     shared    buffers     cached     Mem:       1915936    1831836      84100          0      11280     874072     Swap:      3866620     146944    3719676      cat /proc/meminfo               MemTotal:        1915936 kB     MemFree:           81740 kB     Buffers:           11900 kB     Cached:           869224 kB     SwapCached:         4128 kB     Active:           722020 kB     Inactive:         887300 kB     Active(anon):     669976 kB     Inactive(anon):   235424 kB     Active(file):      52044 kB     Inactive(file):   651876 kB     Unevictable:       50812 kB     Mlocked:               0 kB     SwapTotal:       3866620 kB     SwapFree:        3719680 kB     Dirty:               460 kB     Writeback:             0 kB     AnonPages:        776964 kB     Mapped:            52052 kB     Shmem:            126384 kB     Slab:              77824 kB     SReclaimable:      37580 kB     SUnreclaim:        40244 kB     KernelStack:        2800 kB     PageTables:        33836 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:     4824588 kB     Committed_AS:    2622452 kB     VmallocTotal:   34359738367 kB     VmallocUsed:      560312 kB     VmallocChunk:   34359122920 kB     HardwareCorrupted:     0 kB     AnonHugePages:    118784 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:       12288 kB     DirectMap2M:     1949696 kB


Boot Linux while running Windows

I will be traveling for a month, without bringing my computer. I might only have access to public computers running Windows in Internet cafes. While I'm traveling, I would like to SSH to my Linux server to fix some bugs if occurs. What is the easiest way for me to run Linux on a Windows machine, and have access to the Internet without rebooting the computer. Once I run Linux on top of Windows, I will also have Internet access immediately without the need to reconfigure. In fact, a Linux with terminal is enough. Preferably to run this on a USB flash drive.


How to mount a windows/samba windows share under Linux?

Under Linux (Ubuntu 12.04) I want to mount a windows share / windows partition named `//winshared` on the network. I do not know the IP or anything else. On one Ubuntu system, I am able to mount a directory with               mount  //winshared/mypath /mnt/win      while on one other Ubuntu system the exact same command just gives               mount error: could not resolve address for winshared: Unknown error      Network settings seem to be same on both systems, and I installed `smbfs` and `samba` (the latter with errors). Do I need to instal something else? Do I need to configure something? How to find out the crucial differences between both systems to get the same mount work on both systems? Additional information:   1. When I use `smbclient` to connect to the windows partition/share/whatever, it works on the first system but not on the other system. The error is:              Connection to winshared failed (Error NT_STATUS_BAD_NETWORK_NAME)        2. Following this tutorial I installed `smbfs` and `cifs-utils`, but the `mount` command from above still gives the same error, which is NOT described in the tutorial.    3. I also have an entry in `/etc/fstab` reading              //winshared/mypath /mnt/win cifs uid=alexander,credentials=/etc/samba/wincred 0 0      with the file `/etc/samba/wincred` identical to a same file on the system the mount works. The md5sum of both files are identical. Therefore, an error regarding credentials can be excluded.


How different is Elvis from Vim?

I've been using Slackware for a while now, which ships with Elvis as its default editor. Most other Linux distributions seem to ship with Vim, instead of Elvis. Having gotten quite used to Elvis, will I face a learning curve when moving to a distro which uses vim? What are the advantages and disadvantages of Elvis compared to Vim?


Symlinks and EncFS

I am trying to secure my Dropbox account by using EncFS. My strategy is as follows:   * I store all my files in a folder called `~/Public/`.   * The encrypted counterpart of `~/Public/` is `~/Private/`.   * Use EncFS: `encfs ~/Private/ ~/Public/` Now the problem is that I'd like to use Dropbox for backing up my dotfiles as well. So I tried symlinking `~/.rc/` (the folder containing my dotfiles) into `~/Public`. But EncFS seems to treat the symlink as a file and it shows up in `~/Private` as 0 byte file. Any way I can get EncFS to follow symlinks?


Should I use http or ftp links in apt sources.list

Should I use `http` or `ftp` links in `/etc/apt/sources.list`? What I mean is is using something like,               deb ftp://ftp.debian.org/debian/ squeeze main contrib non-free     deb-src ftp://ftp.debian.org/debian/ squeeze main contrib non-free      better or worser than using,               deb http://ftp.debian.org/debian/ squeeze main contrib non-free     deb-src http://ftp.debian.org/debian/ squeeze main contrib non-free      I guess as `apt` uses `wget` to fetch things, this is same as asking if `wget` is faster on `ftp`. Thanks!


Perform floating point arithmetic in shell script variable definitions

I understand `bash` and some other interpreters only perform arithmetic for integers. In the following `for` loop, how can I accomplish this? I've read that `bc` can be used but am not sure how to use `bc` in this situation.               total=0     for number in `cat /path/to/file`; do             total=$(($total+$number))     done     average=$(($total/10))     echo Average is $average      file:               1.143362     1.193994     1.210489     1.210540     1.227611     1.243496     1.260872     1.276752     1.294121     1.427371


Forward Autocorrect to a script

> **Possible Duplicate:**   >  How do I get bash completion for command aliases? I wrote a series of scripts to make package management a little more intuitive for me. However, I can no longer tab complete for package names. Is there a way I can forward the results of a tab completion to a script? Sample- package-install:               #!/bin/bash          apt-get install $*


MAME saving but not restoring games

**Background** I discovered Ms. PacMan some time ago, but you don't see many of that game in arcades. Then I did find out about `mame` (version 0.145), available on my Linux (Ubuntu) machine and about running Ms. PacMan and that works. **Problem** When I save a game (so I don't have to start from the beginning every time (so to improve more difficult levels) and then restore the game, the game in MAME resets and I have to start from the beginning. I have read here about games being updated to support save state and also somewhere that saving was removed from MAME .100. I also tried to compile an older MAME version 0.99 (which should support saving), but it has no Linux support. And AdvanceMAME (1.2) does not compile because of configuration file problems that don't seem easy to solve. **Question** Should I try harder to get an old MAME compiled, or is this saving of Ms. PacMan not going to work on Linux anyway?


Number of files not containing given string

I read the question about how to find out the number of files that contain a certain string. This is possible with `grep -l "string" * | wc -l`. Is it possible to invert this, finding the number of files **not** containing the target string? I tried adding the `-v` option, but this doesn't seem to output the right result.


Mount Android phone file system on Linux manually

How can I bind my Android file system to my Linux machine, and modify it? When I plug in my Android device, it seems to use one USB interface but I couldn't find whre the mount point is. I checked `/mnt` but there is nothing.


Home key acting strange in bash (tty and X) on long input strings

When I hit `Home` if my current input is short enough (say, <36 characters), it works fine. However, when I've typed a longer command and then want to go back to the beginning, it seems like it does its job, but the command isn't **displayed** right anymore. It looks as if I'm not in the beginning but about 10 characters off. Although if I type "blindly", it works fine, but it looks like a total mess, as if the whole input is shifted to the right, but not redrawn. So I type over it, but "in fact" not, because the place I'm "erasing" is "actually" 10 characters to the right. Accordingly, if I try to erase the command, the first 10 characters are still displayed, but if I hit `Enter` it just displays another prompt as if the previous input was empty. I know it's not the best explanation ever, but the point is that bash recognizes it and tries to do the right thing, but often fails. I reproduce this both in tty and in a terminal in an X session. When I hit `Ctrl`+`V` and then `Home` I see different sequences (`^[OH` in X, `^[[1~` in tty), but both seem to be in my `/etc/inputrc`:               # do not bell on tab-completion     #set bell-style none          set meta-flag on     set input-meta on     set convert-meta off     set output-meta on          $if mode=emacs          # for linux console and RH/Debian xterm     "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\e[5~": beginning-of-history     "\e[6~": end-of-history     "\e[7~": beginning-of-line     "\e[3~": delete-char     "\e[2~": quoted-insert     "\e[5C": forward-word     "\e[5D": backward-word     "\e\e[C": forward-word     "\e\e[D": backward-word     "\e[1;5C": forward-word     "\e[1;5D": backward-word          # for rxvt     "\e[8~": end-of-line          # for non RH/Debian xterm, can't hurt for RH/DEbian xterm     "\eOH": beginning-of-line     "\eOF": end-of-line          # for freebsd console     "\e[H": beginning-of-line     "\e[F": end-of-line     $endif      `echo $TERM` shows `linux` in tty and `xterm` in X session. It's > GNU bash, version 4.2.24(2)-release (i686-pc-linux-gnu) Anyone have clues about this?


soundblast live on linx mint: fatal: module snd-emu10k1 not found

I'm trying to get my soundblast live 5.1 emu10k1 (rev 7) working. It is listed in my xconf settings but the onboard sound processor is the standard (i have tried to make de soundblaster standard, but then I had no sound). I ran `alsamixer` from a terminal and there's my soundblaster live 5.1 shown as the first device, but I cannot get any sound out of it... ### screenshot from alsamixer     ![ss #1](http://i.stack.imgur.com/WgyAx.png) _original URL:https://db.tt/ukN6Qd2T_ I found a tutorial from Ubuntu which tells step by step what to do. When I'm at the point of doing a `modprobe`, this is the output in terminal:               FATAL: Module snd_EMU10K1 not found.      What can I do to make my soundblaster live working?


Lock file from being edited or deleted

I have CentOS and cPanel installed. I want to lock certain files (e.g. `.ftpquota`) from being deleted through FTP. I tried to change the ownership to `root:root` or `root:lock` but it didn't work; neither did changing the mode to 0. How can I lock the `.ftpquota` file?


How to sort date: YYYY.MM.DD. HH:MM?

INPUT:               b|2013.06.03. 18:47|     a|2013.06.03. 13:15|     c|2013.06.03. 13:53|      needed OUTPUT:               a|2013.06.03. 13:15|     c|2013.06.03. 13:53|     b|2013.06.03. 18:47|      How can I sort the dates correctly in ascendant order? The delimiter is the `|`. P.S.               sort -t "|" -n -k 2      is not enough, because it doesn't put the HH:MM in good order, only the YYYY.MM.DD.


Insert variable and keep the variable

I'm on VMWare which, no matter what anyone says, responds to most unix commands. Some things are unique though, for example the fact that almost no files are persistent through reboot. Due to this I'm getting a problem with a scripted backup which is using a variable to name log files: If I manually insert               backup-$(date +%Y-%m-%d).log      into `cron`, log files will of course be named after the date they were started. However, if I insert this into `local.sh` to re-enter `cron` job at reboot;               /bin/echo "0 0 * * 1-5 ...backup-$(date +%Y-%m-%d).log      it will of course end up like this:               backup-2014-07-01.log      So the question is how do I write this to `cron`, so that it ends up as a varible instead of a date?


What are the methods to protect home folder files from other applications runing as the same user?

I would like to enforce the security access of some files in my Home folder. My concern is about processes running with the same privileges as me having access to those files. I've been wondering about this for sometime, because the role based security in Linux is great but weak for things running in the same role. Specially when it comes to an user account that is very active, every file laying inside the home folder is vulnerable to the user actions. For example installing a malicious Firefox plug-in, the other parts of the OS wont be touched but all the files inside the home folder can be exposed and installing a Firefox plug- in is something any user could do with out any special privilege.


Error installing arch Linux due to virtual box-guest-modules (despite not installing on virtual machine)

I'm installing Arch Linux, following the instructions at the Beginners' Guide, and got up to running `pacstrap -i /mnt base base-devel`. It finishes with the following error:               resolving dependencies...     looking for inter-conflicts...     error: failed to prepare transaction (could not satisfy dependencies)     :: virtualbox-guest-modules: requires linux<3.15     ==> ERROR: Failed to install packages to new root      What is really weird is that I'm not installing Arch in a virtual machine, I'm setting it up to dual boot on my laptop.


I can't use or find the google debian unstable/sid repository

I'm trying to use the debian unstable/sid branch of the google repositories (deb http://dl.google.com/linux/deb/ unstable non-free main), but I get errors: > Err "http://dl.google.com" unstable/non-free i386 Packages   >  404 Not Found [IP: 209.85.146.93 80]   >  Err "http://dl.google.com" unstable/main i386 Packages   >  404 Not Found [IP: 209.85.146.93 80]   >  W: Failed to fetch "http://dl.google.com/linux/deb/dists/unstable/non-free > binary-i386/Packages.gz 404 Not Found [IP: 209.85.146.93 80]   >  W: Failed to fetch > "http://dl.google.com/linux/deb/dists/unstable/main/binary-i386/Packages.gz > 404 Not Found [IP: 209.85.146.93 80] I get the same errors for deb "http://dl.google.com/linux/deb/ sid non-free main". I can't browse the repository at "http://dl.google.com", I just get a 404. Is it ok to use the stable repository instead even though I'm using debian unstable?


Where is the current wallpaper stored?

Does anyone know where the current wallpaper is stored in xfce4? I am using SLiM and I want to symlink the SLiM background to whatever my current wallpaper is so I don't have to manually change it every time.


Installing windows from Linux mint

I have an iso of windows xp and I am currently running Linux mint 8 Helena (we don't gave a proper connection to download the latest) . Since my DVD drive isn't working I need to make a boot able USB pen drive to install windows. Please suggest a method not involving too much textual commands . it has 'wine' but common windows utilities do not work. Maybe irrelevant but the processor is core 2duo t6400 3gb ram Intel GMA 4500 MHD..


Failed to download the JMeter CA certificate for HTTPS recording

I am unable to run HTTPS recording in Jmeter. I have used "jmeter_proxy_step_by_step.pdf" for the setup. The Jmeter version is 2.11 and Java jdk7. But I am unable to generate the certificate. The following error is displayed when running "HTTP(S) Test Script Recorder"- ![Warning message](http://i.stack.imgur.com/6w0Uh.png) > Could not create script recording proxy - see log for details:'keytool > -genkeypair -alias :root_ca:dname "CN-_DO NOT INSTALL unless this is your > certificate (Jmeter root CA, OU=Username: shreesha, C-US' -keyalg RSA > -keystore proxyserver.jks -storepass (redacted) -keypas (redacted) -validity > 7 -ext bc:c' failed, code: 1 Illegal option: -ext Try keytool -help


Nvidia Geforce 7150m display issues on Ubuntu 13.10

I have just completed a fresh installation of Ubuntu 13.10 on my desktop and the installation was successful. My video card is an on-board Nvidia Geforce 7150m/630i and I was able to include the latest PPA from Nvidia into the apt repository and did an apt-get install nvidia-current. This too went successful and is now showing that the latest driver of Nvidia is active. The problem is that the screen has a very slight flicker, distortion and is oversized on the display by a few pixels. Using the Nouveau driver gives a crystal clear display and the size is also correct, but there seems to be a few bugs in the display rendering and I suppose it does not use GL so the speed is very slow. Can you give me any assistance on finding the problem? Similar questions have been asked in this forum but nobody seems to struggle with the distortion and/or oversized screen display.


mount other encrypted volume on wrong password entry

I have fully encrypted my laptop using dm-crypt and luks. So If I start my laptop I was prompted for a password before init will start. This works just fine. ### The problem A possible attacker will know if he types in a password (i.e by trying) that his guessed password is wrong because luks refuses to decrypt that device. So I'm wondering if there is a way to circumvent this. If someone enters a wrong password (read: Any literal that was not defined), a fake block device should get mounted (maybe I have to format and install another plain-unix there before) and booted, so that no one can determine (without inspecting the hard-disk any further) if the password was correct or not. If this is not possible, it can also be another literal which is predefined to mount another block-device.


How to Reset Forgotten Root Password in Fedora 19 from GRUB

YES, FEDORA 19. I saw a lot of information about how to do it but doesn't work with this version. All the tutorials explain the method for older versions of Fedora, i didn't found anything about doing it on the v19 or the v18. The GRUB menu is different (and i installed the GRUB's version from fedora installation, I only have this system ). I can enter to the recovery console but asks me the root password, so this doesn't solves anything. If anyone knows a way to do it; or if it's impossible, please tell me why.


NIC missing in 70-persistent-net.rules

I am using Ubuntu and typing               ifconfig -a      shows all interfaces but one(eth4), while the file 70-persistent-net.rules contains all(including eth4) but one (eth8). Any idea why is that and what are the consequences?


How to get Evolution to run in VNC on Debian/Wheezy?

For many years I've been in the habit of, when away from home, VNC-ing (over ssh) back into my "home machine" and running Evolution (for email, contacts etc) in a tightvncserver environment there. This worked fine when the home machine was running Debian/Squeeze, but now it's been updated to Wheezy, attempting to start Evolution in the VNC server session outputs:               Xlib:  extension "GLX" missing on display ":1".     Failed to connected to any renderer:     XServer appears to lack required GLX support      tightvncserver not supporting GLX isn't a surprise, but Evolution moving to a GL backend (through its use of the "clutter" toolkit?) is. (Just to be clear: Evolution works absolutely fine on the desktop; the machine has the nvidia drivers via DKMS.) What are the prospects for working round this? I'm thinking along the lines of:   * Is there a command line option to Evolution which will fix this?   * Is there some way of getting GLX support in a VNC server? (Alternatives to tightvncserver which support it?) Note that I tend to be VNC-ed in over high-latency/low-bandwidth links; I've tried running Evolution remotely over X11 before and it's not a good experience; VNC works much better. Debian-friendly (apt-get -able) solutions preferred.


Ignoring dependencies when installing with yum (Scientific Linux)

How can I ignore dependencies of a single package I am attempting to install using `yum` in Scientific Linux? The answer would presumably the same for CentOS/RHEL. To elaborate, I am looking to get the utility `lsb_release`, which I know would be put into `/usr/bin/lsb_release`. The command `yum whatprovides /usr/bin/lsb_release` tells me that it is part of the `redhat-lsb` packages (for the respective architectures), but those have a bunch of dependencies, including some X11-related. Since I am only after the `lsb_release` program, I would like to dodge the "crud" that comes with the dependencies. How can I achieve that?


Where can I learn more about how to use the GRUB `ntldr` command (module?)

I recently stumbled across the GRUB `ntldr` module. Apparently one of the things it can be used for is as an alternative to `chainloader` to boot the NT >= 6.0 versions of Windows as in the example below. (Very handy if the Volume Boot Record for a Windows partition is, uh, corrupted.)               menuentry "Windows 7 (bootmgr on /dev/sda1)" --class windows --class os {         insmod part_msdos         insmod ntfs         insmod ntldr         set root='(hd0,msdos1)'         search --no-floppy --fs-uuid --set=root 1EA0019AA0017A13         ntldr ($root)/bootmgr     }      Where can I learn more about how this boot directive can be used? I did not see it listed when I looked in the **HTML version** of the _GNU GRUB manual_. * * * ### Replying to ckhan's answer Thank you very much! I had pretty much decided I would have to try digging through the source code to learn more about the GRUB `ntldr` command/module. But you have done a much better job than I would have. It never would have occurred to me to look at the email archives to see what design discussions the person who wrote the code might have had. That method sounds like it could be very helpful in the future. Thanks for mentioning it. **My thoughts about GRUB`ntldr` support**   1. While I'm not really sure how much the distinction means, `ntldr` is a module, not a command. Or perhaps a dynamically loaded command if you wish.      Following your source code link and looking at lines 152 (`GRUB_MOD_INIT`) and 159 (`GRUB_MOD_FINI`) you can see the code to load and ... I'm guessing ... unload the module.      GRUB apparently implements many functions which you might think are " _commands_ " as modules. The only difference in usage that I'm aware of is that before using a module one must ensure it has been loaded with the command `insmod ntldr`.      _Aside:_ I always wondered why GRUB does not support `reboot`. It turns out the command exists, but it is a module. If `reboot` returns `unknown command`, then `insmod reboot` allows GRUB to "remember" the `reboot` command.      _Aside:_ When and why GRUB might " _unload_ " a module, I have no idea yet. Maybe it is the result of something similar to " _garbage collection_ "?? I have noticed that once loaded the modules seem to persist, even after a system is powered down and rebooted. Of course, you cannot **depend** on that, but that appears to be how it often works in practice.   2. It is interesting that they based `ntldr` on `chainloader`. I have not looked at the `chainloader.c` code. I guess it probably also does a relocating load in Intel 16-bit _real_ mode?      I **am** rather glad they did not implement `ntldr` as an option of `chainloader`. I agree with Vladimir. Whatever the similarities under the covers, the usage syntax is very different. The current approach is less kludgy.   3. It is also interesting to see the apparent lack of enthusiasm for adding this command to GRUB. Apparently the GRUB developers thought damage to the Windows _Partition Boot Record (PBR)_ was extremely unlikely. However, I can sketch out how to do it during an ordinary enough install.      Start by assuming a user has Windows installed on their system. They now install Ubuntu (12.04 LTS) " _alongside_ " Windows. At one point during the Ubuntu install they can apparently decide where they want GRUB to be installed. For reasons I cannot begin to guess at, some of them decide to install GRUB into the partition Windows is installed in.      The install completes and they can successfully start Ubuntu. However, when they try to start Windows by selecting the entry in the GRUB menu, Windows does **not** start. Instead attempting to start Windows with GRUB just re- displays the GRUB menu?      Why? Well, apparently when they elected to install GRUB into the windows partition part of what actually happened was the PBR for the Windows partition was over-written with GRUB's PBR. So `chainloader +1` does not chain load a Windows bootloader, but instead re-loads GRUB.      IMO, the safest _quick_ way to allow a user to boot Windows in that situation is to use the GRUB's new `ntldr`. I wonder if this would be of interest to the developers. I expect they did not anticipate this scenario. I wonder what bootloaders other than the Windows ones, `ntldr` and `bootmgr`, the GRUB `ntldr` command might be able to load?


How to make a PAM substack "requisite"?

For the auth section of my PAM configuration, `login` and `mdm` etc. call `common-auth`. I have `common-auth` calling the following as a substack (as `auth substack krb5ldap-cache-auth`):               auth optional pam_echo.so Trying UNIX     # Try UNIX, empty passwords OK     auth sufficient pam_unix.so nullok          auth optional pam_echo.so Checking UID     # If the uid < 500 and UNIX didn't work, then die.     auth requisite pam_succeed_if.so uid >= 500 quiet_success          auth optional pam_echo.so Trying Kerberos     # Try Kerberos, using the same password     # If the password is correct (success), then skip next lines     # If the password is wrong (auth_err), then die     # If Kerberos can't connect (?), then ignore     auth [success=2 auth_err=die default=ignore] pam_krb5.so debug use_first_pass          # Try the cache, using the same password     # Last chance.     auth optional pam_echo.so Trying cache     auth [success=done default=die] pam_ccreds.so action=validate use_first_pass          # Kerberos validated our password.     auth optional pam_echo.so Kerberos validated     # Store the password hash.     auth optional pam_ccreds.so action=store use_first_pass     # See if we can mount user drives, since we have a Kerberos token.     auth optional pam_mount.so     auth optional pam_echo.so Done.      (Using `pam_echo.so` just for debugging.) This seems to work fine for successful authentication. The substack mechanism is convenient, because I can use "sufficient" and "done" to terminate the substack without terminating the larger stack. But for failing authentication, the larger stack continues (for example, `mdm` will uselessly call `pam_gnome_keyring.so`, `login` will uselessly call `pam_group.so`) when it ought to die. Is there a way of calling a substack so that if the substack fails, the stack will die? I tried `auth requisite substack krb5ldap-cache-auth` but that's just bad PAM syntax.


ssh: "Error reading response length from authentication socket"

I have a Makefile with some `ssh` and `rsync` commands. All of them are executed correctly, but give the following error message:               Error reading response length from authentication socket.      I don't like enigmatic error messages - do you know what it means and how to fix it?


Easily switching over to a dynamic window manager from KDE

I've been using KDE on Opensuse for some time now and I feel like improving performance and using the most of my dual screens. I discovered tiling window managers and thought it would be a cool thing to try out. However, I'm stuck on a couple of issues.   * Will all my applications still be compatible? LibreOffice? Google Chrome? The GIMP? Kate? VLC? VirtualBox?   * Will it fully support my dual screens?   * Is it difficult to change environments from the one OpenSuse shipped with? Do I need to change anything internally?   * How easy is it to switch back to KDE and keep all my previous settings?   * Which tiling window manager should I be looking for? I realize that the last bullet point might be seen as off-topic (recommendation), but I will remove it if it's an issue.


Protecting file system contents with TPM and Encrypted File System

I have been assured that this is possible, but have so far not found any reference that will clue me as to how to do it. I need to deploy an "appliance" with software and data that the user is permitted to use, but which I would prefer to keep them from poking around inside. The user will not have root access, so the running system should be protected. I want to stop the HDD being pulled and mounted elsewhere. So far I have installed all but /boot into an Encrypted file system, and I am challenged for a password very early in the boot process. One of my colleagues heard from "somewhere" that TPM would be the solution to protecting the password challenge, which would allow the system to boot and unencrypt the root partition without root user presence. How do I get this working, been googling for various combinations a words, to no avail. I also installed a TPM-aware version of GRUB, but have no idea how/if this actually helps me.


Can I allow a non-root user to log in when /etc/nologin exists?

Suppose a non-root user with sudo privileges executes a delayed shutdown (`shutdown +10` or whatever) and logs out. Then, before the shutdown occurs, he wants to log back in and cancel the shutdown. The problem is that `shutdown` creates `/etc/nologin`, and `login` only allows root to log in when that file exists... is it possible to create an exception from this for a user? If not, what would be the best way to let a user initiate a delayed shutdown, then logging in and cancelling it at a later point?


What modules in the Linux source code take care of hot-pluggability?

Could someone shed more light on the code/modules that are responsible for the hot-pluggabilty of the hardware used in Linux machines?


how to calculate the average value of the column(big number of columns) that have the row ID?

I want to calculate the average value of my data when they have the same ID in the first column. I want to calculate the average values for the remaining columns that have the same value in the first column. I know how to do it for one column, but I got difficulty in doing the average for the whole columns I have. Here is my sample data File name: abraham               year    1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54     1929    7.5 0   7.78    3.695   1.139   0.186   -0.074  -0.205  -0.323  -0.434  -0.539  -0.639  -0.735  -0.916  -1.085  -1.241  -1.387  -1.522  -1.818  -2.058  -2.247  -2.389  -2.488  -2.551  -2.582  -2.521  -2.404  -2.262  -2.118  -1.987  -1.872  -1.775  -1.691  -1.628  -1.578  -1.484  -1.395  -1.311  -1.229  -1.151  -1.075  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1929    6.11    0   6.112   3.536   1.227   0.252   -0.063  -0.201  -0.32   -0.43   -0.535  -0.634  -0.73   -0.91   -1.078  -1.234  -1.379  -1.512  -1.806  -2.046  -2.236  -2.378  -2.478  -2.54   -2.573  -2.515  -2.402  -2.262  -2.119  -1.988  -1.873  -1.776  -1.692  -1.629  -1.578  -1.484  -1.395  -1.311  -1.229  -1.151  -1.075  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1929    2.22    0   2.227   2.542   1.022   0.222   -0.058  -0.198  -0.317  -0.427  -0.531  -0.63   -0.725  -0.905  -1.072  -1.227  -1.371  -1.505  -1.798  -2.038  -2.227  -2.37   -2.471  -2.533  -2.567  -2.512  -2.4    -2.262  -2.12   -1.989  -1.874  -1.776  -1.693  -1.63   -1.579  -1.485  -1.395  -1.311  -1.229  -1.151  -1.075  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1929    2.78    0   2.779   1.993   0.819   0.18    -0.056  -0.195  -0.314  -0.424  -0.527  -0.626  -0.721  -0.9    -1.066  -1.221  -1.364  -1.498  -1.79   -2.03   -2.219  -2.362  -2.464  -2.526  -2.562  -2.509  -2.399  -2.262  -2.12   -1.99   -1.875  -1.777  -1.693  -1.63   -1.579  -1.485  -1.396  -1.311  -1.229  -1.151  -1.075  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1930    0.83    0   0.833   0.85    0.354   0.073   -0.052  -0.187  -0.305  -0.414  -0.517  -0.614  -0.708  -0.885  -1.049  -1.202  -1.344  -1.477  -1.768  -2.006  -2.196  -2.34   -2.442  -2.508  -2.549  -2.5    -2.395  -2.261  -2.122  -1.992  -1.877  -1.779  -1.695  -1.631  -1.58   -1.485  -1.396  -1.311  -1.23   -1.151  -1.076  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1930    -0.28   0   -0.278  0.461   0.242   0.049   -0.052  -0.185  -0.302  -0.411  -0.513  -0.61   -0.704  -0.88   -1.044  -1.196  -1.338  -1.47   -1.761  -1.999  -2.188  -2.332  -2.435  -2.502  -2.544  -2.498  -2.394  -2.261  -2.122  -1.992  -1.878  -1.779  -1.695  -1.631  -1.581  -1.486  -1.396  -1.312  -1.23   -1.152  -1.076  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1930    0.56    0.002   0.511   0.348   0.165   0.033   -0.052  -0.183  -0.299  -0.407  -0.509  -0.607  -0.7    -0.875  -1.038  -1.19   -1.332  -1.463  -1.753  -1.991  -2.18   -2.325  -2.429  -2.496  -2.54   -2.495  -2.393  -2.261  -2.123  -1.993  -1.878  -1.78   -1.696  -1.632  -1.581  -1.486  -1.396  -1.312  -1.23   -1.152  -1.076  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1930    3.89    0   3.884   0.96    0.243   0.041   -0.052  -0.181  -0.297  -0.404  -0.506  -0.603  -0.696  -0.87   -1.033  -1.184  -1.325  -1.457  -1.746  -1.983  -2.173  -2.318  -2.422  -2.49   -2.536  -2.492  -2.391  -2.26   -2.123  -1.994  -1.879  -1.78   -1.696  -1.632  -1.581  -1.486  -1.397  -1.312  -1.23   -1.152  -1.076  -1.002  -0.86   -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.558     1931    -7.22   0.057   -4.563  -0.299  0.035   0.007   -0.054  -0.175  -0.286  -0.391  -0.49   -0.585  -0.676  -0.847  -1.007  -1.156  -1.295  -1.425  -1.711  -1.947  -2.136  -2.282  -2.389  -2.46   -2.514  -2.478  -2.384  -2.259  -2.125  -1.996  -1.882  -1.783  -1.698  -1.633  -1.582  -1.487  -1.397  -1.312  -1.231  -1.152  -1.076  -1.003  -0.86   -0.722  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.307   0.444   0.558     1931    -6.11   0.057   -4.1    -0.663  0.004   -0.001  -0.055  -0.174  -0.284  -0.388  -0.487  -0.581  -0.672  -0.843  -1.002  -1.151  -1.289  -1.419  -1.704  -1.94   -2.129  -2.275  -2.382  -2.454  -2.51   -2.476  -2.383  -2.258  -2.125  -1.997  -1.883  -1.783  -1.698  -1.633  -1.583  -1.487  -1.397  -1.312  -1.231  -1.152  -1.076  -1.003  -0.86   -0.722  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.307   0.444   0.558     1931    -10.28  0.057   -6.362  -1.527  0   -0.001  -0.055  -0.173  -0.283  -0.386  -0.484  -0.578  -0.668  -0.839  -0.997  -1.145  -1.283  -1.413  -1.697  -1.933  -2.122  -2.268  -2.376  -2.448  -2.506  -2.473  -2.382  -2.258  -2.125  -1.998  -1.883  -1.784  -1.698  -1.633  -1.583  -1.487  -1.398  -1.312  -1.231  -1.152  -1.076  -1.003  -0.86   -0.722  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.307   0.444   0.558     1931    -10 0.057   -7.018  -2.259  -0.001  -0.001  -0.056  -0.172  -0.281  -0.384  -0.481  -0.575  -0.665  -0.834  -0.992  -1.14   -1.278  -1.406  -1.691  -1.926  -2.115  -2.261  -2.369  -2.443  -2.501  -2.47   -2.38   -2.258  -2.125  -1.998  -1.884  -1.784  -1.699  -1.634  -1.583  -1.487  -1.398  -1.313  -1.231  -1.152  -1.076  -1.003  -0.86   -0.722  -0.588  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.307   0.444   0.558      desired output               year    1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54     1929    4.6525  0   4.7245  2.9415  1.05175 0.21    -0.06275    -0.19975    -0.3185 -0.42875    -0.533  -0.63225    -0.72775    -0.90775    -1.07525    -1.23075    -1.37525    -1.50925    -1.803  -2.043  -2.23225    -2.37475    -2.47525    -2.5375 -2.571  -2.51425    -2.40125    -2.262  -2.11925    -1.9885 -1.8735 -1.776  -1.69225    -1.62925    -1.5785 -1.4845 -1.39525    -1.311  -1.229  -1.151  -1.075  -1.002  -0.859  -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.559     1930    1.25    0.0005  1.2375  0.65475 0.251   0.049   -0.052  -0.184  -0.30075    -0.409  -0.51125    -0.6085 -0.702  -0.8775 -1.041  -1.193  -1.33475    -1.46675    -1.757  -1.99475    -2.18425    -2.32875    -2.432  -2.499  -2.54225    -2.49625    -2.39325    -2.26075    -2.1225 -1.99275    -1.878  -1.7795 -1.6955 -1.6315 -1.58075    -1.48575    -1.39625    -1.31175    -1.23   -1.15175    -1.076  -1.002  -0.85925    -0.721  -0.587  -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.308   0.445   0.55875     1931    -8.4025 0.057   -5.51075    -1.187  0.0095  0.001   -0.055  -0.1735 -0.2835 -0.38725    -0.4855 -0.57975    -0.67025    -0.84075    -0.9995 -1.148  -1.28625    -1.41575    -1.70075    -1.9365 -2.1255 -2.2715 -2.379  -2.45125    -2.50775    -2.47425    -2.38225    -2.25825    -2.125  -1.99725    -1.883  -1.7835 -1.69825    -1.63325    -1.58275    -1.487  -1.3975 -1.31225    -1.231  -1.152  -1.076  -1.003  -0.86   -0.722  -0.58725    -0.456  -0.328  -0.171  -0.017  0.068   0.151   0.307   0.444   0.558


Firefox mimetypes.rdf

Is it possible to create a default `mimeTypes.rdf` file for all the existing and new users ? So that whenever a user opens the firefox for the very first time, he will get the specified rdf file in his profile @ `~/.mozilla/firefox/*/mimeTypes.rdf`


Booting linux from usb using EFI

I need to use a USB drive as an installation media for my Mint and Ubuntu. For that I have unetbootin to make the usb bootable. But my PC only supports EFI boot (while adding the boot device, I need to provide an `.efi` file path etc). My question is how can I make my Linux distribution by copying some files (`.efi` file)? I have heard of a boot loader called `elilo`, but don't know how to use. And I tried rEFInd, rEFIt etc., they are booting from usb, but I don't know how to configure it to boot the Linux distribution in my usb drive.


Byte-level versus file-level backups

This question is motivated from a reply by Craig Sanders. Thanks, Craig! In what case, are byte or block level backups, i.e. disk or partition image backups, more suitable than file-based backups? For example,   * for routine backup of partitions and disks,    * for case of emergency when data is lost, and one would like to create a copy and restore later, in order to perform different data recovery applications/methods to see which one actually works. One example of byte or block level backups, i.e. disk or partition image backups is `dd`. Some examples of file-based backups are `cp` and `rsync`. Thanks!


Long time Windows user starting to use Linux - what is the essential knowledge I should learn?

> **Possible Duplicate:**   >  Good Introductory resources for linux I've been a Windows user since forever. I touched linux here and there, but my next job will have me use linux as my desktop computer 100% of the time. What are some essential tips/info I should know about?


Proxmox storage question

I am designing a proxmox installation for use as a home server, I chose it for the inherent flexibility and ease of administration, this restricts me to debian based solutions. So after some consideration I am looking at mounting LVM over a software based RAID 5 array. The hardware is a Dell T5500 with 2 xeon 2.66gig 4 core procs, 6 gig of ram, and 3 2tb hdds (more ram on order) Now that the background is out of the way this brings me to my question. Can I expand a RAID 5 by simply adding equal sized HDDs ie if the array is made of 3 2 TB HDDs can I add a 4th to the array and not have to many issues.


Solaris 10 Default File Permissions

I've created an NFS mountpoint with rw permissions. How do I set new files in a directory to be created by a specific user/group with certain permissions?


where does history timestamp stored before i enable it

I tried to set timestamp for history. My first attempt was do `export EXTENDED_HISTORY=ON` command, and it seems like doesn't work. Then i do `echo 'export HISTTIMEFORMAT="%d.%m.%y %T "' >> /etc/bash.bashrc` command, and it works. After i enabled the timestamp, i do `. /etc/bash.bashrc` to reload it, then i do `history` to show my history with timestamp. But the weird thing i noticed was how does the history can store the timestamp before i enable it? The first part of my history, all commands have the same timestamp 20:43:04: ![enter image description here](http://i.stack.imgur.com/jxOlN.png) The second part, start from 619th command, the commands have save their own timestamp, **but at this moment, i never enable the history timestamp yet**. ![enter image description here](http://i.stack.imgur.com/GdbkY.png) Instead, i enable the history timestamp at 694th command: ![enter image description here](http://i.stack.imgur.com/TLrKK.png) My $HISTSIZE is set long time ago which was 1000 lines. I using Konsole 2.10.5 terminal and Ubuntu 13.04. I have no idea the cache is a feature from Konsole or bash. My question is, how and where does **history** store the timestamp before i do 'export HISTTIMEFORMAT="%d.%m.%y %T "' >> /etc/bash.bashrc`? And it seems like have limitation because not all previous history timestamp is store(i.e. 1st to 618th command share the same timestamp). May be it's because of 619th command is the first command for this konsole tab session, i don't remember.


Limiting readers on a pipe

I want to use a pipe to pass some security credential information from "process1" to another script. I only want authorized reader processes to be permitted to read the pipe. I am thinking I will create a temp pipe with process1, and only write to the pipe if the reader is a process is digitally signed or has a chksum that has been registered prior to the run. Has anyone done something similar and have any suggestions?


How do I run a script n times at same time and how do I simulate a semaphore?

I have a text file, inside of this file is a number, and I have a script.sh in ksh. The script reads the file and gets the number, then increases the number by 1 and overwrites the new number in the file, then sleeps for some time and the process repeats until the number is equal to 120. I want to have this script running n times at the same time, how do I do this? But then I will have n processes trying to edit the file.txt and in order to have just one process editing and when it finishes (sleeps) the second can edit and so on... Probably you will tell me that I have to use a lockfile, but unfortunately I can't use that, so I have to find another way in order to simulate semaphores. Any ideas? Thanks.


"nopage" method for ISA vs PCI

This is with reference to LDD3 ch. 15, section "`Mapping memory with nopage`". I am having trouble understanding the `third paragraph on page 429`. It says: > Note that this implementation works for ISA memory regions but not for those > on the PCI bus. PCI memory is mapped above the highest system memory, and > there are no entries in the system memory map for those addresses. Because > there is no struct page to return a pointer to, nopage cannot be used in > these situations; you must use remap_pfn_range instead. Questions:   1. Why would there be NO struct pages for PCI addresses? Aren't these addresses still within the processor address range (i.e less than 4 GB)?   2. Referring to @gby's answer for http://stackoverflow.com/questions/11496999/how-does-one-determine-the-page-frame-number-for-device-memory, one explanation is that the "simple" module is useful only for mapping RAM areas to user virtual addresses. If so, how can one explain the invocation of the nopage method at all? By definition, arent all pages of main memory always available in the main memory? How can a page fault occur? I would really appreciate any inputs/responses on this.


How to properly prepare a server for power outages?

I have a personal Debian server set up, that I'm able to access in person and remotely, but normally I'm away from it and it's remote. It's on a battery- backup surge protector, but sometimes that isn't enough to keep the server on through a power outage. The machine automatically starts and boots, but its left at the login screen (in person). What I want to know is, what is the best way to have the server get itself back on and online after it loses power, without leaving it vulnerable in person? I'd like it to not auto-login for the screen in person, so that the machine isn't overly vulnerable in-person while I'm away. Are there battery backups that signal for hibernation or other safe power down automatically? How can I have a user sign in automatically in the background? What would you recommend as a "best practice" for this, considering it's just a home server?


Pressing `up` to get the previous command in a tty on Ubuntu Server

I've installed Ubuntu Server 10.10, and when I press `up` in a terminal nothing happens. Using Ubuntu Desktop it gave me the previous command that I ran. How can I make it do this in Ubuntu Server as well?


How can I get information about my virtual desktops via the command line?

I'm curious how I can get information such as the dimensions of my desktop, which desktop is currently active, and what labels (if any) are set for my desktop enviornment (DE).


How can I make Debian with KDE louder?

I am running KDE in Debian Testing and I just noticed that the system is really quiet. This is my office laptop, so to be honest I turned the sound on for the first time since I got it 2 years ago. The system sound in KMix is 100%, but still pretty much all the sounds are rather quiet. How can I make it louder?


Can you give a user account multiple passwords?

I want to assign 2 passwords to a single account. What I want to know is 1) is this possible, and 2) what are the security implications of this? The reason I want to do this is because I'm currently busy with some local testing, and I thought it would be convenient in some specific situations. After some research I found something called PAM, but I'm struggling to find information on how installation / configuration works. I'm running Ubuntu 12.04.


Could you explain this "chroot" /tmp directory creation?

In the following linked article they explain how to create a "chroot" /tmp directory. I'm a bit confused by what they did. Could someone explain what the following commands are doing? **Noexec and /tmp Troubleshooting**               1. # mkdir -p /root/chroot /root/tmp      2. # mount --bind / /root/chroot      3. # mount --bind /root/tmp /root/chroot/tmp     4. # chroot /root/chroot      In the first step, why did they create **/root/tmp** and not **/root/chroot/tmp**? Does the first mount command affects the second one? On the second step they are binding the new directory **/root/chroot** to the root directory. Does that mean that on the third step **/root/tmp** actually points to **/root/chroot/root/tmp** ? Where does **/root/chroot/tmp** comes from? That's the part I'm getting confused. What's the logic behind this?


chcon fails to fix "cannot enable executable stack as shared object requires" err under RHEL6

I have an application I test at work, that has always failed installation on systems with SELinux enabled. Our published workaround involves issuing a chcon command for the library-file at the center of the failure.               chcon -t textrel_shlib_t /usr/lib/ourfile.so.1.0.20      In RHEL5, this has worked for us, and allows the application to function correctly, without having to completely disable SELinux. Under RHEL6, the chcon command gives no errors, but we still see the same error, when our application is started as a daemon, via `/etc/init.d/ourapp` My primary concern is figuring out an updated workaround (the application library in question is submitted to an external certification process, and can't be changed for another 6 months), but I'm also curious if this indicates an intentional change from RHEL5 to RHEL6.


Efficient mechanism to determine if open file has been externally modified?

For example, the IDE I'm using at the moment (Aptana Studio) notifies me as soon as a file's contents it has open have been changed by some external program. I can imagine having a periodic loop run stat() on a file and check the time of last data modification. Is this how it's normally done or is there a blocking interrupt-like mechanism used instead?


Looking for an 'all in one' application with a script panel and a console

I'm quite impress with Windows Powershell ISE. Here is a nice video. ISE stands for 'Integrated Scripting Environment' and it's an application that has a panel at the top for scripting and a panel at the bottom with a console. I think it's a great idea! Within the same application, it is possible to use the console as usual, but also you'd have one or multiple script panels at the top where you can write and execute scripts directly. Also it's possible to execute only highlighted sections of the code. So I was thinking, how cool would it be to have something like this in my favourite Linux machine using bash! Has anyone know about something similar for Linux?


Solaris 11: how to get pkg properties in machine readable format

I would like to be able to extract (from within a shell script) the attributes of an IPS package. Basically I'm after exact same information as is listed with the `pkg info` command, but unfortunately this command list information in a format which is not very friendly to read from within a script. Example below:               $ pkg info archiver/gnu-tar               Name: archiver/gnu-tar            Summary: GNU version of the tar archiving utility        Description: Tar is a program for packaging a set of files as a single                     archive in tar format.           Category: Development/GNU              State: Installed          Publisher: solaris            Version: 1.26      Build Release: 5.11             Branch: 0.175.0.0.0.2.537     Packaging Date: October 19, 2011 09:11:16 AM               Size: 1.73 MB               FMRI: pkg://solaris/archiver/gnu-tar@1.26,5.11-0.175.0.0.0.2.537:20111019T091116Z      I was hoping for something like `pkg get-property pkg.summary archiver/gnu- tar` to be available as a command but can't find such command. I would really hate to try to parse the above output. Secondly the man pages clearly states that the output from `pkg info` is intended to be read by humans, not machines.


raid array not mounted

I have configured RAID array in my SUSE machine using `mdadm` command. The `/etc/mdadm.conf` is fine and `cat /proc/mdstat` shows up the array and it is also fine. However, if I run the `df -h` command, it is not showing the raid array. Is there some step am missing?


IRSSI parse chat messages

I run IRSSI on Debian Squeeze on my WD NAS and have it connected to irc.twitch.tv and joined in multiple channels. I can go in much detail here, but I think all I have to say is that I want to have bot commands for my twitch chat. No clue on how to achieve this with IRSSI. **Where do I start?**


Open source tool similar to MetadataTouch or metadata assistant?

I am looking for a tool that is open source and similar to metadata touch or metadata assistant. If there isn't one I may create one.


How can I run a script that starts before my login screen?

I was calibrating my touch screen, and saw that the best tool around was xinput_calibrator. So I used it. It have two options (one of which did not work), so I am here for the second. It says I should execute this command "in a script that starts with your X session": `xinput set-int-prop "3M 3M USB Touchscreen - EX II" "Evdev Axis Calibration" 32 14410 2146 14574 2115` So I tried `~/.xinitrc`, `~/.xsession` and `~/.xsessionrc`, all of which did not exist. So I created them and the exact content was this command. The first two files made my logins fail (after I login, I fall back to the login screen). With the last file, the calibration was functional, but only after logging in... I need that command to run **before** the login dialog shows up. I thought of adding this command to the end of `/etc/X11/xinit/xinitrc` with no result (nothing changed). Also, I tried to add it to the end of `/etc/X11/Xsession.d/40x11-common_xsessionrc` (after inspecting some of the files), but the result was exactly the same as adding it to `~/.xsessionrc`. How can I make this command run before the login screen shows (is this before the window manager starts, or before the X session starts)? Any clue will be appreciated. Thanks in advance. (I am running Kubuntu with the default window manager, if that matters) **UPDATE** As I am using Kubuntu, my display manager is kdm. As the accepted answer suggests, I edited the file `/etc/kde4/kdm/Xsetup`, and as mentioned here I added the command before the command that is there by default. And it works like a charm :)


What's the closest thing to a server version of Fedora?

Fedora seems to bill itself as a client-only OS, in contrast to Ubuntu or SuSE which have both client and servers versions. What is the closest Linux distribution to Fedora that's usable as a server operating system? Or am I misunderstanding the situation with Fedora, and it's a perfectly viable option for using on services such as Linode?


How to import numpy

I am trying to find density of states with `dftb+` in a Linux system. I have a Linux system with `Python-2.7.5` and `Numpy-1.8.1`. I am using the command as written below:               gagan@gagan-desktop:~/tests$ /home/gagan/dptools-0.1p3/bin/dp_dos band.out dos_total.dat      I am getting error as follows:               Traceback (most recent call last):     File "/home/gagan/dptools-0.1p3/bin/dp_dos", line 8, in <module>     import numpy as np     ImportError: No module named numpy


OwnCloud on XBMC Distro

I recently bought a raspbery pi with the purpose of building a cheap good multimedia station. As soon as i heard about the XBMC distribution and saw some videos of it in action i decided to try it myself. I just have one question, can i install the OwnCloud in a XBMC dist ? it would be very useful for me if i could be anywhere at home/work uploading multimedia to it and when i get to my bedroom, there we are, dont even have to bother with external hdd.


Renumbering windows in tmux

I frequently end up with more than ten windows in tmux. Later on, I close some of my older ones. Is there a way to renumber, say window 15, to window 3 (which doesn't exist anymore)? Or to `pack` them all up again, so that there are no empty slots? I'd like to do this because it is difficult to jump to higher numbered windows, because you can't do `Ctrl+B, 15`. I have to use `Ctrl+B, w` to list the windows and then type the letter corresponding to the window I want to open. I know that I can swap windows. For example, I could create a new window (`Ctrl+B, c`) which would open in the empty slot 3. I can then `swapw` window 15 and window 3 and then close window 15. Obviously, this is a tedious approach. How do you manage many windows in tmux?


Wireless problem with RTL8723 and Fedora 18: can't connect to a wpa2-secured network

I'm running Fedora 18 on a Toshiba laptop with the notorious RTL8723 wireless card. I've been able to compile the driver using lwfinger's instructions from this forum thread here               wget http://linuxwireless.org/download/compat-wireless-2.6/compat-wireless-2012-10-03.tar.bz2     wget http://www.lwfinger.com/realtek_drivers/rtl8723ae_master_patch     tar jxvf compat-wireless-2012-10-03.tar.bz2     cd compat-wireless-2012-10-03/     patch -p1 < ../rtl8723ae_master_patch     make     sudo make install     sudo modprobe -v rtl8723ae      After performing these steps the device can indeed see the available wireless networks. The problem appears when I actually try to connect to one of the WPA2-secured ones -- the Gnome network manager keeps asking me for authentication and refuses to establish the connection. I take it I should now figure out whether this is a driver issue or a network manager issue (or something else) but I'm not sure how to proceed. **EDIT:** It appears that the problem isn't with the network manager after all: after disabling Network Manager I tried running `wpa_supplicant` from the terminal, and all I got in response were the following messages, which just kept coming:               wlan0: Trying to associate with 7c:4f:b5:8e:a0:87 (SSID='mynetwork' freq=2462 MHz)     ioctl[SIOCSIWFREQ]: Device or resource busy     wlan0: Association request to the driver failed     wlan0: Associated with 7c:4f:b5:8e:a0:87     wlan0: Authentication with 7c:4f:b5:8e:a0:87 timed out.     wlan0: CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0     wlan0: Trying to associate with 7c:4f:b5:8e:a0:87 (SSID='mynetwork' freq=2462 MHz)     ioctl[SIOCSIWFREQ]: Device or resource busy     wlan0: Association request to the driver failed     wlan0: Associated with 7c:4f:b5:8e:a0:87


How to find old directories in local directory using find in AIX?

I need to find all old directories in current directory.   find in AIX does not provide -maxdepth parameter.   There is only -depth and -prune parameters.   It is possible to write something like following:               find ./* -type d -mtime +31 -prune      But it will not work if current directory is empty.   What is the correct way to find all old directories _in current directory only_ , **not in all sub-directories of the current directory**?


Finding lists of files with specific permissions

I looked into the find command and came up with `find . -maxdepth 1 -perm 521 > test.txt` to output the permissions to a text file, but is it possible to do it just using, for example, simple commands like `ls`? As far as I know, `ls` can't seem to reference permissions specifically so I can't give it a certain permission set to look for. Is there any other straightforward method I may be overlooking?


Installing Ioncube loaders without issues CentOS 5.9

Seem to be having issues installing Ioncube loaders on CentOS 5.9. I followed this guide to install Ioncube: but it's still not working on the site at all, I keep getting this error on BoxBilling, which is the system that I'm trying to get working: ionCube loader is required to run BoxBilling. Instructions to install ionCube loaders or contact support No idea why? I've looked around and looked around on google, but there doesn't seem to be many articles on it, I could get it working on CentOS 6.3, but we recently were forced to downgrade, and now I can't get it working. Any ideas?


What is the 'pam-panel-icon' window?

After starting GNOME desktop, a window titled 'pam-panel-icon' appears, initially displayed in the upper-left of the desktop sized as small as possible. It can be resized, minimized, or maximized, but if it is closed it immediately reappears. There is an old bug report seemingly describing the same behavior with a status of 'CLOSED NOTABUG' filed here. What is the purpose of this window? How do I make it go away?


How can I change screen's hardstatus color based on the logged in user?

I haven't edited/created a .screenrc file in a while, but this is what I'm currently using:               # Turn off the screen startup message     startup_message off          # Define format of bottom navigation/status/date/etc. line     hardstatus alwayslastline "%{yk}[ %H ] %-Lw%50>%{gk}(%{-}%n-%t%{gk})%{-}%+Lw%< %=%{yk}[ %c %d.%m.%Y ]"          # Increase scrollback buffer to 30000 lines     defscrollback 30000      I honestly don't remember what everything in my hardstatus line stands for, but I want to figure out how I could change the hostname color based on the user that is logged in. Is this even possible? Right now, the hostname is yellow when I'm logged in under any user; but I want it to be red if I'm root. Is this something that can be changed in my .bashrc file? I have this in my .bashrc to change new screen window names to the hostname of the server I'm connected to:               # Set screen window title     case "$TERM" in     screen)       PROMPT_COMMAND='echo -ne "\033k$HOSTNAME\033\\"'       ;;     esac      Thanks for any help! **EDIT** I've tried adding this to my .bashrc file, but it just puts the ANSI code in- front of the hostname in my screen hardstatus:               case "$TERM" in     screen)       if (( $UID == 0 )); then         PROMPT_COMMAND='echo -ne "\033k$FRED$HOSTNAME$RS\033\\"'       else         PROMPT_COMMAND='echo -ne "\033k$HOSTNAME\033\\"'       fi       ;;     esac      **EDIT 2** I've also added the actual ANSI color codes (ex: `\\[\033[31m\\]`) and the screen escape codes (ex: `%kr`) to the above statement in my `.bashrc`, but neither worked. **EDIT 3** If I use this as the prompt command line, the hostname appears in red in-front of my PS1:               PROMPT_COMMAND='echo -ne "\033[31m$HOSTNAME\033\\"'      If I use the following prompt, the window name changes to the hostname (YES!); but the color remains the default (NO!):               PROMPT_COMMAND='echo -ne "\033[31m\033k$HOSTNAME\033\\"'      I've also tried replacing `\033[31m` (and just `[31m`) with the screen color escape (%kr), but that did not work either.


Suse 12.1 autoyast, root password not set

I'm trying to configure autoyast to run via cobbler. For some reason the root password is not getting set. I've tried to use encrypted password and generating a profile from GUI autoyast and then copying the "users" section. Nothing seems to work. This is what I have in the autoyast xml file.               <users config:type="list">          <user>            <encrypted config:type="boolean">false</encrypted>            <user_password>password</user_password>            <username>root</username>          </user>     </users>      Thanks in advance.


Will I utilize graphics hardware if I run X on the server? If not, then what is it there for? E.g. Dell PowerEdge R210 II has integrated Matrox G200eW with 8MB memory on board, and some of the latest Xeon CPUs have integrated Intel GPUs. How do these get used? I will be using the server remotely, connecting to it over ssh and installing all the software from the command line. I plan to try x2go, Xpra and/or TightVNC. Will I utilize graphics card regardless? Seems counter-intuitive to me, as I will never need to display graphics on a locally attached monitor.


Can I make "less" execute arbitrary commands with a single key sequence?

The crux of my question is stated in the title. Reading the `less` and `lesskeys` manpages, I have created a file containing:               ^B shell touch ~/testfile      and run it through `lesskey` to generate `.less-test`, then executed `less -k .less-test file`. This all works fine and does what I hope, except that I need to hit enter twice to actually execute the shell command and return to the `file`. Changing the command to `touch ~/testfile\n` removes the need for one of those enter presses, but `touch ~/testfile\n\n` doesn't work to get rid of them both. Is there a way to bypass hitting enter at all here? As a follow-up question (and to explain why I'm asking in the first place)--I am doing this as a process of file tagging, where I inspect the file using less and want to use these hotkeys to write out to another file with one of two tags (which I plan to bind to two different key sequences). So in addition to not having to press enter twice as above, I'd also like to know if there's a way to immediately move to the next file (as with the `next-file` lesskey command) also (that is, press no other keys besides the tagging key sequence).


Cannot switch to TTYs or back

I just upgraded to Mint 13 - KDE x64 I am unable to switch to ttys by using the `Ctrl``Alt``F1` .. `F6` keys. The gettys are running and I can switch to the terminals with the `sudo chvt 1` command. I have browsed to quite a few topics and have not reached a solution that works. I even reinstalled grub with `terminal=console`. Once I make a selection at the boot menu, I do not see any boot messages - just KDE starting after a few seconds. How do I fix this?


Reuse D-Bus sessions across login sessions

I access a machine through multiple login sessions. The sessions' lifetimes may or may not overlap. In my case, these login sessions are currently always over SSH, but I would prefer to handle local sessions too. I sometimes need D-Bus in these sessions, and I want to share the same D-Bus session across these login sessions, in order to use GVFS. What is the recommended way to do this? I don't want to break any use of D-Bus that I may not be aware of. I've considered using               export $(dbus-launch --autolaunch $(cat /var/lib/dbus/machine-id))      but (as of Ubuntu 12.04) this doesn't seem right:   * this requires an X session, but my SSH sessions may or may not be forwarding an X display, and even the ones that are don't have the same `$DISPLAY`;   * if no X display is available, `dbus-launch` complains that “Autolaunch error: X11 initialization failed.” and doesn't start a daemon;   * the `dbus-launch` man page states that “The `\--autolaunch` option is considered an internal implementation detail (…). There's no real reason to use it outside of the libdbus implementation anyhow.” Does `dbus-launch` or another tool in the D-Bus suite support automatically detecting a running `dbus-daemon` and connecting to it? The necessary information is in `~/.dbus/session-bus/$(cat /var/lib/dbus/machine- id)-${DISPLAY#*:}` if D-Bus is started with an X connection, but doesn't seem to be stored anywhere if no X connection is available. Should I cobble my own D-Bus session file? If I do, should I use a file in the `~/.dbus/session-bus` directory? Is the path `/var/lib/dbus/machine-id` reliable and portable?


Which command will open the default browser on a system to a given web page (terminal)?

Title says it all. Is there a way to open the default browser on a user's system to a specific page from within a Bash script, or other-language script?


GParted messed up my partitions

**Update:** running `testdisk` I can actually see all of my files in `/dev/sda1`! I wanted to install Windows alongside my Debian installation in order to play some games. In order to do that, I had to boot up a Ubuntu Live 12.1 DVD and use GParted (I was resizing my main partition which had everything). The resizing finished successfully. I then tried to reboot into my Debian to backup my data, which I had forgotten to do before unfortunately... GRUB loads nicely, but the system cant boot properly! It comes to a point where it tries to configure a "ramdisk", or something like that; then it's just a prompt and that's it. Now I've booted into Ubuntu again, to run a check on my shrank partition. Essentially, it's broken, but I can't really understand the error message. This is what GParted reported:               GParted 0.12.1 --enable-libparted-dmraid          Libparted 2.3     Check and repair file system (ext3) on /dev/sda1  00:11:35    ( ERROR )          calibrate /dev/sda1  00:00:00    ( SUCCESS )          path: /dev/sda1     start: 2,048     end: 1,232,117,759     size: 1,232,115,712 (587.52 GiB)     check file system on /dev/sda1 for errors and (if possible) fix them  00:11:35    ( ERROR )          e2fsck -f -y -v /dev/sda1          ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap     e2fsck: Group descriptors look bad... trying backup blocks...     Block bitmap for group 4700 is not in group. (block 154014812)     Relocate? yes          Inode bitmap for group 4700 is not in group. (block 154014813)     Relocate? yes          Pass 1: Checking inodes, blocks, and sizes     Error allocating 1 contiguous block(s) in block group 4700 for block bitmap: Could not allocate block in ext2 filesystem     Error allocating 1 contiguous block(s) in block group 4700 for inode bitmap: Could not allocate block in ext2 filesystem          /dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****          /dev/sda1: ********** WARNING: Filesystem still has errors **********          e2fsck 1.42.5 (29-Jul-2012)     e2fsck: aborted          ========================================      This is the output of `dmesg | tail`:               [ 1702.169848] EXT3-fs error (device sda1): ext3_check_descriptors: Block bitmap for group 4700 not in group (block 154014812)!     [ 1702.170231] EXT3-fs (sda1): error: group descriptors corrupted     [ 1889.324746] CPU3: Package power limit notification (total events = 50)     [ 1889.324749] CPU1: Package power limit notification (total events = 50)     [ 1889.324750] CPU2: Package power limit notification (total events = 50)     [ 1889.324752] CPU0: Package power limit notification (total events = 50)     [ 1889.335756] CPU2: Package power limit normal     [ 1889.335757] CPU3: Package power limit normal     [ 1889.335759] CPU1: Package power limit normal     [ 1889.335760] CPU0: Package power limit normal      How can I fix my partition? Will I be able to recover my data? **Edit:** Here are some additional commands I ran: **sudo fsck.ext3 -cf /dev/sda1**               e2fsck 1.42.5 (29-Jul-2012)     ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap     fsck.ext3: Group descriptors look bad... trying backup blocks...     Block bitmap for group 4700 is not in group.  (block 154014812)     Relocate<y>? yes     Inode bitmap for group 4700 is not in group.  (block 154014813)     Relocate<y>? yes     fsck.ext3: e2fsck_read_bitmaps: illegal bitmap block(s) for /dev/sda1          /dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****      **sudo e2fsck -b 32768 /dev/sda1**               e2fsck 1.42.5 (29-Jul-2012)     Block bitmap for group 4700 is not in group.  (block 154014812)     Relocate<y>? yes     Inode bitmap for group 4700 is not in group.  (block 154014813)     Relocate<y>? yes     /dev/sda1 was not cleanly unmounted, check forced.     Pass 1: Checking inodes, blocks, and sizes     Error allocating 1 contiguous block(s) in block group 4700 for block bitmap: Could not allocate block in ext2 filesystem     Error allocating 1 contiguous block(s) in block group 4700 for inode bitmap: Could not allocate block in ext2 filesystem     e2fsck: aborted          /dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****          /dev/sda1: ********** WARNING: Filesystem still has errors **********      **sudo parted -l**               Model: ATA Hitachi HTS54757 (scsi)     Disk /dev/sda: 750GB     Sector size (logical/physical): 512B/4096B     Partition Table: msdos          Number  Start   End    Size    Type     File system     Flags      1      1049kB  631GB  631GB   primary  ext3            boot      2      742GB   750GB  7985MB  primary  linux-swap(v1)               Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0     has been opened read-only.     Error: Can't have a partition outside the disk!                                 The partition table entry states "msdos" - is this supposed to be like that?


What is the difference between modify and change in stat command context?

The `stat` command's manual page says: > >        %x     Time of last access >        %y     Time of last modification >        %z     Time of last change >   I am unable to understand what is the difference between _modify_ and _change_. What I understand both are synonyms (English is not my mother tongue), but their output is different. I tried following command                stat --printf="Change %z\nAccess %x\nModify %y\n" p.txt      Now when I open p.txt, access time is changed, I go into insert mode, edit the file, modify and change time remains same. > Change 2010-10-06 12:48:39.286252389 +0500   >  Access 2010-10-06 12:49:14. **962243456** +0500   >  Modify 2010-10-06 12:48:39.234498878 +0500 When I write the changes to file `:w`, modify and change, both change but give different values. > Change 2010-10-06 12:51:21. **949082169** +0500   >  Access 2010-10-06 12:51:21.908246082 +0500   >  Modify 2010-10-06 12:51:21. **908246082** +0500 So what is the meaning of modify and change in this context? Time of modification and change give time of which event?   Thanks


Bind locally installed library

I have no root-acces on a machine and i'm trying to install a library called GiNaC locally in my home folder. I use this tutorial http://www.ginac.de/tutorial/Configuration.html#Configuration. At the end there is an example (dont need to disable the shared-library and i dont need a specific compiler). Unfortunatly if I do this               export CPPFLAGS="$(CPPFLAGS) -I$/home/xxx/include"     ./configure      this is the result...               ...     checking for g++... g++     checking whether the C++ compiler works... no     configure: error: in `/home/redies/ginac-1.6.2':     configure: error: C++ compiler cannot create executables     See `config.log' for more details      In config.log there is the line               CPPFLAGS='CPPFLAGS: command not found -I$/home/xxx/include'      Any ideas?


Why does my vim-7.3 compile fail to include clientserver?

I am trying to compile vim-7.3 will all features enabled. I ran configure with               $ ./configure --with-features=huge --enable-gui --enable-cscope     $ make ; make install      When I check the version, it shows several features are still not installed. > Huge version without GUI. Features included (+) or not (-): +arabic +autocmd > -balloon_eval **-browse** ++builtin_terms +byte_offset +cindent > **-clientserver -clipboard** +cmdline_compl +cmdline_hist +cmdline_info > +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con > +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search > +farsi +file_in_path **....** Now according to vimdoc   > N _+browse_   >  N _+clientserver_ It says > Thus if a feature is marked with "N", it is included in the normal, big and > huge versions of Vim. `features.h` also says > +huge all possible features enabled. According to the above mentioned two resources, `huge` means all features are enabled. Even if not all, then at least `+clientserver` and `+browse` has to be enabled in `huge` compilation mode. But my experience says otherwise. Huge compilation fails to include browse and clientserver feature.   1. Why is it so? Is my understanding of the document is incorrect?     2. How to enable clientserver feature?     3. How to enable gui?     4. Is it possible to enable **all** features simply? I tired huge as `features.h` suggested it will enable all possible features, but it didn't work. Thanks for your time. # Edit: Problem solved! Thanks to all of you guys for your priceless help.   I checked, `vim73/src/auto/config.log`, it was clear that lots of dependencies are missing. Gert post gave an idea which packages are required. I used:               $ yum -yv install libXt.i686 libXt-devel.i686 \     libXpm.i686 libXpm-devel.i686 \     libX11.i686 libX11-common.noarch libX11-devel.i686 \     ghc-cairo-devel.i686  cairo.i686   \     libgnomeui-devel.i686 \     ncurses.i686 ncurses-devel.i686  ncurses-libs.i686 ncurses-static.i686 \     ghc-gtk-devel.i686 gtk+-devel.i686 \     gtk2.i686  gtk2-devel.i686 \     atk-devel.i686 atk.i686 \     libbonoboui.i686 libbonoboui-devel.i686       Some of the packages were already installed, others were not. After that:               $ ./configure --with-features=huge --enable-cscope --enable-gui=auto     $ make ; make install      Now my vim has all the packages associated with `huge`. > Huge version with GTK2 GUI. Features included (+) or not (-):   >  +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset > +cindent   >  **+clientserver** +clipboard +cmdline_compl +cmdline_hist +cmdline_info > +comments   >  +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff   >  +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi   >  **...** Thanks


How to `tee` dropping all CR lines only in the file but not stdout?

When using e.g. `rsync`, I'd like to `tee` its output such that I can both view the current progress live, and have a log for later. Using just piping `| tee logfile` the logfile will contain many lines à la               0 files...<CR>     100 files...<CR>     200 files...<CR>      Where the carriage-return `<CR>` is used to have the live output replace the current line. For the `stdout` part of `tee` this is exactly the desired behavior, but is there any way to have the logfile drop anything between a `<CR>` and the last `<LF>`? (I'm not asking for a `rsync` specific answer, that's just the example!) Maybe some `sed`-piping in between?


How to remove all instances of a particular symbol from a text file?

I've got a huge (about half a GiB, impossible to use a usual text editor on) CSV file with fields enclosed in double quotes like `"abc","def"` but need a file without quotes (I am sure this is not going to break the file consistency - a comma is never used inside the values in it). How to remove all the quotes (without introducing spaces on their places)?


suid-root doesn't have effect

A program from apue.               #include "apue.h"     #include <fcntl.h>          int main(int argc, char *argv[])     {         if(argc!=2)             err_quit("usage: a.out <pathname>");              if(access(argv[1], R_OK)<0)             err_ret("access error for %s",argv[1]);         else             printf("read access OK\n");         if (open(argv[1], O_RDONLY)) {             err_ret("open error for %s", argv[1]);         } else {             printf("open for reading OK\n");         }              return 0;     }      I compiled it to an executable named `4-2` and I changed the owner and set the suid this is the output of `ls -l`:               -rwsr-xr-x 1 root sinners 8490 Jan  7 18:50 4-2*      and `/etc/shadow`:               -rw------- 1 root root 421 Jan  4 01:29 /etc/shadow      But when I run it:               user% ./4-2 /etc/shadow      access error for /etc/shadow: Permission denied     open error for /etc/shadow: Permission denied      Can someone explain why I am getting these `access` and `open` errors?


Reformat terminal output and save to file

I was wondering how to reformat terminal output for logging information. More specifically I would like to reformat the output of the `sensors` command from the `lm-sensors` package and write it to a file. The output looks something like this:               acpitz-virtual-0     Adapter: Virtual device     temp1:        +61.0°C  (crit = +99.0°C)     temp2:        +29.8°C  (crit = +99.0°C)          coretemp-isa-0000     Adapter: ISA adapter     Physical id 0:  +63.0°C  (high = +86.0°C, crit = +100.0°C)     Core 0:         +62.0°C  (high = +86.0°C, crit = +100.0°C)     Core 1:         +59.0°C  (high = +86.0°C, crit = +100.0°C)     Core 2:         +63.0°C  (high = +86.0°C, crit = +100.0°C)     Core 3:         +61.0°C  (high = +86.0°C, crit = +100.0°C)          radeon-pci-0100     Adapter: PCI adapter     temp1:        +61.5°C      My purpose for reformatting is, for later using the data with gnuplot (realtime plotting). So the result should look similar to this:               # Timestamp [hh:mm:ss]    temp1 [°C]       temp2 [°C]     ...      13:45:52                  65.0             29.0            .     13:45:53                  66.0             28.0            .     13:45:54                  64.0             27.0            .     13:45:55                  55.0             26.0            .     ...                       ...              ...             .      I would like to use this on multiple computers with a different amount of sensors this would require some sort of loop. But from where to where would one loop and how to eliminate the redundant lines (e.g. acpitz-virtual-0, Adapter: Virtual device, ...). Also i'm aware of the `lm-sensors` package capabilities to produce graphs. But I would like to realize a homebrew solution and also keep the question more general.


OpenVPN not showing easy-rsa

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm     rpm -Uvh epel-release-6-8.noarch.rpm      I did yum install openvpn in the guide then did the following:               mkdir -p /etc/openvpn/easy-rsa/keys     cp -rf /usr/share/openvpn/easy-rsa/2.0/* /etc/openvpn/easy-rsa      Fails. I get:               ls -la /usr/share/openvpn/     total 8     drwxr-xr-x  2 root root 4096 Jul 31 21:19 .     drwxr-xr-x 64 root root 4096 Sep 20 20:26 ..      Where do I find the easy-rsa keys? I'm told in the guide I need to edit `/etc/openvpn/easy-rsa/vars` but I can't find the vars. What I did find was:               ls /usr/share/doc/openvpn-*/sample/sample-keys     ca.crt  ca.key  client.crt  client.key  dh1024.pem  pass.crt  pass.key  pkcs12.p12  README  server.crt  server.key


Can (and how) KVM use NTFS storage?

Using SL6.4, I am trying to create a new KVM virtual machine using `virt- manager`. When defining storage at default pool, it boots up OK. However, when trying to use storage located on external NTFS drive, it fails with permission denied. I've changed SElinux to permissive mode, defined a directory on the NTFS drive as storage pool; (un)commented the "user" and "group" lines on `/etc/libvirt/qemu.conf` file, but none of these helped. Should something with the NTFS mounting be changed? Maybe some other configuration? EDIT: virt-manager succeeded creating .img file on the NTFS partition (but warned me that it doesn't have search permission (??) in that directory), it failed only when trying to start the virtual machine. Furthermore, if I try to use default storage, and read an ISO file from /home partition - it works; but when I try to use default storage and read an ISO file from NTFS partition it fails with the same failure. (the ISO file is readable from the NTFS partition. I know that because it was copied from there to /home ...)


Launch a GTK3 aplication without customized gtk settings?

In previous versions of gtk it was easy to launch one instance of an application with default gtk settings:               GTK2_RC_FILES= epdfview      But for version 3, it won't work anymore:               GTK3_RC_FILES= evince      has no effect. Is this convenience definitely gone?


how does built in commands of a shell implemented in Linux? as a function or thread of shell process?

I know that external commands are run in the shell by creating a separate process. But what exactly happens when a built in command is run in a shell. Are they executed as a function or if the shell creates a new thread to execute the built in command?


Pause music while screen is locked

I was wondering whether it is possible to pause a music player (in my case Rhythmbox), by pressing a button, while the screen is locked. I would assume no, but I thought I'd ask. A short example: If the screensaver goes on the music continues. But lets say somebody comes in my office, I don't want to type in the password, but just hit a button to pause it. And ideally of course play again once I'm alone. Is there a program that would allow something like this? I'm using Fedora16. Edit thanks to pbm for the solution. Here is my `actkbd.conf` (using `Ctrl`+`Alt`+`P`):               25+29+56:::su MyUserName -c "dbus-send --type=method_call  --print-reply --dest=org.gnome.UPnP.MediaServer2.Rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"


samba4: odd username mapping?

I'm using samba4 as a dc with sssd to talk to a separate LDAP server. When I try to login to a win7 machine that's added as a domain member samba is stripping off the domain name and substituting the samba domain instead. Errors that I see in log.samba:               [2014/07/18 06:46:28.177400,  3] ../source4/auth/ntlm/auth.c:270(auth_check_password_send)         auth_check_password_send: Checking password for unmapped user [ldapdom]\[user]@[win7host]         auth_check_password_send: mapped user is: [sambadom]\[user]@[win7host]         [2014/07/18 06:46:28.178098,  3] ../source4/auth/ntlm/auth_sam.c:61(authsam_search_account)       sam_search_user: Couldn't find user [user] in samdb, under DC=dom,DC=server,DC=edu        [2014/07/18 06:46:28.178184,  2] ../source4/auth/ntlm/auth.c:420(auth_check_password_recv)       auth_check_password_recv: sam_ignoredomain authentication for user [sambadom\user]         FAILED with error NT_STATUS_NO_SUCH_USER      I can't tell if I need some sort of username mapping or a change to either the smb.conf or sssd.conf. Username mapping would seem odd since I essentially want it to map the original value to itself. CentOS 6.4 x64   Samba4 4.1.9   sssd


input, evdev alternatives?

Simply put what are some other input subsystems? P.S. (a little context) Is there a popular alternative? (I'm looking at an HP- UX and have no idea how its taking care of this, because there is no /dev/input/event*) and based on the wiki Evdev is "closely related input driver for the X.Org Server" - can evdev exist without X.Org?


Bash - file, arrays and output

I have a file that contains employees names, departments and the cities the employee is in, something like:               John     IT     Chicago     Joshua     accounting     New York     Marcy     CEO     Los Angeles     ...       I have to transform this file to this format:               John?IT?Chicago     Joshua?accounting?New York     Marcy?CEO?Los Angeles      using the question mark as a field delimiter I am a newbie in Bash, but I have done this bash script so far:               fname="mix.txt"     exec<$fname          index=0     while read line ; do             ARRAYLINES[$index]="$line"             index=$(($index+1))     done < $fname          NUMBERLINES=$(grep -c "" $fname)     NUMBERLOOP=$(($NUMBERLINES/3))               count=0          for i in $(eval echo {1..$NUMBERLOOP})     do       one=$(($count+1))       two=$(($count+2))            LINE0=${ARRAYLINES[$count]}       LINE1=${ARRAYLINES[$one]}       LINE2=${ARRAYLINES[$two]}       ((count + 3))            FINAL="$LINE0?$LINE1?$LINE2"       echo $FINAL >> final.txt     done      The final file has the correct number of lines, but all lines are equal to the first employee data, like               John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago      any clues? thanks


How to set the default domain for a new Roundcube webmail user?

New Roundcube identities get a '@localhost' domain part for their Email address. That is kind of useless. I would rather have Roundcube take the Apache HTTP host (minus a possible 'www.'), since my users will use 'their' associated domain for getting to the Roundcube interface. How can I configure this?


How can I direct input from two keypads to two respective terminals on one computer?

I want to connect two usb keypads to the same computer (Linux). Then I want to open 2 consoles #1 and #2 and execute one process on each one of them. Then I want to receive input from keypad #1 on console #1 and input from keypad #2 on console #2, that is, each keypad submits input to a specific process. How can this be achieved? Assume code is written in C. Thanks!


Why does this script show all files in the directory and not just PDF files?

I wrote the script below to find the number of PDF files in a given directory. However, it instead shows all the files in the directory:               #!bin/bash     message="."     message1="*.pdf"          ls -al $message $message1       What's wrong with the script?


How to change metadata on an installed rpm

I need to modify information for an rpm which is already installed. E.g.               rpm -qi sip-section-call-1.0.19-1.noarch       Name        : sip-section-call               Relocations: (not relocatable)       Version     : 1.0.19                              Vendor: Self       Release     : 1                               Build Date: Thu 08 Sep 2011 02:47:43 PM CEST         Install Date: Mon 28 Nov 2011 03:31:09 PM CET        Build Host: ari.eris.com                        Group       : ari/JavaEE               Source RPM: sip-section-call-1.0.19-1.src.rpm       Size        : 3929998                         License: Commercial         Signature   : DSA/SHA1, Tue 01 Nov 2011 01:25:59 PM CET, Key ID bdd82316c28e369d       Packager    : ari       Summary     : ari com Engine sip Service       Description :       Provides session id's for applications.        Here, I need to modify the Description to some other value   How do I do it?