Chromium when maximized has gaps at the sides in Awesome WM

There are 1-2 px gaps between a maximized Chromium window and screen's border. As a result when I put my mouse on the border the Chromium window loses focus, or if I'm using my mouse wheel it changes tags. This doesn't happen if I unmaximize Chromium and stretch it out, but it's annoying. If I am not mistaken this happens with the default `rc.lua`. Awesome 3.4.


Samba: system group mapping

I have w2008R2 PDC and Linux server with samba and winbind. Now I'd like to add some domain users to Unix `adm` group in AD. Let's say I have `adm` group defined in AD, and every user from this group will be a member of Unix `adm` group when logging to Linux over PuTTY. I expected that it will be possible with `net groupmap`, so I tried:               net groupmap add ntgroup="adm"  unixgroup=adm   type=l but it is not working. If I login I see that I'm a member of `adm` group, but I don't have `adm` group permissions (i.e I can't view syslog). I've tried also               net groupmap add ntgroup="adm"  unixgroup=adm   type=d but the behavior is the same.


Protecting Devices from dd and fdisk Commands

I'm wondering if there is some way to prevent certain certain devices from becoming the output file of the `dd` command and the target of the `fdisk` command. I'm currently using the two operations to set up a write a bootloader, kernel, and root filesystem on an SD card, which appears as `/dev/sdd`. I'm always a little anxious that I'll mix up `sdd` with `sdb`, or `sda` since the letters `A` and `D` are close on the keyboard, and I would like to find a way to prevent commands with this format:               dd if=/dev/sd[a-zA-Z0-9]* of=/dev/sd[ab]      or               fdisk /dev/sd[ab]


Mint Linux - Filesystem check or mount failed

I made a bootable USB stick in order to install Mint. When I start it, after the loading screen I get an error: > Filesystem check or mount failed. A maintenance shell will now be started. > CONTROL-D will terminate this shell and continue booting after re-trying > filesystems. Any further errors will be ignored I am using win32diskimager to write the iso file to usb stick, the usb stick is working properly, also the iso itself is fine, I have downloaded it 2 times just in case. ![enter image description here](http://i.stack.imgur.com/q7Uod.jpg)


Output from ls has newlines but displays on a single line. Why?

I think I may be overlooking a relatively fundamental point regarding shell. Output from the **ls** command by default separates output with newlines, but the shell displays the output on a single line. Can anyone explain this to me? I had always presumed that the output was simply separated by spaces, but now that I see the output separated by newlines, I would expect the output to be displaying on separate lines. Example:               cpoweradm@debian:~/lpi103-4$ ls text*     text1  text2  text3      **od** shows that the output is separated by newlines:               cpoweradm@debian:~/lpi103-4$ ls text* | od -c     0000000   t   e   x   t   1  \n   t   e   x   t   2  \n   t   e   x   t     0000020   3  \n     0000022      If newlines are present, then why doesn't the output display as:               text1      text2     text3


Shall I copy server's ca.crt to the client?

I'm setting up an OpenVPN server and I need a little info: do I need to copy the server's ca.crt to the client?   I have tried both ways and only when I do that I can get it working; I would like to know whether what I've done is correct because otherwise do I need to build the certificate on the client-side (`./build.ca`) just for the client.crt?


Disable GNOME on a Debian Install

I'm very new to Linux, and I'm setting up a Debian server. Since I don't have any need for a GUI most of the time, I'd like to disable it from running at startup and wasting system resources. However, I'd still like to have it available for running Firefox and performing tasks that might be painful to do with the command line. I've tried doing some research on the subject, and people seem to say this line will do it: `#update-rc.d -f gdm remove` (I assume the hash signifies I should enter it into the terminal; if I leave it in there nothing happens) If I SSH in as root and enter that line, I receive the result:               update-rc.d: using dependency based boot sequencing      which is wonderfully cryptic. When I reboot the computer afterwards, GNOME comes right back up. Does anyone know what I'm doing wrong here?


How to measure light?

I've got a Dell Latitude E6410 notebook which changes lcd light intensity in response to ambient light levels, so it has to have some photocell. How can I access the data from this photocell? I tried different google searches like lux meter, light intensity monitor and so on and did not find a single right thing.


Alternatives not working well for Java installation on Centos 6.4

I am trying to installing on Centos java from Oracle. Following are my steps.               yum install /usr/local/jdk-7u3-linux-x64.rpm               alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000          alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000          alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000          alternatives --config java I pick the latest version here.      The problem now only my java is pointing to the new version wheras the javac is not pointing to it below is how I trace for java and javac. Java                ls -la /usr/bin/java lrwxrwxrwx. 1 root root 22 May 22 13:09 /usr/bin/java -> /etc/alternatives/java           ls -la /etc/alternatives/java lrwxrwxrwx. 1 root root 25 May 22 13:09 /etc/alternatives/java -> /usr/java/latest/bin/java      Javac               ls -la /usr/bin/javac lrwxrwxrwx. 1 root root 23 May 22 11:37 /usr/bin/javac -> /etc/alternatives/javac           ls -la /etc/alternatives/javac lrwxrwxrwx. 1 root root 48 May 22 11:37 /etc/alternatives/javac -> /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/javac       Any solution to overcome this? I have tried previously on other machines on Centos 6.3 works fines.


How can I defragment my SSD on linux?

This page demonstrates that defragmentation is beneficial for SSDs. I suppose this type of defragmentation has to be trim-aware, so as to preserve the life time of the disk. How can I do that on linux? **EDIT** : Comments pointed out that this article's content is questionable.


Compare multiple files

I want a bash-script to compare OR find differences for multiple files which are stored in different locations: Files under `/tmp/test/`   * A.txt   * B.txt   * C.txt Compare with files under `/home/oldtest`/   * A.txt   * B.txt   * C.txt ### Condition:   1. File `/tmp/test/A.txt` compare only with `/home/oldtest/A.txt` (similarly for other files - `B.txt` compare with `B.txt`).   2. If any changes found: status should be "Modification require in file A.txt".


Graphical Keyboard-driven Email Client

I use a laptop without a mouse as my main work system, and I could really use a fully keyboard-driven email client with graphics support. Right now I have the option of using GUI clients, which, even if they support the keyboard, are optimized for the mouse (buttons and menus taking screen space, actions based on navigating menus with the arrow keys, etc) or terminal-based clients, which don't support embedded images in HTML messages. Is there something that tries to mix the best of both worlds?


reading exchange mail, address book and calendar in mint 14 nadia

I've heard the only mail client that can be used as ms outlook in mint is evolution. I couldn't find any good web resource regarding this. I have evolution installed, but I don't see Exchange as an option for server type. At least I want to be able to read exchange emails, address book and calendars on mint.


DLNA server on Linux

I just bought a TV with DLNA support. I already have a machine dedicated to file server (with 8 disks) and I would love to use this machine as DLNA server if possible. Are there any usable Linux implementations of DLNA?


WiFI access in BackTrack 5 R1

I recently started using a live USB version of BackTrack 5 R1 (A kubuntu-based distro), but I can't find any way to enable access to my home WiFi network. I can't find any comprehensive tutorials on Google, and BackTrack's wiki on the subject is vague at best. How can I connect it to my home wireless?


How to check progress of running cp?

Is it possible to check the progress of running cp process? Some processes respond to various KILL signals so that you can check what is their status. I know that I can run cp with parameter -v but what if forgot to do that, cp is running for a very long time and I want to know which file is being copied, or how many were already copied.


Restarting udev on centos6 (tethering a mobile phone using proxoid)

I am trying to use proxoid (a proxy server to allow tethering like facility for mobile phones). The https://code.google.com/p/proxoid/wiki/installationLinux says that I need to restart the process udev similar to (in ubuntu) sudo /etc/init.d/udev restart lsusb does list the mobile phone but I do not see a running process or a binary named as udev There is a process udevd on centos /sbin/udevd. Is it the same as udev. I could not find specific information to centos as the centos.org site seems to be down for several hours now. Any information helpful


zfs send volume fluctuates misteriously

Why would the amount of data in a zfs send stream "fluctuate"? I would expect send of a specific snapshot to always produce exactly the same data! The test data below was created through something like `dd if=/dev/zero of=filename bs=1024 count=1000` The snapshots were taken at intervals between creating the test files. I then repeatedly sent the data to /dev/null using command-history to re-run the command again and again rapidly. No cheating - the snapshots were taken prior to the test and no amount of "writing" to the file system should affect what goes on in an incremental send, or so I would imagine.               sol10-primary:/TST> # ls -l     total 1007     -rw-r--r--   1 root     root      102400 Mar  4 12:01 data1     -rw-r--r--   1 root     root      102400 Mar  4 11:49 data2     -rw-r--r--   1 root     root          30 Mar  4 11:48 data3     -rw-r--r--   1 root     root      102400 Mar  4 11:50 data4     -rw-r--r--   1 root     root      102400 Mar  4 11:52 data5     -rw-r--r--   1 root     root      102400 Mar  4 11:53 data6     sol10-primary:/TST> # rm data5     sol10-primary:/TST> # dd if=/dev/zero of=data5 bs=1024 count=100               100+0 records in     100+0 records out     sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null     412+6 records in     412+6 records out     sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null     412+5 records in     412+5 records out     sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null     412+6 records in     412+6 records out     sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null     402+32 records in     402+32 records out     sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null     405+22 records in     405+22 records out     sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null     412+6 records in     412+6 records out     sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null     412+5 records in     412+5 records out     sol10-primary:/TST> # zfs list -o name,mountpoint,used,referenced,usedbychildren,usedbysnapshots -r rpool/tst     NAME          MOUNTPOINT   USED  REFER  USEDCHILD  USEDSNAP     rpool/tst     /TST         892K   532K          0      360K     rpool/tst@s1  -             20K   232K          -         -     rpool/tst@s2  -             20K   432K          -         -     rpool/tst@s3  -            120K   532K          -         -      Sometimes in the above I created a snapshot then dd-ed over an existing file, just to get something into the "USEDBYSNAPSHOTS" value. This is basically pretty much an academic question, I suspect that the variance is within a very small limit, only noticed here because my test data is itself pretty small.


Get the most recent backup files

I'm googling for this, but the terms are so generic I'm getting way too many false positives, so what the hey, I'll ask here. I'm sure there's a simple answer but I don't generally script in *nix. I'm trying to write a database refresh script to our test environment. The backups are mounted from an smbfs share, something like `/data/backups/prod`, but the subfolders get a little tricky. It looks like `myproddbserver/yyyymmdd`, with a bunch of files underneath. I want to execute a command `restore` that will collect the files with known names from the most recent `yyyymmdd` directory. For example, if I had:               myproddbserver/20130630/foo.bak     myproddbserver/20130630/bar.bak     myproddbserver/20130731/foo.bak     myproddbserver/20130731/bar.bak      I would want to restore `myproddbserver/20130731/foo.bak` and `myproddbserver/20130731/bar.bak`. How would I reliably get those paths?


Sparse files/file holes and unexpected block size

For my own learning, I've been playing around with creating files with file holes. I created a util that simply reads from stdin and writes to a file, but before writing to the file, it uses lseek to move beyond the end of file by a number of bytes.               fh -b 20000 testfile     hello     there      After starting this process, input can be entered ("hello"), and written to testfile, but before it does, it seeks past end of file by 20000 bytes. Then before writing, it seeks again past end of file another 20000 bytes before "there" is written. What I'm not clear on is the number of blocks allocated to the newly created file. If I do               ls -ls testfile      it shows 8 blocks are allocated, and the file size is 40013 (which is expected). A new file with 13 bytes (but no file holes) allocates 4 blocks according to `ls -ls`. I found out that this really means 1 block (2048 bytes for a block) but the blocks reported are divisible by 512 bytes. So presuming this is true, the math doesn't compute for the file with files holes. Why are 8 blocks allocated, shouldn't it still only be 4 since the physical file size is only 13 bytes (as opposed to logical size of 40013)? I'm not sure if I'm reading the block size correctly, and secondly, I don't understand why the block size is 8 considering that a similar size file with no file holes has only 4. I'm running Ubuntu 11.10 on an ext4 file system.


Bash -Extract characters from string

Suppose I have the following variable $string = 'cat somecommandhere' Now the output of the above `cat` command is               test="Thanks serverfault"      I want to extract the value between the quotes and store it in the same variable `$string`, including the quotes. I want string to contain value below:               $string = "Thanks serverfault"        How can this be done with `sed` or `grep` but not `awk`. I haven't learned `awk` yet.


vim - don't highlight search term after a search & replace?

After performing a search and replace, my installation of GVIM highlights any text remaining that still matches the search pattern. Example input text:               foo     foo     fighters      I run `:%s/foo/bar/gc` and confirm that I only wish to replace one `foo`. The other `foo` remains highlighted. Can this be disabled?


Screen content showing for a few seconds before screensaver starts (Fedora 14)

This happens every now and then, I have not pinned down the cause but let me describe the symptoms. On occasion when I come back to the computer after a few hours the screen is in energy saving mode, I touch the mouse, or the keyboard and I see the screen as it was when I left it. Then, a few seconds later the screen dims to black and the screen saver turns on, moving the mouse again brings me to the login page to unlock the screen. This seems to be a security flaw since unauthorised users can see my screen... Anyone seen this happen to them? I'm using Fedora 14 2.6.35.14-95.fc14.i686PAE Cheers.


Vim syntax highlight certain lines

I have php files well any file type in general that I would like vim to highlight here docs sections using a different syntax highlighting.               <?php     echo <<<HTMLDOC     <h1> I am highlighted as html </h1>     <<<HTMLDOC          echo 'High Lighted as PHP again '     ?>


Increasing the size limit for /var/cache/apt/archives

I have 2 systems running Debian at home and I am trying to minimize the bandwidth use while upgrading the packages. How can I increase the size limit of the cache, so that I could just copy the packages over LAN? (currently they get removed too quickly)


Vim remembering settings of edited files

I read some where about creating files in vim to save things like open windows and folds. I tried to Google it but had trouble finding reference to it. What should I be looking for?


How to limit ftp access to multiple places for one user

I don't even know how to write the correct question since it is a little confusing to ask it. Here is the problem. User X would like FTP access to /user/x folder and to /var/www/x folder. How can I manage to give the user access to both places without making 2 ftp accounts for each. Am using vsftpd on Ubuntu 11.04. He will use filezilla to login and wants to see the following structure or something similare to it:               / <-- The root of the ftp directory       usr/x <-- The user X       www/x <-- The www folder for X      Is this possible all in one ftp access account?


How to see the iTunes shared library from Linux Banshee?

I'm trying to see my friend's Mac iTunes library through Banshee and can't get it to work. The daap is already installed and i still can't list their musics. Is there a way to make this work on Ubuntu?


Conky on multiple display?

I have an external display that show the right part of my screen (`\--right- of` option in xrandr), And my conky panel was just gone. (occupies space, but not visible on both display) What I want is the same view of conky, for both my laptop display and the external one, any thoughts? Thanks **Part of my conkyrc, might be helpful**               own_window yes      if_up_strictness address     own_window_colour 262729     own_window_transparent no      own_window_type panel     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager     double_buffer yes     use_spacer right      use_xft yes     font snap.se-7     xftalpha 1     text_buffer_size 2048      #alignment tl     alignment bl     gap_x 0     gap_y 3


How to Update only important Security Packages in redhat 5.6

One of our client has Redhat 5.6 and he is asking to update only the important packages. But question is how do we know which are the important packages. Note:: It will be a partial Update not complete update.


CentOS file owner changed on editing

I have the following problem. On Unix server (CentOS 5.5) a number of users belonging to the same group have access to the same files (via ssh). After one particular user (let's say usera A) has edited the file the file owner is changed to A, the group (G) and the permissions (0664) remain intact. Once a second user (B) tries to modify the same file he is not allowed to do so. If on other hand the user B modifies the file then A can change it without problems (except screwing up the permissions). I understand that there is something screwed up with the permissions/groups but I can't find out what. So any help would be appreciated. Providing more information:               $ ls -l /path/file     -rwxrwxr-x 1 B G 42269 jan 14 10:30 file          $ getfacl /path/file     # file: file     # owner: B     # group: G     user::rwx     group::rwx     other::r-x          $ ls -ld /path     drwxrwxr-x 12 B G 4096 jan 14 10:24 .          $ getfacl /path     # file: .     # owner: B     # group: G     user::rwx     group::rwx     other::r-x


Externaly limiting number of CPU cores used

I need to externally limit a process/session to a certain number of cores. Are there any other possibilities than CPU affinity (I don't like the need to specify the actual cores) and cgroups (hard to integrate into our project)?


What is the common name for directories . (dot) and .. (dot dot)?

The . (dot) and .. (dot dot) exist in every directory (and probably in every OS). As we all know (or at least should):   * . (dot) is the current directory    * .. (dot dot) is the parent directory **Is there a common name for these special cases?**


Enable remote desktop for Gnome from command line?

I am trying to set up some automation scripts to set up a Linux environment. I would like to enable remote desktop sharing without the user having to actually use the GUI to do so. My plan is to write a batch script that maybe edits some file to do this automatically, if possible. I am using Fedora 16 with the Gnome. I want to achieve the following: http://docs.fedoraproject.org/en- US/Fedora/13/html/User_Guide/chap-User_Guide-Sharing_your_desktop.html Any tips on what file to edit would be greatly appreciated.


How to set default tabs only for cat?

I prefer to set `tabs 4` however this may have some side effects, such as for example `ls` out put may look not properly aligned. **How might I configure the terminal / cat to use four spaces for tabs for cat only?** Should I just alias / wrap `cat` to something that sets `tabs 4`, runs `/bin/cat`, then sets it back? My thinking is that this route is less preferable since in fact I would like this behaviour for `less`, `diff`, and other utilities.


Having desktop icons with Thunar on Arch Linux with Openbox

I'm using Arch Linux with Openbox as my window manager. And Thunar as my preferred file manager. I'm using `zsh` in case that's relevant in any way. How would I go about having desktop icons? I find it very useful to have my desktop with symlinks to all my frequently used folders and apps. I tried searching Google but haven't been able to find anything about accomplishing this with _only_ Thunar. Or some script that accomplishes just that.


Why is uname -M returning an empty string?

On the exact same machine (AIX 6.1), in 2 different login shells (both ksh), with different user IDs, I can do `uname -M`; in one shell I get the system model. In the other shell I get BLANK! The only difference is the user ID and therefore the environment. I can't put the environment in here. Example User 1 Shell:               $ uname -M     IBM,1234-567     $      Example User 2 Shell:               $ uname -M          $      I have done a truss in both shells. There is a difference, but I don't understand it. Here is the bad truss:               truss uname -M     .. a bunch of execve's ripped out as it was searching the PATH for uname.     execve("/bin/uname", 0x2FF2155C, 0x20012EF8)     argc: 2     __loadx(0x03480000, 0x2FF21380, 0x00000108, 0xF0713968, 0x20000CD0) = 0x00000000     __loadx(0x0A040000, 0xD042D064, 0x0000008A, 0x20001254, 0x00000000) = 0x00000000     sbrk(0x00000000)                                = 0x200013D0     vmgetinfo(0x2FF20530, 7, 16)                    = 0     sbrk(0x00000000)                                = 0x200013D0     __libc_sbrk(0x00000000)                         = 0x200013D0     getuidx(4)                                      = 28633     getuidx(2)                                      = 28633     getuidx(1)                                      = 28633     getgidx(4)                                      = 100     getgidx(2)                                      = 100     getgidx(1)                                      = 100     getuidx(4)                                      = 28633     getuidx(2)                                      = 28633     getuidx(1)                                      = 28633     getgidx(4)                                      = 100     getgidx(2)                                      = 100     getgidx(1)                                      = 100     __loadx(0x01480080, 0x2FF1FEF0, 0x00000A50, 0x2FF20A60, 0x2FF22ED1) = 0xD0538128     __loadx(0x01480180, 0x2FF1FEF0, 0x00000A50, 0xF068921C, 0xF068914C) = 0xF0759FA0     __loadx(0x07080000, 0xF06891EC, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AF3C     __loadx(0x07080000, 0xF068912C, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AF48     __loadx(0x07080000, 0xF06891FC, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AF78     __loadx(0x07080000, 0xF068913C, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AF84     __loadx(0x07080000, 0xF06891BC, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AF54     __loadx(0x07080000, 0xF068915C, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AF6C     __loadx(0x07080000, 0xF06891CC, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AF90     __loadx(0x07080000, 0xF06891DC, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AFC0     __loadx(0x07080000, 0xF068916C, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075AFA8     __loadx(0x07080000, 0xF068917C, 0xFFFFFFFF, 0xF0759FA0, 0x00000000) = 0xF075B020     getuidx(4)                                      = 28633     getuidx(2)                                      = 28633     getuidx(1)                                      = 28633     getgidx(4)                                      = 100     getgidx(2)                                      = 100     getgidx(1)                                      = 100     __loadx(0x01480080, 0x2FF1FEF0, 0x00000A50, 0x2FF20A60, 0x2FF22ED1) = 0xD0538128     getuidx(4)                                      = 28633     getuidx(2)                                      = 28633     getuidx(1)                                      = 28633     getgidx(4)                                      = 100     getgidx(2)                                      = 100     getgidx(1)                                      = 100     __loadx(0x01480080, 0x2FF1FEF0, 0x00000A50, 0x2FF20A60, 0x2FF22ED1) = 0xD0538128     getuidx(4)                                      = 28633     getuidx(2)                                      = 28633     getuidx(1)                                      = 28633     getgidx(4)                                      = 100     getgidx(2)                                      = 100     getgidx(1)                                      = 100     __loadx(0x01480080, 0x2FF1FEF0, 0x00000A50, 0x2FF20A60, 0x2FF22ED1) = 0xD0538128     getuidx(4)                                      = 28633     getuidx(2)                                      = 28633     getuidx(1)                                      = 28633     getgidx(4)                                      = 100     getgidx(2)                                      = 100     getgidx(1)                                      = 100     __loadx(0x01480080, 0x2FF1FEF0, 0x00000A50, 0x2FF20A60, 0x2FF22ED1) = 0xD0538128     access("/usr/lib/nls/msg/en_US/uname.cat", 0)   = 0     _getpid()                                       = 7405946     uname(0x2000132C)                               = 0     statx("CuAt", 0x2FF20870, 76, 0)                Err#2  ENOENT     kopen("CuAt", O_RDONLY)                         Err#2  ENOENT     kioctl(1, 22528, 0x00000000, 0x00000000)        = 0          kwrite(1, "\n", 1)                              = 1     __loadx(0x04000000, 0x2FF20970, 0x00000800, 0x0000D032, 0x00000000) = 0x00000000     kfcntl(1, F_GETFL, 0x00000001)                  = 67110914     kfcntl(2, F_GETFL, 0x2FF22FFC)                  = 67110914     _exit(0)      You can see the `kwrite` at the end is only printing out a newline character, `"\n"`. In the good truss output, it looks like uname is getting the attribute from:               /etc/objrepos/CuAt      This lead me to the `lsattr` command and others. **Why is uname -M blank? What environment variables would affect this?**


I have an unshadowed db.txt file:               [root@SERVER ~]# rpm -qa | grep -i john     john-1.7.9-1.el6.rf.x86_64     [root@SERVER ~]# head -1 /etc/issue     Scientific Linux release 6.3 (Carbon)     [root@SERVER ~]# cat db.txt      cecil:$6$iHc0bEXn$IxtX8x0TCx6h13qTH8yVjf5cGwT25AitFEQpJc3cP6qgN4LLMiJfDD2pQGUyZFX7JYeGneX34j38tNZHAgQsV/:503:504::/home/cecil:/bin/bash     [root@SERVER ~]# john db.txt      fopen: $JOHN/dynamic.conf: No such file or directory     [root@SERVER ~]# ls -la .john/     összesen 44     drwx------.  2 root root  4096 máj   31 11.27 .     dr-xr-x---. 15 root root  4096 máj   31 11.35 ..     -rw-------.  1 root root     0 máj   31 11.24 dynamic.conf     -rw-------.  1 root root 36305 máj   31 11.27 john.conf     -rw-------.  1 root root     0 máj   31 11.24 john.ini     [root@SERVER ~]#       But can't resolve the:               fopen: $JOHN/dynamic.conf: No such file or directory      error message. How can I? I already touched john.ini & dynamic.conf & copied john.conf from /etc.. UPDATE:               [root@SERVER ~]# john db.txt      fopen: $JOHN/dynamic.conf: No such file or directory     [root@SERVER ~]# echo $JOHN          [root@SERVER ~]#       The $JOHN variable is empty. UPDATE2: I updated to SL 6.4, but still the same, after a reboot too.


Install Desktop on Centos 6.3 remote server

Through our hosting provider, we can create servers running CentOS 6.3. However, these installs are meant to be used as servers that are accessed remotely. They do not come packaged with a GUI "Desktop" environment. What steps do you suggest to take in order to go from the packaged minimal install, to an install that includes:   * Desktop GUI    * Remote desktop functionality (so we can log and use the desktop from a remote environment)


How is 32bit Linux virtual memory structured in relation to PCIe Base Address Registers

I'm working on a Linux system (32 bit, 4GB RAM) and found some contradictory information about memory addressing in Linux. Am I right with this: Only virtual memory has the differentiation between kernel and user space. Virtual memory is in a 32bit system 4GB large. 3 GB for the User space, 1GB for the kernel space. But there are also addresses for the physical memory or which are not located - referencing to ZONE_NORMAL and it's association with Kernel/User-pages?.   * On this homepage it is illustrated that the physical memory has also the differentiation in kernel and user space, is that right?   * Since I'm working with PCIe, I would like to know how it is possible, that the BAR has a physical address?   * That would mean that there is a reserved space for the PCIe device - where is this space located?   * Is there a special structure in the physical memory? I found a reference here, which might show the structure in figure 16.   * I'm translating this BAR address into a virtual address, so how is this possible?   * Also some references say, that each process can uses all of the virtual addresses, is that right? If yes, how can I combine this fact with the above ones?


Why does hitting "Ctrl minus" in the command line shrink the font size?

I have hit a few `CTRL``-` in command line and I see the text in the terminal getting smaller with every invocation. What is going on here and is there a way to redo ie magnify the text to bring it back to the original size via a command? Edit: As per Christopher's suggestion in the comment I can get back to my original font size by hitting `CTRL``+` but I would still like to understand what is going on behind the scenes here.


Stop broken NFS mounts from locking a directory?

I have a somewhat interesting setup: A server with multiple remote NFS servers mounted in a folder, with that folder then being re-exported over Samba. Think of it as a share proxy, keeping all the shared folders in one place. My issue though is that whenever one of the mounts goes down (server restarted, service restarted, external hard drive that the server was exporting removed, etc) any attempt to read the mount blocks forever. This also means that running `ls` in that directory freezes and users connecting over Samba also freeze. This has also caused a few times one of my cron jobs to block which almost crashed the server because it had hundreds of blocked processes. This is getting very annoying as I usually have to bring up a terminal that isn't waiting for `ls` to finish (can't cancel it), run `for i in *; do sudo umount -l -f $i; done;`, hope that it works, fix the issue, then remount everything. Is there a way to mount an NFS share with the stipulation that if the connection fails for whatever reason (preferably with a retry period) then the mount un-mount's itself or at least doesn't block?


Make group permissions same as user permissions

I want to set the group permissions for all files and subdirectories within a certain parent directory to whatever the user permission setting for that specific file or directory is. For example, everything under `/path/to/parentdir`               # Permissions before     # Path                      Permissions     /path/to/parentdir/file1    755     /path/to/parentdir/file2    644     /path/to/parentdir/file3    600          # Permissions after     /path/to/parentdir/file1    775     /path/to/parentdir/file2    664     /path/to/parentdir/file3    660      I'm hoping there's a simple way to do this in hopefully one command. I can think of ways using a script with a bunch of commands, but it feels like there should be a pretty direct way of doing it. Thanks in advance!


why does htop meter show >90% while table is 0.0%?

Why do the progress meters across the top of the screen in `htop` show CPU usage consistently above >90% while the numbers in the table below show a nearly idle system with CPU usage and load average at 0.0%? ![partial htop screen grab](http://i.imgur.com/0yVCK.png)


wired ethernet interface not detected by lshw, lspci

I have a Toshiba Satellite PSAG8U-04001W. No eth* interface shows up on ifconfig.               $ ifconfig -a     lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:32 errors:0 dropped:0 overruns:0 frame:0               TX packets:32 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:2544 (2.4 KiB)  TX bytes:2544 (2.4 KiB)          wlan2     Link encap:Ethernet  HWaddr 00:21:6b:d3:1b:dc                 inet addr:192.168.1.83  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::221:6bff:fed3:1bdc/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:27901 errors:0 dropped:0 overruns:0 frame:0               TX packets:18098 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:20958957 (19.9 MiB)  TX bytes:3551000 (3.3 MiB)      Even more surprinsingly, neither lshw nor lspci shows anything related to wired ethernet controller/adapter: lshw:               $lshw -C network       *-network            description: Wireless interface            product: WiFi Link 5100            vendor: Intel Corporation            physical id: 0            bus info: pci@0000:03:00.0            logical name: wlan2            version: 00            serial: 00:21:6b:d3:1b:dc            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=iwlwifi driverversion=3.2.0-4-amd64 firmware=8.83.5.1 build 33692 ip=192.168.1.83 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn            resources: irq:45 memory:d4600000-d4601fff      lspci:               $lspci -nnk     00:00.0 Host bridge [0600]: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub [8086:2a40] (rev 07)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: agpgart-intel     00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a42] (rev 07)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: i915     00:02.1 Display controller [0380]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a43] (rev 07)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]     00:1a.0 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 [8086:2937] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: uhci_hcd     00:1a.1 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 [8086:2938] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: uhci_hcd     00:1a.7 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 [8086:293c] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: ehci_hcd     00:1b.0 Audio device [0403]: Intel Corporation 82801I (ICH9 Family) HD Audio Controller [8086:293e] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: snd_hda_intel     00:1c.0 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 [8086:2940] (rev 03)        Kernel driver in use: pcieport     00:1c.1 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 [8086:2942] (rev 03)        Kernel driver in use: pcieport     00:1c.4 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 [8086:2948] (rev 03)        Kernel driver in use: pcieport     00:1d.0 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 [8086:2934] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: uhci_hcd     00:1d.1 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 [8086:2935] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: uhci_hcd     00:1d.2 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 [8086:2936] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: uhci_hcd     00:1d.3 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 [8086:2939] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: uhci_hcd     00:1d.7 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 [8086:293a] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: ehci_hcd     00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev 93)     00:1f.0 ISA bridge [0601]: Intel Corporation ICH9M LPC Interface Controller [8086:2919] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]     00:1f.2 SATA controller [0106]: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] [8086:2929] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: ahci     00:1f.3 SMBus [0c05]: Intel Corporation 82801I (ICH9 Family) SMBus Controller [8086:2930] (rev 03)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: i801_smbus     03:00.0 Network controller [0280]: Intel Corporation WiFi Link 5100 [8086:4232]        Subsystem: Intel Corporation WiFi Link 5100 AGN [8086:1201]        Kernel driver in use: iwlwifi     04:06.0 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 IEEE 1394 Controller [1180:0832] (rev 05)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: firewire_ohci     04:06.1 SD Host controller [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter [1180:0822] (rev 22)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: sdhci-pci     04:06.2 System peripheral [0880]: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter [1180:0592] (rev 12)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: r592     04:06.3 System peripheral [0880]: Ricoh Co Ltd xD-Picture Card Controller [1180:0852] (rev 12)        Subsystem: Toshiba America Info Systems Device [1179:ff1e]        Kernel driver in use: r852      Why is my laptop's wired ethernet not showing? How can I debug this? The installation of Debian wasn't originally on this system: it was on an older laptop whose motherboard fried, so I rescued the hard drive as well as the Debian installation. However, I doubt this should have anything to do with lspci not even detecting the wired eth controller.


Will tar -cvzf packed.tar.gz mydir take hidden files into account?

I need to create a tarball of a given directory. However, I need to make sure hidden files are included too (such as those beginning with `.`). Will the following command automatically take the hidden files into account?               tar -cvzf packed.tar.gz mydir      If not, how can I make sure I include hidden files?


How to write a shell script restart apache if `server reached MaxClients`

Recently, My blog always shutdown, it use `centos6.2+apache2.2+mysql5.5+php5.3`. I have raised `MaxClients` in `httpd.conf`, but less useful. So is it possible to write a shell script (Run with crontab every 10 minutes), to read the `httpd/error_log`, if the last message `preg_match` `sending a SIGTERM` do restart apache automatically?


Swap alt and windows key except when using an external keyboard

On my laptop the `Alt` and `Windows` keys are in the opposite positions that I'd prefer them in. Swapping them is fairly easy. However, my external (USB) keyboard has the `Alt` and `Windows` keys in the order I prefer, meaning when I switch over to the external keyboard I have the unpreferable keyboard arrangement. Is there some manner of Linux-y voodoo I can invoke to detect whether input is coming from an external keyboard or not, and have it swap the two keys accordingly? If that's pushing it, I'd settle for a way to detect when an external keyboard is plugged in. Or are there any other reasonable solutions that I haven't considered?


Apache2 permissions issue

I have changed my DocumentRoot to `/home/user/www`. To achieve that I have just changed the 2 occurrences of the path at /etc/apache2/sites- available/default. The permissions of /home/user/www are 0774. I have added the www-data user to my user's group and the owner of `/home/user/www` is my own user and group (user:user). I have done that by:               sudo chmod -R 0774 www     sudo chown -R user:user www     sudo adduser www-data user      The problem is that Apache can't write to this directory. It can write only if I set www-data as owner, but if I do that, I can't write at the directory. I have tested the permissions with:               sudo -u www-data ls /home/user/www     sudo -u www-data cat /home/user/www/some-file      and it works. But the Wordpress I have at `www` can't delete or create files. Any ideas?


How can I use awk to extract URL's from a HTML file?

I have an HTML file with javascript and CSS in the source. Listed in the JS is a series of URLs' embedded with other meta-data. I want to use awk to extract the URLs (all enclosed in double quotes with the http:// prefix) and dump the urls to stdout. But I do not know how to use awk, but it seems to be the tool to use.               {     title: "Dsssat",     artist: "cxpl djij awsoj e",     mp3: "http://somesite.com/seal/dsssat.mp3",     },


confusing behavior of emacs-style keybindings in bash

Bash offers many useful `emacs-style keybindings` for simple commandline editing. For example, `Ctrl+w` deletes ("kills") word left from the cursor. Another keybinding, `Alt+d` is supposed to be a "mirror" of the first one. It is supposed to delete a word right from the cursor. However, I have noticed, these two keybindings do not act completely symetricaly. Whereas `Ctrl+w` treats `foo.bar` as one word, `Alt+d` treats it as two words Even more annoyingly, `# echo` are two words for `Ctrl+w`, but one word for `Alt+d`. Is there some logic in this? Is there some reason why they don't treat words in the same way? **Is there any way for me to change this?** I am using bash on `Debian Wheezy`


GlassFish/Tomcat security issue between domain users in linux server (alternate docroot issue)

Let's suppose we give to different users(clients) different domains (one domain for one user) in our glassfish application server for their work. This glassfish works in centos 6 server. Every user has his user folder in /home (/home/user1, /home/user2). Glassfish is installed in /usr/glassfish..... and runs as "glassfish" linux user. And every user(client) wants to have an alternate docroot(s). Here's is the problem. Every user has access only to his home folder. So it's the place where he wants to have alternate docroot(s) to keep his data. In order for glassfish to get users' alternate docroots we open users' folders (/home/user1, /home/user2) for glassfish. But now, every user can deploy his application and get another user's alternate docroot. Because it's the user sets alternate docroot folder not the admin. Here is the big difference - in apache it's the administrator who sets webserver folders for reading. So either my vision is wrong or how can it be fixed? [EDITED] Here I am talking about one linux server with one IP and one glassfish application server in that linux server. To supply services to our clients we don't install different glassfish servers we give them different domains in the same glassfish server as I see it's the best strategy.


How to check if aptitude did something?

I've a CI build process during which I install a debian package from my local reprepro. I have a `Makefile` which does call aptitude to install the package from its own repository like this               sudo aptitude -y install foobar >> aptitude.log 2>&1      Now it could happen that aptitude has conflicts, which can't be resolved or the repository doesn't offer a new version for the package "foobar". In both cases aptitude wouldn't install anything. But               echo $?      after the aptitude call in the `Makefile` always returns `0`. What way do you propose to check if aptitude actually did install anything? Grepping for the last line of the aptitude output is the only thing I can think of if the exit codes are always `0`.


Why doesn't Bash accept `&>&3`, i.e. redirecting stdout and stderr to file descriptor 3?

Given the preamble, `foobar` function and invocations of it:               exec 3>/dev/null         function foobar { echo foo; echo bar >&2; }     foobar >/dev/null     foobar 2>/dev/null     foobar &>/dev/null     foobar &>&3      Why doesn't the last simple command get executed by Bash? Instead Bash quits with:               -bash: syntax error near unexpected token `&'


Bash port auto upgrading script in cron doesn't work properly?

I've been recently try to write a script to automate checks for new version of ports and software installed on my FreeBSD server. This script is added to root's crontab and fires daily. If I run it from sudo /path/to/script it goes forward decently sending mail with content on my email address. If it's run by cron I get an empty mail. I think that the reason might be that while update sometimes window appears (from `make config` i think) with compilation options, but I might be wrong. Here's the script:               #!/usr/local/bin/bash     # DIRECTORIES SETUP     script_path_dir="/tmp"     working_dir="$script_path_dir/portsupgradescript"          # FILES SETUP     mail_file="$working_dir/mail.txt"     mail_address="MY_MAIL_ADDRESS"     mail_subject="Daily update"     pm_out="portmaster_log.txt"     pu_out="portupgrade_log.txt"               # START          if [ ! -d "$script_path_dir" ];      then       echo "Script base directory set does not exist. Creating..."       mkdir $script_path_dir      else       echo "Script base directory set exists. OK"     fi          if [ ! -d "$working_dir" ];      then       echo "Script working directory set does not exist. Creating..."       mkdir $working_dir      else       echo "Script working directory set exists. OK"     fi          if [ "$(ls -A $working_dir)" ]; then      echo "Script working directory is empty. OK"     else      echo "Script working directory is not empty. Cleaning..."      rm -rf $working_dir/*     fi               rm -rf $pm_out     rm -rf $pu_out     rm -rf $mail_file          /usr/sbin/portsnap fetch update && \     /usr/local/sbin/portmaster -L --index-only | egrep '(ew|ort) version|total install' > $pm_out          linecount=`wc -l $pm_out | awk {'print $1'}`     if [ "$linecount" != "0" ]     then      echo "Master file log not empty. Concatenating..."      cat $pm_out >> $mail_file      else       echo "Master file log empty... ( x )  "     fi               portupgrade -aqyP -l $pu_out          upg_linecount=`wc -l $pu_out`     if [ "$upg_linecount" != "0" ]      then       echo "Upgrade file log not empty. Concatenating..."       cat $pu_out >> $mail_file      else       echo "Upgrade file log empty... ( x ) "      fi               echo "Seding mail report..."      cat $mail_file | mail -s "$mail_subject" "$mail_address"      Is there any way to select defaults on "`make config`" window so this would be not a showstopper? Or maybe I should run this script sudoed in user's cron, not root's?


Find a particular nesting of directory names, e.g. .../project/dir1/dir2

I'm having some issues dealing with the `find` command; I don't know the syntax for it very well and I need to use it in a script to find a specific directory structure that could be located anywhere. Basically, I have a structure like "project/dir1/dir2" that I know will always be exactly those three directories, with the same names, in that order. What may not be the same is how deep this structure is nested; for example you could have: `$HOME/project/dir1/dir2` or `$HOME/workspace/project/dir1/dir2` Basically I need a general way to locate the `project/dir1/dir2` structure no matter how far deeply buried it is. If it helps, this will always be on Ubuntu. I thought about using locate, but then I'd have to guarantee that the locate db is always up to date.


Shuffle file randomly with some additional constraints

I have a huge music playlist and, while some artists have many albums, others have just one song. I wanted to sort the playlist so the same artist won't play twice in a row, or his songs won't end up mostly in the beginning or end of the playlist. Example playlist:               $ cat /tmp/playlist.m3u     Anna A. - Song 1     Anna A. - Song 2     I--Rock - Song 1     John B. - Song 1     John B. - Song 2     John B. - Song 3     John B. - Song 4     John B. - Song 5     Kyle C. - Song 1     U--Rock - Song 1      Output from `sort -R` or `shuf`:               $ sort -R /tmp/playlist.m3u     Anna A. - Song 1 #     U--Rock - Song 1     Anna A. - Song 2 # Anna's songs are all in the beginning.     John B. - Song 2     I--Rock - Song 1     John B. - Song 1     Kyle C. - Song 1     John B. - Song 4 #     John B. - Song 3 #     John B. - Song 5 # Three of John's songs in a row.      What I am expecting:               $ some_command /tmp/playlist.m3u     John B. - Song 1     Anna A. - Song 1     John B. - Song 2     I--Rock - Song 1     John B. - Song 3     Kyle C. - Song 1     Anna A. - Song 2     John B. - Song 4     U--Rock - Song 1     John B. - Song 5      **EDIT:** I have uploaded a real example of such a playlist here.


corrupt debian package archives on self-made database packages

I set about packaging several large databases in some very basic debian packages so as to make life easier at my job. However, I'm now encountering some issues. Most of the databases will install happily, however, the largest three are failing.               find . -name "*.deb" -exec du -h '{}' \; | sort -h     # These install fine     4.0K    ./hh-suite-data_1.0_all.deb     422M    ./hh-suite-data-env70/package/hh-suite-data-env70_1.0.0_amd64.deb     660M    ./hh-suite-data-env90/package/hh-suite-data-env90_1.0.0_amd64.deb     795M    ./hh-suite-data-env/package/hh-suite-data-env_1.0.0_amd64.deb     1.6G    ./hh-suite-data-scop70/package/hh-suite-data-scop70_1.0.0_amd64.deb     2.6G    ./hh-suite-data-nr70/package/hh-suite-data-nr70_1.0.0_amd64.deb     2.8G    ./hh-suite-data-pfamA/package/hh-suite-data-pfama_1.0.0_amd64.deb     3.2G    ./hh-suite-data-nr90/package/hh-suite-data-nr90_1.0.0_amd64.deb     # These fail to install     4.3G    ./hh-suite-data-nr20/package/hh-suite-data-nr20_1.0.0_amd64.deb     6.2G    ./hh-suite-data-pdb70/package/hh-suite-data-pdb70_1.0.0_amd64.deb     7.4G    ./hh-suite-data-nr/package/hh-suite-data-nr_1.0.0_amd64.deb      The failures look like this:               sudo dpkg -i package/hh-suite-data-nr20_1.0.0_amd64.deb      [sudo] password for esr:      (Reading database ... 276172 files and directories currently installed.)     Unpacking hh-suite-data-nr20 (from .../hh-suite-data-nr20_1.0.0_amd64.deb) ...     dpkg: error processing package/hh-suite-data-nr20_1.0.0_amd64.deb (--install):      corrupted filesystem tarfile - corrupted package archive     dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)     Errors were encountered while processing:      package/hh-suite-data-nr20_1.0.0_amd64.deb      I'm somewhat convinced it's because of the size of the archives, that somewhere between 3.2 and 4.3G. Does anyone have any experience with _very_ large packages and their failure modes? Anyone have any idea why this is happening? I have no reason to believe the tar archive are corrupted, I've built the package many times and still see this error on installation I'm re-writing my packages to just `wget` the files from a mirror instead of actually containing the databases, as that'll get around the tar problem. ## Running with -D10               # This file unpacks fine     D000010: tarobject ti->name='./usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.index' mode=100644 owner=0.0 type=48(-) ti->linkname='' namenode='/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.index' flags=2 instead='<none>'     D000010: ensure_pathname_nonexisting `/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.index.dpkg-tmp'     D000010: ensure_pathname_nonexisting `/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.index.dpkg-new'     # This is a 16G file and fails IMMEDIATELY.     D000010: tarobject ti->name='./usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db' mode=100644 owner=0.0 type=48(-) ti->linkname='' namenode='/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db' flags=2 instead='<none>'     D000010: ensure_pathname_nonexisting `/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.dpkg-tmp'     D000010: ensure_pathname_nonexisting `/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.dpkg-new'     dpkg: error processing hh-suite-data-pdb70_1.0.0_amd64.deb (--install):      corrupted filesystem tarfile - corrupted package archive      ## Running with -D100 There are two entries in this portion, a good one and the bad one, and some after the failure. What worries me is the "tarobject file open size=0" bit.               D000100: setupvnamevbs main=`/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.index' tmp=`/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.index.dpkg-tmp' new=`/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.index.dpkg-new'     D000100: tarobject already exists     D000100: tarobject file open size=900749     D000100: tarobject nondirectory, `link' backup     D000100: tarobject done and installation deferred     D000100: setupvnamevbs main=`/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db' tmp=`/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.dpkg-tmp' new=`/usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.dpkg-new'     D000100: tarobject already exists     D000100: tarobject file open size=0     D000100: tarobject nondirectory, `link' backup     D000100: tarobject done and installation deferred     dpkg: error processing hh-suite-data-pdb70_1.0.0_amd64.deb (--install):      corrupted filesystem tarfile - corrupted package archive     D000100: setupvnamevbs main=`//usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db' tmp=`//usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.dpkg-tmp' new=`//usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.dpkg-new'     D000100: cu_installnew restoring atomic     D000100: secure_remove '//usr/share/hh-suite-data/pdb70/pdb70_19Oct13_a3m_db.dpkg-new' unlink OK


Why can't my python script change umask?

This is my script               #!/usr/bin/python          import os          print "hello world from python"     os.system("echo 'hello world from bash'")     os.system("umask 055")     os.system("ls -alh > test")      If I run this code the permissions of file test are not set as 722 but as 600. What could be the reason? the Umask of my shell is 0077.


What files should I copy from Windows into Wine?

As far as I understand Wine runtime does better if some libraries are copied from MS Windows, but some Windows system libraries really are not to be used with Wine (some can even make it stop working, and many are simply useless). So what files make sense and are safe to copy from MS Windows into Wine system? I own a legal Windows XP copy (but prefer to use GNU/Linux) and run Wine 1.3.8 on Ubuntu 10.10.


What Linux distro would you recommend for a big all-purpose LiveUSB?

I am about to buy a 2TB hard drive to have all my scrap in one place. I will split it to some partitions one to store my data, and others to store OS distros and bootable OSes like WinPE and Linux. I'd like the Linux system to be a fully-equipped all-purpose graphical environment (preferably with XFCE, but this doesn't really matter) with all hardware (including 3D graphics) automatic support on virtually any machine and automatic RW mounting of all available partitions (incl. those on this HDD and on a host machine (incl. NTFS, LVM, and FreeBSD partitions)). I'd like as fresh software versions as possible. Should I use Mandriva Move, Knoppix, or something else?


