Does "stopped" belong to "blocked" state?

The manpage of `ps` says               PROCESS STATE CODES        R  running or runnable (on run queue)        D  uninterruptible sleep (usually IO)        S  interruptible sleep (waiting for an event to complete)        Z  defunct/zombie, terminated but not reaped by its parent        T  stopped, either by a job control signal or because           it is being traced      Wikipedia http://en.wikipedia.org/wiki/Process_state doesn't mention D, S and T states, at least explicitly. Do D, S and T belong to ready state, blocked state or some other state?


Warning for kernel "make config" command without sudo

while trying to configure kernel before compile, when I give this command without sudo privileges:               make config      I get these:               /boot/config-3.2.0-4-amd64:488:warning: symbol value 'm' invalid for ACPI_PCI_SLOT     /boot/config-3.2.0-4-amd64:490:warning: symbol value 'm' invalid for ACPI_CONTAINER     /boot/config-3.2.0-4-amd64:491:warning: symbol value 'm' invalid for ACPI_HOTPLUG_MEMORY     /boot/config-3.2.0-4-amd64:1565:warning: symbol value 'm' invalid for BMP085     /boot/config-3.2.0-4-amd64:2979:warning: symbol value 'm' invalid for POWER_SUPPLY     /boot/config-3.2.0-4-amd64:3214:warning: symbol value 'm' invalid for MFD_WM8400     /boot/config-3.2.0-4-amd64:4703:warning: symbol value 'm' invalid for COMEDI_MISC_DRIVERS     /boot/config-3.2.0-4-amd64:4710:warning: symbol value 'm' invalid for COMEDI_PCI_DRIVERS     /boot/config-3.2.0-4-amd64:4767:warning: symbol value 'm' invalid for COMEDI_PCMCIA_DRIVERS     /boot/config-3.2.0-4-amd64:4775:warning: symbol value 'm' invalid for COMEDI_USB_DRIVERS      while none of these come while doing `sudo make config`. Why is that?


How can I constantly see the current filename in vim?

I am using vim and I need a way to always be able to see the file that I am working on without having to do `^G`.   I see the file name when I start vim but when I start to work and use various functions it gets lost.   Also I have seen other people have some kind of "addons" in the lower part of the vim console that seem like they are "button"/"tabs" (I am not sure how to describe them) that show various info constantly including the file name.   Any idea what are these plugins? Or how can I achieve what I want?


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

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


Start scrolling command prompt when filled until a particular fraction

I'm using the default terminal command prompt on Ubuntu 12.04. When I'm doing something on the prompt (as opposed to editing in `VI`) the scrolling starts when the text reaches bottom of the screen. I don't like that because I have to keep my eyes always at the bottom of the screen. I would prefer if there were an option to start scrolling things up when we reach a particular fraction of vertical screen size. Currently I just use clear screen (`CTRL+L`) but it's tedious to do that every time. I don't like resizing command prompt because the background distracts me and I have to resize it each time in a new session. Is there some way to do scroll when prompt fills until a particular fraction (say 70%)?


Domain name resolution tool not specific to DNS

`host`, `dig` and `nslookup` can be used to lookup DNS names from the command line. However, they query the names from the DNS server directly, instead of using `nsswitch` to resolve host names. This means /etc/hosts and mDNS aren't used. Is there a command line tool that looks up the name by the standard way (honouring mDNS and /etc/hosts)? There is a similar question on Ask DIfferent, but it seems to be specific to OS X.


What is the usage of $& in bash?

I was looking into special parameters in bash. I am curious to know what is `$&` and how it is different from `$_`. I see the following output when running the commands but could not locate the meaning as well.               k@Linux:~$ echo $&     [1] 12397     $     k@Linux:~$ echo $n          [1]+  Done                    echo $     k@Linux:~$


If htaccess doesn't use cookies, then how does it identify the client?

If I log in to my site that I protected with htaccess (so it pops up for a username/pwd) then I can't see any cookies. But why? How could the server identify that I'm the one that already logged in to the htaccess protected site? Could that be that we are on a NAT'ed network, and the server will let in others with the same public IP?


Ubuntu change language encoding for file uploading

Previously we were running a Wordpress site on a Mac OS Server machine. We had several hundred images with Chinese characters for the image names. Now we're trying to migrate to a Ubuntu system and everything is fine except the images. Every time I try to upload an image with a Chinese name via FTP, I get the following message: `MyImage contains illegal characters. Please choose an appropriate text encoding`. I have no idea how to solve this issue, do I need to somehow change the system language encoding in Ubuntu to allow for Chinese charactered image uploading?


Unable to install open CV in Ubuntu 12.04

I am trying to install openCv for learning purpose and then using it for OCR(Optical Character Recognition) but i am unable to install it in Ubuntu 12.04 I am following this link and able to carry upto step of downloading ffmpeg but while configuring it getting following error               ERROR: libmp3lame >= 3.98.3 not found      I tried to install libmp3lame following this link but get this error again when configuring ffmpeg               ERROR: libmp3lame >= 3.98.3 not found


Can I forbid the creation of files with certain permissions?

I have a directory with a certain group ID, and I only want files with the same ID to be in that directory. So I set the SGID bit on that directory, so that everytime a file is created inside it, it gets the correct ID. Commands like cp or touch are fine now. The problem is that if someone uses mv to move a file inside the directory, its group ID isn't set to that of the directory. I do not want that to happen.


Network adapter forgetting address?

I started sysrescuecd v3.7.0 via USB on my PC because I'd like to backup my disk.   My idea was to use `dd` and `nc` to send data to a different PC, so I'm using `ip addr add` to configure the ethernet device like this:               ip addr add 192.168.212.11/24 dev enp0s25      and I can successfully ping the remote PC. Problem is that, after a little while (some minutes), it seems that the OS is _forgetting_ the configuration. Pinging doesn't work anymore and `ip addr show` displays an unconfigured network card. Of course, I'm not rebooting or issuing other `ip` commands in the meanwhile. Anybody could help me figure out this, please?


Replace hard drive in ubuntu

