Booting grub-2.00 with 2 initrds, crashes with RAMDISK: incomplete write

So, I'm trying to split my initrd into two initrd's. There's some pretty significant scripts that run in the initrd, and we wanted to split the initrd so we could rev the just the logic or just the kernel portion. As a single initrd, it boots fine. But, when I split it into two, I get an error:               RAMDISK: incomplete write (-28 != 8388608)      The grub menu entry's initrd looks like:               initrd /initramfs-scripts.img /initramfs-kernel.img      I can't find any documentation on using two initrd's. All I have found so far are this: stackexchange question, and this: grub bug. But, it doesn't give me an idea about what I'm doing wrong.


"[sdc] Assuming drive cache: write through" Need to hide this message!

When you plug an external drive into my Ubuntu server this message pops up "[sdc] Assuming drive cache: write through"... I would really like it so it stops sending it to the screen. Any ideas on how I can shut it up? :)


Move files and delete directories with rsync?

Recently I needed to delete a large number of files (over 1 million) and I read that doing:               rsync -av --delete `mktemp -d`/ ~/source && rmdir ~/source      Was one of the most optimized ways to do that, and I can vouch that it's faster than `rm -rf`. I'm not an expert on the matter, but from my understanding the reason for rsync performance has something to do the way it lists files (LIFO instead of FIFO I suppose). Now, the problem is, I also need to to move a large number of files in a efficient way. After searching a bit, I found this:               rsync -av --ignore-existing --remove-source-files ~/source ~/destination      While this deletes all the moved **files** in `~/source`, the directories remain there. Since I have a "round-robin"-like directory structure the number of `files/directories` is very close to 1, so I am forced to run the first command again to get rid of the directory entirely:               rsync -av --ignore-existing --remove-source-files ~/source ~/destination && \     rsync -av --delete `mktemp -d`/ ~/source && rmdir ~/source      A straight `mv` would finish virtually instantly, but my `~/destination` directory has files that should be kept, so `mv` is not an option. I found the `\--prune-empty-dirs` and `\--force` rsync options, but neither seem to work as I would expect:               --force                 force deletion of directories even if not empty     --prune-empty-dirs      prune empty directory chains from the file-list     --remove-source-files   sender removes synchronized files (non-dirs)      Is there a way to mimic a _move_ with rsync in one go?


Get list of installed printers

Inside of a script I send a certain file to print using the `lpr` command on an user-selected printer. The list of the printers, from which the user selects the one to use, I get using the `lpstat -a` command and then considering everything before the first space as the name of the printer. This works but relies heavily on the specific output format of the `lpstat -a` command. I'm afraid that in the future (or now on different distributions) if the output format changes it will break the script. So, is there a way to get the names of all the installed printers in a way that is safer than the one I'm using?


Print files with file size less than 100 bytes

Basically this script is just supposed to print out the file size and the name of all files in a directory that are under 100 bytes. This script I wrote works perfectly on my Ubuntu, but wont work on my mac os lion. Can anyone tell me why?               #!/bin/bash          for i in $(ls)     do       if [[ $(wc -c $i | cut -d" " -f1) -le 100 ]]; then         echo $(wc -c $i)       fi     done


Does Windows recognize Linux's symbolic links?

I was just wondering how a Windows system handles symbolic links. My best guess is that it will not recognize them, but I'm not entirely sure. Also, what do Macs do when confronted by one?


man path and 'man foo' vs. 'man -k foo'

I have a set of man pages in a non-standard location; however, the location is on my MANPATH (and I verified this with `man --path`). When I do               man fst-infl      (where fst-infl has a man page in this non-standard location), it works: it brings up the man page for fst-infl. But when I do               man -k fst-infl      I get               fst-infl: nothing appropriate      Same for `man -f` or `/usr/bin/apropos`. All of these work fine for programs that are on the default MANPATH, e.g. `man -k fstab-decode`. Why doesn't `man -k` look in the same place that plain `man` does? More specifically, why doesn't it use MANPATH?


Restore default completion

I use `compgen` when `$COMP_WORD` equals 1, now I want to restore default completion when otherwise, Right now I have,               _rr()     {         case $COMP_CWORD in             1)                 COMPREPLY=($(compgen -W "A B" "${COMP_WORDS[$COMP_CWORD]}"))                 ;;         esac     }          complete -F _rr rr      Now when `$COMP_CWORD` is not 1, I got no completion for files / directories, that's the default completion I needed. Also I need to enable completion only when `${COMP_WORDS[$COMP_CWORD - 1]}` is `A` in this minimal case.


Delete the matching line and several more from a file

I have a text file called file_a.txt. My first command is               grep -A 12 ".production =" file_a.txt      The output is a few block. Each block of string contains 13 rows I specifically want to delete all the block of strings I got with the `grep` command from the original file file_a.txt. I do not want to send the grep output to a new file. Also I do not want to to use `grep -v` because it will not work in my case. I have tried something like things like this, but nothing is working:               cut < grep -A 12 ".production =" file_a.txt          sed -i '/`grep -A 12 ".production ="`/d' file_a.txt


auto create groups directories on user logging in

Below is my real and effective UIDs and GIDs. My task is to implement a bash script (Ubuntu 10.10 desktop) which should auto create 3 directories `rtkit`, `admin`, `pr007drdl` (group names) in `/home directory`. Once I have the bash script, I will create an init start/stop script, so should create directories when user logs in. I am totally new to bash scripting. Please help. Thanks in advance. I have no idea where gids' and uids' stored.               uid=10002(sandy)      gid=119(rtkit) groups=119(rtkit),10001(admin),10003(pr007drdl)


Unable to follow steps for building application in Linux Os?

I was using these steps to build an application from Csipsimple but the problem is, they have mentioned it's for Linux and I tried, as a first step:               subversion git quilt unzip wget swig2.0 python make      I get a `command not found` error. First thing is, that I'm using fedora 13. I searched for the swig, python, quilt, subversion packages in package management system in fedora already but I didn't get to install it. Can anyone help me, solving this error?


Booting Ubuntu from usb on a Mac

I have a Macbook pro (late 2009) running OSX 10.6.8. I want to partition a flash drive and install my Ubuntu iso image onto it. Then I want to boot up from it by (restarting my computer and) holding down the option key. How could I:   1. Install Ubuntu on the flash drive?   2. Get OSX to see the drive when booting up? P.S. I tried following This link but it is for Mountain Lion, not Snow Leopard (which is what I have)


Where does the "export" command come from?

Why doesn't the `whereis` command give any information about the `export` command? How does the `export` command work even if the shell path variable is set to null?


How to check the Passive and Active FTP

How do I check which FTP (Passive or Active) is running? By default, passive FTP is running in linux, but how do I check?


Installing Chrome on Linux without needing to be root

How can I install Chrome on Linux without needing to log in as root? Note that I want to use Chrome, not Chromium. If I go to the official download page, I get the choice between:               Please select your download package:     32 bit .deb (For Debian/Ubuntu)     64 bit .deb (For Debian/Ubuntu)     32 bit .rpm (For Fedora/openSUSE)     64 bit .rpm (For Fedora/openSUSE)       Can I somehow extract and install Chrome from the .deb or the .rpm without needing to be root? Or is there another link that I missed?


Where does GSettings store its files?

I would like to have a look at the files the dconf-editor uses to read/write settings, and I'm assuming that they are managed by gsettings. Where are these files stored on the system, and in what format?


How to view and change kernel memory size?

How can i view the kernel's share of memory on a machine? How can I increase it? What should I consider before doing it?


Accessing Windows7_OS partition from Linux on a dual-boot

Are there any limitations on accessing the Windows7_OS partition while I am booted on my Linux OS? Occasionally I like to browse files that are on my Windows partition or copy files to my Linux drive without having to reboot. This appears safe, but is there any risk with doing such operations? Sometimes I get Ubuntu internal errors, and I don't know if this may contribute to the cause. I am running Ubuntu 13.10 (Saucy Salamander) on a W520 ThinkPad 7200 RPM 500 GB HDD. I have a typical partition pattern: `SYSTEM_DRV` | `WINDOWS7_OS` | `UBUNTU_13.10` | `SWAP SPACE (7-8 GB)` | `LENOVO RECOVERY`


Bash command to delete a certain file in * folders

The situation isn't really as simple as the title may imply. I have a `.desktop` file that execs with `bash -c` to set an environment variable then load the program. Now I need to add another command before it goes to loading the program. Sometimes the program creates file called `SOFT_REPAIR` in `~/path to/*/`, and I need to delete it before running the program. `*` represents whatever version the program maybe, and as `/path to/` implies, there's spaces in the folder names within which the `SOFT_REPAIR` resides. So here's the thing:   * Do I need to do `/path\ to/`?   * Will `rm 'path to/*/SOFT_REPAIR/'` work?   * Can I just use the `rm` command whether `SOFT_REPAIR` exists or not, or do I need to use the `if` statement?


Preventing Nix from upgrading git to git-full

I'm using Nix on Ubuntu to have more modern versions of some packages, one of them being git. When I'm run `nix-env -u`, this is what happens:               % nix-env -u --dry-run '*'     (dry run; not doing anything)     upgrading `git-1.8.5.4' to `git-1.9.0-full'      This is not what I want - I prefer the plain version `git-1.9.0` over the `-full` version. I know I can manually upgrade to the plain version with `nix- env -i git-1.9.0`, but is there a way to make `nix-env -u` to do what I want?


targeted network speed over LAN

I have a Solaris 11 system which has several NFS exports which are accessed my other systems within my LAN. I use a Linux system as a client for testing. I wrote a quick script to test read speed and I average at around 110Mbps (or 13MB/s) on a Gigabit LAN. And I would have think it could get much faster. SSH (scp) only gives me 3.8MB/s but that's with encryption. http gives me 11.5M/s, similar to NFS than. ain't this low? what could be the bottleneck from these numbers?


Difference between authpriv and auth?

What's the difference between authpriv and auth in syslog configuration? It wasn't mentioned in syslog.conf, only tells me that such facility exists.


Setting the bash SHELL for remote openSSH connections?

I am connected to a Freebsd 10 `-STABLE` server with `SSH` from my office box but when I trying to work inside the session I encounter these problems:   * although I did `chsh` for every user in said server to `/usr/local/bin/bash`; whenever I ssh to server I get:   `sh (the default Bourne shell in FreeBSD) supports command-line editing. Just ``set -o emacs'' or ``set -o vi'' to enable it.`   * in my ssh session I can't go to end of a line by `End` key or beginning of a line by `Home` key. instead I get `~` character. all and all the environment I feel in the `SSH session` is primitive and hard to navigate. the `echo $SHELL` returns `/usr/local/bin/bash`. the `ps -ef|grep $$` returns:   `2010 0 S 0:00.03 TERM=xterm PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/s` and `echo $0` returns `su`


Outgoing firewall application similar to Little Snitch for Mac

Is there a Linux application similar to Little Snitch? Little Snitch is an outgoing firewall that temporarily blocks outgoing network requests until the user decides whether to allow the connection or not. The most powerful feature of Little Snitch is that it is able to tell what host name each application wants to talk to and make permanent or temporary blocking rules based on host name or application. All of this in a really easy and convenient UI.


netstat — why are IPv4 daemons listening to ports listed only in -A inet6?

I have a computer with:               Linux superhost 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux      It runs Apache on port 80 on all interfaces, and it does not show up in `netstat -planA inet`, however it unexpectedly can be found in `netstat -planA inet6`:               Active Internet connections (servers and established)     Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     tcp6       0      0 :::5672                 :::*                    LISTEN      2402/beam.smp        tcp6       0      0 :::111                  :::*                    LISTEN      1825/rpcbind         tcp6       0      0 :::9200                 :::*                    LISTEN      2235/java            tcp6       0      0 :::80                   :::*                    LISTEN      2533/apache2         tcp6       0      0 :::34611                :::*                    LISTEN      1856/rpc.statd       tcp6       0      0 :::9300                 :::*                    LISTEN      2235/java            ...     tcp6       0      0 10.0.176.93:80          10.0.76.98:53704        TIME_WAIT   -                    tcp6       0      0 10.0.176.93:80          10.0.76.98:53700        TIME_WAIT   -                     I can reach it by TCP4 just fine, as seen above. However, even these connections are listed under `tcp6`. Why?


Impossible pmap results

Nautilus is taking up 450 MiB according to System Monitor (Ubuntu 10.04).               $pmap <PID of Nautilus>     ...     total          1578276K      Is `pmap` reporting 1.5 GiB of memory here? I'm trying to find out what's taking up the 450 MiB so I can deduce what I'm doing wrong, or where the problem lies.


Run a cron job every minute, meaning of syntax

I read somewhere that you can add a cron job to run every minute like this:               #min hour day month weekday command     */1   *    *    *    *     <your command>      What does the `/1` part mean? Can I omit it?