How to get Nautilus to "Open with Archive Mounter"?

I see Ubuntu screenshots showing that one can right-click an ISO, and have an option to "Open with Archive Mount". How do I get that running elsewhere where it isn't default (Debian in my case)? This is so as to avoid having to use the command-line to loop-mount it. Note that I use GNOME **2.30**.


How to create .ko files in Linux

I have written one driver for one device in Linux. How can I create (using `gcc`) a `.ko` file so that I can insert it into the kernel?


Blank Screen after login. Although virtual console works. Please help

A very frustrating thing happened today. To give you a little background, I had been running Dropbox and a few other programs prior on my CrunchBang box (Debian based). It seems that some of the processes were taking more than the amount of memory I prefer. So, I performed a system reboot. Once the box came back to the login screen I entered my necessary credentials. After that, to my horror the screen went blank/dark grey!!! I did a hard reboot as the box didn't seem to respond to commands. Once it came back I noted that it would let me switch to command line terminal view (virtual console). It appeared all my files where intact. But, I really need my GUI back. Any ideas on what may have happened? Or what I might try to do to fix this? This CrunchBang install is only a few days old, it doesn't matter since it's not working. I've also tried launching the X server by running:               startx       Still nothing happens, just the blank screen. If I `Control`+`C` it terminates the X server and returns back to the command prompt. **Solution UPDATE (11/22/13):** Come to find out, my problem was simply that my default x-session-manager got switched to "lxsession" (which was configured to display a blank screen by default apparently). I'm not sure why but that's what happened. I'm thinking maybe one of the system updates changed the default x-session manager configuration. The following command allows you to change the defualt x-session manager(atleast in debian): > sudo update-alternatives --config x-session-manager Something like this will be the ouput:                    There are 2 choices for the alternative x-session-manager (providing /usr/bin/x-session-manager).            Selection    Path                      Priority   Status     ------------------------------------------------------------       0            /usr/bin/lxsession         49        auto mode       1            /usr/bin/lxsession         49        manual mode     * 2            /usr/bin/openbox-session   40        manual mode          Press enter to keep the current choice[*], or type selection number:            The output of that command will allow you to switch between all installed x-session managers. Thanks all!