I know variants of this question have been asked before, but I couldn't find a specific answer to my situation. So here goes: Running ubuntu server 12.04 with the os on a separate drive and two 1,5 TB WD Green drives (sdc and sdd). The 2 WD greens make up a volume group using all the available space and this makes up a logical volume of the same size. One of the drives (sdd) are getting old, and I'm planning on replacing it. I have bought a WD Red 4 TB (sdb) drive on which I have managed to create a partition using the gpt partition table. I have added this drive to the volume group (/dev/storage) and logical volume (/dev/storage/storage (not ideal nomenclature, I know, but I didn't set this up to begin with)) and resized the file system using resize2fs (completed after 18 hours) so that all the space on the 3 drives are available. I'm using webmin from time to time (as well as the terminal), and I got the impression that one could tell the system to move all the contents from one drive to another one, but no luck. Getting error message telling me "No extents available for allocation". So this is where I'm stuck at the moment. I would really like some advice on what's the easiest way to make sure all my files on the oldest 1,5TB drive is moved to the new 4TB drive (or at least off the oldest one), so that I can remove the old one completely. From what I've read, I need to reduce the filesystem, then reduce the logical volume freeing enough space on my new drive to fit the files from the old one. Do I have to run lvreduce -L3T /dev/storage/storage followed by resize2fs to scale it down first? And then what? pvmove? Another solution might be to just create a new volume group and logical volume using the new 4TB drive, mount it, move everything from the old lv to the new one, and then remove the old lv and vg? I feel I have tangled myself into something I don't know the best way out of. Any input is greatly appreciated.


Expression error in bash script

I am getting this really weird error despite of the fact that the same script runs fine on one platform (Arch linux) but not on my other mobile platform (Maemo Linux). I'll pass here the relevant part of the code with the line numbering:               41 for DIR in $DIRS     42 do     43 tempdir=$DIR/     44 tempval=$(stat -c %Y $tempdir)     45 echo $tempval     46 if (( $tempval > $(date +%s) - 3600*24*30 )); then     47     echo "I am done basically. Exiting..."     48     exit     49 else     50     continue     51 fi     52 done      In the code above **DIRS** is a list which contains names of directories. In this loop i am trying to find one directory of the list which is newer than 30 days old and if i find one i exit the script. Line 45 is put there for debugging purposes basically. I am getting the error below:               ./script.sh : line 52 : 1372757584 : not found      **After some changes suggested from the comments:** Ok the error now is below:               scone.sh: line 46: ((: 1372768246 -gt 1372770593 - 3600*24*30 : syntax error     in expression (error token is "1372770593 - 3600*24*30 ")


Can you specify a separate trap in a subshell created with ()?

I'm writing a script that starts a subshell to go off and do some work. In a special case, the script needs to tell the subshell to cleanly stop what it's doing and exit early. However, my psuedo-code below doesn't seem to be working. Am I trying the impossible? Is it possible to define a separate trap for signals in a subshell?               #!/bin/bash          function myExitFunction { ... }     trap myExitFunction SIGTERM          while [ 1 ] ; do         waitForSpecialCondition              kill -0 $SUBSHELL_PID   # check if subshell is running         if [ $? -eq 0 ] ; then  # and kill it if it is             kill $SUBSHELL_PID         fi              (         someProcess         MYOWNCHILD=$!           # save someProcess's pid to kill later if I need to         trap "kill $MYOWNCHILD" SIGTERM         ... # do stuff         ) &         SUBSHELL_PID=$!          done


Installing SCO OpenServer 5.0.7 Maintenance Pack

I have had so many issues on how to download, extract and install this software on SCO. And I'm sure there are loads of people having or had the same issue as I am having. So the question is, how do I install software in SCO?


Differences between sed on Mac OSX and other "standard" sed?

I am having some issues in using an answer provided on this site for this question about a sed command to replace a blank line with two other lines of content, and it was brought up if the sed command on Mac OS (10.6.7 for me) is different. I don't think that it is, but was wondering if others on this site thought differently.


"nopage" method for ISA vs PCI

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


Zip contents of some subfolders but not others

I would like to use the unix zip command to zip a directory. Let's say the directory is structured as follows:               dir1/     dir1/dir2/     dir1/dir2/file1     dir1/dir2/file2     dir1/dir3     dir1/dir3/file1     dir1/file1     dir1/file2      I would like to zip `dir1` into `dir1.zip` such that `dir1.zip` contains `dir1/file1, dir1/file2, dir1/dir2/file1, dir1/dir2/file2, dir3/`, but NOT `dir1/dir3/file1`. In short, I'd like to zip all of the FILES under `dir1`, `dir2` and all of its files, and `dir3` but NONE of its files. If I do `zip dir1 dir1/`, it will zip everything in `dir1`, all of its files and subfolders but not the contents of the subfolders. If I do `zip -r dir1 dir1/`, it will zip everything in `dir1`, including all of its files and all of the files of its subfolders. I would like to be able to control which subfolders should be zipped recursively and which shouldn't. Thanks.


How to stop Western Digital External HDD from Sleeping

I have one Western Digital External HDD(2TB) connected to Redhat Server with the Partition type Ext3. But I noticed that it goes to 'sleep' mode if no one is accessing it. So if I try to access it, it takes some time to wakeup I want to disabled this feature. Please advice me which parameter to disable # OUTPUT               sudo /sbin/hdparm /dev/sdb1          /dev/sdb1:      readonly     =  0 (off)      readahead    = 256 (on)      geometry     = 46589/255/63, sectors = 3906959742, start = 63


Xorg freeze with external monitor on Intel Mobile GM965/GL960 ( Debian linux )

I have as issue with my ASUS X80L laptop ( system config: Celeron M 550, 2Gb RAM, Intel Mobile GM965/GL960 video ). I'm running Debian testing on it with X.Org v 1.12.1.902 and XFce 4.8. Every 10-20 minutes my X-server is freeze for 20-60 seconds w/o any reason ( usually I'm using only IDE and opera browser for web-dev ). During freeze-time I can only move cursor and hear music on background. Watching my `/var/log/Xorg.0.log` on a tty1 I see repeated entries (it repeats every time while X is not respond):               (II) AIGLX: Suspending AIGLX clients for VT switch     (II) Open ACPI successful (/var/run/acpid.socket)     (II) AIGLX: Resuming AIGLX clients after VT switch     (II) intel(0): EDID vendor "GSM", prod id 17503     (II) intel(0): Using hsync ranges from config file     (II) intel(0): Using vrefresh ranges from config file     (II) intel(0): Printing DDC gathered Modelines:     (II) intel(0): Modeline "1280x1024"x0.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz eP)     (II) intel(0): Modeline "800x600"x0.0   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz e)     (II) intel(0): Modeline "640x480"x0.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz e)     (II) intel(0): Modeline "640x480"x0.0   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)     (II) intel(0): Modeline "720x400"x0.0   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz e)     (II) intel(0): Modeline "1280x1024"x0.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz e)     (II) intel(0): Modeline "1024x768"x0.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz e)     (II) intel(0): Modeline "1024x768"x0.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz e)     (II) intel(0): Modeline "832x624"x0.0   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz e)     (II) intel(0): Modeline "800x600"x0.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz e)     (II) intel(0): Modeline "1152x864"x0.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz e)     (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found      Full log http://pastebin.com/raw.php?i=92JXreRW Output of `lspci -v` http://pastebin.com/raw.php?i=QXWqsxZu Xorg.conf               Section "ServerLayout"         Identifier     "Layout0"         Screen      0  "Screen0"         InputDevice    "Keyboard0" "CoreKeyboard"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Keyboard0"         Driver         "kbd"         Option         "XkbLayout" "us,uk(winkeys)"         Option         "XkbOptions" "grp:alt_caps_toggle,grp_led:scroll"     EndSection          Section "Monitor"         Identifier     "Monitor0"         VendorName     "LG"         ModelName      "L1752HR"         Option         "DPMS" "false"              Modeline       "1280x800x0.0"   69.30  1280 1328 1360 1405  800 803 809 822 -hsync -vsync     EndSection          Section "Device"         Identifier     "Device0"         Driver         "intel"              VideoRam       524288     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24              SubSection     "Display"             Depth       24         EndSubSection     EndSection      I can't solve this issue by using google and forums. What's wrong? **upd.** I'm performed test using laptop w/o external display, but I'm still get save freezes and errors. Here is dmesg output http://pastebin.com/raw.php?i=xf9B1jgh Also, every time after that freezes my keyboard setting fall back to default, defined in `xorg.conf`. My xfce4 setting defines locales chagne by alt+caps, and left-alt as a compose-key. But it turn alt+shift to change locale, with no compose key. **upd 2** After changing my `xorg.conf` by adding some optioons regarding EDID               Option "UseEDID" "False"     Option "IgnoreEDID" "1"      There are no more error message in dmesg, but sometimes X-server freeze for the time (now for shorter time). And I've got some messages in my `Xorg.0.log`               [157600.245] (II) AIGLX: Suspending AIGLX clients for VT switch     [157605.263] (II) Open ACPI successful (/var/run/acpid.socket)     [157605.263] (II) AIGLX: Resuming AIGLX clients after VT switch     [157605.409] (II) intel(0): EDID vendor "LPL", prod id 297     [157605.409] (II) intel(0): Printing DDC gathered Modelines:     [157605.409] (II) intel(0): Modeline "1280x800"x0.0   69.30  1280 1328 1360 1405  800 803 809 822 -hsync -vsync (49.3 kHz eP)     [157605.810] (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found


How to properly prepare a server for power outages?

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


How do I configure multiple monitors to work with dwm's tag rules?

I have a laptop with an external monitor and I want to use the external monitor as the primary one. I'm also running Debian with dwm. `xrandr -q` gives me this:               Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 8192 x 8192     LVDS1 connected 1366x768+1920+0 (normal left inverted right x axis y axis) 345mm x 194mm        1366x768       60.0*+   50.0     VGA1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm        1920x1080      60.0*+      (I omitted some of the other resolutions for brevity). My dwm config.h file has several tag rules like this:               static const Rule rules[] = {         /* xprop(1):          *  WM_CLASS(STRING) = instance, class          *  WM_NAME(STRING) = title          */         /* class      instance    title       tags mask     isfloating   monitor */         { "Chromium",    NULL,   NULL,       1,            False,       -1 },         { "xxxterm",     NULL,   NULL,       1,            False,       -1 },         { "Surf",        NULL,   NULL,       1,            False,       -1 },         { "Iceweasel",   NULL,   NULL,       1 << 1,       False,       -1 },         { "Vlc",         NULL,   NULL,       1 << 3,       False,       -1 },     };      and I have this xrandr command in my ~/.xinitrc file that configures the monitors properly when I run `startx`:               xrandr --output VGA1 --auto --output LVDS1 --auto --right-of VGA1      I want my tag rules to apply whenever I open a program, and for that program to be automatically assigned to whichever monitor has focus. I found a reddit post that said that -1 would do this, but for any program that has a tag rule, they always open on my laptop (LVDS1), not the external monitor (VGA1). For programs that don't have a tag rule, e.g. st, they will open on whichever monitor/tag has focus. I tried changing the monitor value to 0 or 1, rebuilding dwm and restarting X, and the result is the same. How do I configure dwm so that programs with tag rules open in their respective tag on whichever monitor has focus? * * * My full `config.h`:               /* appearance */     static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";     static const char normbordercolor[] = "#333333";     static const char normbgcolor[]     = "#101010";     static const char normfgcolor[]     = "#999999";     static const char selbordercolor[]  = "#224488";     static const char selbgcolor[]      = "#224488";     static const char selfgcolor[]      = "#ffffff";     static const unsigned int borderpx  = 1;        /* border pixel of windows */     static const unsigned int snap      = 32;       /* snap pixel */     static const unsigned int minwsz    = 20;       /* Minimal heigt of a client */     static const Bool showbar           = True;     /* False means no bar */     static const Bool topbar            = True;     /* False means bottom bar */     static const Bool viewontag         = False;    /* Switch view on tag switch */     static const Bool extrabar          = True;     /* False means no extra bar */          /* tagging */     static const char *tags[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9" };          static const Rule rules[] = {         /* xprop(1):          *  WM_CLASS(STRING) = instance, class          *  WM_NAME(STRING) = title          */         /* class      instance    title       tags mask     isfloating   monitor */         { "Chromium",    NULL,   NULL,       1,            False,       -1 },         { "xxxterm",     NULL,   NULL,       1,            False,       -1 },         { "Surf",        NULL,   NULL,       1,            False,       -1 },         { "Iceweasel",   NULL,   NULL,       1 << 1,       False,       -1 },         { "Vlc",         NULL,   NULL,       1 << 3,       False,       -1 },         { NULL,          NULL,   "IPython",  1 << 4,       False,       -1 },         { "Eclipse",     NULL,   NULL,       1 << 4,       False,       -1 },         { "Quodlibet",   NULL,   NULL,       1 << 5,       False,       -1 },         { "Icedove",     NULL,   NULL,       1 << 6,       False,       -1 },         { "libreoffice", NULL,   NULL,       1 << 7,       False,       -1 },         { "Gnumeric",    NULL,   NULL,       1 << 7,       False,       -1 },         { "Abiword",     NULL,   NULL,       1 << 7,       False,       -1 },         { "Keepassx",    NULL,   NULL,       1 << 8,       False,       -1 },     };          /* layout(s) */     static const float mfact      = 0.50; /* factor of master area size [0.05..0.95] */     static const float smfact     = 0.00; /* factor of tiled clients [0.00..0.95] */     static const int nmaster      = 1;    /* number of clients in master area */     static const Bool resizehints = False; /* True means respect size hints in tiled resizals */          #include "patchlibs/bstack.c"     #include "patchlibs/bstackhoriz.c"     #include "patchlibs/fibonacci.c"     #include "patchlibs/gaplessgrid.c"     #include "patchlibs/tcl.c"     static const Layout layouts[] = {         /* symbol     arrange function */         { "T",      tile },    /* first entry is default */         { "F",      NULL },    /* no layout function means floating behavior */         { "B",      bstack },         { "G",      gaplessgrid },         { "M",      monocle },         { "H",      bstackhoriz },         { "C",      tcl },         { "S",      spiral },         { "D",      dwindle },     };          /* key definitions */     #define MODKEY Mod1Mask     #define WINKEY Mod4Mask     #define TAGKEYS(KEY,TAG) \         { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \         { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \         { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \         { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },          /* helper for spawning shell commands in the pre dwm-5.0 fashion */     #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }          /* commands */     static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */     static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };     static const char *termcmd[]  = { "st", NULL };     static const char *chromiumcmd[] = {"chromium-incognito", NULL};     static const char *icedovecmd[] = {"icedove", NULL};     static const char *xxxtermcmd[] = {"xxxterm", NULL};     static const char *musiccmd[] = {"quodlibet", NULL};     static const char *ipythoncmd[] = {"ipython3qt", NULL};     static const char *iceweaselcmd[] = {"iceweasel", NULL};     static const char *texteditcmd[] = {"scite", NULL};     static const char *lockcmd[] = {"lock", NULL};     static const char *videocmd[] = {"vlc", NULL};     static const char *screenshotcmd[] = {"screenshot", NULL};          #include "patchlibs/movestack.c"     static Key keys[] = {         /* modifier                     key        function        argument */         { WINKEY,                       XK_t,      spawn,          {.v = termcmd } },         { WINKEY,                       XK_c,      spawn,          {.v = chromiumcmd } },         { WINKEY,                       XK_d,      spawn,          {.v = icedovecmd } },         { WINKEY,                       XK_x,      spawn,          {.v = xxxtermcmd } },         { WINKEY,                       XK_i,      spawn,          {.v = iceweaselcmd } },         { WINKEY,                       XK_m,      spawn,          {.v = musiccmd } },         { WINKEY,                       XK_e,      spawn,          {.v = texteditcmd } },         { WINKEY,                       XK_p,      spawn,          {.v = ipythoncmd } },         { WINKEY,                       XK_l,      spawn,          {.v = lockcmd } },         { WINKEY,                       XK_v,      spawn,          {.v = videocmd } },         { WINKEY,                       XK_s,      spawn,          {.v = screenshotcmd } },         { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },         { MODKEY,                       XK_b,      togglebar,      {0} },         { MODKEY,                       XK_b,      toggleextrabar,      {0} },         { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },         { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },         { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },         { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },         { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },         { MODKEY,                       XK_u,      setsmfact,      {.f = -0.05} },         { MODKEY,                       XK_m,      setsmfact,      {.f = +0.05} },         { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },         { MODKEY,                       XK_Return, zoom,           {0} },         { MODKEY,                       XK_Tab,    view,           {0} },         { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },         { ControlMask|ShiftMask,        XK_t,      setlayout,      {.v = &layouts[0]} },         { ControlMask|ShiftMask,        XK_f,      setlayout,      {.v = &layouts[1]} },         { ControlMask|ShiftMask,        XK_b,      setlayout,      {.v = &layouts[2]} },         { ControlMask|ShiftMask,        XK_g,      setlayout,      {.v = &layouts[3]} },         { ControlMask|ShiftMask,        XK_m,      setlayout,      {.v = &layouts[4]} },         { ControlMask|ShiftMask,        XK_h,      setlayout,      {.v = &layouts[5]} },         { ControlMask|ShiftMask,        XK_c,      setlayout,      {.v = &layouts[6]} },         { ControlMask|ShiftMask,        XK_s,      setlayout,      {.v = &layouts[7]} },         { ControlMask|ShiftMask,        XK_d,      setlayout,      {.v = &layouts[8]} },         { ControlMask,                  XK_space,  setlayout,      {0} },         { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },         { MODKEY,                       XK_0,      view,           {.ui = ~0 } },         { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },         { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },         { MODKEY,                       XK_period, focusmon,       {.i = +1 } },         { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },         { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },         { MODKEY|ShiftMask,             XK_j,      movestack,      {.i = +1 } },         { MODKEY|ShiftMask,             XK_k,      movestack,      {.i = -1 } },         TAGKEYS(                        XK_1,                      0)         TAGKEYS(                        XK_2,                      1)         TAGKEYS(                        XK_3,                      2)         TAGKEYS(                        XK_4,                      3)         TAGKEYS(                        XK_5,                      4)         TAGKEYS(                        XK_6,                      5)         TAGKEYS(                        XK_7,                      6)         TAGKEYS(                        XK_8,                      7)         TAGKEYS(                        XK_9,                      8)         { MODKEY|ShiftMask,             XK_q,      quit,           {0} },     };          /* button definitions */     /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */     static Button buttons[] = {         /* click                event mask      button          function        argument */         { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },         { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[3]} },         { ClkWinTitle,          0,              Button2,        zoom,           {0} },         { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },         { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },         { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },         { ClkTagBar,            0,              Button1,        view,           {0} },         { ClkTagBar,            0,              Button3,        toggleview,     {0} },         { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },         { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },     };


Command to run a child process "offline" (no external network) on Linux

I have a program I would like to test in offline mode without taking down my actual network. This program would still need to connect to local sockets, including unix domain sockets and loopback. It also needs to _listen_ on loopback and be visible to other apps. But attempts to connect to a remote machine should fail. I'd like to have a utility that works like `strace`/`unshare`/`sudo` and simply runs a command with the Internet (and LAN) concealed and everything else still working: ` $ offline my-program-to-test ` This question has hints at the answer: Block network access of a process? There are a couple of suggestions there, such as run as another user then manipulate iptables, or `unshare -n`. But in both cases I don't know the incantation to get unix domain sockets and loopback to be shared with the main system - the answers to that question only tell me how to unshare the _entire_ network. The program I'm testing still needs to connect to my X server and dbus and even be able to listen on loopback for connections from other apps on the system. Ideally I'd like to avoid creating chroots or users or VMs or the like, since it becomes just as annoying as unplugging the network cable is. i.e. the point of the question is how can I make this as simple as a `sudo`. I'd love the process to run 100% normally except that network calls specifying a non-local address would fail. Ideally keeping the same uid, same homedir, same pwd, same everything except ... offline. I'm using Fedora 18, so unportable Linux answers are just fine (expected, even). I'm even happy to solve this by writing a C program, if that's what's involved, so answers that involve writing C are fine. I just don't know what syscalls that C program would need to make to revoke the external network access while keeping local network. Any developer trying to support "offline mode" would probably appreciate this utility!


Remove trailing new line from 'clipboard' to prevent execution on the terminal?

Is there some way to run whatever you copy to the 'clipboard' through some sort of filter? Ideally to strip out the trailing newline from something you copy, so that it doesn't auto-run in the terminal? This is what it looks like when I copy the test in question, and I sometimes forget this is a new line.   ![enter image description here](http://i.stack.imgur.com/7e0qY.png)


Lintian reports non-dev-pkg-with-shlib-symlink while dh_auto_install makes this link

So, I am trying to build the main package of a library (which means, without the development header file). When I run debuild lintian complains that:               W: libwebsitesnapshot1: non-dev-pkg-with-shlib-symlink usr/lib/i386-linux-gnu/libwebsitesnapshot.so.1.0.0 usr/lib/i386-linux-gnu/libwebsitesnapshot.so      So, I need to get rid the libwebsitesnapshot.so symlink. Searching what debhelper does, I found out that these symlinks are being built from 2 (!) separate places. The one place was dh_link and the other one was dh_auto_configure. In my debian/rules file I overrided dh_link with nothing, but I cannot override dh_auto_install with nothing, because it does more things than just linking. Here's my debian/rules file:               #!/usr/bin/make -f     export DH_VERBOSE=1          %:         dh $@          override_dh_auto_configure:         dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)     override_dh_link:      So: How am I going to get rid of just that .so file? What I've tried so far is adding               override_dh_auto_instal:         dh_auto_install -X .so      to debian/rules, in an attempt to make dh_auto_install to ignore the .so symlink, but to no avail.


Which Unixes support cross-device filesystem links (in particular for rename)?

Just read the following on the FreeBSD man page for the rename syscall:               ...     [EXDEV] The link named by to and the file named by from are on             different logical devices (file systems).  Note that             this error code will not be returned if the implemen-             tation permits cross-device links.     ...      Especially: > .. **if the implementation permits cross-device links.** Are there Unixes that implement this behavior using cross-device links? Which ones? Sidenote: One case, where it would be useful to have cross-device links is atomic renames. How can one have atomic renames if a the system (like most) does not support these over devices?


How does the script /etc/init.d/sudo work?

I was reading the script `/etc/init.d/sudo`. It has been written as a comment in the script that it **provides limited super user privileges to specific users**. Though, I could not understand the script as to how is it working? Can someone explain me the script? I am using Ubuntu 14.04 32-bit.


Lightdm user session settings on Ubuntu

Lightdm is displayed properly but after entering a password and clicking login, I see the screen blink and lightdm window re-appears and asks to log in as if nothing happened. ## Configs user@laptop:~$ cat /etc/lightdm/               lightdm.conf                     lightdm-gtk-greeter-ubuntu.conf       lightdm-gtk-greeter.conf         users.conf                             ## lightdm.conf user@laptop:~$ cat /etc/lightdm/lightdm.conf               #[LightDM]     #xsessions-directory=/usr/share/xsessions           [SeatDefaults]     user-session=xfce     greeter-session=lightdm-gtk-greeter     greeter-hide-users=true      ## lightdm-gtk-greeter.conf user@laptop:~$ cat /etc/lightdm/lightdm-gtk-greeter.conf               #     # background = Background file to use, either an image path or a color (e.g. #772953)     # theme-name = GTK+ theme to use     # font-name = Font to use     # xft-antialias = Whether to antialias Xft fonts (true or false)     # xft-dpi = Resolution for Xft in dots per inch (e.g. 96)     # xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)     # xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)     #     [greeter]     logo=/usr/share/pixmaps/xubuntu-logo-menu.png     background=/usr/share/xfce4/backdrops/xubuntu-karmic.png     #show-language-selector=false     theme-name=retro1     font-name=Droid Sans 10     xft-antialias=true     #xft-dpi=     xft-hintstyle=hintfull     xft-rgba=rgb     show-language-selector=true      ## lightdm-gtk-greeter-ubuntu.conf user@laptop:~$ cat /etc/lightdm/lightdm-gtk-greeter-ubuntu.conf               #     # background = Background file to use, either an image path or a color (e.g. #772953)     # theme-name = GTK+ theme to use     # font-name = Font to use     # xft-antialias = Whether to antialias Xft fonts (true or false)     # xft-dpi = Resolution for Xft in dots per inch (e.g. 96)     # xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)     # xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)     #     [greeter]     logo=/usr/share/pixmaps/xubuntu-logo-menu.png     background=/usr/share/xfce4/backdrops/xubuntu-karmic.png     #show-language-selector=false     theme-name=retro1     font-name=Droid Sans 10     xft-antialias=true     #xft-dpi=     xft-hintstyle=hintfull     xft-rgba=rgb     show-language-selector=true      ## users.conf user@laptop:~$ cat /etc/lightdm/users.conf               #     # User accounts configuration     #     # NOTE: If you have AccountsService installed on your system, then LightDM will     # use this instead and these settings will be ignored     #     # minimum-uid = Minimum UID required to be shown in greeter     # hidden-users = Users that are not shown to the user     # hidden-shells = Shells that indicate a user cannot login     #     [UserAccounts]     minimum-uid=500     hidden-users=nobody nobody4 noaccess     hidden-shells=/bin/false /usr/sbin/nologin      ## Logs user@laptop:~$ cat /var/log/lightdm/               lightdm.log          x-0-greeter.log.old  x-1-greeter.log      x-1.log                   x-0-greeter.log      x-0.log              x-1-greeter.log.old        user@laptop:~$ cat /var/log/lightdm/lightdm.log               cat: /var/log/lightdm/lightdm.log: Permission denied     user@laptop:~$ sudo cat /var/log/lightdm/lightdm.log     [sudo] password for user:      [+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log     [+0.00s] DEBUG: Starting Light Display Manager 1.2.1, UID=0 PID=2677     [+0.00s] DEBUG: Loaded configuration from /etc/lightdm/lightdm.conf     [+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager     [+0.00s] DEBUG: Registered seat module xlocal     [+0.00s] DEBUG: Registered seat module xremote     [+0.00s] DEBUG: Adding default seat     [+0.00s] DEBUG: Starting seat     [+0.00s] DEBUG: Starting new display for greeter     [+0.00s] DEBUG: Starting local X display     [+0.00s] DEBUG: Using VT 7     [+0.00s] DEBUG: Activating VT 7     [+0.01s] DEBUG: Logging to /var/log/lightdm/x-0.log     [+0.01s] DEBUG: Writing X server authority to /var/run/lightdm/root/:0     [+0.01s] DEBUG: Launching X Server     [+0.01s] DEBUG: Launching process 2683: /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch     [+0.01s] DEBUG: Waiting for ready signal from X server :0     [+0.01s] DEBUG: Acquired bus name org.freedesktop.DisplayManager     [+0.01s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0     [+0.91s] DEBUG: Got signal 10 from process 2683     [+0.91s] DEBUG: Got signal from X server :0     [+0.91s] DEBUG: Connecting to XServer :0     [+0.91s] DEBUG: Starting greeter     [+0.91s] DEBUG: Started session 2688 with service 'lightdm', username 'lightdm'     [+0.94s] DEBUG: Session 2688 authentication complete with return value 0: Success     [+0.94s] DEBUG: Greeter authorized     [+0.94s] DEBUG: Logging to /var/log/lightdm/x-0-greeter.log     [+0.94s] DEBUG: Session 2688 running command /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/lightdm-gtk-greeter     [+1.12s] DEBUG: Greeter connected version=1.2.1     [+1.12s] DEBUG: Greeter connected, display is ready     [+1.12s] DEBUG: New display ready, switching to it     [+1.12s] DEBUG: Activating VT 7     [+1.45s] DEBUG: Greeter start authentication     [+1.45s] DEBUG: Started session 2733 with service 'lightdm', username '(null)'     [+1.46s] DEBUG: Session 2733 got 1 message(s) from PAM     [+1.46s] DEBUG: Prompt greeter with 1 message(s)     [+2.98s] DEBUG: Continue authentication     [+2.99s] DEBUG: Session 2733 got 1 message(s) from PAM     [+2.99s] DEBUG: Prompt greeter with 1 message(s)     [+8.36s] DEBUG: Continue authentication     [+8.41s] DEBUG: Session 2733 authentication complete with return value 0: Success     [+8.41s] DEBUG: Authenticate result for user user: Success     [+8.42s] DEBUG: User user authorized     [+8.42s] DEBUG: Greeter requests session xfce     [+8.42s] DEBUG: Using session xfce     [+8.42s] DEBUG: Stopping greeter     [+8.42s] DEBUG: Session 2688: Sending SIGTERM     [+8.46s] DEBUG: Session 2688 exited with return value 0     [+8.46s] DEBUG: Greeter quit     [+8.47s] DEBUG: Dropping privileges to uid 1001     [+8.47s] DEBUG: Restoring privileges     [+8.47s] DEBUG: Dropping privileges to uid 1001     [+8.47s] DEBUG: Writing /home/user/.dmrc     [+8.54s] DEBUG: Restoring privileges     [+8.58s] DEBUG: Starting session xfce as user user     [+8.58s] DEBUG: Session 2733 running command /usr/sbin/lightdm-session startxfce4     [+8.60s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0     [+8.60s] DEBUG: Greeter closed communication channel     [+8.60s] DEBUG: Session 2733 exited with return value 1     [+8.60s] DEBUG: User session quit     [+8.60s] DEBUG: Stopping display     [+8.60s] DEBUG: Sending signal 15 to process 2683     [+8.77s] DEBUG: Process 2683 exited with return value 0     [+8.77s] DEBUG: X server stopped     [+8.77s] DEBUG: Removing X server authority /var/run/lightdm/root/:0     [+8.77s] DEBUG: Releasing VT 7     [+8.77s] DEBUG: Display server stopped     [+8.77s] DEBUG: Display stopped     [+8.77s] DEBUG: Active display stopped, switching to greeter     [+8.77s] DEBUG: Switching to greeter     [+8.77s] DEBUG: Starting new display for greeter     [+8.77s] DEBUG: Starting local X display     [+8.77s] DEBUG: Using VT 7     [+8.77s] DEBUG: Logging to /var/log/lightdm/x-0.log     [+8.77s] DEBUG: Writing X server authority to /var/run/lightdm/root/:0     [+8.77s] DEBUG: Launching X Server     [+8.77s] DEBUG: Launching process 2764: /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch     [+8.77s] DEBUG: Waiting for ready signal from X server :0     [+9.68s] DEBUG: Got signal 10 from process 2764     [+9.68s] DEBUG: Got signal from X server :0     [+9.68s] DEBUG: Connecting to XServer :0     [+9.68s] DEBUG: Starting greeter     [+9.68s] DEBUG: Started session 2769 with service 'lightdm', username 'lightdm'     [+9.70s] DEBUG: Session 2769 authentication complete with return value 0: Success     [+9.71s] DEBUG: Greeter authorized     [+9.71s] DEBUG: Logging to /var/log/lightdm/x-0-greeter.log     [+9.71s] DEBUG: Session 2769 running command /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/lightdm-gtk-greeter     [+9.87s] DEBUG: Greeter connected version=1.2.1     [+9.87s] DEBUG: Greeter connected, display is ready     [+9.87s] DEBUG: New display ready, switching to it     [+9.87s] DEBUG: Activating VT 7     [+9.87s] DEBUG: Stopping greeter display being switched from     [+10.20s] DEBUG: Greeter start authentication     [+10.20s] DEBUG: Started session 2814 with service 'lightdm', username '(null)'     [+10.20s] DEBUG: Session 2814 got 1 message(s) from PAM     [+10.20s] DEBUG: Prompt greeter with 1 message(s)     [+110.97s] DEBUG: Got signal 15 from process 1     [+110.97s] DEBUG: Caught Terminated signal, shutting down     [+110.97s] DEBUG: Stopping display manager     [+110.97s] DEBUG: Stopping seat     [+110.97s] DEBUG: Stopping display     [+110.97s] DEBUG: Session 2769: Sending SIGTERM     [+110.97s] DEBUG: Session 2814 terminated with signal 15     [+110.97s] DEBUG: Session 2814 failed during authentication     [+110.97s] DEBUG: Authenticate result for user (null): Authentication stopped before completion     [+111.04s] DEBUG: Session 2769 exited with return value 15     [+111.04s] DEBUG: Greeter quit     [+111.04s] DEBUG: Sending signal 15 to process 2764     [+111.06s] DEBUG: Process 2764 exited with return value 0     [+111.06s] DEBUG: X server stopped     [+111.06s] DEBUG: Removing X server authority /var/run/lightdm/root/:0     [+111.06s] DEBUG: Releasing VT 7     [+111.06s] DEBUG: Display server stopped     [+111.06s] DEBUG: Display stopped     [+111.06s] DEBUG: Seat stopped     [+111.06s] DEBUG: Display manager stopped     [+111.06s] DEBUG: Stopping daemon     [+111.06s] DEBUG: Exiting with return value 0      ## Installed packages A web search suggested I need to install additional packages, such as lightdm- gtk-greeter, but I already have it installed.               user@laptop:~$ sudo dpkg -l lightdm*     Desired=Unknown/Install/Remove/Purge/Hold     | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend     |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)     ||/ Name                        Version                     Description     +++-===========================-===========================-======================================================================     ii  lightdm                     1.2.1-0ubuntu1.1            Display Manager     un  lightdm-greeter             <none>                      (no description available)     un  lightdm-greeter-example-gtk <none>                      (no description available)     ii  lightdm-gtk-greeter         1.1.5-0ubuntu1              LightDM GTK+ Greeter     un  lightdm-gtk-greeter-config  <none>                      (no description available)     user@laptop:~$      ## Unity-greeter solution (not what I want) Bug 850941, bug 804171 suggest using unity-greeter with lightdm. This might work, but lightdm does not depend on unity-greeter, and I am trying to use the lightdm-gtk-greeter alternative. ## Problem interpretation The way I see it, the problem is that the user session is not defined properly. It is started and closes off at once. Relevant snippet from the log:               [+8.58s] DEBUG: Starting session xfce as user user     [+8.58s] DEBUG: Session 2733 running command /usr/sbin/lightdm-session startxfce4     [+8.60s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0     [+8.60s] DEBUG: Greeter closed communication channel     [+8.60s] DEBUG: Session 2733 exited with return value 1     [+8.60s] DEBUG: User session quit     [+8.60s] DEBUG: Stopping display     [+8.60s] DEBUG: Sending signal 15 to process 2683     [+8.77s] DEBUG: Process 2683 exited with return value 0     [+8.77s] DEBUG: X server stopped     [+8.77s] DEBUG: Removing X server authority /var/run/lightdm/root/:0     [+8.77s] DEBUG: Releasing VT 7     [+8.77s] DEBUG: Display server stopped     [+8.77s] DEBUG: Display stopped     [+8.77s] DEBUG: Active display stopped, switching to greeter      I am using the xfce desktop environment and any working examples would be appreciated.


How to use persistent names in LILO?

I have two SATA drives, but their names `/dev/sda` and `/dev/sdb` are chosen randomly by Linux. How can I correctly set up LILO? How can I put a stable reference to the hard drives in `lilo.conf`? **ADDED.** Can I use udev's names (like /dev/disk/by-id/*) in lilo.conf? LILO dont read lilo.conf at each boot, but only once on setup MBR when I run 'lilo' without arguments. At this stage udev names are available. But how do LILO store information about disks to MBR and boot-files? I use dual-boot with Windows, but NTFS disks have no UUID. I want to use udev's id.


vfat not recognized in debian

I want to mount my usb drive (kindle vfat32). When I do               mount -t auto /dev/sdf1 /mnt/usb      I get               mount: unknown filesystem type 'vfat'        * I checked if the drive is recognized with `sudo fdisk -l` and the recognized filesystem is `W95 FAT32`   * my kernel is `3.2.0-4-686-pae`.    * I checked the recognized filesystem with `cat /proc/filesystems` and vfat is not there.    * `dosfstools` is installed what should I do? * * * I am using the kernel released in the minimal netbook installation of debian. If I run `modprobe vfat` as root I get the following:               libkmod: ERROR ../libkmod/libkmod-module.c:174 kmod_module_parse_depline: ctx=0xb8556008 path=/lib/modules/3.2.0-4-686-pae/kernel/fs/fat/fat.ko error=No such file or directory     libkmod: ERROR ../libkmod/libkmod-module.c:174 kmod_module_parse_depline: ctx=0xb8556008 path=/lib/modules/3.2.0-4-686-pae/kernel/fs/fat/fat.ko error=No such file or directory     ERROR: could not insert 'vfat': Unknown symbol in module, or unknown parameter (see dmesg)      * * * When I `cat /proc/modules` I get:               dm_mod 57362 0 - Live 0xfcb45000     ip6table_filter 12492 1 - Live 0xf847a000     ip6_tables 17185 1 ip6table_filter, Live 0xf8564000     snd_hda_codec_realtek 142274 1 - Live 0xf86a3000     ppdev 12651 0 - Live 0xf8408000     binfmt_misc 12813 1 - Live 0xf8454000     lp 12797 0 - Live 0xf846d000     nfsd 173890 0 - Live 0xf8711000     nfs 265921 0 - Live 0xf86cf000     nfs_acl 12463 2 nfsd,nfs, Live 0xf8437000     auth_rpcgss 32143 2 nfsd,nfs, Live 0xf8501000     fscache 31978 1 nfs, Live 0xf8494000     lockd 57277 2 nfsd,nfs, Live 0xf850a000     sunrpc 143904 6 nfsd,nfs,nfs_acl,auth_rpcgss,lockd, Live 0xf852e000     iptable_filter 12488 1 - Live 0xf8403000     ip_tables 17079 1 iptable_filter, Live 0xf8421000     x_tables 18158 4 ip6table_filter,ip6_tables,iptable_filter,ip_tables, Live 0xf8414000     usbhid 31554 0 - Live 0xf84cf000     hid 60152 1 usbhid, Live 0xf84e5000     nouveau 526808 3 - Live 0xf856d000     mxm_wmi 12467 1 nouveau, Live 0xf8385000     video 17459 1 nouveau, Live 0xf841b000     ttm 47786 1 nouveau, Live 0xf842a000     drm_kms_helper 22738 1 nouveau, Live 0xf840d000     drm 146387 5 nouveau,ttm,drm_kms_helper, Live 0xf84aa000     snd_hda_intel 21786 6 - Live 0xf8473000     snd_hda_codec 63477 2 snd_hda_codec_realtek,snd_hda_intel, Live 0xf8443000     snd_hwdep 12943 1 snd_hda_codec, Live 0xf835b000     snd_pcm 53461 3 snd_hda_intel,snd_hda_codec, Live 0xf8459000     snd_page_alloc 12867 2 snd_hda_intel,snd_pcm, Live 0xf843e000     snd_seq 39512 0 - Live 0xf8394000     snd_seq_device 13016 1 snd_seq, Live 0xf82e3000     snd_timer 22356 2 snd_pcm,snd_seq, Live 0xf8363000     power_supply 13283 1 nouveau, Live 0xf8356000     snd 42722 19 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_seq,snd_seq_device,snd_timer, Live 0xf834a000     i2c_nforce2 12520 0 - Live 0xf8345000     i2c_algo_bit 12713 1 nouveau, Live 0xf83fe000     i2c_core 19116 5 nouveau,drm_kms_helper,drm,i2c_nforce2,i2c_algo_bit, Live 0xf8378000     soundcore 12921 1 snd, Live 0xf82d0000     evdev 17225 8 - Live 0xf82f7000     acpi_cpufreq 12807 0 - Live 0xf82e8000     mperf 12421 1 acpi_cpufreq, Live 0xf82de000     processor 27565 1 acpi_cpufreq, Live 0xf84a2000     thermal_sys 17752 2 video,processor, Live 0xf8372000     parport_pc 22036 0 - Live 0xf83a9000     parport 31254 3 ppdev,lp,parport_pc, Live 0xf83a0000     coretemp 12770 0 - Live 0xf838f000     container 12525 0 - Live 0xf838a000     button 12817 1 nouveau, Live 0xf8380000     wmi 13051 2 nouveau,mxm_wmi, Live 0xf836d000     pcspkr 12515 0 - Live 0xf82fe000     loop 17810 0 - Live 0xf82d8000     autofs4 22784 2 - Live 0xf82f0000     ext4 306996 3 - Live 0xf83b2000     crc16 12327 1 ext4, Live 0xf82be000     jbd2 52330 1 ext4, Live 0xf82b0000     mbcache 12938 1 ext4, Live 0xf8239000     usb_storage 35142 0 - Live 0xf82c6000     sg 21476 0 - Live 0xf8264000     sr_mod 17468 0 - Live 0xf82aa000     sd_mod 35425 5 - Live 0xf8295000     cdrom 34813 1 sr_mod, Live 0xf82a0000     crc_t10dif 12332 1 sd_mod, Live 0xf8234000     ata_generic 12439 0 - Live 0xf822f000     ahci 24917 4 - Live 0xf828d000     libahci 18308 1 ahci, Live 0xf8242000     ohci_hcd 22059 0 - Live 0xf826c000     r8169 41802 0 - Live 0xf8281000     mii 12595 1 r8169, Live 0xf821f000     libata 125014 3 ata_generic,ahci,libahci, Live 0xf8325000     ehci_hcd 35509 0 - Live 0xf8273000     scsi_mod 135037 5 usb_storage,sg,sr_mod,sd_mod,libata, Live 0xf8303000     usbcore 104555 5 usbhid,usb_storage,ohci_hcd,ehci_hcd, Live 0xf8249000     usb_common 12338 1 usbcore, Live 0xf8215000


Order of mounting USB devices in Linux

I'm running a Ubuntu system where USB drives are mounted automatically.   I'm curious to what happens when a USB device plugs in a port. Which part of the linux senses that a new device has been plugged in? After that which processes (and what is the caller or callers) are called to mount it to the system? Are theese kernel-space, user-space processes or mixed ? I'd like to follow theese steps in a C/C++ program. Is there any way to do that? Where could I read more about it? How would you do it?


can't change user

I setup `vsftp` with my ftp users' home directory at `/var/www` but I realized, it wouldn't let em login by ftp, I tried to connect to `127.0.0.1`. So then i wanted to "try out" my ftp user on the shell but I get this:               reg@regDesktopHome:~$ whoami     reg     reg@regDesktopHome:~$ su - ftp     Password:      reg@regDesktopHome:~$ whoami     reg      Why does `su` not let me change the current user I'm wondering?


installing/configuring and running sshguard on debian

I am trying to install/configure and run sshguard on debian, I want to check if brute force attacks happen on my server. I have installed it via apt-get, then I installed systemd and followed the following instructions for configuring https://wiki.archlinux.org/index.php/Sshguard (but those are for archlinux). when I type `systemctl enable sshguard` it does not work and I get `Failed to issue method call: Unit name sshguard is not valid.` I know this should be a routine task, but it is the first time I have to work with daemon. This stuff is very new to me and I am lost in the documentation. I would like to configure the thing in a way that it default: it bans temporarily ip after 4 failed attempts and of course I would like to start the service at boot. Maybe I can entirely forget about it because I intend to allow passwordless login (via public key exchange) * * * when I start `sshguard` with `/etc/init.d/sshguard start` , I get               [....] Starting sshguard (via systemctl): sshguard.serviceFailed to issue method call: Access denied failed!


I've been doing some research into improving performance for OpenVPN and I found out about setting fastforwarding to 1 but when I tried I got the error `error: "net.inet.ip.fastforwarding" is an unknown key` and tried `error: "net.ipv4.ip.fastforwarding" is an unknown key`and wanted to know if I needed to load a module? This is a CentoOS 6.x 64bit box.


Compacting `find` name patterns

I am using               find . -name '*.[cCHh][cC]' -exec grep -nHr "$1" {} ';'     find . -name '*.[cCHh]' -exec grep -nHr "$1" {} ';'      to search for a string in all files ending with .c, .C, .h, .H, .cc and .CC listed in all subdirectories. But since this includes two commands this feels inefficient. How do I write a regex to include .c,.C,.h,.H,.cc and .CC files using one single regex? EDIT: I am running this on bash on a Linux machine.


Is it possible for du to report significantly more disk in use than the mount point has available?

I ran into an interesting situation the other day. I have a 1TB NFS filesystem mounted on /backup. `df` reported approx 1TB total size, as expected. However, running `du -csh .` in the /backup/.snapshot directory reported 3.0 TB of data. I have never seen du produce output that is greater in total size than the mount point. This NFS share is provided by a NetApp appliance. The .snapshot directory is created by the NetApp afaik, configured to use 5% of space. (and of course, shouldn't be possible to use 300% of space) So is this a Linux issue, an NFS issue, a NetApp issue, or something else? What other data can I provide? OS is CentOS 6.


for vs find in Bash

When looping through files there are two ways: **`1.` use a for-loop**               for f in *; do         echo "$f"     done      **`2.` use `find`**               find * -prune | while read f; do          echo "$f"     done      Assuming these two loops will find the same list of files, what are the differences in those two options in **perfomance** and handling?


Apache configuration issues

I'm running OpenSuSE Linux and installed `apache`, `php`, `mysql`, `vsftp` for web experiments. I installed Wordpress on local Apache but... problem comes from here. So I've localhost/wordpress as root directory, which is `/srv/www/htdocs/wordpress/` of course there is content directory and plugins and themes... Wordpress can see installed plugins and themes, but doesn't see sub- directories of theme directory. So no images, nothing else what is in sub- directories isn't displayed. I 've checked, it isn't a theme issue.... something on Apache needs to be configured.


vsftp user authentication problems

I configured my ftp user's home dir to `/var/www` and set a password but I cannot login with `ftp 127.0.0.1`, it keep giving me `530 Login incorrect.` Why is this? I'm sure I have typed the password right. **edit 1** My config `/etc/vsftpd.conf` looks like:               # Example config file /etc/vsftpd.conf     #     # The default compiled in settings are fairly paranoid. This sample file     # loosens things up a bit, to make the ftp daemon more usable.     # Please see vsftpd.conf.5 for all compiled in defaults.     #     # READ THIS: This example file is NOT an exhaustive list of vsftpd options.     # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's     # capabilities.     #     #     # Run standalone?  vsftpd can run either from an inetd or as a standalone     # daemon started from an initscript.     listen=YES     #     # Run standalone with IPv6?     # Like the listen parameter, except vsftpd will listen on an IPv6 socket     # instead of an IPv4 one. This parameter and the listen parameter are mutually     # exclusive.     #listen_ipv6=YES     #     # Allow anonymous FTP? (Disabled by default)     anonymous_enable=NO     #     # Uncomment this to allow local users to log in.     local_enable=YES     #     # Uncomment this to enable any form of FTP write command.     write_enable=YES     #     # Default umask for local users is 077. You may wish to change this to 022,     # if your users expect that (022 is used by most other ftpd's)     #local_umask=022     #     # Uncomment this to allow the anonymous FTP user to upload files. This only     # has an effect if the above global write enable is activated. Also, you will     # obviously need to create a directory writable by the FTP user.     #anon_upload_enable=YES     #     # Uncomment this if you want the anonymous FTP user to be able to create     # new directories.     #anon_mkdir_write_enable=YES     #     # Activate directory messages - messages given to remote users when they     # go into a certain directory.     dirmessage_enable=YES     #     # If enabled, vsftpd will display directory listings with the time     # in  your  local  time  zone.  The default is to display GMT. The     # times returned by the MDTM FTP command are also affected by this     # option.     use_localtime=YES     #     # Activate logging of uploads/downloads.     xferlog_enable=YES     #     # Make sure PORT transfer connections originate from port 20 (ftp-data).     connect_from_port_20=YES     #     # If you want, you can arrange for uploaded anonymous files to be owned by     # a different user. Note! Using "root" for uploaded files is not     # recommended!     #chown_uploads=YES     #chown_username=whoever     #     # You may override where the log file goes if you like. The default is shown     # below.     #xferlog_file=/var/log/vsftpd.log     #     # If you want, you can have your log file in standard ftpd xferlog format.     # Note that the default log file location is /var/log/xferlog in this case.     #xferlog_std_format=YES     #     # You may change the default value for timing out an idle session.     #idle_session_timeout=600     #     # You may change the default value for timing out a data connection.     #data_connection_timeout=120     #     # It is recommended that you define on your system a unique user which the     # ftp server can use as a totally isolated and unprivileged user.     #nopriv_user=ftpsecure     #     # Enable this and the server will recognise asynchronous ABOR requests. Not     # recommended for security (the code is non-trivial). Not enabling it,     # however, may confuse older FTP clients.     #async_abor_enable=YES     #     # By default the server will pretend to allow ASCII mode but in fact ignore     # the request. Turn on the below options to have the server actually do ASCII     # mangling on files when in ASCII mode.     # Beware that on some FTP servers, ASCII support allows a denial of service     # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd     # predicted this attack and has always been safe, reporting the size of the     # raw file.     # ASCII mangling is a horrible feature of the protocol.     #ascii_upload_enable=YES     #ascii_download_enable=YES     #     # You may fully customise the login banner string:     #ftpd_banner=Welcome to blah FTP service.     #     # You may specify a file of disallowed anonymous e-mail addresses. Apparently     # useful for combatting certain DoS attacks.     #deny_email_enable=YES     # (default follows)     #banned_email_file=/etc/vsftpd.banned_emails     #     # You may restrict local users to their home directories.  See the FAQ for     # the possible risks in this before using chroot_local_user or     # chroot_list_enable below.     #chroot_local_user=YES     #     # You may specify an explicit list of local users to chroot() to their home     # directory. If chroot_local_user is YES, then this list becomes a list of     # users to NOT chroot().     # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that     # the user does not have write access to the top level directory within the     # chroot)     chroot_local_user=YES     #chroot_list_enable=YES     # (default follows)     #chroot_list_file=/etc/vsftpd.chroot_list     #     # You may activate the "-R" option to the builtin ls. This is disabled by     # default to avoid remote users being able to cause excessive I/O on large     # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume     # the presence of the "-R" option, so there is a strong case for enabling it.     #ls_recurse_enable=YES     #     # Customization     #     # Some of vsftpd's settings don't fit the filesystem layout by     # default.     #     # This option should be the name of a directory which is empty.  Also, the     # directory should not be writable by the ftp user. This directory is used     # as a secure chroot() jail at times vsftpd does not require filesystem     # access.     secure_chroot_dir=/var/run/vsftpd/empty     #     # This string is the name of the PAM service vsftpd will use.     pam_service_name=vsftpd     #     # This option specifies the location of the RSA certificate to use for SSL     # encrypted connections.     rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem     # This option specifies the location of the RSA key to use for SSL     # encrypted connections.     rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key          allow_writeable_chroot=YES      and permissions are set to `777`:               reg@regDesktopHome:~$ ls -ld /var/www/     drwxrwxrwx 11 root root 4096 Feb 19 20:42 /var/www/      And the log file at `/var/log/vsftp.log` only says:               Tue Feb 25 21:19:38 2014 [pid 18250] CONNECT: Client "127.0.0.1"     Tue Feb 25 21:19:46 2014 [pid 18249] [ftp] FAIL LOGIN: Client "127.0.0.1"      Oh and syslog-ng doesn't say anything at `/var/log/messages`


what is the linux boot param "memmap" equivalent in freebsd

In linux kernel, there is an option to reserve a portion of system ram i.e memmap=512M$2G (boot param) Here 512M starting from 2G would be reserved and not available to OS What is the equivalent in freebsd ?


"Can't cd to /home/user" when sourcing a script

I have this script:               echo $HOME     cd $HOME     cd /     cd /usr/local/src/      When I run it like this               . script.sh      I get this output:               /home/user     : No such file or directory     : No such file or directory     : No such file or directory      If I run it normally (I added `#!/bin/bash` before the first line)               sh script.sh      I get this output:               : not found.sh: 2: script.sh     /home/user     script.sh: 3: Can't cd to /home/user     script.sh: 4: Can't cd to /     script.sh: 5: Can't cd to /usr/local/src/      The script was run from `$HOME` directory each time. If I run each command one by one from shell, it executed without problems (invoking `cd $HOME` from within `$HOME` simply didn't change directory). What must I do to make this work?


Xubuntu Media plays at triple+ speed

Out of the blue today, I just booted my PC and Raspberry Pi like normal, with my PC running Xubuntu and my RPI running Raspbian, and on my PC at least ALL media is running at triple or higher speed. Youtube videos, mp3's and normal videos all run at triple speed. They also won't play any sound, and I am sure I have my speakers turned on and medium volume. On my windows 7 partition everything still works. Something like this has never happened to me before, and is obviously very strange. The only thing I can remember to have done is `sudo apt-get update` and `sudo apt-get upgrade`. I have looked at the following, but I don't have any sound settings anywhere. http://www.hanckmann.net/?q=high_speed_video_and_no_audio_in_linux My Raspberry Pi can't play any sound for whatever reason so I wouldn't know about the RPI. Obviously, my question is, how can I play media normally again? /IP


How to get "undefined references" such as "s_wsfi" and "do_fio" in f77 32-bit Fortran libraries using `gfortran -m32`?

Update: Per steeldriver's suggestion, I have tried to get libf2c, and have posted my new error here. ======== I am new to Fortran, but this is what I know:   * I am running on Ubuntu 14.04   * My fortran file is f77   * The libraries that it uses are i386, which I'm pretty sure are 32-bit   * I can get them to compile using `gfortran -m32` with packages lib32gfortran-4.8-dev and gcc-multilib.   * I get my library files, namely libmathlib.a and libkernlib.a, from the CERNLIB downloads, which has many versions. I've tried multiple versions, including the newest from 2006, but I get the same undefined references. The errors are all similar, such as: `undefined reference to 's_wsfi'` **How can I get these references, such as`s_wsfe` or `e_wsfe`?** Can I download them somewhere or compile them from somewhere to 32 bit? If so, how? This what I get from running the 2004 version of libmathlib.a and libkernlib.a, I get the same errors from the 2006 version too:                   $ gfortran -m32 -O -o out10 MBpart1ep0.f -L. -lmathlib -lkernlib -Lcuba              /tmp/ccs5Njbz.o: In function `MAIN__':         MBpart1ep0.f:(.text+0x82): undefined reference to `cuhre_'         //usr/local/lib/libmathlib.a(cgamma64.o): In function `wgamma_':         cgamma64.F:(.text+0xd1): undefined reference to `s_wsfi'         cgamma64.F:(.text+0xe5): undefined reference to `do_fio'         cgamma64.F:(.text+0xea): undefined reference to `e_wsfi'         cgamma64.F:(.text+0x424): undefined reference to `z_log'         cgamma64.F:(.text+0x47e): undefined reference to `z_exp'         cgamma64.F:(.text+0x522): undefined reference to `z_sin'         //usr/local/lib/libmathlib.a(wpsipg.o): In function `wpsipg_':         wpsipg.F:(.text+0x97): undefined reference to `s_wsfi'         wpsipg.F:(.text+0xa7): undefined reference to `do_fio'         wpsipg.F:(.text+0xac): undefined reference to `e_wsfi'         wpsipg.F:(.text+0x1b4): undefined reference to `s_wsfi'         wpsipg.F:(.text+0x1c8): undefined reference to `do_fio'         wpsipg.F:(.text+0x1cd): undefined reference to `e_wsfi'         wpsipg.F:(.text+0x8e7): undefined reference to `z_log'         //usr/local/lib/libmathlib.a(mtlprt.o): In function `mtlprt_':         mtlprt.F:(.text+0x20): undefined reference to `s_cmp'         mtlprt.F:(.text+0x90): undefined reference to `s_wsfe'         mtlprt.F:(.text+0xa0): undefined reference to `do_fio'         mtlprt.F:(.text+0xb3): undefined reference to `do_fio'         mtlprt.F:(.text+0xc2): undefined reference to `do_fio'         mtlprt.F:(.text+0xd6): undefined reference to `do_fio'         mtlprt.F:(.text+0xdb): undefined reference to `e_wsfe'         mtlprt.F:(.text+0xfe): undefined reference to `s_wsfe'         mtlprt.F:(.text+0x10e): undefined reference to `do_fio'         mtlprt.F:(.text+0x121): undefined reference to `do_fio'         mtlprt.F:(.text+0x130): undefined reference to `do_fio'         mtlprt.F:(.text+0x144): undefined reference to `do_fio'         mtlprt.F:(.text+0x149): undefined reference to `e_wsfe'         //usr/local/lib/libmathlib.a(mtlset.o): In function `__g77_masterfun_mtlset':         mtlset.F:(.text+0x38): undefined reference to `s_cmp'         mtlset.F:(.text+0x5d): undefined reference to `s_cmp'         mtlset.F:(.text+0xa7): undefined reference to `s_cmp'         mtlset.F:(.text+0x11a): undefined reference to `s_cmp'         mtlset.F:(.text+0x137): undefined reference to `s_wsfe'         mtlset.F:(.text+0x147): undefined reference to `do_fio'         mtlset.F:(.text+0x14c): undefined reference to `e_wsfe'         mtlset.F:(.text+0x1d7): undefined reference to `s_wsfe'         mtlset.F:(.text+0x1f6): undefined reference to `do_fio'         mtlset.F:(.text+0x1fb): undefined reference to `e_wsfe'         mtlset.F:(.text+0x21e): undefined reference to `s_wsfe'         mtlset.F:(.text+0x23d): undefined reference to `do_fio'         mtlset.F:(.text+0x242): undefined reference to `e_wsfe'         collect2: error: ld returned 1 exit status      Since the errors show that code inside libmathlib.a are referencing .f files that reference functions that are undefined, I feel like my libmathlib is being read correctly. **Again, how can I get the references, such as`s_wsfe` or `e_wsfe`?** Can I download them somewhere or compile them from somewhere to 32 bit? If so, how?


Check whether files in a file list exist in a certain directory

The runtime arguments are as follows: $1 is the path to the file containing the list of files $2 is the path to the directory containing the files What I want to do is check that each file listed in $1 exists in the $2 directory I'm thinking something like:               for f in 'cat $1'     do     if (FILEEXISTSIN$2DIRECTORY)     then echo '$f exists in $2'     else echo '$f is missing in $2' sleep 5 exit     fi     done      As you can see, I want it so that if any of the files listed in `$1` don't exist in the directory `$2`, the script states this then closes. The only part I can't get my head around is the `(FILEEXISTSIN$2DIRECTORY)` part. I know that you can do `[ -e $f ]` but I don't know how you can make sure its checking that it exists in the `$2` directory. Thank you, I hope you can help this bash noob out.


How to disable VLC output in command-line mode?

When I play music on `vlc` or `cvlc` in terminal or console there is always this _(shown below)_ non-stopping output that prevents me from issuing commands by pressing `ENTER` key. I want to disable it, I tried to start vlc with `vlc -q` switch in quite mode but it only gets rid of **[ ]** bracket parts, the rest still remains and continues to grow. So, how to make `vlc` completely not to show this information and still be able to execute command-line commands like `next`, `play`, `random` etc?               VLC media player 2.0.7 Twoflower (revision 2.0.6-54-g7dd7e4d)     [0x255e418] dummy interface: using the dummy interface module...     libdvdnav: Using dvdnav version 4.2.0     libdvdread: Encrypted DVD support unavailable.     libdvdread: Attempting to use device /dev/sdb1 mounted on /run/media/easl/freyja for CSS authentication     libdvdread: Could not open input: Permission denied     libdvdread: Can't open /dev/sdb1 for reading     libdvdread: Device /dev/sdb1 inaccessible, CSS authentication not available.     libdvdnav:DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.IFO failed     libdvdnav:DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.BUP failed     libdvdread: Can't open file VIDEO_TS.IFO.     libdvdnav: vm: failed to read VIDEO_TS.IFO     [0x24966b8] main playlist: stopping playback     TagLib: MPEG::Header::parse() -- Invalid sample rate.     TagLib: ID3v2.4 no longer supports the frame type TDAT.  It will be discarded from the tag.     TagLib: MPEG::Header::parse() -- Invalid sample rate.     TagLib: MPEG::Header::parse() -- Invalid sample rate.     TagLib: ID3v2.4 no longer supports the frame type TDAT.  It will be discarded from the tag.     TagLib: MPEG::Header::parse() -- Invalid sample rate.


Alix Board write performance

I have an alix board on which I have installed debian4alix (sqeeze). After using it for a while I noticed that the write performance of the board was pretty low. I ran the following test:               dd count=100 bs=1M if=/dev/urandom of=/var/www/cgrid/test      This yielded the following:               100+0 records in     100+0 records out     104857600 bytes (105 MB) copied, 328.903 s, 319 kB/s      This is the same speed I get when running the test on the compact flash card that the OS is installed on or on a flash disk. I had tested the flash disk performance on a linux desktop PC and achieved speeds around 15.3 MB/s using the same tests. My read speed on the alix board is around 9MB/s (tested with `hdparm -t`) I would like to know if the slow write speeds I am receiving is a result of the operating system ( since it is not running directly off the compact flash card but off a ramdisk) or from the embedded hardware solution being really slow.


Rip audio CDs while keeping extraction and encoding separate

I'd like to rip my audio CDs to mp3. I know this has been discussed to a good extent but I'm not sure if my setup makes sense, though. I want to use an older PC for that and I have read on the net that concurrent encoding can compromise the quality of the audio extraction. I suspect this has happened already in a test run because there were sound issues for one mp3 that could not be explained by a scratched surface. So I thought it would be a good idea to keep the two steps apart. So my questions is: **Do you know of any solution to extract mp3s from an audio CD that first extracts _all_ tracks as wavs and _after that_ starts with the encoding?** I looked at `K3b`, `ripperX` and `abcde`. All of them start encoding while extraction is still in process. The best thing that came to my mind was calling `abcde` twice: first for just querying the cddb and wav extraction of all tracks, second for converting the extracted wavs to mp3s giving them the correct names and tagging information. The command line for that looks like this               $ abcde -a cddb,read && abcde -o mp3      I know that one could start from scratch and write a shell script for extraction using `cdparanoia`, encoding with `lame`, tagging with IDv3, querying cddb but this is not a trivial job (see e.g. these examples), not to mention that `abcde` additionally does some nice munching of the track names. But I'd rather use as much of the things that are available already. * * * **EDIT:** After sr_'s valuable hint the commandline can be simplified to               $ abcde -l -o mp3      with the "l" option for low disk space being the important part. Now abcde reads the first track, then encodes and tags it, after that it reads the second track, encodes and tags it and so forth...


Debian installation media with non-free packages?

Are there any Debian DVDs (Lenny, 5.0) out there that include the non-free hardware driver components?


pipe, { list; } only works with some programs

Need explanations from power users for such unpredictable behaviour:               ps -eF | { head -n 1;grep worker; }     UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD     root       441     2  0     0     0   2 paź15 ?       00:00:00 [kworker/2:1H]      everything looks ok whereas               ls -la / | { head -n 1;grep sbin; }      displays only output from `head` ... I thought about `stdout 2>&1` and doesn't work neither for me it's weird, any explanations or suggest how to handle it?


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

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


Copy multiple files from filename X to filename Y?

I'm pretty noob when it comes to unix commands. What I want to do is to copy files within a lexicographic range. Example of files:               -rw-r--r--   1 root root   15276 Oct  5  2004 a2ps.cfg     -rw-r--r--   1 root root    2562 Oct  5  2004 a2ps-site.cfg     -rw-r--r--   4 root root    4096 Feb  2  2007 acpi.txt     -rw-r--r--   1 root root      48 Feb  8  2008 adjtime.jpg     -rw-r--r--   4 root root    4096 Feb  2  2007 alchemist.jpg      Example of use:   * Copy the 3 files from `asps.cfg` to `acpi.txt`   * Copy the 3 files from `a2ps-site.cfg` to `adjtime.jpg`   * Copy the 4 files from `a2ps-site.cfg` to `alchemist.jpg` So is there any way to copy a range of files (from filename X to filename Y) into a directory? Like: `cp filenameX ... filenameY destination/`


I broke my openbox menu.xml by mistake

I'm on a Debian distro, it's been a long time that I edited Openbox menu.xml, so I forgotten that I had to use `obmenu` or whatever, I opened it in a normal text editor, edited something in the right click menu. Then saved then restarted Openbox without reconfiguring it. And now I can still login, after that all I see is a black screen with the mouse cursor. I try opening the terminal using the `super key + t` but I can't see anything at all, no terminal, no web browser, just a cursor and a black screen. Note, I can't boot to live cd, due to nomodeset issue, if nomodeset is on, my PC won't boot correctly, so I always set it to off, but when booting from a live cd, you can't set it to off.


Selective dim screens

How can I dim only select screens of my multiple-monitor linux system? I have 5 monitors connected to my computer 4 *15 inch and one 27 inch. sometimes i want to use only the main screen (27) and have the rest black or in power save How can i do this? I'm running ubuntu linux 13.10 with kde. To blackout all screens I use `xset dpms force off` but this will be undone as soon as i touch the mouse or keyboard.


Using a LVM partition as a Virtualbox drive

Is it possible to use a LVM partition as a Virtualbox disk? I can't find any option to use a device as a Virtualbox disk, only disk images.


No space on device when removing a file under OpenSolaris

While trying to mount a NFS share (exported from an OpenIndiana server) on a client box, the OI server crashed. I got the black screen of death, what looked like a log dump, then the system restated. It never came back up and I get the following error msg after I halt the boot: > `svc.startd[9] Could not log for svc:/network/dns/mulitcast:default: > write(30) failed with No space left on device?` I don't have anything else on the boot drive other than the OS so... I'm not sure what could be filling up the drive? Maybe a log file of some kind? I can't seem to delete anything regardless. It gives me a no space error when I try and delete anything:               $ rm filename     cannot remove 'filename' : No space left on device       I can login into "Maintenance Mode" but not the standard user prompt. The output of `df` is:               rpool/ROOT/openindiana-baseline    4133493    4133493          0    100%   /     swap                              83097900      11028  830386872      1%   /etc/svc/volatile     /usr/lib/libc/libc_hwcap1.so.1     4133493    4133493          0    100%   /lib/libc.so.1      The output of `mount` is:               / on rpool/ROOT/openindiana-baseline read/write/setuid/devices/dev:2d9002 on Wed Dec 31 16:00:00 1969     /devices on /devices read/write/setuid/devices/dev:8b40000 on Fri Jul 8 14:56:54 2011     /dev on /dev read/write/setuid/devices/dev:8b80000 on Fri Jul 8 14:56:54 2011     /system/contract on ctfs read/write/setuid/devices/dev:8c40001 on Fri Jul 8 14:56:54 2011     /proc on proc read/write/setuid/devices/dev:8bc0000 on Fri Jul 8 14:56:54 2011     /etc/mnttab on mnttab read/write/setuid/devices/dev:8c80001 on Fri Jul 8 14:56:54 2011     /etc/svc/volatile on swap read/write/setuid/devices/xattr/dev:8cc0001 on Fri Ju8 14:56:54 2011     /system/object on objfs read/write/setuid/devices/dev:8d00001 on Fri Jul 8 14:6:54 2011     /etc/dfs/sharetab on sharefs read/write/setuid/devices/dev:8d40001 on Fri Jul 14:56:54 2011     /lib/libc.s0.1 on /usr/lib/libc/libc_hucap1.s0.1 read/write/setuid/devices/dev:d90002 on Fri Jul 8 14:57:06 2011       The output of 'zfs list -t all' is:               rpool                                                       36.4G   0       47.5K   /rpool     rpool/ROOT                                                  4.23G   0         31K   legacy     rpool/ROOT/openindiana                                      57.5M   0       3.99G   /     rpool/ROOT/openindiana-baseline                             61K     0       3.94G   /     rpoo1/ROOT/openindiana-system-edge                          4.17G   0       3.98G   /     rpool/ROOT/openindiana-system-edge@install                  19.9M   -       3 38G   -     rpoo1/ROOT/openindiana-system-edge@2011-07-06-20:45:08      73.1M   -       3.57G   -     rpoo1/ROOT/openindiana-system-edge@2011-07-06-20:48:53      75.9M   -       3 82G   -     rpoo1/ROOT/openindiana-system-edge@2011-07-07-02:14:04      61K     -       3.94G   -     rpoo1/ROOT/openindiana-system-edge@2011-07-07-02:15:14      61K     -       3.94G   -     rpoo1/ROOT/openindiana-system-edge@2011-07-07-02:28:14      61K     -       3.94G   -     rpool/ROOT/openindiana-system-stable                        61K     0       3.94G   /     rpoo1/ROOT/pre_first_update_07.06                           108K    0       3 82G   /     rpool/ROOT/pre_second_update_07.06                          90K     0       3.57G   /     rpool/dump                                                  9.07G   0       9.07G   -     rpool/export                                                3.85G   0       32K     /export     rpool/export/home                                           3.85G   0       32K     /export/home     rpool/export/home/admin                                     3.85G   0       3.85G   /export/home/admin     rpool/swap                                                  19.3G   19.1G   126M    -


Deleting Lines, which match a particular Identifier from another file

I have 2 files. File 1, has an identifier (eg. `D7MHBF:11:1449:1988`) and every new entry starts with `@`. It has few more fields, which are not important in our analysis. File 2 consists of a column of Identifiers. If the Identifier of File 2 is exactly matching with the Identifier of File 1 then, delete the whole three- line entry in File 1.(P.S. Every entry starts with @). **File 1** :               @D7MHBF:11:1449:1988  1:N     NGCCCATTCTATGCAACAAATTCAACAAAGTCTCCCA     +     #1=DDFFDFHHDHIGGFIIIIIIIHHIHIGDGIGGEH     @D7MHBF:11:1681:1959  1:N     NGGTTTAGAGCCTGTATTTTGAACGTAATAGCAGGGT     +     #1=ADDFFHHDDHEHIHJJJICCFHGEIGJGGGIJJF     @D7MHBF:11:1778:1946  1:N     NTGTGGGTTCAACAATGGGCTCATTGCCATCAGCGAG     +     #1=ADDFDHHGHFHGGIIJJJGIIJIFIIJJJIJIIJ     @D7MHBF:11:1854:1955  1:N     NTTGATTGTGCTTCTTATGAGCAAAAATGTTGATGAC     +     #1=DFFFFHHHGHHIJEHIIGGGGIJJJJIHIIHIII     @D7MHBF:11:1903:1972  1:N     NACTACTATACTATGAAGTGGCTATGACAATTGTCTT     +     #1=DFFFFHHHGHHIJEHIIIGGGGIJJJJIHIIHII      **File 2:**               D7MHBF:11:1449:1988     D7MHBF:11:13844:51576     D7MHBF:11:13838:51641     D7MHBF:11:1778:1946     D7MHBF:11:1903:1972                                                                                Expected Output:               @D7MHBF:11:1681:1959  1:N     NGGTTTAGAGCCTGTATTTTGAACGTAATAGCAGGGT     +     #1=ADDFFHHDDHEHIHJJJICCFHGEIGJGGGIJJF     @D7MHBF:11:1854:1955  1:N     NTTGATTGTGCTTCTTATGAGCAAAAATGTTGATGAC     +     #1=DFFFFHHHGHHIJEHIIGGGGIJJJJIHIIHIII      I am new in Bioinformatics and Programming.


Using mplayer inside kvm/qemu

Is it possible to use mplayer inside kvm/qemu configuration? What video driver should I use? The only driver that worked was `sdl` and it was super slow. EDIT: I just found out that VirtualBox works fine with `gl` driver (when 3D acceleration is turned on).


RadioTray error: gstplaysink

I installed RadioTray in Lubuntu 12.04 (64bit) and it can't play radio streams. When a stream is started, it throws this notification: > >     > Radio Error gstplaysink.c(1906): gen_audio_chain ():/ >     > GstPlayBin2:player/GstPlaySink:playsink0 >   I can play all those streams from audacious and the browser itself (chrome). I have been playing radio streams (shoutcast) for months and had been using streamtuner2 to find streams (but it has a sorting error that you cannot tell what stream will you end up listening to). I also can watch videos with vlc and in youtube, etc. Maybe it could be some plugins problem, but I can't find any logs.


How to host an intranet website inaccessible outside the LAN?

I am a Linux/Unix noob, so please bear with me. Here is my situation: I have a server (Debian Squeeze) on a LAN. I have installed Nginx web server on it. The server has Internet access to download and install packages. My question: Can I host a website so that when users on the LAN type:               http://abcd (no .com, .net, etc.)       into their browser, the website opens? Note that they also have full Internet access, so it should not go straight to Google or some other default search engine instead. At the same time, anyone outside the LAN must not be able to access it, no matter what URL they type. Is this possible?


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

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


How can I make Debian with KDE louder?

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


curl several files and save output in one file

I am using `curl` to grab the HTML of a website. I want to only grab the first 20 lines, and save this in an external file. I need to grab about 10 URLs, and want to save all of them in the same file. Preferably with the URL of each file above the results. What I came up with is: `curl http://example.com/url1 | head -20 && curl http://example.com/url2 | head -20 > exportfile` However, this yields two issues:   * This only saves the latest page (and if I put > exportfile after every statement, it overvwrites the file   * This does not save the actual command in the file Any way to make this work as I intend?


recurrent loss of wireless connectivity

My wireless connection is frequently terminated (reason unknown). I can remedy the problem either by rebooting or by unloading and reloading the kernel module for my wireless network interface controller (Intel Corporation Centrino Wireless-N 1000 [Condor Peak]). The frequency with which the connection terminates appears to be random, so unloading and reloading the kernel once per minute (cron: `*/1 * * * * modprobe -r iwlagn; modprobe iwlagn; iwconfig`) usually provides uninterrupted connectivity for a period of a few hours. If I recall correctly, this problem occurred shortly after upgrading to multiarch support in Debian 7. Please advise if you know or can suggest a solution.


Can you give a user account multiple passwords?

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


unable to establish communication using grabserial

I have use teraterm in past and it works fine. I can see log messages coming from my board. Ultimately I reach the login prompt where I enter my login and password for OS running on my board. Now I am trying to do the same using grabserial. But here I reach the login prompt, but after that nothing happens. The password option never comes. And even if I enter password, nothing happens (but my password that I am typing is visible).               grabserial -v -d "/dev/ttyUSB0" -b 115200 -w 8 -p N -s 1 -e 30 -t -m "Starting kernel.*"       Why it is happening. Also I am running the grabserail as a root, and if i don't do this I get permission related error. Why this is happening? **Additionally** I found that in teraterm when I used to see the following message (actually log message from my board):               Hit any key to stop autoboot      Then it counts upto 5 seconds for the user to input a key. It really worked. I was able to stop this autoboot by pressing a key. But in case of grabserial when I see this message and type any key , the character appears on the console, but nothing happens, ultimately it boot in auto after 5 seconds. Both these issues (password option not coming and the above one), indicates that the communication is perhaps only in one direction. My input is not going to the board via grabserial. But it was going through Teraterm when I was using it. Any guess why is this happening ?


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

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


How to tar only files in a multiple of directories but not directory?

I have three folders under the Test folder.               Test ----> dir1, dir2, dir3      Under dir1,dir2 and dir3, I have lot of files. I want to tar only the files not the dir1, dir2 and dir3.


Where is a shell script run from?

I have a shell script in `/usr/bin`. Let's call it `hello`. It contains this:                echo "I am located in $PWD"      echo "I am called from this directory: ???"      Running `hello` from `/home/Documents` I expect the following output:                I am located in /usr/bin      I am called from this directory: /home/Documents      How can I get the directory path where the script is run from?


Trigger an init script when a specific device is up and a kernel module has been loaded

On my ubuntu 12.04 servers, I need to write an _init.d_ script that waits until the infiniband interface (device: _mlx4_0_ , interface: _ib0_ ) is completely up, and until the _knem_ kernel module is loaded. I have an _init.d_ script that works if I wait that the system is up and manually `service myscript start` but it does not work if I load it normally at boot time. I'm using boot order _99_ , but it does not start correctly because I need it to wait until those features are running. What is the correct syntax in an `init.d` to achieve that (one kernel module and )? I guess there must be some keyword like `# Required-Start: $remote_fs $syslog $network` but I can't find the correct ones for specific interface and kernel modules. EDIT: a) precision: the init script is related to _SLURM_ , _openMPI_ and _infiniband_ interactions. I have compiled _SLURM_ with _Mellanox infiniband driver_ support, and _openMPI_ is linked to this version of SLURM. The result is that openMPI is using directly the mellanox infiniband driver, which is much more powerfull than _ipob_ (ip over inifiniband). To do that, it needs to use the registered memory of the system, which has to be set as _unlimited_. SO: I have added a few `logger` output in my _init.d_ script. I notice that in fact the modules are up and running. So I don't understand fully the problem. It is strange, maybe related to some environment variables needed and that are set up only in a full user space and not at init time. The problem concerns the memlock limits set in _/etc/security/limits.conf_. To make it work I had to set               *             -   memlock       unlimited     root          -   memlock       unlimited      and in this way, when I launch the slurm deamon with an _ssh_ connection everything works, and when it is the init process that starts the deamon, it is like it does not consider the rules in _/etc/security/limits.conf_.