How to check why sound over HDMI doesn't work

I installed Gentoo clean on my system, except my /home but I deleted all hidden folders that might have an impact on sound (.mplayer .pulse* .config .esd_auth and more) and with a fresh user `adduser mistertest -m -G audio,video,users` the result is the same, no sound when I play a file in mplayer. Its a Z68 Chipset and I am using the Intel IGP H2000 inside my CPU, so this should not be an issue of the spdif connector on my mainboard and I think i have installed all the correct modules in the kernel. I have no aditional hardware to check if my sound is working at all (no headset or external speakers), but I suppose the problem is either some bad config or the internal spdif (if there is such).               dronemother ~ # lsmod | grep snd     snd_hda_codec_hdmi     22705  1     snd_hda_codec_realtek   190506  1     snd_hda_intel          21727  3     snd_hda_codec          63422  3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel     snd_hwdep               5726  1 snd_hda_codec     snd_pcm                69969  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec     snd_timer              17697  1 snd_pcm     snd                    53814  13 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_    timer     soundcore               5009  1 snd     snd_page_alloc          6641  2 snd_hda_intel,snd_pcm          dronemother ~ # lspci -v     # cut other stuff away here         00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)             Subsystem: ASRock Incorporation Device 1892             Flags: bus master, fast devsel, latency 0, IRQ 46             Memory at fe600000 (64-bit, non-prefetchable) [size=16K]             Capabilities: [50] Power Management version 2             Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+             Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00             Capabilities: [100] Virtual Channel             Capabilities: [130] Root Complex Link             Kernel driver in use: snd_hda_intel             Kernel modules: snd-hda-intel      I have pulseaudio, alsa-plugins, mplayer, mixer and pavucontrol installed. I get no errors when playing a file in mplayer just no sound. So how can I examine where exactly my problem is located? Edit: I just booted the PC from a Ubuntu Live USB stick, sound did not work, too. (took a bit longer, cannot restart the server every day, some people rely on its services.)


ZIP password finders for Linux?

I'm trying to extract ZIP files for an encrypted archive I've forgotten the password for. So far I've found the tool `fcrackzip` which does what I want, but its own manpage states that it has numerous problems, for example: "It's still early alpha."   "Stop/resume facility is missing."   "Could be faster." Whilst I appreciate this honesty, it does rather make me hope that there are some better, more mature ZIP cracking utilities for Linux (GUI or commandline, I don't mind), out there. Does anyone have recommendations? I'd really value speed, and a stop/resume facility would be nice.


Linux Mint Settings Changed Automatically

The settings for my linux mint OS have somehow changed automatically. The wallpaper has changed to default background, the mouse and touchpad settings are different, and I can't see the 'Computer' icon on my desktop either. I've tried restarting a couple times and in some restarts I've seen this message:               fsck from util-linux 2.19.1     /dev/sda4: clean, 270358/1144640 files, 2372070/4574707 blocks (check in 3 mounts)     * Starting mDNS/DNS-SD daemon[74G[ OK ]     * Starting configure network device[74G[ OK ]     * Starting configure network device security[74G[ OK ]     * Starting load fallback graphics devices[74G[ OK ]     * Starting Userspace bootsplash[74G[ OK ]     * Stopping load fallback graphics devices[74G[ OK ]     * Stopping cold plug devices[74G[ OK ]     * Stopping log initial device creation[74G[ OK ]     * Starting configure network device security[74G[ OK ]     * Starting save udev log and update rules[74G[ OK ]     * Starting configure virtual network devices[74G[ OK ]     * Stopping save udev log and update rules[74G[ OK ]     * Stopping configure virtual network devices[74G[ OK ]     speech-dispatcher disabled; edit /etc/default/speech-dispatcher     Checking for running unattended-upgrades:     * Stopping Failsafe Boot Delay[74G[ OK ]     * Stopping System V initialisation compatibility[74G[ OK ]     * Starting System V runlevel compatibility[74G[ OK ]     * Starting LightDM Display Manager[74G[ OK ]     * Starting ACPI daemon[74G[ OK ]     * Starting anac(h)ronistic cron[74G[ OK ]     * Starting CPU interrupts balancing daemon[74G[ OK ]     * Starting regular background program processing daemon[74G[ OK ]     * Starting deferred execution scheduler[74G[ OK ]     * Stopping Userspace bootsplash[74G[ OK ]     * Starting save kernel messages[74G[ OK ]      What seems to be the problem here?


Why doesn't GoogleTalk plugin recognize my camera, even with v4l?

The thing is that I have GoogleTalk plugin, also used for Google+ hangouts, and it works in my netbook, on Ubuntu. But on my laptop, using the same Ubuntu (Oneric) and having used the camera on Cheese so it works, Google+ shows a black screen while trying to use webcam in hangouts. This is weird, I have installed libv4l-0 and forced GoogleTalkPlugin to preload it. Starting from a console, it shows:               [009:591] Got cookie response, socket is authorized     [009:591] AUTHORIZED; socket handshake complete     [014:536] HandleOnlineCheck: Starting check     [014:536] HandleOnlineCheck: OK; current state: 3     [031:321] Error(scriptinterface.cc:288): Passed a non-object for onmessasge_callback     Check failed: g_shutdown_pipe_write_fd != -1     [113:230] Warning(clientchannel.cc:678): Connection to GoogleTalkPlugin lost, reason=0     [113:367] Error(scriptinterface.cc:288): Passed a non-object for onmessasge_callback      I just don't know why I cannot get it to work. My netbook (hp-mini) works fine with an integrated camera.


How to set the command(s) that get run before every single prompt?

I used to know this but I forgot: I want to execute a command or a couple of commands before every single prompt. When I am in our PROD box, I want a big fat reminder above every prompt that says *** YOU ARE IN PROD *** and maybe another thing or two. Currently, I think that is how mail is checked but I can't remember how that configuration is set. Using ksh and Solaris 5.10 Any idea? Thanks


groff to PS Conversion

I am very new to **`UNIX`** , learning **`groff`** with the help of **`cygwin`** on **`Windows XP SP3`**. I have downloaded **`groff-binaries`** from **_here_**, but using **`cygwin`**, I could not able to re-produce **`ps`** files. I have used following command in **`cygwin`** :               $ groff grnexmpl.me > grnexmpl.ps      But, in generated `grnexmpl.ps` file, all special formatting are gone. When I look inside the `grnexmpl.ps.gz` archive(comes with the binaries) and the `grnexmpl.ps` looks beautiful. It would be a great help if somebody assist me to understand what is going here? Am I missing something?


su and redirection

The following line shows the principle of a construct which I can use under Red hat 5.5:               $ echo "foo" | ssh myhost "echo \"cat <&1\" | su --login"     foo      Actually it was never clear to me why cat can read from FD #1, but it works. Now with Red Hat 6.3 that doesn't work anymore:               $ echo "foo" | ssh myhost "echo \"cat <&1\" | su --login"     cat: -: Bad file descriptor      First question: Why does this not work anymore? Second question: Does anybody has an idea for a solution that works under Red Hat 6.3? All ideas are appreciated. Armin


How do I ensure outbound TCP/IP traffic always uses a VPN, even when using Wifi?

I'd like to ensure that my VPN is started and running, before any TCP traffic from any of my background services send or receive data. How can I guarantee that this is the case? How do I handle the special case where I connect to a Wifi access point (in Starbucks) that requires me to press "I Agree" prior to continuing my session?


Countdown timer in panel

Is there some widget that I can put in the panel of my Xubuntu system that will show me a countdown of time? I've tried `pystopwatch`, but although it minimizes, it doesn't show me how long I have left. I've also tried xfce `timer-plugin`, but it doesn't really minimize. I just need something that will show how much time left I have for a certain task, as inconspicuously as possible. I'm running Xubuntu 12.04.


Counting files in leaves of directory tree