How do I download PDFs from PubMed, given their IDs?

I have PubMed IDs for files I need to download from the PubMed site in `.pdf` format. I tried this script:               #!/usr/bin/env bash          Link="http://www.ncbi.nlm.nih.gov/pubmed/"          ID=(10021369              10051005     10051007     100562     10064668     10071185     )          for f in ${ID[]};     do        wget  --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" \              -l1 --no-parent -A.pdf ${Link}${f}/pdf/ -O ${f}.pdf     done      This gives me PDF files, but I can't open any of them. What am I doing wrong?


How to exit vncconfig process properly

On CentOS 5.7, when open up a `vncconfig`, a tray icon shows on the taskbar. Hit `close` or the `x` button to close the vncconfig doesn't exit the vncconfig, the tray icon is still there. Next time, if I open up another vncconfig rather than clicking the one on taskbar. There will be another vncconfig tray icon added to the taskbar. Except using `kill $pid` to remove the tray icon, is there any other way to exit the vncconfig process properly? See screenshot below: ![enter image description here](http://i.stack.imgur.com/OQqhh.png)


Debian VLAN (8021q) Configuration doesn't work

I try to setup VLANs on a virtual Debian machine. It's connected to an Cisco 2960 Switch. The Switch has 3 VLANs (1,100,200) which're allowed the pass the trunk. The Switch Configurations was tested with an other layer2 switch, which was also configured as trunk. It worked perfectly so it has to be the VM. The 8021q Kernel Module is loaded but "Used by" is set to 0. The Network Configuration of the Debian Host looks like:               auto eth0.1     iface eth0.1 int static         address 192.168.0.1         netmask 255.255.255.0         vlan_raw_device eth0          auto eth0.100     iface eth0.100 int static         address 192.168.1.1         netmask 255.255.255.0         vlan_raw_device eth0          auto eth0.200     iface eth0.200 int static         address 192.168.2.1         netmask 255.255.255.0         vlan_raw_device eth0      When I try to ping the IP of the Switch I get back               From 192.168.1.1 icmp_swq=1 Destination Host Unreachable      I would realy appreciate Help!


File compression - how to implement in Linux

I would like to be able to compress certain files (that I need to keep, but use rarely) on disk. I noticed that `chattr +c` flags a file for compression, but it doesn't seem to actually compress files. What is the simplest way to implement file compression on a per-file or per- directory basis?


RHEL - GDM could not be initialized

**Actions before the GDM failure** I was trying to install _RT tool_ in my system. However, the RT tool required _Perl 5.10_. So, I did `yum remove perl` to remove the existing version. While the command was getting executed, I was not able to navigate to any other tab or window. The system was stuck. So, I long pressed the power button and turned it on. **After Turning ON** I got the below error messages (Not exactly in the same order, but after trying various options)   * Couldn't start X server on card 0. (I think when I did the `startx` command)   * Xserver not found.   * Install x server or correct GDM configuration and restart GDM.  I tried to do the below command.               cp xorg.conf failsafe xorg.conf      However, I did not find the file **xorg.conf** file itself. I tried to update the GDM by doing `yum install GDM` after removing GDM. However, I still do not get the display. I want to bring back the display without having to reinstall the entire OS again.


Archlinux not configured with iptables

I have been trying to set up iptables on my archlinux server, however when I run `iptables -nvL` I receive the error `iptables v1.4.20: can't initialize iptables table 'filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.` Having tried to load the modules and failing I checked to see if they were installed using modinfo and they could not be found. I was trying to run these modules `x_tables, ip_tables, ip_filter, iptable_filter, xt_tcpudp, nf_conntrack, xt_state, nf_conntrack_ipv4` Does anybody know how to solve this problem? EDIT: Having done some more research on the problem I think I may need to install the necessary modules manually. Is this something which is possible over ssh? I am not sure how to go about rebuilding the kernel.