I came up with the following snippet for counting files in each subdirectory:               for x (**/*(/)); do print $x; find $x -maxdepth 1 -type f | wc -l; done      The command outputs consecutive pairs (one below the other) as follows:               directory_name     # of files      I would like to change the code above to:   * Print each match on the same line (i.e. `directory_name ':' # of files`)   * Only count files if the folders are leaves in the directory tree (i.e. they don't have any subfolders).  How can I do that?


rename a batch of files after reading from a source file

I have a directory full of over a thousand files and the names are bit long (and no pattern found in the naming style). I would like to simplify the filenames. E.g.:               Bioimage_23335989_Data_22317866_22317867_20140723_1002.pdb     Bioimage_22335990_Data_22318490_22318491_20140723_1009.pdb     Bioimage_23835970_Data_22317866_22317867_20140723_1005.pdb      .....and so on ! I have made a simple text file (`filelist.txt`) which reads like this:               1.pdb   Bioimage_23335989_Data_22317866_22317867_20140723_1002.pdb     2.pdb   Bioimage_22335990_Data_22318490_22318491_20140723_1009.pdb     3.pdb   Bioimage_23835970_Data_22317866_22317867_20140723_1005.pdb      .....and so on ! Can anybody provide me with a script (`awk`, `sed`, etc) which would read the source file and rename the files accordingly? I could get similar scripts else where but nothing seems to work for me.


How to escape text in awful.util.spawn_with_shell command?

Based on a suggestion, I've now got the following call in rc.lua:               awful.util.spawn_with_shell('vlc $(xclip -o)')      How do I ensure that the output of `xclip` is escaped so that _space characters_ are not taken as parameter separators? For example, if I select the string "foo bar" (without the quotes) and press `Mod4`+`v` VLC complains about being unable to open _both_ "foo" _and_ "bar". To illustrate, in a shell context I would validate the issue as follows:               $ params() {         for param         do             echo "$param"         done     }     $ params $(xclip -o)     params     $(xclip     -o)      And fix it like this:               $ params "$(xclip -o)"     params "$(xclip -o)"      However, if I change the Lua call to this, it does nothing:               awful.util.spawn_with_shell('vlc "$(xclip -o)"')


Execute root command after a user starts their session

I'm trying to find how is possible to execute a root command when a user starts their session. I found that adding commands to thes file `/etc/rc.local` should execute the commands after the boot, but my command is not being executed, or maybe the system is not ready yet to execute it. (the command works well) Maybe an example could clarify what I'm trying to do. In almost all desktop managers there is an option at settings called "Session and Start-up", in the section "Application AutoStart" it is possible to add commands that will be executed once you're logged-in. I want to do that but with a command that needs to be executed as root!


How do I repeat the last command without using the arrow keys?

I know I can use `Up` to iterate through previous commands. Running the _last_ command simply involves `Up` + `Enter`. However, I was thinking of buying the Happy Hacking Keyboard as I spend a lot of time in `vim`. This keyboard has no arrow keys, and the only way I know how to get this kind of behaviour is by pressing `Ctrl` + `R` and beginning to repeat my previous command. Is there an easy way to emulate `Up` + `Enter` in an UNIX terminal without the arrow keys?


Distinguish between Desktop session and desktop environment

I heard/observed following words and want to distinguish information.   * Desktop Environment   * Desktop Session   * GDM Session   * Shell   * Window Manager So **I can understand exact difference and working relation between them.**


In Emacs' org-mode, any way to hide the subtree with timestamp not set to today?

I just started to learn org-mode (and _Emacs_ ) and I plan to use it as a _calendar/timetable/todo-list_ hybrid. Is it possible to hide entries with timestamp not set to today? If so, how? For example, say if today is 2014-09-18:               * Lunch          * TODO Call boss       <2014-09-18 Thu 13:30pm>             ** Report :: Nothing happened          * TODO Call Bob                             ; This entry will not be shown       <2014-09-19 Fri 13:30pm>                  ; This entry will not be shown                                                 ; This entry will not be shown        ** Discuss :: Project Alice              ; This entry will not be shown        ** Discuss :: Upgrading to CentOS 5      ; This entry will not be shown          * TODO Fetch Claire from school      Incidentally, are there any more efficient way to deal with calendar/timetable/todo-lists in org-mode?


Puppet Master not serving out/reading manifests

I have a really strange issue with my Puppet Master. I can't seem to get it to serve my manifests properly. I have installed manifests in two locations:   * `/etc/puppet/manifests/kungfumaster.mydomain.com.pp`   * `/etc/puppet/environments/production/kungfumaster.mydomain.com.pp` Both of which contain something similar to this:               node "kungfumaster.mydomain.com" {          notify { "found the one in environments!": }     }      Neither of them run when I connect with my agent. The only one which is actually read appears to be `/etc/puppet/manifests/site.pp`, which does, in fact, run:               Notice: /Stage[main]/Main/Node[default]/Notify[thungs]/message: defined 'message' as 'thungs'      This node is defined like this:               node default {          notify { 'thungs': }     }      No matter how I've tried, I haven't been able to get these manifests to work properly, even when specifying a `node default` in the aforementioned files. I'm seeing some strange logs emitted from my Puppet Master, but I'm not quite clear as to what they mean or how to solve the problem mentioned in them:               Jul 31 01:50:28 kungfumaster puppet-master[443]: Could not retrieve fact fqdn     Jul 31 01:50:28 kungfumaster puppet-master[443]: Could not retrieve fact ipaddress     Jul 31 01:50:28 kungfumaster puppet-master[443]: TrustedInformation expected a certificate, but none was given.      Configuration files:   * /etc/puppet/puppet.conf   * /usr/share/puppet/rack/puppetmaster/config.ru (config file for running the Puppet Master rails app)   * /etc/nginx/nginx.conf   * /etc/nginx/sites-enabled/puppetmaster Log files:   * /var/log/syslog   * Output of `puppet apply --onetime --no-daemonize --debug --verbose`: here   * Output of `puppet apply --onetime --no-daemonize --debug --verbose --environment production`: here The Puppet Agent and Puppet Master are both on the exact same host. The strange message about expecting a certificate is generated here: https://j.mp/1zxG08Q


Distributing Updates to VirtualBox Images with (Bandwith) Efficency

I'm currently responsible for a lab of machines that all need to run the same virtual machines. I want to automate my current setup of distributing VirtualBox virtual machines via rsync (erasing any local changes and replacing the disks/snapshots that make up the virtual machine). I'm thinking of doing something along the lines of making a snapshot for each change, copying the snapshot to the user's machine, and deleting the snapshot on the target ("flattening" it back to the starting disk). This allows me to patch each Virtual Machine with a minimum amount of bandwidth requirements. The current environment consists of Fedora hosts, where rsync is used to copy the new disk images. The new solution needs to work on Linux/Windows/Mac as we are moving to a "bring your own device" environment. Are there any already existing scripts/projects that address this issue? What should I be aware of before I start developing my own system to handle update management?


Using regex in for loop

I'm looking to loop through a directory of files and match them with regex, then subsitute the appropriate character:               #somefile.txt     %somefile.txt     >somefile.txt          # arr=(\% \> \#) ;for f in *; do echo -- "$f" "${f//${arr[@]}/}"; done      should echo:               #somefile.txt -- somefile.txt     %somefile.txt -- somefile.txt     >somefile.txt -- somefile.txt      instead i get:               #somefile.txt -- #somefile.txt     %somefile.txt -- %somefile.txt     >somefile.txt -- >somefile.txt      which results in no change, nada, zilch. the array works if i use `arr(\%)` with a single character, which defeats the whole purpose.               #somefile.txt -- #somefile.txt     %somefile.txt -- somefile.txt     >somefile.txt -- >somefile.txt


Switching to edit mode in VIM rc?

Still related to the previous question, but switching mode with `exe "a"` doesn't seem to work, I still have to press the `a` button manually Here upon opening a newly created a file, a template is in use and the cursor will be moved to the right position, then erase the tag, and switch to the `appending (editing)` mode.               function LoadFile()       0r ~/.vim/skel/tmpl.%:e       exe "normal /<CURSOR>\<Cr>"       exe "s#<CURSOR>##"       exe "a"     endf          autocmd! BufNewFile * silent! call LoadFile()      Any ideas?


Change font in vesa menu for pxelinux

I am trying to change the font of the menu in my syslinux/pxelinux configuration. According to the documentation this is all it takes:               FONT myfont.psf      where in my case `myfont.psf` has been decompressed from `/usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz` on my Debian system. However, the font does not load in the menu. Are there any restrictions on the font that can be used that is not mentioned in the documentation?


Emacs - Changing show-paren-mode Areas

I like show-paren-mode in Emacs, but I would really like to change the highlighting behavior for closing brackets. That is, I want the opening bracket to be highlighted when the point is on the closing bracket. The default behavior highlights the opening bracket when the point is on the character following the closing bracket. Is this easy to change? Also, I would be interested in potential benefits of keeping the show-paren-mode behavior as it is.


How to add a new line for a missing entry between two fields

I have this file. As you can see in column1, entries TEST01N03, TEST01N06, and TEST01N18 are missing (total of 18 entries). Is there a way to check the fields of this column and fill in the missing entries ?               TEST01N01 40   2002    2697    2523       TEST01N02 40   4       4       5         TEST01N04 40   4       4       5       TEST01N05 40   4       4       5       TEST01N07 40   4       4       5       TEST01N08 40   1       4       5       TEST01N09 40   4       4       5       TEST01N10 40   4       4       5       TEST01N11 40   2002    2621    2617       TEST01N13 40   1       4       5       TEST01N14 40   1       4       5         TEST01N15 40   1       4       5       TEST01N16 40   1       4       5       TEST01N17 40   2002    2576    2515      The output should look like this:               TEST01N01 40   2002    2697    2523       TEST01N02 40   4       4       5         TEST01N03 empty       TEST01N04 40   4       4       5       TEST01N05 40   4       4       5       TEST01N06 empty       TEST01N07 40   4       4       5       TEST01N08 40   1       4       5       TEST01N09 40   4       4       5       TEST01N10 40   4       4       5       TEST01N11 40   2002    2621    2617       TEST01N12 empty       TEST01N13 40   1       4       5       TEST01N14 40   1       4       5         TEST01N15 40   1       4       5       TEST01N16 40   1       4       5       TEST01N17 40   2002    2576    2515       TEST01N18 empty        Really appreciated for any suggestion of a script to accomplish this.


How do I run a command on each input given a list of input

I have a bunch of folders, and I want to cd into each folder and run a command. I feel like it should be something like this: (The following is a contrived and simplified example of what I want to do).               ls | xargs echo 'Looking at {}' && cd {} && /bin/do_stuff      But that does not work. How do I do this?


svn: add all my new files and directories

I'm using Solaris 10. I need to add to SVN everything I've placed in the sub directories of my SVN checkout. I have added files and directories and sub directories - is there a command to take care of everything at once? If not, is there a command I can run to list all the items I have added that have not been added to SVN yet?


Get full path from within Bash script

I have a bash script that works with relative paths. It needs to have a working directory that is equal to the directory the script is stored in. This works fine as long as I start it from the prompt, because I can cd to the script's directory first. However, when I create a symlink to the script in /etc/cron.hourly, the script breaks. I need a way to make the bash script change directory to the directory the script is stored in. However, so far I am unsuccessful. Is there an easy way to do this, even if the script is called from cron via a symlink?


getent hosts prints IPv4, getent ahosts prints IPv6

Verbatim output from my terminal:               $ getent hosts example.org     2001:500:88:200::10 example.org     $ getent ahosts example.org     192.0.43.10     STREAM 43-10.any.icann.org     192.0.43.10     DGRAM       192.0.43.10     RAW          I thought they were both (at the very least ahosts) supposed to print both IPv4 and IPv6 addresses. Why are these printing different address types?               $ uname -srvmpio     Linux 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:17:36 UTC 2012 i686 i686 i386 GNU/Linux      **Edit** : Looks like it might be related to this bug report.


OpenSUSE - Apple Wireless Keyboard - Switch "fn" and "ctrl" key?

I'm trying to configure the Apple Keyboard so that the "fn" key and the "ctrl" key are swapped. So far I swapped the "cmd" and "alt" key, the "°" and "<" key using xmodmap. Information for that can be found comparatively easy. Unfortunately xev does not give any output for the fn key, for all the other's it does. Does anybody have a solution for that, without me having to recompile my own kernel (this is a machine from work so I can't change the system, though I can do whatever I want in the user space). The solution with recompiling the kernel can be found here: Linux: Apple Wireless A1314 Fn key not registered, looks like software bug My kernel is the 2.6.37.6-0.20-desktop kernel from the OpenSUSE repository, under a OpenSUSE 11.04 32bit. Update: I found out here, that the fn-key has the keycode 464 (showkeys detects it). Unfortunately this is bigger than 255 which means it can appearently not be mapped with xmodmap.


/etc/php.ini not being read on fastcgi?

On my DV from MediaTemple running Centos 5.8 I installed APC. I then added `extension = "apc.so"` to `/etc/php.ini` so APC will be enabled for all existing and future sites on the server. When I checked `php.info` still no APC showing up. I removed the line and added it to `/var/www/vhosts/example.com/etc/php.ini` and then checked phpinfo which was running in example.com and APC showed up. However, I don't of course want to have to add this each time to every domain. Is there a reason why /etc/php.ini isn't picking it up? I restart httpd, do I need to restart it more? Or if for some reason with FastCGI it has to be in each domain php.ini is there a way to get it added to that template? Also the server uses the default plesk 11.


Graphical logviewer that auto reload when file changes?

I'm wondering if there's a graphical viewer, also it needs to support auto- reloading when log file has changed. ksystemlog doesn't reload automatically.


My Ubuntu doesn't hibernate

My Ubuntu 13.10 installation does not hibernate, no matter what I do. Although I have Tuxonice and enough swap space to cover the real RAM, it still doesn't work. Is the problem specific to Ubuntu or to the machine? If it's the former, I'd try to install a different Linux dist, otherwise I'd give up. **Update:** VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18) (prog-if 00 [VGA controller]) I have 50% of free RAM. There is no problem suspending the machine. I have tried all the tips on https://www.kernel.org/doc/Documentation/power/basic-pm-debugging.txt.


Get filesystem name and usage with `df -h`

df -h | grep test | sed -e 's/*%.^ //g;s/.*[ ^I]//'      Output:               /test     /test/drv0     /test/drv1                df -h  | grep test  | cut -d '%' -f1 | sed -e 's/*%.^ //g;s/.*[ ^I]//'      Output:               10     20     15 I want to know how can I join those outputs like this:               /test 10     /test/drv0 20     /test/drv1 15 Can someone help me?


How does Debian make use of lots of CPU cores?

I just got an account on a 24 core VPS (according to UnixBench there are 24 CPUs).   1. In general terms, how can I make good use of all these cores for general purpose shell computing in Debian?   2. Do I need to type something special when I issue long-running apps from the shell in order to make each process run on a separate core if one is available? Or does Debian just handle all of that, invisible to me?


Syncing multiple home folders with dropbox and symlinks

To keep multiple computers synced with dropbox I tried the following. Approach A. -Computer 1: Install dropbox, dropbox folder: /Dropbox/   -Computer 1: Create symbolic link in that folder to home folder                   $ln -s /home/ /Dropbox/      -Computer 2: Install dropbox, dropbox folder: /Dropbox/ (got populated with files from computer 1   -Computer 2: Try to overwrite the files with symbolic links to identical local files               $ln -sfn /home/ /Dropbox/       ln: `/Dropbox/home': cannot overwrite directory      So that approach fails, does anyone have a suggestion to fix the error? Or another approach? The approaches I have come up so far: Approach B. I could write a script to recursively symlink all the files but I would rather not go that direction since then I would have to run that script in order to pickup on new files. Approach C. Use rsync to sync between the home and dropbox folder. I would not like that since then it is not automatically updated, you would have to call rsync to do that. And putting rsync in a cronjob that runs each minute seems not like a ideal solution. Can someone help me with fixing approach A or coming up with approach D or convincing me of approach B or C ?


changing pattern by removing spaces?

file :               hi hello,new york,      ,  ,brazil site   ,brazil     january,month is feb   ,      , ,indiana jones      task:   * delete all horizontal space (spaces and tab) between any two comas (like , ,) if there is no character other than space. so it would look like :              hi hello,new york,,,brazil site   ,brazil     january,month is feb   ,,,indiana jones        * also, delete any trailing or leading horizontal space (space and tab) for each parameter so that it looks like this. final output:              hi hello,new york,,,brazil site,brazil     january,month is feb,,,indiana jones      NOTE: The parameters itself has spaces like `hi hello` and `indiana jones` etc. It should not be affected and become like `hihello` or `indianajones`. If possible a solution with awk, otherwise sed will also do. I am unable to achive the first task with sed like this:               sed -n 's/,[[:blank:]],/,,/gp' file      but i get this as output:               january,month is feb   ,      ,,indiana jones


IP_TRANSPARENT missing from glibc headers

I'm trying to use the `IP_TRANSPARENT` declaration. I am using debian 6.0.5. IP_TRANSPARENT is only defined in `linux/in.h` however it conflicts with `netinet/in.h`. In centos for example, `IP_TRANSPARENT` is defined in both `linux/in.h` and `bits/in.h`. When I look at the top of `bits/in.h` (which I get when I include `netinet/in.h`, the centos one has               /* Copyright (C) ... 2008, 2010 Free Software Foundation, Inc.      Whereas one in my debian install has               /* Copyright (C) ... 2004, 2008 Free Software Foundation, Inc.      I've tried               apt-get install linux-headers-2.6.32-5-686      But it says it is already the newest version. How do I update the debian linux headers to the latest versions? **Edit:** In centos, `IP_TRANSPARENT` is defined in `bits/in.h`, which I get if I include `netinet/in.h`. It compiles fine under centos. In debian, `IP_TRANSPARENT` is not in `bits/in.h`, so when I include `netinet/in.h` I get a `‘IP_TRANSPARENT’ undeclared` error when compiling.


Removal of lines with more than 'N' fields?

_I am working on mac with sed, perl, awk, bash.._ I have a large-ish (10GB) text file which has 13 fields (columns) of `TAB` delimited data. Unfortunately some of these lines have extraneous `TABs` , so I want to **delete the entire line where we have extra** `TABs` , and thus unequal fields. (I don't mind discarding the lines in their entirety) What I currently have writes the number of fields into another file.               awk -F'\t' '{print NF}' infile  > fieldCount          head fieldCount     13     13     10     13     13     13     14     13     13     13      I would like to construct a short script that removes any line with more (or less) than 13 proper fields (from the original file).   1. speed is helpful as I have to do this on multiple files   2. doing it in one sweep would be cool   3. I currently am porting the fieldCount file into Python, trying to load with line by line. EDIT: vaild (13 columns)               a       b       c       d       e       f       g       h       i       j       k       l       m      invalid (14 columns)               a       b       c       d       e       f       g       h       i       j       k       l       m       n


Enable previous command cycling at ftp prompt

Currently on pressing arrow keys or `Ctrl`+`P`/`N`, I see characters like               ftp> ^[[A     ftp> ^[[B     ftp> ^P     ftp> ^N      I would like to know, how to configure the ftp prompt so that I am able to view the previous commands just like we do on other shells (e.g. `Ctrl`+`P`/`N` in bash or arrow keys)


Tokenize string from $REPLY in bash script

This is my first post, and I have no idea how I managed anything before StackExchage, Google, Wiki, GNU, Internet, the list goes on :) I am trying to find a way to construct a SQL database generator bash script, which currently looks like this...               renice -n 19 $$;          idx=32768;     dbt='Radix_en';          cat Domains_en.txt;     cat Tables_en.txt;          while read;      do     checks="$(echo -n $REPLY | md5sum)";     checks=${checks%"  -"};          echo "insert into $dbt values ($idx,'$(uuidgen)','${checks}',$REPLY);";     idx=$((idx+1));          done < Data.txt;     echo "commit;";      The data comes from Data.txt, currently in the form of:               'NUMBER','US_EN','LATIN','GREEK','GERMAN'     0,'zero','nulla','μηδέν','Null'     1,'one','Unum','ένα','ein'      The output is valid SQL (for Firebird):               create domain ...;     create domain ...;     commit;          create table ( ... );     create table ( ... );     commit;          insert into Radix_en values (32768,'dff0207a-591f-4435-9f8b-7b9b3e6ba2c1','d1f77359b3f7236806489ba3108c771f','NUMBER','US_EN','LATIN','GREEK','GERMAN');     insert into Radix_en values (32769,'5ef0e634-5c96-4ae4-92a8-0d68c02ffeb6','4e3f710600230cf0520bf32269511062',0,'zero','nulla','μηδέν','Null');     insert into Radix_en values (32770,'eae9cacc-3ee3-4471-afad-e5af201da435','9ab2f782988416431238ec63277b11df',1,'one','Unum','ένα','ein');     commit;      I would like to find a way to generate the MD5 checksum for every field, instead of the entire line of text including delimiters. Data.txt format is not yet finalized, and I may change its format to anything which would makes this possible or easier. Also, if there has to be several separate steps - fine, since the entire process should be scripted and automated. I was considering processing Data.txt first, then run it through this script, but I would like to simplify the process as much as possible. The number of different Data.txt files could be large, and I still have numerous other processors to include. As the matter of fact I am also trying to learn more about bash scripting, and I am rather hooping to find expert approach and advise to this problem more than a specific solution. I am not even sure if my post title is the solution I need, and thus it is related to my question. I was not sure if I should post this on Superuser where I usually visit or here. So I post here first, and sorry if I am off a bit. Thanks! Sandor ... Edited to add more on 08/23/2014 3:00 AM Thanks to mikeserv using IFS is working, so my scripts now looks like this:               renice -n 19 $$ > /dev/null; #for now          idx=32768;     dbt='Radix_en';          cat Domains_en.txt;     cat Tables_en.txt;          while read;      do          gid="$idx,'$(uuidgen)'";          IFS=,; set -f # no gobbling!     echo "insert into $dbt values ($gid";         for field in $REPLY         do           printf '%s' ",$field,'";         printf '%s' "$field" | md5sum;         done | cut -d\  -f1;               echo "$var);";          idx=$((idx+1));          done < Data.txt;      The output is great, the line breaks are making text edit/search much easier while Firebird is still happy, except one thing.. Here is the output:               create domain ...;     create domain ...;     commit;          create table ( ... );     create table ( ... );     commit;          insert into Radix_en values (32768,'303f8957-57cf-4485-ace4-d21c7cf144e6'     ,'NUMBER','722d79c16b51fe86610972b8d950038c     ,'US_EN','b63fb39e32b062c76694bec58c4f8c67     ,'LATIN','fd6f27a3c59111fc2a0b5e452595ef3d     ,'GREEK','c081310697bb6b7d7bed5034824e2530     ,'GERMAN','15db1d0e1b0861d8ac1f391db801493a     );     insert into Radix_en values (32769,'e7fdf095-d31c-4c59-a23b-7ea67db7aefb'     ,0,'cfcd208495d565ef66e7dff9f98764da     ,'zero','01b40535afbfd9611e910f58f4ab5146     ,'nulla','584edd0b6638798dee53e2c23e84e2d1     ,'μηδέν','cd3ed2f1039ed8668b4d48e742bd2e5b     ,'Null','e0a93a9e6b0eb1688837d8bab9b4badb     );     insert into Radix_en values (32770,'a21916b5-2a05-4656-ad4e-c8cfee1abfcc'     ,1,'c4ca4238a0b923820dcc509a6f75849b     ,'one','7e31533231a12e4a560a18ac8cd02112     ,'Unum','05d92bcbffbf59b375f25945e9af2dd0     ,'ένα','826f5e2d5ba7ace48f4d6fe3c5e2925f     ,'ein','dcc09a2cb665ca332d1689cb11aff592     );     commit;      The md5 hash is missing a delimiter at the end, and I have no idea how to negotiate the output with the pipes. What is it I am not understanding here? Since in this particular case the data fields are going to hold code for programmable ICs no extra characters are going to be acceptable in the checksum between the delimiters, and so far it looks like so. Again, the code is in ASCII and my delimiter is going be something that is not part of ASCII so it is safe. Firebird also going to reject anything not ASCII. If you would be so kind to point me to how to finish this script, as I am already banging my head against some new issues IFS just showed me (yes, file paths on Windows). I'll try and see how this script is going to work with pure ASCII, then I would like to move on and make another post about some more issues. Thanks again for your help! Sandor ... Edited to final on 08/30/2014 7:00 PM Replacing cut with sed seems to work. Firebird field input still needs to be escaped for semi-colons (') with another of the same added, and the current comma IFS delimiter in data files still has to be replaced with non-ASCII. Instead of recursive file lists this script is still a single-file input. echo should probably be replaced by printf, and a whole lot of more... Here is the final script excluding the shebang:               renice -n 19 $$ >> Radix_en_log.txt;          idx=32768; dbt='Radix_en';     cat Domains_en.txt; cat Tables_en.txt;          while read;     do     gid="$idx,'$(uuidgen)'";          IFS=,; set -f;     echo "insert into $dbt values ($gid";         for field in $REPLY         do               printf '%s' ",$field,'"; printf '%s' "$field" | md5sum;         done | sed "s/[ ][ ][-]/\'/g"; printf '%s\n' ");";         idx=$((idx+1));             done < Data.txt;     echo "commit;";      Here is the output:               create domain ...;     create domain ...;     commit;          create table ( ... );     create table ( ... );     commit;          insert into Radix_en values (32768,'2f675b86-b2b4-4e52-b000-e6a8cf0f3dca'     ,'NUMBER','722d79c16b51fe86610972b8d950038c'     ,'US_EN','b63fb39e32b062c76694bec58c4f8c67'     ,'LATIN','fd6f27a3c59111fc2a0b5e452595ef3d'     ,'GREEK','c081310697bb6b7d7bed5034824e2530'     ,'GERMAN','15db1d0e1b0861d8ac1f391db801493a'     );     insert into Radix_en values (32769,'e2afcd65-9a1b-49e3-baf1-74b0619a4776'     ,0,'cfcd208495d565ef66e7dff9f98764da'     ,'zero','01b40535afbfd9611e910f58f4ab5146'     ,'nulla','584edd0b6638798dee53e2c23e84e2d1'     ,'μηδέν','cd3ed2f1039ed8668b4d48e742bd2e5b'     ,'Null','e0a93a9e6b0eb1688837d8bab9b4badb'     );     insert into Radix_en values (32770,'f51b72eb-d64f-4e9e-ab49-8954df9505cd'     ,1,'c4ca4238a0b923820dcc509a6f75849b'     ,'one','7e31533231a12e4a560a18ac8cd02112'     ,'Unum','05d92bcbffbf59b375f25945e9af2dd0'     ,'ένα','826f5e2d5ba7ace48f4d6fe3c5e2925f'     ,'ein','dcc09a2cb665ca332d1689cb11aff592'     );     commit;      Thanks! Sandor


Adding 2 lines in text file stanza

I have a text file divided in stanzas. Each stanza starts with a [keyword] and ends with a blank line. Something like this:               [keyword1]     param1 = value1     param2 = value2     param3 = value3          [keyword2]     param4 = value4     param5 = value5     ...      I need a script (probably a one line command will work) to insert 2 lines immediately after a given `[keyword]`. Lines to be inserted are like the above couples:               param = value      I was thinking about using `sed` with in place editing plus a backup copy file just in case.


Unable to install rbenv with deployer user in CentOS - Permission denied

I created a new user in CentOS 6.3 using this commands               useradd deployer          passwd deployer          visudo      then I added this line to file:               deployer ALL=(ALL) ALL      Fine! Now I trying to install rbenv, to deploy an RoR application. I followed this steps:               cd /home/deployer          su deployer          curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash      It worked. After, I added rbenv to .bashrc and tried to reload .bashrc file and get this error:               [deployer@mycentos ~]$ . ~/.bashrc      bash: /home/deployer/.rbenv/bin/rbenv: Permission denied      Anyone know why?


Are there any tools to test MTD/JFFS2 for Linux 2.4 kernels

I have some issues with a platform I support and I suspect memory problems. I wanted to check the Flash parts using some MTD JFFS2 test tools, I found a link to a bunch on this site. However they note that support really isn't there for 2.4 and as stated on that site: > The MTD community is neither able nor interested to provide support for > ancient kernels. Either move yourself and update to a recent kernel. As upgrading isn't an option for me, I'm trying to find out if there are any other tools that could be used to test Flash memory in Linux on older kernels.


How set glib environment variable: g_slice

I've been told I need to set the following environment variable in order to work around a glib bug:               G_SLICE=always-malloc      But I don't know how to do it, and anywhere I've seen it's use recommended, they just take it for granted you know how to do it (even the gnome documentation: https://developer.gnome.org/glib/stable/glib-running.html). So I tried setting it as a linux environment variable. I tried setting it in the programming environment I was in (Firefox Add-on SDK), but without success. It seems to me that I may have to install glib development packages and find some sort of config file. But perhaps someone would help before I go up the wrong path?


Difference between Solaris and OpenSolaris?

So I want to learn using Solaris [Diskgroups, etc.]. I recently found out that there is an OS named OpenSolaris: https://en.wikipedia.org/wiki/OpenSolaris Is it a good point to learn Solaris? Or it's different then Solaris? How much it differs from it?


Help me to replace sshfs with ssh?

I love to do just this:               $ sshfs mountPoint myServer     $ cp thisFile mountPoint      I am now using LiveCD and I do not have sshfs utility available and I need run `$ sudo dd /dev/sdb2 > mountPoint`, how to do this as easy as with sshfs? **Perhaps related**   1. http://superuser.com/questions/397646/cloning-fresh-windows-7-fsed-hdd-to-linux-server-because-having-no-external-hdd **Comment to Psusi**               $ sudo fdisk -l|tail     255 heads, 63 sectors/track, 4864 cylinders, total 78142806 sectors     Units = sectors of 1 * 4096 = 4096 bytes     Sector size (logical/physical): 4096 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x181d6d22             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *        2048     3074047    12288000    7  HPFS/NTFS/exFAT     /dev/sdb2         3074048   600563711  2389958656    7  HPFS/NTFS/exFAT     /dev/sdb3       600563712   625139711    98304000    7  HPFS/NTFS/exFAT     $ sudo file -s /dev/sdb     /dev/sdb: x86 boot sector; partition 1: ID=0x7, active, starthead 32, startsector 2048, 3072000 sectors; partition 2: ID=0x7, starthead 89, startsector 3074048, 597489664 sectors; partition 3: ID=0x7, starthead 254, startsector 600563712, 24576000 sectors, code offset 0xe     $ sudo ntfsclone --save-image --output - /dev/sdb2     ntfsclone v2011.4.12AR.4 (libntfs-3g)     ERROR(22): Opening '/dev/sdb2' as NTFS failed: Invalid argument     Apparently device '/dev/sdb2' doesn't have a valid NTFS. Maybe you selected     the whole disk instead of a partition (e.g. /dev/hda, not /dev/hda1)?


How to mimic zsh named directories with bash

> **Possible Duplicate:**   >  bash directory shortcuts zsh has the concept of named directories, so you can say in ~/.zshrc               c=/home/fschmitt/svn/plugin_root     : ~c      and later use this short cut in the shell like this               cd ~c/release      How to best emulate this with bash? I can of course say               export c=/home/fschmitt/svn/plugin_root      and then               cd $c/release      however firstly, the $ is complicated to input on German keyboard layout and secondly, I fear binding a variable with just a single letter name might give problems with unwanted variable expansion.


Difference between --xz and --lzma in GNU tar?

As far as I can tell, XZ is a container that uses the LZMA2 algorithm (i.e. extended LZMA); but e.g.               $ xz foo/      complains about `foo/` being a directory. So presumably the correct way to preserve directories with XZ is with `tar`; then what is the difference between `tar --lzma` and `tar --xz`? (Note that I do explicitly want ownership and permissions preserved, which is why I'm not just using 7z.)


A real non-"better touch tools" solution for select-to-copy on Mac OS X

I recently moved to Mac. I am missing my X11 copy-paste style. I can't find a way to exactly emulate X11 behavior "select-to-copy", "middle-click-to-paste" **globally** on Mac OS X. I am aware that this issue has been around for a long time, yet I can't find any real killer solution. The best thing I found is in Can I copy by highlighting and paste by middle click on Mac OS X?. All suggested solutions try to find out a way to paste text from the clipboard with a middle click. Yet, nobody has a real solution for automatically copying the highlighted text. I am wondering if there can be a way to automate the copying of highlighted text. Even if I should write a daemon to do it. Any pointers on where to start thinking will be great.


Is it possible to preload glibc?

One of my client runs a glibc-2.7 based system , and my static linked program wasn't able to start on the target machine, raising an error: `_ZNSt7num_getlcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE, version GLIBCXX_3.4` So I'm wondering if I can use LD_PRELOAD and passing on the glibc on the develop machine? And if it's possible, what file should be copied there?


vi / vim - extra indents when pasting text?

I can copy characters in other apps such as browsers with `ctrl``c`. I can then press `i` to enter insert mode in vim and press `shift``ctrl``v` to paste the text in. The problem is that each line gets indented a bit more so I end up with: ![enter image description here](http://i.stack.imgur.com/Iq4LL.png) but what I want (and end up manually editing to achieve) is:![enter image description here](http://i.stack.imgur.com/9HzLn.png)


Disable apache's auto directory "/" completion

I'm in the following situation: I have a directory named `test` at the top level of my site. When I request `http://mysite.com/test`, apache automatically adds a trailing slash and gives me `http://mysite.com/test/`. Is there a way to disable that?


Why are the X11 colours different from Wikipedia's?

In this Wikipedia article it gives a bunch of X11 colours but they are different from the ones on my FreeBSD system. For example I have no "aqua" or "fuchsia" but, e.g. aquamarine1, etc. and many other numbered colours. Why is that?


Should a serious student of *nix choose a distribution that is POSIX-compliant to learn standard features well?

I want to learn Unix or Linux as a serious student, and specifically want to learn the basics well so that I can have proper understanding and so I can move between platforms and distributions without unlearning unusual habits. What should I be looking for in a standard distribution? Does it really matter? Many distributions seem to be POSIX-compliant - is that the most important consideration?


Bash variable into html

I have a script that gets the filenames in a folder and creates HTML link to them on my homepage. Here is the script:               #!/bin/bash       list_dir=`ls -t /path/to/dir/`     for i in $list_dir        do       echo `'<a href="/path/to/dir/$i">$i</a>' >> /var/www/index.html`        done      But when I check the `var/www/index.html` the code is submitted, but the variables have not been substituted. Any advice on how to fix this?


Remove string from a particular field using awk/sed

I have a file (>80,000 lines) that looks likes this:               chr1    GTF2GFF chromosome  1   249213345   .   .   .   ID=chr1;Name=chr1     chr1    GTF2GFF gene    11874   14408   .   +   .   ID=DDX11L1;Note=unknown;Name=DDX11L1     chr1    GTF2GFF exon    11874   12227   .   +   .   Parent=NR_046018_1     chr1    GTF2GFF exon    12613   12721   .   +   .   Parent=NR_046018_1     chr1    GTF2GFF exon    13221   14408   .   +   .   Parent=NR_046018_1     chr1    GTF2GFF gene    14362   29370   .   -   .   ID=WASH7P;Note=unknown;Name=WASH7P     chr1    GTF2GFF exon    14362   14829   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    14970   15038   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    15796   15947   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    16607   16765   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    16858   17055   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    17233   17368   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    17606   17742   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    17915   18061   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    18268   18366   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    24738   24891   .   -   .   Parent=NR_024540     chr1    GTF2GFF exon    29321   29370   .   -   .   Parent=NR_024540     chr1    GTF2GFF gene    34611   36081   .   -   .   ID=FAM138A;Note=unknown;Name=FAM138A     chr1    GTF2GFF exon    34611   35174   .   -   .   Parent=NR_026818     chr1    GTF2GFF exon    35277   35481   .   -   .   Parent=NR_026818      and I want to extract only the rows that that contain "gene" in the 3rd field and re-arrange the 9th field to contain only the ID value (for example, DDX11L1). This is the desired output:               chr1    11874   14408   DDX11L1    .       +     chr1    14362   29370   WASH7P      .       -     chr1    34611   36081   FAM138A    .       -      Using awk I got the desired fields easily:               head -20 genes.gff3 | awk '$3=="gene" {print $1 "\t" $4 "\t" $5 "\t" $9"\t" $6 "\t" $7}'     chr1    11874   14408   ID=DDX11L1;Note=unknown;Name=DDX11L1    .       +     chr1    14362   29370   ID=WASH7P;Note=unknown;Name=WASH7P      .       -     chr1    34611   36081   ID=FAM138A;Note=unknown;Name=FAM138A    .       -      But I am struggling with getting the ID value. I've tried piping it to sed:               head -20 genes.gff3 | awk '$3=="gene" {print $1 "\t" $4 "\t" $5 "\t" $9"\t" $6 "\t" $7}' | sed 's/\(^.+\t\)ID=\(\w+\).+\(\t.+$\)/\1\2\3/g'      and also gsub               head -20 genes.gff3 | awk '$3=="gene" {gsub(/\(^.+\t\)ID=\(\w+\).+\(\t.+$\)/, "\1\2\3", $9); print $1 "\t" $4 "\t" $5 "\t" $9"\t" $6 "\t" $7}'       But the result is same as using awk alone. How can I extract the ID value? I feel that I am really close to a solution here. Cheers.


How to compile a selection of Markdown documents using a shell script

Technical authors are increasingly being encouraged to write in standalone topics. Topics are written so that they make sense when compiled into different packages or when they are read in isolation. There are heavily-engineered structured formats for topic-based writing but I want to use Pandoc and Markdown. Processing a single Markdown file to HTML:               pandoc -f markdown -t html inputfile.md      Although I can use Pandoc like this to process individual Markdown files, I will need compile a list of selected Markdown files and process that to achieve a topic-based workflow. If I have some Markdown files:               inputfile1.md, inputfile2.md, inputfile3.md      what is a simple shell script that I can use that can compile them and process them using Pandoc to a single output file?


How can you change the process name of Wing IDE from python to something more descriptive

In my process list under Ubuntu (using `top`/`System Monitor`) one of the largest memory hogs (200+Mb) was `python`. I searched a bit for one of my programs to be the cause until I realised this was my Python IDE (Wing), which itself is written in Python. I thought I could change the name of the program by inserting setproctitle from the setproctitle package, but the python version that Wing is using is different from my own. `setproctitle` needs to be compiled and the python that wing uses is not a full installation (I asked Wing Support but they are unlikely to change that/incorporate setproctitle). `setproctitle` can only change the name of the running process, so I could not make a script that starts Wing and then change the process name either. After that I tried to write to /proc/PIDNUM/comm, but although that 'file' is 'rw', I am not allowed to write there. I finally found a, not-so-portable, solution for this particular case. But I would like to know if there is a standard way of changing the process name of another (possible a child-) process with a Linux system call.


Wifi module doesn't work anymore in CentOS

Like the title said, my wifi module doesn't work anymore. After a kernel upgrade. The wifi LED is permanently red. I can only use a wired connection. **EDITS** I add only the lscpi output because the others command result are too long.               00:00.0 Host bridge: Advanced Micro Devices [AMD] RS880 Host Bridge     00:01.0 PCI bridge: Advanced Micro Devices [AMD] RS780/RS880 PCI to PCI bridge (int gfx)     00:05.0 PCI bridge: Advanced Micro Devices [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 1)     00:06.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 2)     00:11.0 SATA controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]     00:12.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller     00:12.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller     00:13.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller     00:13.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller     00:14.0 SMBus: Advanced Micro Devices [AMD] nee ATI SBx00 SMBus Controller (rev 41)     00:14.2 Audio device: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel HDA) (rev 40)     00:14.3 ISA bridge: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)     00:14.4 PCI bridge: Advanced Micro Devices [AMD] nee ATI SBx00 PCI to PCI Bridge (rev 40)     00:14.5 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI2 Controller     00:16.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller     00:16.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller     00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor HyperTransport Configuration     00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Address Map     00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor DRAM Controller     00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Miscellaneous Control     00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control     01:05.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI RS880M [Mobility Radeon HD 4200 Series]     02:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)     03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)


keybinding in xterm to shift one line up using shift+up

follow urxvt: scroll just one line How can we set keybindings so that shift+up can scroll one line up in xterm?


VPN and gateway problems

I've got a corporate VPN, which I use to access the Internet. When it's on, I cannot reach the servers inside the corporate network anymore, so I think there are some problems with the gateway setup. Here is the `netstat -rn` output when the VPN is turned off:               Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     91.218.225.31   10.131.60.1     255.255.255.255 UGH       0 0          0 eth1_rename     10.131.60.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1_rename     169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1_rename     0.0.0.0         10.131.60.1     0.0.0.0         UG        0 0          0 eth1_rename      Here it is with the VPN turned on:               Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     10.7.4.0        0.0.0.0         255.255.255.255 UH        0 0          0 ppp0     91.218.225.31   10.131.60.1     255.255.255.255 UGH       0 0          0 eth1_rename     91.218.225.31   10.131.60.1     255.255.255.255 UGH       0 0          0 eth1_rename     10.131.60.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1_rename     169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1_rename     0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0      `ppp0` is the VPN device. How can I make both the Internet and LAN routing work when the VPN is enabled?


Apache redirecting when it shouldn't

I have inherited a LAMP server with a lot of customization. I want to enable mod_status in apache to get some monitoring of apache started. Problem is, with mod_status enabled in the httpd.conf, I am not allowed to travel to the http://"serverIP"/server-status URL because apache is redirecting me to a 'landing page'. If I type any invalid URL for the server, it redirects to this page, all error document pages have been hashed out from the httpd.conf. Any assistance to where this has may have been configured or if there is a way to override it so I can get to the url http://"serverIP"/server-status ?


VirtualBox host-only network suddenly stopped working , no interface available inside

I'm unable to setup host-only network in virtualbox suddenly , please see my screenshot , there's no entry in "Name" comboBox ![enter image description here](http://i.stack.imgur.com/wDruH.png)


vim always shows help/documentation

Whenever I run vim, it randomly shows the help/documentation at a non particular time. How do I disable that. It's irritating.


Why does chmod require disk space? Not-in-place algorithm?

I try to chmod some files and I get the error "disk quota exceeded": ![enter image description here](http://i.stack.imgur.com/Wb4Xx.png) It's true that I don't have that much space remaining in the filesystem where I use chmod, namely`nfs.mit.edu:/export/evodesign/beatdb` (which is an NFS), either in terms of bytes or in terms of inodes: ![enter image description here](http://i.stack.imgur.com/FreRR.png) But why does chmod need more space? I use Ubuntu 12.04. * * * Edit: Some more info following the comments: 1) I don't know the OS of the NFS server (`nmap -O nfs-server-ip` didn't return anything) 2) The NFS protocol in use by a mounted NFS filesystem is NFSv3: ![enter image description here](http://i.stack.imgur.com/RHLQu.png) 3) `quota -v`: ![enter image description here](http://i.stack.imgur.com/RGqOL.png) 4) I don't have any `/var/log/messages` logs, I do have some `/var/log/syslog` logs but nothing looks weird there.


Strange titles (and bookmarks) in chromium in xubuntu

Chromium browser in xubuntu doesn't show Persian titles. For example this site: www.farsnews.com Screenshot (just title): ![](https://dl.dropboxusercontent.com/u/12338367/strange-titles.png) How can I fix that? Edit: I noticed it happens in bookmarks too. Screenshot: ![](https://dl.dropboxusercontent.com/u/12338367/strange- titles2.png)


nginx server config with multiple locations does not work

I have been trying to get this to work for hours now! I would like to set up a simple web server. My web files shall be in `/var/www`. I also want to have phpmyadmin. I created a directory `/var/phpmyadmin`. Now I want to acces the normal web files in the standard way.   For instance: The file `/var/www/test.php` should be accesible with `http://localhost/test.php`.   The phpmyadmin part should be acces like this: `http://localhost/phpmyadmin`. With the config below I get a 404. Also with this URL: `http://localhost/phpmyadmin/index.php` For this I created this file in the sites-availble folder of nginx:               server {       listen 80; ## listen for ipv4; this line is default and implied       listen [::]:80 default_server ipv6only=on; ## listen for ipv6            root /var/www;       index index.html index.htm index.php;            try_files $uri $uri/ $uri/index.html $uri/index.htm $uri/index.php;            # This didn't work       location /phpmyadmin/ {          alias /var/phpmyadmin;       }            # And this did neither. (Never used both at the same time!)       location /phpmyadmin/ {          root /var;       }            location ~ \.php$ {         try_files $uri =404;         fastcgi_split_path_info ^(.+\.php)(/.+)$;         # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini              # With php5-cgi alone:         #fastcgi_pass 127.0.0.1:9000;         # With php5-fpm:         fastcgi_pass unix:/var/run/php5-fpm.sock;         fastcgi_index index.php;         include fastcgi_params;       }            location ~ /\.ht {         deny all;       }     }      What am I doing wrong? # Edit: Interesting to note is that this works (The root directory works (`http://localhost`)):                 root /var/www/htdocs;            index index.php index.html index.htm;            location /phpmyadmin/ {         root /var/www/phpmyadmin;       }      And this doesn't:                 index index.php index.html index.htm;            location / {         root /var/www/htdocs;       }            location /phpmyadmin/ {         root /var/www/phpmyadmin;       }      phpmyadmin still doesn't work!


kernel panic error after recompilation

I am completely blocked, but temporarily. I have an Ubuntu 11.10 in good condition, in this one I installed VirtuelBox. I installed on VirtuelBox as Ghest Debian Squeeze with Kernel 2.6.32-5-686. ja 'tried to recompile my kernel to erase all composont driver then I turned on the current configuration of the driver necessary for the operation of Ghest Debian. Steps for compiling and installing the kernel are: > >     root login >     # nano /etc/apt/sources.list >     # apt-get update >     # apt-get install debconf-utils debhelper dpkg-dev build-essential > kernel-package libncurses5-dev >     # uname-r >     2.6.32-5-686 >     # wget > http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.5.tar.bz2 >     # tar xvjf linux-2.6.32.5.tar.bz2 >     # mv linux-2.6.32.5/ /usr/src/ >     # cd /usr/src/linux-2.6.32.5/ >     # cp /boot/config-2.6.32-5-686. config >     ### make allnoconfig## >     # make menuconfig >     we selected the penultimate year Load Alternate Configuration File >     you exit the menu while watching >     # make-kpkg - append-to-version "-tango" - initrd buildpackage-us-uc >     the image is now in /usr/src/ >     # dpkg-i linux-image-2.6.32.5-tango-tango-2.6.32.5-10.00Custom_i386.deb >   > > an error when starting the first line from Grub kernel panic not syncing vfs > Unable to mount root fs on unknown-block 0 0 > ![GRUB](http://i.stack.imgur.com/Trh2H.png) ![ERROR](http://i.stack.imgur.com/3oGgO.png) ![after recompilation](http://i.stack.imgur.com/BUcR7.png) lsmod Module Size Used by ppdev 4058 0 lp 5570 0 binfmt_misc 4907 1 fuse 44268 1 loop 9769 0 snd_intel8x0 19595 1 snd_ac97_codec 79200 1 snd_intel8x0 ac97_bus 710 1 snd_ac97_codec snd_pcm 47226 2 snd_intel8x0,snd_ac97_codec snd_seq 35463 0 snd_timer 12270 2 snd_pcm,snd_seq snd_seq_device 3673 1 snd_seq parport_pc 15799 0 parport 22554 3 ppdev,lp,parport_pc snd 34423 8 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_seq,snd_timer,snd_seq_device psmouse 44809 0 pcspkr 1207 0 serio_raw 2916 0 ac 1640 0 joydev 6739 0 evdev 5609 8 i2c_piix4 7076 0 button 3598 0 i2c_core 12787 1 i2c_piix4 soundcore 3450 1 snd snd_page_alloc 5045 2 snd_intel8x0,snd_pcm ext3 94396 5 jbd 32317 1 ext3 mbcache 3762 1 ext3 usbhid 28008 0 hid 50909 1 usbhid sg 19937 0 sr_mod 10770 0 cdrom 26487 1 sr_mod sd_mod 26005 7 crc_t10dif 1012 1 sd_mod ata_generic 2247 0 ohci_hcd 16999 0 ata_piix 17736 0 ahci 27410 6 ehci_hcd 28693 0 thermal 9206 0 libata 115869 3 ata_generic,ata_piix,ahci thermal_sys 9378 1 thermal usbcore 98969 4 usbhid,ohci_hcd,ehci_hcd nls_base 4541 1 usbcore scsi_mod 104853 4 sg,sr_mod,sd_mod,libata e1000 77317 0 root@debian:/boot# root@debian:/boot# lspci 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01) 00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter 00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02) 00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service 00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01) 00:06.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB 00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08) 00:0b.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller 00:0d.0 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 02) root@debian:/boot# root@debian:/boot# lscpu Architecture: i686 CPU(s): 1 Thread(s) per core: 1 Core(s) per socket: 1 CPU socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 15 Stepping: 13 CPU MHz: 1983.975 root@debian:/boot# the file .config is in the link: .config Help me please


extracting attachments from mail that is coming to my postfix inbox

How do I extract attachments from mails arriving at my postfix mailbox and preferably send the content of the attachment to another email account? I am interested in being able to acquire/read the content of the attachment on ubuntu terminal.


How to detect and stop user from deleting particular file on Linux?

Is it possible to monitor user actions on the file system and prevent him from performing particular actions? Can inotify only monitor actions on the file system? What about fanotify? There's very little about it in Web... My program (daemon) sends particular files over network. I want to make sure, that user will not delete or move my file however he cloud be able to read it. When user tries to delete my file with any program calling eg. unlink() I want to make this unlink() call will fail with some error (EACCES?). I can do similar trick implementing file system on FUSE, but it's not a solution here...


How to check mdadm raids while running?

I'm starting to get a collection of computers at home and to support them I have my "server" linux box running a raid array. Its currently mdadm raid1, going to raid5 once I have more drives (and then raid6 I'm hoping for). However I've heard various stories about data getting corrupted on one drive and you never noticing due to the other drive being used, up until the point when the first drive fails, and you find your second drive is also screwed (and 3rd, 4th, 5th drive). Obviously backups are important and I'm taking care of that also, however I know I've previously seen scripts which claim to help against this problem and allow you to check your raid while its running. However looking for these scripts again now I'm finding it hard to find anything which seems simular to what I ran before and I feel I'm out of date and not understanding whatever has changed. How would you check a running raid to make sure all disks are still preforming normally? I monitor SMART on all the drives and also have mdadm set to email me in case of failure but I'd like to know my drives occasionally "check" themselves too. Thanks in Advance.


Installing to a PCIE sata card

I have an ASUS P5Q deluxe from an old gaming computer that I'm converting to a server. Unfortunately, while their silly onboard fake RAID thing(drive xpert) worked fine in Windows, the drives are not being detected at all when I attempt to install openSUSE to them. I've tried disabling it and setting it to "normal" but still no luck. The other SATA ports are detected without issue, but they're for my storage drives. Eventually I decided the better option might be a pcie SATA card, but I'm not positive it will solve my problem: Will I be able to install to drives attached through a PCIE card? If so is there a specific card anybody could recommend?


Which is better for product level web server: RHEL/Ubuntu Server/Debian/CentOS

We are planning to setup a linux based web hosting solution, which should include an HTTP server, SMTP server, mongoDB and Java. We want to understand which distribution is better for this purpose. We very care about:   1. Security including antivirus, patch policy etc   2. Performance   3. Stability   4. Commercial support Thanks, Green


How should I solicit feedback from a tree maintainer for patches sent to the lkml?

I have submitted a patch to the linux kernel that has gotten several reviews and gone through a couple iterations on the mailing list. It has been ACKed and reviewed by two developers, but they say it is up to a specific developer to approve the patch. This developer is relatively absent from the mailing list. I do not want to harass him personally, but I would like some sort of acknowledgement that the patch can or cannot be accepted. What is the best way to solicit feedback from this developer? Is it acceptable to send a private email to him or to one of the reviewers or is it important for all communication to be public through the mailing lists?


lost superblock in md raid

Issue on Red Hat Linux 5. Due to some miscommunication two LUNs in our environment were enlarged from 1.2 TB to 1.7 TB. Now, after a reboot, mdadm does not find the superblocks to build the array again. > The common format — known as version 0.90 — has a superblock that is 4K long > and is written into a 64K aligned block that starts at least 64K and less > than 128K from the end of the device (i.e. to get the address of the > superblock round the size of the device down to a multiple of 64K and then > subtract 64K). I found some old documentation:               # mdadm -D /dev/md0     /dev/md0:             Version : 0.90       Creation Time : Tue Jul 10 17:45:00 2012          Raid Level : raid1          Array Size : 1289748416 (1230.00 GiB 1320.70 GB)       Used Dev Size : 1289748416 (1230.00 GiB 1320.70 GB)        Raid Devices : 2       Total Devices : 2     Preferred Minor : 0         Persistence : Superblock is persistent              Update Time : Wed Apr 17 15:03:50 2013              State : active     Active Devices : 2     Working Devices : 2     Failed Devices : 0       Spare Devices : 0                     UUID : 2799bd51:67eb54d2:1fcd3c90:293311a1              Events : 0.39              Number   Major   Minor   RaidDevice State            0     253       10        0      active sync   /dev/dm-10            1     253       11        1      active sync   /dev/dm-11          # fdisk -l /dev/dm-10 /dev/dm-11          Disk /dev/dm-10: 1320.7 GB, 1320702443520 bytes     255 heads, 63 sectors/track, 160566 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes          Disk /dev/dm-10 doesn't contain a valid partition table          Disk /dev/dm-11: 1320.7 GB, 1320702443520 bytes     255 heads, 63 sectors/track, 160566 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes          Disk /dev/dm-11 doesn't contain a valid partition table


Route outgoing traffic to different gateway based on port

I am trying to get around my Usenet download bandwidth restrictions based on IP. I currently have two IPs from my ISP to double the download speed. So far I have it working and getting double speed from one server that has multiple access addresses, by using this command to get a second stream going with the first on eth0. sudo route add -host xx.xx.xxx.20 gw 192.168.2.1 dev wlan0 My problem is another service I want to do the same only has one address but multiple port choices. So how can I send any data to a different gateway based on the port. Default example.com:80 should use the 192.168.1.1 gateway on eth0 (which it does since this is the default gateway) Whereas example.com:81 should use the 192.168.2.1 gateway on wlan0


Debian: Mounting NFS Volume at boot with fstab not working, How to change when this is attempted on boot

So there are a bunch of NICs and vlans on the server and after adding the last ones the auto mount of a network volume is not working. I can do it all right if i SSH in and use `mount` however it doesnt happen with `fstab`. What I'm speculating is the interfaces that are needed to reach the networked storage come up too late, I have no experience with the startup so I have only a few bits of debug you show such as               # chkconfig --list     networking                0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on      nfs-common                0:off  1:off  2:on   3:on   4:on   5:on   6:off  S:on       (thats among others, do ask if you need to see other entries, I don't actually know what would be needed) How can I make the nfs mounting be done at a later point, this above suggests to me that perhaps the nfs stuff happen too early?               # ls -lh /etc/rc5.d/     total 4.0K     -rw-r--r-- 1 root root 677 Mar 27  2012 README     lrwxrwxrwx 1 root root  17 Apr 10 13:46 S14portmap -> ../init.d/portmap     lrwxrwxrwx 1 root root  20 Apr 10 13:46 S15nfs-common -> ../init.d/nfs-common     lrwxrwxrwx 1 root root  20 Apr 11 11:19 S17fancontrol -> ../init.d/fancontrol     lrwxrwxrwx 1 root root  17 Apr 10 13:46 S17rsyslog -> ../init.d/rsyslog     lrwxrwxrwx 1 root root  14 Apr 10 15:59 S17sudo -> ../init.d/sudo     lrwxrwxrwx 1 root root  17 Apr 11 11:18 S18apache2 -> ../init.d/apache2     lrwxrwxrwx 1 root root  15 Apr 11 11:18 S19acpid -> ../init.d/acpid     lrwxrwxrwx 1 root root  13 Apr 11 11:18 S19atd -> ../init.d/atd     lrwxrwxrwx 1 root root  14 Apr 11 11:18 S19cron -> ../init.d/cron     lrwxrwxrwx 1 root root  15 Apr 11 11:18 S19exim4 -> ../init.d/exim4     lrwxrwxrwx 1 root root  21 Apr 11 11:18 S19mpt-statusd -> ../init.d/mpt-statusd     lrwxrwxrwx 1 root root  17 Apr 11 11:18 S19nagios3 -> ../init.d/nagios3     lrwxrwxrwx 1 root root  17 Apr 11 20:49 S19postfix -> ../init.d/postfix     lrwxrwxrwx 1 root root  15 Apr 12 19:15 S19rsync -> ../init.d/rsync     lrwxrwxrwx 1 root root  13 Apr 11 11:18 S19ssh -> ../init.d/ssh     lrwxrwxrwx 1 root root  18 Apr 11 11:18 S21bootlogs -> ../init.d/bootlogs     lrwxrwxrwx 1 root root  18 Apr 11 11:18 S22rc.local -> ../init.d/rc.local     lrwxrwxrwx 1 root root  19 Apr 11 11:18 S22rmnologin -> ../init.d/rmnologin     lrwxrwxrwx 1 root root  23 Apr 11 11:18 S22stop-bootlogd -> ../init.d/stop-bootlogd      How can I delay or change the order of events so that it'd mount with `fstab`, what to look for anyway?


Ruby Version Prompt (Oh My ZSH) not working outside of TMUX

I am working on some Ruby development, and I installed RVM on my Mac. I regularly use TMUX. I have Oh My ZSH configured to show the Ruby version in my prompt. When I am in TMUX it shows my ruby version in the prompt. When i'm out of TMUX it doesn't show the version. Also, when I enter ZSH again (type `zsh` after i'm in my terminal) the ruby version does show. It does NOT show upon initial login.   * ZSH Version: 5.0.2


How can I install Sun JDK on a Debian based system?

I can't find any `.deb` packages for Sun's Java Development Kit. How can I install it on my Debian machine without causing conflicts with the already installed `openjdk` packages?


Is there any ftp command to resume upload?

Oh! with my slow net connection, I am badly stuck. I was uploading a video file from local box to remote one via ftp. But net failed.I know there is a command named reget to resume download but Is there any command to resume upload.? If no then I am hit.


Cross LFS - PPC - Error while compiling

I'm trying to build a CLFS for a PPC 8270 processor. All is fine until I use the `make ARCH=powerpc CROSS_COMPILE=${CLFS_TARGET}-` command.               CC      arch/powerpc/kernel/align.o     arch/powerpc/kernel/align.c: In function 'fix_alignment':     arch/powerpc/kernel/align.c:704:33: error: variable 'instruction' set but not used [-Werror=unused-but-set-variable]     cc1: all warnings being treated as errors          make[1]: *** [arch/powerpc/kernel/align.o] Error 1     make: *** [arch/powerpc/kernel] Error 2      In `menuconfig`, I used the default configuration except I choose compatibily with PPC 82XX processor family.


Why sudo timestamp is not updated when NOPASSWD is set?

I've set up sudo not to prompt for password by editing the sudoers file:               myuser ALL=(ALL:ALL) NOPASSWD: ALL      And it works fine, running sudo with no password prompting. But when entering `sudo -v` I noticed that it prompted for password, only once. I know what `sudo -v` does, from the manual: > If given the -v (validate) option, sudo will update the user's time stamp, > prompting for the user's password if necessary. This extends the sudo > timeout for another 15 minutes (or whatever the timeout is set to in > sudoers) but does not run a command. And I know I don't need to use it anyway (or am I wrong?). The question is, why `sudo -v` prompted for password when sudo is configured not to ask that user from password? And especially when `sudo -v` is run afterwards another sudo command: why the timestamp isn't updated unless `sudo -v` is run exiplicitly? My machine is running Ubuntu Server 11.10 if that mattered. EDIT: running `sudo sudo -v` requires no password, but doesn't seem to update the timestamp because when immediately followed by `sudo -v`, it prompts for password again. What is the mechanism used in updating sudo timestamp? Why the timestamp is not updated when running any sudo command and then running `sudo -v` ??


FTP server - directories

I have been playing around with several ftp servers and can't get the configuration I want. I want to allow both anonymous and standard user login, user logins are fine with the default pure-ftpd config (users can get to their home directories), but I'd like anonymous users to have read only access to a subdirectory of my users home directory (~/web/ftp). Is there anyway to do this with pure-ftpd, or is there an alternative that could?


Egrep: contains and does not contain

egrep -i '12-12.*\swarning' log.file | cless      The above will produce two lines with the date `12-12`, followed by random characters, a white space, then `Warning` and more text.               2011-12-12 textetc Warning 1234     2011-12-12 textetc Warning 5678      I wish it only to return lines that DO NOT contain 1234 at the end. I'm using GNU grep 2.5.4. Currently, this is my workaround.               egrep -i '12-12.*\swarning' log.file > tmp.txt     egrep -i -v '1234' tmp.txt      I've tried piping the first to the second (without creating a file), but it either returns way too much, and it's all wrong, or it returns nothing at all.


filesystem image mounted with lofiadm looks smaller than expected

I have a .gz file and I'd like to see the content of it. I used lofiadm to mount it.               lofiadm /backup/file.gz ->>  returned /dev/lofi/1     mount -F ufs /dev/lofi/1 /mnt      Then I checked the content               /mnt> du -sh *     4K   etc     79M   kernel     8K   lost+found     13M   platform      The problem is size of file.gz was around 342 MB but the content is around 93 MB. I checked it with `ls -al` but there were no other file.               /dev/lofi/1            321M    93M   196M    33%    /mnt      Now I don't understand how that happens. File size was 342 MB but after mount it returns 92 MB


Where is the official udev source and other dev information?

I'm trying to find a changelog or commit history for `udevd`, but I can't seem to find the official source. Where is that?


Can use Password authentication with SFTP even though "PasswordAuthentication no" in /etc/ssh/sshd_config

I have enabled SSH-keys based authentication on the Ubuntu 14.04 server, disabled root login using SSH and can connect successfully using SSH-keys based authentication with my user account _blahblah_ on my Mac SSH client. However, to test the SSH login with Password authentication, I used the SFTP login in Filezilla for user account _blahblah_ with its password, and it allowed me to log in without the need for any SSH-keys based authentication. The `/etc/ssh/sshd_config` file is as below. As you can see, I have disabled `PasswordAuthentication`. I have already restarted the sshd daemon by using `sudo service ssh restart` after modifying this config file. Any ideas why this might be happening?               Port 8888     Protocol 2     HostKey /etc/ssh/ssh_host_rsa_key     HostKey /etc/ssh/ssh_host_dsa_key     HostKey /etc/ssh/ssh_host_ecdsa_key     HostKey /etc/ssh/ssh_host_ed25519_key     UsePrivilegeSeparation yes          KeyRegenerationInterval 3600     ServerKeyBits 1024          SyslogFacility AUTH     LogLevel INFO          LoginGraceTime 120     PermitRootLogin no     StrictModes yes          RSAAuthentication yes     PubkeyAuthentication yes          IgnoreRhosts yes     RhostsRSAAuthentication no     HostbasedAuthentication no          PermitEmptyPasswords no          ChallengeResponseAuthentication no          PasswordAuthentication no               X11Forwarding yes     X11DisplayOffset 10     PrintMotd no     PrintLastLog yes     TCPKeepAlive yes          AcceptEnv LANG LC_*          Subsystem sftp /usr/lib/openssh/sftp-server          UsePAM no     AllowUsers blahblah


Issue with mv command in a script

This must be a very simple issue to solve, but I am stuck (not a UNIX pro). I need to move a gz to a target directory, but I get a `No such file or directory`.               NOW=$(date +"%Y-%m-%d-%T")          DEST="~/scripts/backup"     SQL_DUMP="db_dump_$NOW.sql.gz"     echo "$SQL_DUMP"          drush sql-dump | gzip -9 > $SQL_DUMP     mv -t $DEST $SQL_DUMP      The `sql.gz` is created properly, only the last command does not work. How should I use it? Thanks.


How can I pass strings with single quotes to grep?

My desired outcome is the following: to recursively search a directory looking for a given string in all found files. The following command is my usual port of call:               find ./ | xargs grep -ns 'foobar'      However, when `foobar` has quotes the command fails and gives me a `>` prompt in the shell. The specific command that's causing the problem is as follows:               find ./ | xargs grep -ns 'add_action(\'save_post\','      I've tried to escape the quotes with backslashes but to no avail. What's the correct way to do this?


Permissions changed on /dev/nvidia* when GPU accessed as root on SUSE

I've got a Linux box running SLES11SP1 with 4 NVIDIA GPUs in it, for running CUDA programs. If the GPU is accessed by a process running as root, it changes the permissions on /dev/nvidia{0,1,2,3,ctl} to something inaccessible by non-root users. However, this behavior doesn't seem to occur when running on Ubuntu. Does anybody know what would cause this behavior on SLES, and how to disable it?


Create sub-directories and organize files by date

I have some directories of files copied from my security camera that I would like to organize into sub-directories by file date. So for example;               -rwxrwxrwx 0 root root 4935241 Jul 19  2012 DSCN1406.JPG     -rwxrwxrwx 0 root root 4232069 Jul 19  2012 DSCN1407.JPG     -rwxrwxrwx 0 root root 5015956 Jul 20  2012 DSCN1408.JPG     -rwxrwxrwx 0 root root 5254877 Jul 21  2012 DSCN1409.JPG      I would like a script that runs to see the files in that directory, then create the 3 needed directories named like;               drwxrwxrwx 1 root root     0 Sep  2 16:49 07-19-2012     drwxrwxrwx 1 root root     0 Sep  2 16:49 07-20-2012     drwxrwxrwx 1 root root     0 Sep  2 16:49 07-21-2012      And then move the files into the appropriate directories. Does anyone have any suggestions on a good scriptable way to accomplish this?