I want to run `cmake` for a program,               [build]$ cmake ../     cmake: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by cmake)      I have this error, how i can fix it? I use from Archlinux


Is NFS very secure? Secure alternatives

I know that there is a very similar question to that Is NFS Secure Over Internet, but I am asking a little bit different. I guess that NFS is not so secure, as I can learn from the internet and from that question. Are there any very secure methods to use in order for your employees to have access to some files you want to be _very_ secure? Let's say it a little different. If NSA for example, has some documents, lets say top secret, and wants those documents to be available to its employees (NSA may want each employee to have access to different documents according with what they are working on) but no-one else, and under no circumstances someone from inside or outside of the agency could have access to files that should not see, what NSA may do? I am not just asking for NFS here, but everything that NSA could use to achieve it's purpose.


Using EXIFTool to add EXIF data from filenames

There is a set of photos with timestamps in their filenames like these:               Photo on 3-09-12 at 9.24 PM #2.jpg          Photo on 3-09-12 at 9.24 PM #1.jpg          Photo on 3-09-12 at 8.23 PM.jpg      etc. ("3-09-12", means "3rd Sep 2012" or DD-MM-YY) But these photos have no EXIF data at all. Before you imported them to a larger collection, how would you pipe this information to `exiftool` and also tell it to add new timestamps as EXIF data, all from the photos' filenames? **_Update_** : (The now Pt. 1 of) my question about parsing filenames with DD- MM-YY and 12 hour time has been very kindly answered by @Stephane. But I discovered that the same batch of photos contains filenames with one variation I had missed. I hope it makes more sense to add a 'Pt. 2' instead of starting a whole new question. **In short** : How could I change @Stephane's brilliant answer --               exiftool '-CreateDate<${FileName;use Date::Manip;                           Date_Init("DateFormat=non-US");                           /on (.*?at.*?[AP]M)/;$_=$1;                           y/./:/;$_=UnixDate($_,"%Y-%m-%d %T")                           }' ./*on\ *at*[PA]M*.jpg      -- so that it might work with filename format below, which is slightly different from the first part of the question, in that it uses YYYY-MM-DD and 24-hour time:               Photo on 2010-09-15 at 18.44 #4.jpg          Photo on 2010-09-15 at 18.44 #3.jpg          Photo on 2010-09-15 at 18.44.jpg      **More explanation:** Trying to edit the `Date::Manip` part of the Stephane's script seems to show up my ignorance of what's going on in the most important parts of it. I tried omitting the `Date_Init` line since we are back to an ISO-esque full- year date format and then having               /on (.*?at.*?)/;$_=$1;     y/./:/;$_=UnixDate($_,"%Y-%m-%d %T")     ' ./*on\ *at*.jpg      But `exiftool` is giving me `no writeable tags` and `FileName not defined`. Instructions at http://search.cpan.org/~sbeck/Date- Manip-5.56/lib/Date/Manip.pod don't seem to be helpful (at least to me) in understanding what's going on with those periods, that 'y' at the start of the line, semicolon etc, and they're rather ungoogleable :S


Cross-compile any aptitude package?

I have an ARM Chromebook. There is a project called Crouton that is able to install Ubuntu to the internal harddrive pretty easily (I've done it). But most packages in the repositories are of course only for X86 and X64.   1. Is it even possible technically to take an arbitrary apt package and cross-compile it to run on my ARM Chromebook?   2. If it is possible, how can I do so relatively painlessly? I have access to a very fast 24-core system for the compilation if I can figure out a way to automate the process of making ARM packages.


can't receive mails to thunderbird via postfix local server

A small introduction. I have a SMTP server ( Haraka - http://haraka.github.io/ ) on port 25 and a local postfix server on port 9267. I intercepts mails in Haraka and then I send them to my postfix server. I can see the mails received using mail -u username command but I want to use a email client(Thunderbird) to have access to them. I've created an account in Thunderbird via this http://askubuntu.com/questions/192572/how-read-local-email-in-thunderbird , but without any result and I think the problem is the postfix server configuration. Here is my postfix main.cf file .               # See /usr/share/postfix/main.cf.dist for a commented, more complete version               # Debian specific:  Specifying a file name will cause the first     # line of that file to be used as the name.  The Debian default     # is /etc/mailname.     #myorigin = /etc/mailname          smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)     biff = no          # appending .domain is the MUA's job.     append_dot_mydomain = no          # Uncomment the next line to generate "delayed mail" warnings     #delay_warning_time = 4h          readme_directory = no          # TLS parameters     smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem     smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key     smtpd_use_tls=yes     smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache     smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache               #transport test     #transport_maps = hash:/etc/postfix/transport          # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for     # information on enabling SSL in the smtp client.          myhostname = mydomain.com     alias_maps = hash:/etc/aliases     alias_database = hash:/etc/aliases     myorigin = /etc/mailname     mydestination = mydomain.com, localhost.mydomain.com, localhost     relayhost =      mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128     mailbox_size_limit = 0     recipient_delimiter = +     inet_interfaces = all      I appreciate any help.


Making a tty9 on a openvz VE

I am in a virtual environment. I am installing Asterisk and freepbx. They use this script amportal and it has a requirement to check for tty9 there is alot of mention on folks running this in a VE who just modify the script to remove the tty reference i do not want to do that I want to actually add this how do I do this. there is this mknod command but I really do not understand how to work it. anyone enlighten myself and otheres on how to create a tty9!


Secondary bridge only working at random in debian wheezy

We are currently migrating from vmware server to kvm. So far everything works smooth, with the exception of the secondary bridge. Our network layout is as follows: Firewall with 3 ports               eth0 Public Internet IP address     eth1 Internal network 192.168.200.x     eth2 DMZ internal network 192.168.202.x      On the KVM host we also have two NIC's, one attached to the eth1 port of the firewall and the secondary to the eth2 port of the firewall. We defined two bridges in the KVM host, so we have a bridge for the internal servers (192.168.200.x) and one for the DMZ servers (192.168.202.x) The network config of the KVM host looks like this:               auto lo br0 br1 eth0 eth1     iface lo inet loopback          iface eth0 inet manual     iface br0 inet static             address 192.168.200.249             netmask 255.255.255.0             broadcast 192.168.200.255             network 192.168.200.0             bridge_ports eth0             gateway 192.168.200.4          iface eth1 inet manual     iface br1 inet static             address 192.168.202.249             netmask 255.255.255.0             broadcast 192.168.202.255             network 192.168.202.0             bridge_ports eth1             gateway 192.168.202.4      KVM guest which are located in the 192.168.200.x network (bound to br0) can communicate just fine. But KVM guests with IP's 192.168.202.x (bound to br1) have connectivity only at random. Sometimes the guest have connectivity for 20 seconds, then for several minutes/hours no connection. Any ideas?


What does % utilization mean in htop if only 1 process can execute at a time?

I see that the `htop` command reports respective the % of utilisation of each CPU core and also that of the processes. We know that only 1 process can execute at a time in the CPU. How is it possible for processes to occupy a certain "Percentage" of the CPU ? Does it have anything to do with the Instruction Pipeline ?


no install buttons in extensions.gnome.org

I just got a new computer, and I wanted to install all the nice shell extensions I had on my old one. Both of them are running Debian 7.5, and have gnome shell version 3.4.2. The only difference I could find is that my new computer has a 64 bit version of Debian, and my old one has a 32 bit version. But now, when I go to https://extensions.gnome.org/, all the extensions look greyed out and there are no install buttons. ![a screenshot. The reviews never load.](http://i.stack.imgur.com/m3UiW.png) Also, it looks like the user reviews just never load. Probably a related issue. They do load on my old computer.


Why does the setxkbmap compose key mess with other keys?

I just found a tip to set the compose key manually:               setxkbmap -option compose:caps      Unfortunately, after running this several keypresses act as if the compose key had been pressed. For example, to get a tilde, I now have to press `Shift`-`~` _twice_ , and I can no longer figure out how to get a single or double quote - When I press that key twice ( _without_ pressing Caps Lock) I get a single `´` (without `Shift`) or `¨` (with `Shift`) character.               $ setxkbmap -print      xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us(dvorak-intl)+inet(evdev)+level3(ralt_switch)+compose(caps)"  };         xkb_geometry  { include "pc(pc105)" };     };      Setting the compose key to the more popular `Right-Alt` did not help - The results are the same with the following settings:               $ setxkbmap -print      xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us(dvorak-intl)+inet(evdev)+level3(ralt_switch)+compose(ralt)"  };         xkb_geometry  { include "pc(pc105)" };     };      Stranger still, even after disabling the compose key with `setxkbmap -option` the keys are still messed up. On a different machine with GNOME 3 and similar settings it works just fine (`Caps Lock`, `a`, `a` produces `å`, while a single press of `Shift`-`~` produces `~`):               $ setxkbmap -print      xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us(dvorak-alt-intl)+ch:2+inet(evdev)+compose(caps)" };         xkb_geometry  { include "pc(pc105)" };     };      Maybe it's an LXDE issue - I'll test it next week.


How to set separate global/user keyboard settings in LXDE?

I need to have `English (US)` and no compose key for the _system_ , and I'd like `English (Dvorak alternative international no dead keys)` + `Caps Lock` as the compose key for _myself_. How can I set this up? I tried setting `dvorak-alt-intl` in `lxkeymap`, but it only worked until I logged in again. I also tried to set `@setxkbmap -option compose:caps` in `~/.config/lxsession/LXDE/autostart`, but that didn't work after logging in again.


Making UDEV ignore certain devices during boot.

I'm trying to make UDEV stop mounting one of my devices at boot time, and I've created a rule in _/etc/udev/rules.d/_ called _1-myblacklist.rules_. All the rule does is matches the device by kernel identifier (ie. "sdb") and and set the attribute OPTION to "ignore_device"               udevadm test /sys/block/sdb       Shows that the my rules file is parsed as the first entry, but all subsequent rules still gets applied. And the partitions on the drive still shows up on my desktop (XFCE).


Error with grub2 installation on Backtrack 5

I installed BackTrack 5 r1 and I can't select boot option between Windows and BackTrack on start up. How can I fix this, or how can I install grub 2?


What are the (dis)advantages of ext4, ReiserFS, JFS, and XFS?

What purpose is each suitable for?


Identity Management with ActiveDirectory

What is the best, or most reliable, way to manage my Unix/Linux user accounts with ActiveDirectory? Or, is this even feasible?


How can I identify processes that use network facilities, and can they be killed?

In the output of               netstat -a | grep LISTEN      there are usually a lot of processes. How (where) can I find out information about them, what is their purpose in the system and if I can kill them? Which of them can be insecure and which are safe?


symbolic link to a directory and relative path

I've created symlink with absolute path to the directory (Blink) and have for example following tree:               $ ls -l /tmp/A     total 0     lrwxrwxrwx 1 root root 6 Apr  3 12:27 Blink -> /tmp/B     -rw-r--r-- 1 root root 0 Apr  3 12:27 foo          $ ls -l /tmp/B     total 0     -rw-r--r-- 1 root root 0 Apr  3 12:27 bar      then I go to /tmp/A and change directory to Blink:               $ cd /tmp/A     $ pwd     /tmp/A     $ cd Blink     $ pwd     /tmp/A/Blink      `cd ..` returns me to `/tmp/A` but if I type for example `ls ../foo` I'll got error:               ls: ../foo: No such file or directory      builtin cd command resolve path as needed, but external ls consider the .. as up-level of /tmp/B and therefore cannot find foo. What is the problem here? Can I get the foo file from /tmp/A/Blink by relative path like ../foo?


What does this [number] beginning many lines during the Linux boot screen represent?

My Linux sandbox boots into the text mode. During the boot process many lines are prefixed with a number between brackets ie. [40.000] Normally this number reaches upwards to 80. Recently I've noticed this number can be as short as 40 and today it was at a completely different magnitude and ended around 1200.   1. What is it called?    2. What does it represent?    3. Any idea why a stable install without auto update would suddenly change this value?


When using awk /pattern/ { print "text"} /patern/ {print ""} is there an ELSE pattern?

Let's say I have text file like:               R1 12 324 3453 36 457 4 7 8     R2 34 2342 2525 25 25 26 26 2 2     R3 23 2342 32 52 54 543 643 63     R4 25 234 2342 4 234242      I want to use `awk` to process these lines differently, like               awk '/R1/ { print "=>" $0} /R2/ { print "*" $0} '      and I want to also print all the rest of the lines as they are (without making duplicates of the lines I've already processed), basically I need an `/ELSE/ { print $0}` at the end of my `awk` line. Is there such a thing?


convert WAV music library to FLAC on command line and achieve best quality

I would like to produce (nearly) perfect FLAC files by verifying/checking all conversion steps. I'm hoping to do this in a single command, although a short bash script would be acceptable as a second choice. I am on Kubuntu 12.04 and I installed flac 1.2.1. Here is my starting point:               find ~/Music -type f -iname "*.wav" | while read fn; do flac --keep-foreign-metadata --ogg --verify "$fn"; done      How can I improve this? If `shntool` is recommended, how would I include it? How would I include checksum comparisons? How can I make FLAC test the integrity of each file? A working example is appreciated. BTW, I took a look at perfect-flac-encode, but it is too complicated for me. I don't even fully understand the first sentence of the project's description! The installation steps also look too complex. If there is a similar project that might fit my needs, please let me know.


Wrap command in the prompt

Is it possible to insert a separator after the command in a prompt? This is an example:               ~/Desktop: ls -al     -------------------------------------     total 80     drwx------+  6 eddie  staff   204B Apr 29 16:57 .     drwxr-xr-x+ 54 eddie  staff   1.8K Apr 30 10:54 ..          ~/Desktop:      Specifically I want to add the --------- part after issuing a command to easier distinguish the command from the result


How to circumvent "Too many open files" in debian

If I want to see all relevant log files of my apache2 server at once, I use               tail -f /var/kunden/logs/*log /var/kunden/logs/*log /var/log/apache2/*log |grep -v robots|grep -v favicon      But since those are too many files by now, I would like to encrease that limit. How can I increase it for one ssh session? And How could I increase it globally systemwide? I can see the open files limit is 1024 on my machine:               ulimit -n     1024


Installing Simon Listens on Linux Mint

Recently I've heard about the Simon Listens package which enables you to create a speech recognition engine on Linux as well as windows. I have Linux Mind 14 - cinnamon installed on my laptop. I wanted to install Simon Listens on this system, I downloaded the most recent version (0.4.0) from here and extracted the files. However there is no way form me to run the build.sh script. When I double click on it a window pops up asking me if I want to run it or run it in terminal. Regardless which option I select a terminal window flashes briefly and closes (before I can read it). I can't install it. How can I get it to work?


Does ~ always equal $HOME

I know this has probably been asked before, but I couldn't find it with Google. Given   * Linux Kernel   * No configurations that change $HOME   * bash Will `~ == $HOME` be true?


Remount an SSHFS mount without umounting it

What is the equivalent to `mount -o remount,ro` in an `sshfs` mount? The only way I know is to do `fusermount -u` and then mount it again with `sshfs -o ro`.


NFS file owner(uid) = 4294967294, can't do much with my mount, How do I fix this?

I have a somewhat strange setup going on here, I have Android as the client and it's kernel does not support NFSv4, also my /etc/exports file on the server side has no NFSv4 style entries. I am trying to build some toolchains (I have gcc-4.8-armhf and all that on my phone as well as apt-get with repositories set up so I can install stuff if needed) as well as following LFS, but I can't build some programs such as perl due to not being able set file ownership and what not. My /etc/exports (server) :               /media/usb3/Android     192.168.1.209(rw,sync,subtree_check,no_root_squash)      A `ls -l` looks like this (client):               drwxr-xr-x  6 4294967294 4294967294      4096 Jun 21 17:23 toolchains     -rw-r--r--  1 4294967294 4294967294         0 Jun 25 18:51 rootu      A `sudo chown root:root` looks like this (client) (rootu is just a test file):               sudo chown root:root rootu     chown: changing ownership of `rootu': Invalid argument      My mount command (client) :               sudo mount -t nfs 192.168.1.210:/media/usb3/Android /home/edge-case/Android-Lab/ -o tcp      I've gone over the man pages and read some tutorials and other questions but they all say to just set no_root_squash, which I did from the start, and that doesn't work. I don't have LDAP or Kerberos, or any sophisticated authentication set up at the moment, that is all beyond my skill ( and 0 pay ) level at the moment. I'm at home so I have complete root access and ownership of everything and not too worried about security other than maybe war-drivers, but I do have a good wireless password, so no tin foil hat really needed for me ;P I used to have this working, but it seems some changes to Debian have been made and things are not working so well anymore. Are Windows agents screwing up Linux source!? J/k Really what is this? Where can I find a simple way to mount a directory with files owned by me, or root (via sudo chown) if I choose, and not some strange "4294967294" user that doesn't exist on the client or server?


Difference between the Unity shell interface and a desktop environment

I am writing a report and I have stumbled across a topic I am not quite sure how to to discuss. Essentially I have been doing a little research on the Unity shell system and its usage in Ubuntu primarily. I understand that Unity is a shell interface and that it runs with GNOME desktop environment. My question is in a broad description how does it do this is the shell interface simply how the user triggers certain programs to do certain tasks within the GNOME desktop environment? My questions stems from the fact that everywhere I have researched seems to compare GNOME and Unity yet how I understand it they serve different processes almost entirely. Am I missing something?


How do I obtain the kill signal / message / reason within a script?

I am using the following trap:               trap OnExit EXIT      And in my `OnExit` function I would like to capture all the info I can on what happened so I can write it to a log file. Id like to know who, why, how, when etc.. Is any of this possible?


Linux Mint 17 - Get Blank screen after login

I was trying to setup a dual monitor environment on my Linux desktop. I have an ATI graphic card and it was working correctly. It mirrored by default and I went into my AMD ATI Admin to enable the Xinerama feature so that I could have the dual monitor work like I want it to. it then asked me to reboot which after I did things went south. I can boot up and login with no issue but after that I get a blank screen and as a result I'm dead in the water. I'm hoping someone can help me resolve this issue without having to resort to a complete reinstall.


Install PLoP Bootmanager to GRUB2 on an HP 2000 Series to Dual-boot with Windows 7?

I know this sounds complicated, but how can I pull this off? So, basically after installing Ubuntu 14.04, it might have done some BIOS MOD or something because my PC lost the ability to boot from CD/DVD. So, in this case, I have manually tweaked GRUB2's settings to make it show up when I start the PC (I know, I could have just held shift.) So, what I want to do is Install Plop Boot Manager and make it an option when you go into the GRUB2 menu, then be able to install Windows 7, and if possible not overwrite GRUB2, and in case it does overwrite GRUB2, I'd need instructions on how to get GRUB2 back. (My best idea is installing to a Virtual Hard Disk and making it bootable on the real machine, would that overwrite the boot loader?) Okay, now that I told you all I wanna do, I'm gonna post my grub2.cfg and my 40_custom right here in this sentance.


Playing MP3 in Firefox on Debian

Is there a way to get MP3 playback within Firefox 31+ without installing plugins? I know about the entire encoding issues, but I have read somewhere that Firefox will look for native OS encoders like LAME to add support for audio HTML5 tags. What is the best way to add MP3 support for Firefox 31+ on Debian 7/Crunchbang?


Multiple named processes for bind9 in Debian

I'm running a name server using `bind9` on Debian. I noticed that there are multiple "named" processes running, when `bind` starts: ![htop output](http://i.stack.imgur.com/cM5lH.jpg)   * How can I limit this to n `bind` instances (processes)?   * What is the recommended use of multiple `bind` processes? I know that `bind` is a relatively low intensive application in terms of CPU and network.


Why is the PGID of my child processes not the PID of the parent?

So I keep reading everywhere that this command should terminate all child processes of the parent process:               kill -- -$$      Using a negative ID with the kill command references a PGID and from the examples I have seen it appears the PGID of child processes should be the PID of the parent but its not the case on my system. On my system the PGID of the child is the same as the PGID of the parent script which turns out to be bash. Whats going on here? Were the examples wrong or is my system set up differently? What I need to achieve is to terminate child processes without terminating the parent so I don't want to send a kill signal to the PGID the parent is in...


How to to remove libgcj from Debian?

I am doing Java programming on Debian. By default Debian 6.x ships with libgcj JVM. On starting eclipse it shows a warning that `this JVM is deprecated and may cause problems`. For this reason I downloaded the JVM from Oracle's site and installed it. However after installing the Oracle JVM the default JVM on system is still libgcj. When I type `java -version` I get following output -               java version "1.5.0"     gij (GNU libgcj) version 4.4.5      How should I remove this from my system? And after that how should I set the newly installed JVM to be the default one. This would involve two things -   1. Setting the bin directory on system path.   2. Making javaw the default program when a jar is double clicked. I'm familiar with these tasks on Windows but not on Linux. Thanks.


Pulling out keywords using standard command line utilities?

As an example, this is the pronunciation of "when" according to Wiktionary. enPR, IPA and X-SAMPA are different schemes for showing pronunciations.               when:* {{a|US}} {{enPR|wĕn|hwĕn}}, {{IPA|/wɛn/|/ʍɛn/}}, {{X-SAMPA|/wEn/|/WEn/}}      I'd like to pull out the keyword `when` and its two IPA pronunciations, and put them on separate lines:               when wɛn     when ʍɛn      There may be one, two or more IPA pronunciations of a word, and there may or may not be enPR or X-SAMPA pronunciations. I'm thinking PHP, lists within lists, but this seems to be overkill, and I don't want the users to have to install it if possible. Is there a way to do this in awk, sed, cut or other standard Unix command line utility?


Can I create a bootable distribution backup

I'm interested in trying out a couple of distributions, but for extended periods of time (so using a LiveCD is not really an option). However, I would like to create a backup of my current distribution (Ubuntu- Gnome) with it's settings and extra packages/dependencies. Would it be a case of simply backing up a list of packages and settings folders (if so which ones) and reapplying these to a new installation, or can I create my own bootable installation?


How many sections can I create in object file?

I'm following the course of Baking Pi – Operating Systems Development. In it they created another section `.init`. So can we create as many sections as we want (not just `.data, .bss, .text`) and can we put code and data (initialized of no) in any of them?. If so, what's the purpose of sections then?


Capabilities for a script on Linux

If I want to set a capability (`capabilities(7)`), such as `CAP_NET_BIND_SERVICE`, on an executable file and that file is _a script_ , do I have to set the capability (`setcap(8)`) on the interpreter starting that script or is it sufficient to set it on the script file itself? Note: the question concerns Scientific Linux 6.1 in particular, but I think it can be answered generically.


file system uid and gid in linux

I came across a linux kernel tutorial and there they talked about 4 pairs of identifiers and one of them was **_file system uid and gid._** Could someone explain me what it is and how it is different from **_uid and gid_**?


View pdf file in terminal

I want to see pdf files available on our cluster rather than copying them into my local machine and than visualize. Please tell me how can i do this.


Screen resolution problems on Thinkpad E520

I'm having some troubles with screen resolution.   First of all, I'm using a Lenovo Thinkpad E520, with BackTrack 5 R2 installed. My natural resolution is 1366x768, but I'm stuck with 1024x768.   This is my hardware:               lspci | grep VGA     00:02.0 VGA compatible controller: Interl Corporation 2nd Generation Core      Processor Family Integrated Graphics Controller (rev 09)      How can I fix that?   Is there a ready-to-use driver or I have to compile that from source?   At least, is there a solution, at all? :( This is the output of `xrandr` command:               Screen 0: minimum 1024x768, current 1024x768, maximum 1024x768        default connected 1024x768+0+0 0mm x 0mm         1024x768            0.0*


External disk partitions with identical UUIDs

I have two external USB drives of the same make and model, and one of them is driving me slightly nuts by never being assigned a UUID (or, at least, it doesn't show up in `/dev/disk/by-uuid`). What could cause that, and how can I fix it? FWIW, ext2fs on Windows was never able to assign a drive letter to that disk automatically, and always complains that "GUID is 0" when I assign a drive letter to it manually (but after that it works fine). The device block information seems to pinpoint the problem (thanks @dchirikov): **Both partitions have the same UUID.** How can I fix this?               $ sudo blkid /dev/sd[ab]*     /dev/sda: PTUUID="0002866e" PTTYPE="dos"      /dev/sda1: LABEL="Elements1" UUID="DACC0069CC0041ED" TYPE="ntfs"      /dev/sdb: PTUUID="83529362" PTTYPE="dos"      /dev/sdb1: LABEL="Elements2" UUID="DACC0069CC0041ED" TYPE="ntfs"


FTP timeout FIRST time

I'm using PureFTPd on MacOSX (Snow Leopard, not server version). When trying to access the FTP account from the outside via dyndns (e.g. using https://www.wormly.com/test_ftp_server) the connection always **times out the FIRST time**. When I try **AGAIN in the next few seconds it works**. What is this about? I have forwarded the ports to my apple router and tried disabling the OSX firewall as well.


Centos 6.5 laptop with multiple KVM on roaming networks

I have Laptop with CentOS 6.5 with 16GB RAM and many KVMs are created for testing purpose. Situation is I have to move from site to site, and due to that physically connected network eth0 to Host changes, one could be on 192.168.0.X and while another could be on 100.100.100.X IP ranges. So if physical adapter IP, Subnet, Gateway and DNS changes does it also required to change my Guest's Network settings to communicate in following situation: - To communicate between Guest and Host - To communicate between Guest to Guest **My Questions are:** - How to make everything auto tune? For example when I was in network (i.e 192.168.0.X) I've configured WinSCP on Windows 7 Guest having IP 192.168.0.72 on KVM to connect Host having IP 192.168.0.71. Now when I goes with my laptop to another network, Host IP has been changed to 192.168.8.110, but still existing configuration on guest is referring to 192.168.0.71. Kindly requested to suggest the possible solutions and also if possible briefly explain technically how internally it works for the same.


installing grub and a working kernel over an old and broken debian system

I have an old debian system, which I always have been able to upgrade over the years. I had installed an old kernel, compiled by me from sources. After my last dist-upgrade (using testing distribution), I had a kernel panic at boot. My old kernel and my new libc are not able to work together anymore (I presume). Even device names are changed: with my latest working kernel, I had `/dev/hda` and `/dev/hdb`, now those devices are recognized as `/dev/sda` and `/dev/sdb`. Additionaly, two partitions (`/dev/hda2` and `/dev/hdb2`) were joined in a raid array, which name was `/dev/md0` (mounted as root), and now is `/dev/md127`. Partition `/dev/hda1` was mounted as `/boot`, and `/dev/hdb1` was the swap partition. I used lilo as boot manager. Now that everything is broken, I tried to use debian rescue mode, without success. I removed lilo and installed grub2, still nothing works. So I decided to install a new minimal debian system in the old swap partition (`/dev/hdb1`, now `/dev/sdb1`) and, from there, I tried to rescue the system. Still nothing: I can't install a working kernel (this time a precompiled one) in the old partitions. I tried to rebuild my old raid array, mount my boot partition, chroot-ed ant apt-get installed a new kernel: grub is not able to see nothing. I don't know what else I could try...


Schedule job at irregular intervals

It's simple enough to use `cron` to schedule a job to occur periodically. I'd like to have something occur less regularly -- say, run the job, then wait 2 to 12 hours before trying again. (Any reasonable type of randomness would work here.) Is there a good way to do this?


Check if content of file has length X and contains only specific characters

Let's say, I have files that contain only one docker id: `myid.id`:               28fe2baadbe8da32ed0b99c69b11c01b2d141bc5b732b81e0960086de52fc891      I want to check if the content of `my.id` is exactly `64` characters long and contains only characters in the range [0-9] and [a-z] (maybe [a-f]).   * How can I do that?   * If the file contains a newline `0x0a`, how can I include/exclude it in this check?


How to install wine via brew?

I am trying to install wine via homebrew on Mac OS Mountain Lion 10.8.4.               $ brew install wine     Error: wine dependency jpeg not installed with:       --universal      How do I resolve this?