Wrong language setting in Arch KDE

I've installed KDE on Arch Linux, everything is ok, except the language, infact after that I've installed italian language and setted that as preferred, the texts of tabs, settings and so on is mixed in american english and italian. I want use only italian and american english is available languages menu (not preferred). How could I delete american english?


Spawn login prompt in an X terminal

I have a system that runs a bash script when it starts (I use `/etc/init.d/rc.local` to execute it without needing to log in). For reasons I won't go in to here, I need to launch a graphical terminal to run the script. It does things like display diagnostic messages while starting an application. The way I start everything in `rc.local` is like this               xinit urxvt --hold -e /path/to/script      After doing all its diagnostic stuff, the script launches a full screen application. When that application dies (for whatever reason) the user gets dropped back at the urxvt terminal exactly where the script left off before launching. What I would like to happen is that when the application dies, the script launches a new urxvt terminal with a login prompt. I have tried `urxvt --ls` and `urxvt --loginShell` but every time the new terminal is launches, I get a shell with the root user logged in - obviously not idea. How can I make it launch a login prompt with no user logged in?


Cannot figure out how to revert back to backed up profile file

Basically, I made a backup copy of my `/etc/profile` (or `~/.profile` I can't remember exactly) file that executes as soon as you login to a TTY, and then I changed the one that was there, and now it automatically logs you out as soon as you login. I just need to view the current file and make a modification to the script, but I can't figure out a way to get to it. I've tried a Ubuntu live CD but I can't figure out how to get permission after I mount the drive locally. I have Grub installed but I removed all of the options except the default from the menu. Edit: also if it's relevant, I the disk is a `.vhd` that I am trying to access via virtualbox.


cp --backup=numbered for folders

To backup existing files with number suffixes, I can do the following:               cp --backup=numbered afile /path/to/dest      But this does not apply when I try to do the same with a folder:               cp -R --backup=numbered afolder /path/to/dest      How can I achieve this? * * * Maybe I should demonstrate a bit what I want to achieve. First we have two dirs:               ls -ld source container     drwxrwxr-x 6 kaiyin kaiyin 4096 Nov 29 22:11 container     drwxrwxr-x 2 kaiyin kaiyin 4096 Nov 29 22:09 source      Then we do this: myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ Ideally I want this result:               tree container/     container/     ├── source     ├── source.~1~     ├── source.~2~     └── source.~3~


Simple CLI rss reader, that can print only subject and uri, based on new since time interval

So what I'm looking for is easy enough to code, but I'm wondering if it already exists, so I don't going releasing duplicate code. I need a feed reader, that prints the subject, and uri on one line, to stdout. It should be able to be configured (not necessarily by config file) to only show new feeds in say the last 5 minutes. The reason I want this is because I'm coding my ping.fm replacement. I basically want to be able to do something like `feedreader | pingit` where `pingit` will do, `foreach` line of input, make a separate post. In this way I'll also be able to `echo -n "my social post" | pingit` I'll probably also make `pingit "post"` work.


Mint changes default route when eth0 comes back and breaks existing tcp connections

I have two interfaces on my laptop (eth0, wlan0). lets say I am moving away from desk and connecting to an internal network A using openvpn software which uses wlan0 as gateway. I then ssh to a few vms inside this network A. when I return back to my desk, the system detects eth0 is available and automatically changes default route. I then lose vpn connection and all the ssh sessions with the vms in network A. on wlan0               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         10.147.76.1     0.0.0.0         UG    0      0        0 wlan0      when reestablished connection with eth0               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         10.148.93.1     0.0.0.0         UG    0      0        0 eth0      how to solve this issue?


Determine dynamically allocated port for OpenSSH RemoteForward

## Question (TL;DR) When assigning ports dynamically for remote forwarding (a.k.a. `-R` option), how can a script on the remote machine (for instance sourced from `.bashrc`) determine which ports were chosen by OpenSSH? * * * ## Background I use OpenSSH (on both ends) to connect to our central server, that I share with multiple other users. For my remote session (for now) I would like to forward X, cups and pulseaudio. The most trivial is forwarding X, using the `-X` option. The allocated X address is stored in the environmental variable `DISPLAY` and from that I can determine the corresponding TCP port, in most cases anyways. But I hardly ever need to, because Xlib honors `DISPLAY`. I need a similar mechanism for cups and pulseaudio. The basics for both services exist, in the form of the environmental variables `CUPS_SERVER` and `PULSE_SERVER`, respectively. Here are usage examples:               ssh -X -R12345:localhost:631 -R54321:localhost:4713 datserver          export CUPS_SERVER=localhost:12345     lowriter #and I can print using my local printer     lpr -P default -o Duplex=DuplexNoTumble minutes.pdf #printing through the tunnel     lpr -H localhost:631 -P default -o Duplex=DuplexNoTumble minutes.pdf #printing remotely          mpg123 mp3s/van_halen/jump.mp3 #annoy co-workers     PULSE_SERVER=localhost:54321 mpg123 mp3s/van_halen/jump.mp3 #listen to music through the tunnel      The problem is setting `CUPS_SERVER` and `PULSE_SERVER` correctly. **We use port forwardings a lot and therefore I need dynamic port allocations. Static port allocations are not an option.** OpenSSH has a mechanism for dynamic port allocation on the remote server, by specifying `0` as bind-port for remote forwarding (the `-R` option). By using the following command, OpenSSH will dynamically allocate ports for cups and pulse forwarding.               ssh -X -R0:localhost:631 -R0:localhost:4713 datserver      When I use that command, `ssh` will print the following to `STDERR`:               Allocated port 55710 for remote forward to 127.0.0.1:4713     Allocated port 41273 for remote forward to 127.0.0.1:631      There is the information I want! Ultimately I want to generate:               export CUPS_SERVER=localhost:41273     export PULSE_SERVER=localhost:55710      However the "Allocated port ..." messages are created on my local machine and sent to `STDERR`, which I can't access on the remote machine. Oddly enough OpenSSH does not seem to have means to retrieve Information about port forwardings. How do I fetch that information to put it into a shell script to adequately set `CUPS_SERVER` and `PULSE_SERVER` on the remote host? * * * ## Dead Ends The only easy thing I could find was increasing verbosity of the `sshd` until that information can be read from the logs. This is not viable as that information discloses a lot more information than is sensible to make accessible by non-root users. I was thinking about patching OpenSSH to support an additional escape sequence which prints a nice representation of the internal struct `permitted_opens`, but even if that is what I want, I still can't script accessing the client escape sequences from the server side. * * * ## There must be a better way The following approach seems very unstable and is limited to one such SSH session per user. However, I need at least two concurrent such sessions and other users even more. But I tried ... When the stars are aligned properly, having sacrificed a chicken or two, I can abuse the fact that `sshd` is not started as my user, but drops privileges after successful login, to do this:   * get a list of port numbers for all listening sockets that belong to my user `netstat -tlpen | grep ${UID} | sed -e 's/^.*:\\([0-9]\\+\\) .*$/\1/'`   * get a list of port numbers for all listening sockets that belong to processes my user started `lsof -u ${UID} 2>/dev/null | grep LISTEN | sed -e 's/.*:\\([0-9]\\+\\) (LISTEN).*$/\1/'`   * All ports that are in the first set, but not in the second set have a high likelyhood to be my forwarding ports, and indeed subtracting the sets yields `41273`, `55710` and `6010`; cups, pulse and X, respectively.   * `6010` is identified as the X port using `DISPLAY`.   * `41273` is the cups port, because `lpstat -h localhost:41273 -a` returns `0`.   * `55710` is the pulse port, because `pactl -s localhost:55710 stat` returns `0`. (It even prints the hostname of my client!) (To do the set substraction I `sort -u` and store the output from the above command lines and use `comm` to do the substraction.) Pulseaudio lets me identify the client and, for all intents and purposes, this may serve as an anchor to separate SSH sessions that need separating. However, I haven't found a way to tie `41273`, `55710` and `6010` to the same `sshd` process. `netstat` won't disclose that information to non-root users. I only get a `-` in the `PID/Program name` column where I would like to read `2339/54` (in this particular instance). So close ...


Bash- Help modify code for a custom output statement

The script will read the contents of a user-input file and count the number of employees with a specific job. Ex file line:               Sophia Lewis, 542467, Accountant       The script I have so far is:               if [ -s $1 ]     then          cat $1 | tr -s ' ' | cut -d' ' -f4- | sort | uniq -c          else             echo "ERROR: file '$1' does not exist."          fi      Output:               4 Sales      2 Accountant      1 CEO       But I want the output to appear as:               There are 4 ‘Sales’ employees.      There are 2 ‘Accountant’ employees.      There is 1 ‘CEO’ employee.      There are a total of 7 employees in the company      Should I take out the cat and put in echo statements so I can customize each line? And is there a way for it to know if it should be "is/are" x employees?


What's the right way to shutdown Arch Linux through dbus interface?

I'm running `openbox` with Arch Linux, and looks like the old console kit interface has been long gone,               %> dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop     Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files      So what's the interface to use now?


Does alsa depend on the kernel version?

Lately I had nothing but trouble with my sound setup. The full chain looks like this:               alsa (pulse plugin)-> pulseaudio (jack plugin) -> jackd -> firewire soundcard      This works fine, except for flash in firefox and Chrome. I have reason to believe that the tail end of the chain is okay, because every other source of audio, using pulse or jackd directly works fine. On the front end I made some experiments, like connecting alsa directly to jackd, but this also causes trouble with flashplayer: playback stops after like 20 seconds and firefox freezes. This made me believe that there is something wrong with the alsa stuff. Now I do have a custom kernel (3.8.2) but the rest of the system uses regular debian "stable" stuff. Can it be that the kernel is "too new" for the alsa libs?


How do I get current keyboard layout?

I'm wondering is there any command line tool, that returns current keyboard layout. I have `XkbLayout` set to `us, ru`. **Update:** `setxkbmap` returns layout settings, not selected layout. E.g.:               $ setxkbmap -print | grep xkb_symbols     xkb_symbols   { include "pc+us+ru:2+inet(evdev)+capslock(grouplock)+terminate(ctrl_alt_bksp)"   };      It will return same result no matter what current layout is.


How does 'screen' impact environment variables?

I noticed a difference in 'env' before and after a 'screen' call, is there any additional clarity on what gets called (for setting environment variables)? I couldn't see any clear explanation from a quick search on 'man screen' Some googled queries on the topic: http://alan.lamielle.net/2009/03/09/environment-variables-and-gnu-screen http://superuser.com/questions/105954/updating-screen-session-environment- variables-to-reflect-new-graphical-login I guess a more specific sub-question would be, what is not instantiated in a screen session vs. that of a normal log-in?


Microsoft LifeCam VX-800 stopped working on Linux Mint

My Microsoft Lifecam VX-800 stopped working without any plausible reason. `lsusb` identifies the camera with the name "Z-Star Microelectronics Corp. Venus USB2.0 Camera". Another unusual thing is that the camera's green light is always turned on (this didn't happen when it was still working). I didn't install any new software, update anything, or change any OS configurations. What could have broken things?


Centos CMake Does Not Install Using gcc 4.7.2

A similar problem has been reported here with no solution:https://www.centos.org/modules/newbb/print.php?form=1&topic_id=42696&forum=56&order=ASC&start=0 I've added and upgraded gcc to centos               cd /etc/yum.repos.d     wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo      yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++     scl enable devtoolset-1.1 bash      The result is this for my gcc               [root@hhvm-build-centos cmake-2.8.11.1]# gcc -v     Using built-in specs.     COLLECT_GCC=gcc     COLLECT_LTO_WRAPPER=/opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper     Target: x86_64-redhat-linux     Configured with: ../configure --prefix=/opt/centos/devtoolset-1.1/root/usr --mandir=/opt/centos/devtoolset-1.1/root/usr/share/man --infodir=/opt/centos/devtoolset-1.1/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-ppl --with-cloog --with-mpc=/home/centos/rpm/BUILD/gcc-4.7.2-20121015/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux     Thread model: posix     gcc version 4.7.2 20121015 (Red Hat 4.7.2-5) (GCC)       And I tried to then install cmake through http://www.cmake.org/cmake/resources/software.html#latest But I keep running into this error:               Linking CXX executable ../bin/ccmake     /opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: CMakeFiles/ccmake.dir/CursesDialog/cmCursesMainForm.cxx.o: undefined reference to symbol 'keypad'     /opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: note: 'keypad' is defined in DSO /lib64/libtinfo.so.5 so try adding it to the linker command line     /lib64/libtinfo.so.5: could not read symbols: Invalid operation     collect2: error: ld returned 1 exit status     gmake[2]: *** [bin/ccmake] Error 1     gmake[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2     gmake: *** [all] Error 2      The problem seems to come from the new gcc installed because it works with the default install. Is there a solution to this problem?


Emacs subshell (M-x shell) not autocompleting shell aliases

I have aliases defined on my `.zshrc` file that I commonly use when I am on a `gnome-terminal`. However, when I am on `M-x shell` on Emacs, the autocompletion does not find them (even though they still work). Is this a limitation of the Emacs subshell? Are there any known workarounds to this problem?


How to compile and install iperf on a MIPS based router?

I have a DIR-825 router based on Atheros AR7161 (MIPS) running DD-WRT v24-sp2 std. How can I compile and install iperf on it? Can I compile it directly on the target device, or do I have to cross compile it and then transfer the binary to the target device? Is this possible, and where do I begin? What kind of tools do I need? What's involved in doing something like this? _Side note: I have limited knowledge of Linux, so please provide as thorough answer as possible, and not just some external links. If you do post a link, make sure it links to some article or a blog post that thoroughly explains the process._


help needed to decipher this Acer Aspire 4830TG ACPI code for Nvidia Optimus

I am trying to make sense of the following NVOP Method from the ACPI tables for an Acer Aspire 4830TG with an Nvidia Optimus hybrid graphics system. The NVOP method on top defines a bunch of instructions that can be used later on in the _DSM method. Which method should I call with the acpi_call module or the byo-switcheroo module to switch on/off the card on demand? See the code below:               Method (NVOP, 4, Serialized)     {         Name (_T_0, Zero)         Store ("------- NV OPTIMUS DSM --------", Debug)         If (LNotEqual (Arg1, 0x0100))         {             Return (0x80000001)         }              While (One)         {             Store (ToInteger (Arg2), _T_0)             If (LEqual (_T_0, Zero))             {                 Store (Buffer (0x04)                     {                         0x61, 0x00, 0x01, 0x0C                     }, Local0)                 Return (Local0)             }             Else             {                 If (LEqual (_T_0, 0x05))                 {                     Name (TMP5, Buffer (0x04)                     {                         0x00, 0x00, 0x00, 0x00                     })                     CreateField (TMP5, Zero, 0x04, DAVF)                     CreateField (TMP5, 0x04, One, LIDF)                     CreateField (TMP5, 0x08, 0x06, TOGN)                     CreateField (Arg3, 0x1F, One, NCSM)                     CreateField (Arg3, 0x19, 0x05, NCSN)                     CreateField (Arg3, 0x18, One, DIMK)                     CreateField (Arg3, 0x0C, 0x0C, ACTD)                     CreateField (Arg3, Zero, 0x0C, ATTD)                     If (ToInteger (NCSM))                     {                         Store (ToInteger (NCSN), TOGN)                     }                     Else                     {                         If (ToInteger (DIMK))                         {                             GETD (ToInteger (ATTD), ToInteger (ACTD))                             Store (\_SB.PCI0.PEG0.PEGP.NTOI, TOGN)                             Store (One, DAVF)                         }                     }                          Return (TMP5)                 }                 Else                 {                     If (LEqual (_T_0, 0x06))                     {                         Name (TMP6, Package (0x0F)                         {                             Ones,                              0x2C,                              Ones,                              0x2C,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C                         })                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, Zero))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x02))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x04))                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, 0x06))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x07))                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, 0x09))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x0A))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x0C))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x0D))                         Return (TMP6)                     }                     Else                     {                         If (LEqual (_T_0, 0x10))                         {                             Return (\_SB.PCI0.PEG0.PEGP.GOBT (Arg3))                         }                         Else                         {                             If (LEqual (_T_0, 0x1A))                             {                                 CreateField (Arg3, 0x18, 0x02, OPCE)                                 CreateField (Arg3, Zero, One, FLCH)                                 If (ToInteger (FLCH))                                 {                                     Store (ToInteger (OPCE), OMPR)                                 }                                      Name (RBUF, Buffer (0x04)                                 {                                     0x00, 0x00, 0x00, 0x00                                 })                                 CreateField (RBUF, Zero, One, OPEN)                                 CreateField (RBUF, 0x03, 0x02, CGCS)                                 CreateField (RBUF, 0x06, One, SHPC)                                 CreateField (RBUF, 0x18, 0x03, DGPC)                                 CreateField (RBUF, 0x1B, 0x02, HDAC)                                 Store (One, OPEN)                                 Store (One, SHPC)                                 Store (0x02, HDAC)                                 Store (One, DGPC)                                 If (\_SB.PCI0.PEG0.PEGP.GSTA ())                                 {                                     Store (0x03, CGCS)                                 }                                 Else                                 {                                     Store (Zero, CGCS)                                 }                                      Return (RBUF)                             }                             Else                             {                                 If (LEqual (_T_0, 0x1B))                                 {                                     Store (Arg3, Local0)                                     CreateField (Local0, Zero, One, OPFL)                                     CreateField (Local0, One, One, OPVL)                                     If (ToInteger (OPVL))                                     {                                         Store (Zero, OPTF)                                         If (ToInteger (OPFL))                                         {                                             Store (One, OPTF)                                         }                                     }                                          Store (OPTF, Local0)                                     Return (Local0)                                 }                                 Else                                 {                                     Return (0x80000002)                                 }                             }                         }                     }                 }             }                  Break         }     }          Method (GOBT, 1, NotSerialized)     {         Name (OPVK, Buffer (0xE2)         {             /* 0000 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0008 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0010 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0018 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0020 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0028 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0030 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0038 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0040 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0048 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0050 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0058 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0060 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0068 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0070 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0078 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0080 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0088 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0090 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0098 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00A0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00A8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00B0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00B8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00C0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00C8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00D0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00D8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00E0 */    0x00, 0x00         })         CreateWordField (Arg0, 0x02, USRG)         If (LEqual (USRG, 0x564B))         {             Return (OPVK)         }              Return (Zero)     }          Method (_INI, 0, NotSerialized)     {         Store (Zero, \_SB.PCI0.PEG0.PEGP._ADR)     }          Method (GSTA, 0, Serialized)     {         If (LEqual (\_SB.PCI0.PEG0.PEGP.PI17, One))         {             Return (One)         }         Else         {             Return (Zero)         }     }          Method (_ON, 0, Serialized)     {         \_SB.PCI0.PEG0.PEGP.PWRE ()         Store (Zero, LNKD)         While (LLess (LNKS, 0x07))         {             Sleep (One)         }              Store (Zero, CMDR)         Store (VGAB, VGAR)         Store (0x06, CMDR)     }          Method (_OFF, 0, Serialized)     {         Store (VGAR, VGAB)         Store (One, LNKD)         While (LNotEqual (LNKS, Zero))         {             Sleep (One)         }              \_SB.PCI0.PEG0.PEGP.PWRD ()     }          Method (_PS0, 0, NotSerialized)     {         If (DGOS)         {             GLSC ()             \_SB.PCI0.PEG0.PEGP._ON ()             GLSR ()             Store (Zero, DGOS)             Store (Zero, MLTF)             Store (Zero, \_SB.PCI0.LPCB.EC0.DSPM)         }     }          Method (_PS3, 0, NotSerialized)     {         If (LEqual (\_SB.PCI0.PEG0.PEGP.OMPR, 0x03))         {             GLSC ()             \_SB.PCI0.PEG0.PEGP._OFF ()             GLSR ()             Store (One, DGOS)             Store (0x02, \_SB.PCI0.PEG0.PEGP.OMPR)             Store (One, \_SB.PCI0.LPCB.EC0.DSPM)         }     }          Method (_STA, 0, Serialized)     {         Return (0x0F)     }          Method (_ROM, 2, NotSerialized)     {         Store (Arg0, Local0)         Store (Arg1, Local1)         If (LGreater (Local1, 0x1000))         {             Store (0x1000, Local1)         }              If (LGreater (Local0, 0x00010000))         {             Return (Buffer (Local1)             {                 0x00             })         }              If (LGreater (Local0, RVBS))         {             Return (Buffer (Local1)             {                 0x00             })         }              Multiply (Local1, 0x08, Local3)         Name (ROM1, Buffer (0x8000)         {             0x00         })         Name (ROM2, Buffer (Local1)         {             0x00         })         If (LLess (Local0, 0x8000))         {             Store (RBF1, ROM1)         }         Else         {             Subtract (Local0, 0x8000, Local0)             Store (RBF2, ROM1)         }              Multiply (Local0, 0x08, Local2)         CreateField (ROM1, Local2, Local3, TMPB)         Store (TMPB, ROM2)         Return (ROM2)     }          Method (MXMX, 1, Serialized)     {         If (LEqual (Arg0, One))         {             P8XH (One, 0x99, P8XH (Zero, One, Return (One), Return (Zero)))         }     }          Name (MXM3, Buffer (0x45)     {         /* 0000 */    0x4D, 0x58, 0x4D, 0x5F, 0x03, 0x00, 0x3D, 0x00,          /* 0008 */    0x30, 0x10, 0xB8, 0xFF, 0xF9, 0x3E, 0x00, 0x00,          /* 0010 */    0x00, 0x01, 0x8A, 0xFF, 0xF9, 0x3E, 0x00, 0x00,          /* 0018 */    0x60, 0x79, 0xD0, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0020 */    0x20, 0x2B, 0xE2, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0028 */    0x60, 0x6C, 0xEA, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0030 */    0x01, 0x90, 0x01, 0x00, 0x03, 0x00, 0x90, 0x01,          /* 0038 */    0x13, 0x00, 0x90, 0x01, 0xE5, 0x0D, 0x01, 0x01,          /* 0040 */    0x01, 0x00, 0x00, 0x00, 0x96     })     Method (_DSM, 4, Serialized)     {         Name (_T_0, Zero)         If (LEqual (Arg0, Buffer (0x10)                 {                     /* 0000 */    0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,                      /* 0008 */    0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0                 }))         {             Return (\_SB.PCI0.PEG0.PEGP.NVOP (Arg0, Arg1, Arg2, Arg3))         }              If (LEqual (Arg0, Buffer (0x10)                 {                     /* 0000 */    0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C,                      /* 0008 */    0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65                 }))         {             While (One)             {                 Store (ToInteger (Arg2), _T_0)                 If (LEqual (_T_0, Zero))                 {                     Return (Buffer (0x04)                     {                         0x01, 0x00, 0x01, 0x01                     })                 }                 Else                 {                     If (LEqual (_T_0, 0x18))                     {                         Return (Buffer (0x04)                         {                             0x00, 0x03, 0x00, 0x00                         })                     }                     Else                     {                         If (LEqual (_T_0, 0x10))                         {                             If (LEqual (Arg1, 0x0300))                             {                                 Return (MXM3)                             }                         }                     }                 }                      Break             }                  Return (0x80000002)         }              Return (0x80000001)     }      The original ACPI tables are available here:   http://bugs.launchpad.net/lpbugreporter/+bug/752542/+attachment/2235754/+files/Aspire%204830TG.tar.gz http://github.com/mkottman/acpi_call   http://github.com/awilliam/asus-switcheroo


Update yum offline

I've been looking around for a way to update an offline fedora box but haven't found anything. I only have a Windows computer connected to the Internet. I noticed that my yum config is pointed to http://download.fedoraproject.org/pub/fedora/linux/updates/14/i386. Is there a way I can download a list of packages and then those packages manually but still use yum? I've seen ways to do this with a second linux box that has Internet access, but I don't have that.


Could ">" be included in a bash Variable?

**Current approach** :               sudo awk 'BEGIN{printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<hello>\n\t<world>\n";} {print "\t\t",$0}END{printf "\t </world>\n</hello>\n"}' hello > hello2      **Preferred approach does not work** : `hello > hello2` would like to be defined as a variable to avoid code duplication               $CURRENT_TO_OUT=hello > hello2          echo "CP1" $CURRENT_TO_OUT          sudo awk 'BEGIN{printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<hello>\n\t<world>\n";} {print "\t\t",$0}END{printf "\t </world>\n</hello>\n"}' $CURRENT_TO_OUT      **Output $CURRENT_TO_OUT:** `CP1 hello`


su - user doesn't work for users without a password

I've created a user on CentOS with `useradd -M username`. Now, I want to become that user just like `su - username`. It asks me for a password for that user but I didn't set a password for that user. As a workaround, I have to become root then `su - username` works obviously. First, I thought it asks for a root password but it is not the case. Any ideas?


How can I extract the hash value of a LUKS device?

For LUKS devices I know that hashes are stored somehow in the partition header (I don't really know what this means). But I don't know how to print the hash value in this case. For example in a standard unix system the user password hashes are stored in `/etc/shadow`. If I want to see a hash of a password I can just open this file and see it. So, how can I extract the hash value of a LUKS device?


How can I track virtual Disk device to physical slot?

I'm kind of new working with Unix (Ubuntu). I managed to install Ubuntu on RAID1 and mounted 3 RAID 0 drives. I have a 9271-8i storage controller:               RAID1 (sda) - Unix installed     RAID0 (sdb)     RAID0 (sdc)     RAID0 (sdd)      I'm trying to track virtual drives (sdb, sdc, sdd) to the actual physical slot. If I see sdb is bad, I need to know which drive it is exactly on the server (I only have chance to do with the Device Id/Slot Id). How to get the physical drive/Slot ID? Any guidance on this would be appreciated.


How can I change the terminal tmux info (lower right) called status-right to username or host?

I have 7 dashes (`\-------`) on the lower right.   Can I replace them with something like my name or my host name? This is not about the PS1 prompt. I already have time name host dir there.   I use tmux.   I am on Ubuntu13 but I'd like it to work in iterm2 on OSX if possible. In `.tmux.conf` I have it as               set -g status-right "-------"      How can I make it be user or host? I tried \u but that didn't work. Example: ![enter image description here](http://i.stack.imgur.com/E6oxq.png)**< --- here**


Use start-stop-daemon for a PHP server

I'm working on a socket server written in PHP. This part of the work is done but now I need to run it as a daemon. For this I've tried to use `start-stop-daemon` but it doesn't work. My server is running Debian. To simplify, my question is why does the following command not run my daemon or how can I debug it?               start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/server-ticket.pid --exec /usr/local/zend/bin/php /var/www/server/consultpilot/ServerTicket.php >> /var/log/server-ticket.log 2>> /var/log/server-ticket.log </dev/null      The following is the full script, based on Till Klampaeckel's tutorial:               #! /bin/sh          ### BEGIN INIT INFO     # Provides: ServerTicket     # Required-Start: $all     # Required-Stop: $all     # Default-Start: 2 3 4 5     # Default-Stop: 0 1 6     # Short-Description: starts ServerTicket     # Description: starts ServerTicket using start-stop-daemon     ### END INIT INFO          # Load the VERBOSE setting and other rcS variables     . /lib/init/vars.sh          PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin     DAEMON=/usr/local/zend/bin/php     DAEMON_OPTS="/var/www/server/consultpilot/ServerTicket.php"     NAME=server-ticket     DESC="Daemon for the Server Ticket from DiffMed"     PIDFILE="/var/run/${NAME}.pid"     LOGFILE="/var/log/${NAME}.log"     QUIET="--quiet"     START_OPTS="--start ${QUIET} --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} ${DAEMON_OPTS}"     STOP_OPTS="--stop --pidfile ${PIDFILE}"              test -x $DAEMON || exit 0          set -e          case "$1" in         start)             echo -n "Starting $DESC: "             start-stop-daemon $START_OPTS >> "${LOGFILE}" 2>> "${LOGFILE}" </dev/null             echo "$NAME."                    ;;         stop)             echo -n "Stopping $DESC: "             start-stop-daemon $STOP_OPTS             echo "$NAME."             rm -f $PIDFILE             ;;         restart|force-reload)             echo -n "Restarting $DESC: "             start-stop-daemon $STOP_OPTS             sleep 1             start-stop-daemon $START_OPTS             echo "$NAME."             ;;     *)         N=/etc/init.d/$NAME         echo "Usage: $N {start|stop|restart|force-reload}" >&2         exit 1         ;;     esac          exit 0      For information, when I start the process, there is no return. But when I finish it, it tells me that no process corresponds:               root:/var/run$ service server-ticket start     Starting Daemon for the Server Ticket from DiffMed: result : 0     server-ticket.     root:/var/run$ service server-ticket stop     Stopping Daemon for the Server Ticket from DiffMed: start-stop-daemon: warning: failed to kill 5772: No such process     1 pids were not killed     No process in pidfile '/var/run/server-ticket.pid' found running; none killed.


LVM Mirrored Logical Volume Performance

I read that when mirroring a logical volume a log of some sort is used to keep the files in sync. You can either set it so this log is in a separate physical volume or in memory. I also read that if the log is in memory, the system has to resync the volumes. Is there a performance hit for using the log in memory? For example, does it take much longer to boot the machine? Is the data at risk while the resync is happening? I'm working with Ubuntu 10.04 in this case. I believe it's lvm2. The clearest documentation I've found is the CentOS document here. I was also looking at this description.


Is SCADA an RTOS?

Is SCADA one of the RTOS out there (it's used for real-time control and data acquisition)?


What causes various signals to be sent?

I sometimes get a little confused by all of the signals that an application can receive. As I understand it, an application has a default handler for each of these signals, but it can provide its own handler by calling `sigaction()`. So here is my question: what causes each of the signals to be sent? I realize that you can manually send signals to running applications via the `-s` parameter to `kill`, but what are the _natural_ circumstances under which these signals are sent? For example, when does `SIGINT` get sent? Also, are there any restrictions on which signals can be handled? Can even `SIGSEGV` signals be processed and control returned to the application?


Activate/deactivate WiFi on Lenovo B5400 under Ubuntu 14.04

I have a Lenovo B5400 with Ubuntu 14.04 x64. The Ethernet port works fine. How can I enable/disable the WiFi connection? I have no hardware button for this functionality. Under Windows I can press `Fn`+`F5` and a dialog window appears, but I cannot find this functionality under Linux. `lspci | grep Network` produces: > 04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe > Wireless Network Adapter The answer from here is incomplete. Any other ideas? **EDIT #1:** The output of `rfkill list all` is:               0: tpacpi_bluetooth_sw: Bluetooth         Soft blocked: yes         Hard blocked: yes          1: hci0: Bluetooth         Soft blocked: yes         Hard blocked: no          2: phy0: Wireless LAN         Soft blocked: yes         Hard blocked: yes      PS: disclaimer: crossposting


Capture web traffic grouped by individual TCP streams

As far as I know a HTTP request and response constructs one TCP connection. To debug a web application on a GUI-less server, I'd like to be able to capture these TCP streams in a single distinguishable entity (same color, file, db record, anything). `tcpdump` can only save IP packets as they arrive or leave, with no ordering or reassembling. `tcpflow` goes one step further to reassemble TCP connections in separate files, but puts send and receive streams in separate files, which makes quick debugging annoying. I'm sure I can write a script or even one- liner to merge related files, but I'm guessing a wrapper around `tcpflow` for this job could introduce complexities which wouldn't exist inside `tcpflow`. Also I'm lazy and looking for a cleaner solution. Any suggestions would be appreciated.


Can I configure apache to limit access to a directory only from my ssh connection?

I have a virtual machine running a number of websites. All users have access these via the external IP address of the machine. I am running Debian Stable on this machine. I can access the machine via `ssh` and have organized it so I port forward my local `10080` port to `localhost:80` so I can connect my browser to localhost port `10080`/phpmyadmin and gain access to phpmyadmin. My machine is on a `192.168.0.0/24` network Trouble is, you can also access it via any of the external web sites - because Debian has placed it in the top level Apache config. I would like to limit access to only connections via the `ssh` port. But there doesn't appear to be the equivalent of a listen directive for a directory. However there is Allow from IP_address. What IP address does apache think I connected on when I come over the `ssh` tunnel.


How to install b43-firmware on arch without internet access?

I currently don't have wire internet access in the PC I'm trying to install arch to, but my other PC (win7) can access the internet just fine. I tried downloading the b43 package from the AUR and copy it with a pendrive but when I run `makepkg -s --asroot` it goes and tries to download the source from "http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2" which doesn't work since I still don't have internet access. I manually downloaded the source on my other pc but I guess I have to modify the PKGBUILD file to reflect this so instead of trying to fetch it online it looks in my local folder? How can I do this?


Why does Vi have multiple modes?

Why does Vi have multiple modes? I'm not interested in the functions of the modes unless that was a reason to have different modes. I'm only interested in the design / engineering reasons for multiple modes.


How to report back system installation progress

I'd like to do some reporting from the system setup progress for virtualised (libvirt/kvm) Ubuntu servers. I expected some kind of such system to already exist out there, but couldn't find anything. Is it possible that there's no such thing? For a custom solution I've found there's a good interface available via `virt- install`'s `\--channel` option. Essentially I can start a daemon listening for messages on the host and on the client pipe messages to either a virtio device or to a pre-configured address using `netcat`. Alternatively I could make sure kernel logging is done into a file on the host and send my messages that way. Are there some other reasonable / tried solutions?


C Shell Array Declaration Syntax, () vs. {}

In my C-shell script (tcsh specifically) I have been trying to declare an array with six values: x, nx, y, ny, z, nz. After some trial and error I discovered three different ways of declaring the array I want:               set arrname = ("x" "nx" "y" "ny" "z" "nz")     set arrname = (x,nx,y,ny,z,nz)     set arrname = {x,nx,y,ny,z,nz}      but the following line doesn't work:               set arrname = {"x" "nx" "y" "ny" "z" "nz"}      The above line produces the following error:               Missing }.      My question is what is different between () and {} that makes the fourth declaration I've listed not work?


/usr/bin/ld: cannot find -lcrypt (rhel 6 )

**System info**               [root@xilinx busybox-1.22.1]# uname -r     2.6.32-71.el6.x86_64      Following errors come when I make busybox on rhel 6:               /usr/bin/ld: cannot find -lcrypt     collect2: ld returned 1 exit status     make: *** [busybox_unstripped] Error 1      Also I can see the libraries are there in lib:               [root@xilinx busybox-1.22.1]# ls  -ld /lib/libcry*     -rwxr-xr-x. 1 root root 38380 Sep  7  2010 /lib/libcrypt-2.12.so     lrwxrwxrwx. 1 root root    16 Jan 25 16:48 /lib/libcrypt.so.1 -> libcrypt-2.12.so          [root@xilinx busybox-1.22.1]# ls -ld /usr/bin/ld*     -rwxr-xr-x. 1 root root  595192 May  5  2010 /usr/bin/ld     -rwxr-xr-x. 1 root root 1685416 Aug 24  2010 /usr/bin/ldb3add     -rwxr-xr-x. 1 root root 1685416 Aug 24  2010 /usr/bin/ldb3del     -rwxr-xr-x. 1 root root 1685416 Aug 24  2010 /usr/bin/ldb3edit     -rwxr-xr-x. 1 root root 1685424 Aug 24  2010 /usr/bin/ldb3modify     -rwxr-xr-x. 1 root root 1685424 Aug 24  2010 /usr/bin/ldb3rename     -rwxr-xr-x. 1 root root 1685424 Aug 24  2010 /usr/bin/ldb3search     -rwxr-xr-x. 1 root root    5656 Sep  7  2010 /usr/bin/ldd      Why this is happening ? **Additional Info:**               [root@xilinx busybox-1.22.1]# yum install glibc-*     Loaded plugins: refresh-packagekit, rhnplugin     There was an error parsing the RHN proxy settings.     RHN support will be disabled.     Setting up Install Process     Package glibc-devel-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-headers-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-utils-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-common-2.12-1.7.el6.x86_64 already installed and latest version     Nothing to do      Also these are the installed packages starting with glib*               [root@xilinx busybox-1.22.1]# yum list installed |grep glibc*     There was an error parsing the RHN proxy settings.     RHN support will be disabled.     NetworkManager-glib.x86_64          1:0.8.1-5.el6                      @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     PackageKit-glib.x86_64              0.5.8-13.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     avahi-glib.x86_64                   0.6.25-8.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     dbus-glib.x86_64                    0.86-5.el6                         @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     dbus-glib-devel.x86_64              0.86-5.el6                         @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     glib.x86_64                         1:1.2.10-33.el6                    @epel         glib-devel.x86_64                   1:1.2.10-33.el6                    @epel         glib2.x86_64                        2.22.5-5.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     glib2-devel.x86_64                  2.22.5-5.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     glibc.i686                          2.12-1.7.el6                       @server       glibc.x86_64                        2.12-1.7.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     glibc-common.x86_64                 2.12-1.7.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     glibc-devel.x86_64                  2.12-1.7.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     glibc-headers.x86_64                2.12-1.7.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     glibc-utils.x86_64                  2.12-1.7.el6                       @server       glibmm24.x86_64                     2.22.1-1.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     poppler-glib.x86_64                 0.12.4-3.el6                       @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     pulseaudio-libs-glib2.x86_64        0.9.21-13.el6                      @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0     taglib.x86_64                       1.6.1-1.1.el6                      @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0      **glibc is installed:**               [root@xilinx busybox-1.22.1]# yum list installed glibc     Loaded plugins: refresh-packagekit, rhnplugin     There was an error parsing the RHN proxy settings.     RHN support will be disabled.     Installed Packages     glibc.i686                                              2.12-1.7.el6                                             @server                                                     glibc.x86_64                                            2.12-1.7.el6                                             @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0      **Tried RPM**               [root@xilinx Downloads]# rpm -ivh glibc-static-2.12-7.2.x86_64.rpm      warning: glibc-static-2.12-7.2.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 2ca06d46: NOKEY     error: Failed dependencies:         glibc-devel = 2.12-7.2 is needed by glibc-static-2.12-7.2.x86_64      **Now here is a chicken and egg problem**               [root@xilinx Downloads]# rpm -ivh glibc-2.12-7.2.x86_64.rpm      warning: glibc-2.12-7.2.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 2ca06d46: NOKEY     error: Failed dependencies:         glibc-common = 2.12-7.2 is needed by glibc-2.12-7.2.x86_64      Ok then I installed this dependency:               [root@xilinx Downloads]# rpm -ivh glibc-common-2.12-7.2.x86_64.rpm     warning: glibc-common-2.12-7.2.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 2ca06d46: NOKEY     error: Failed dependencies:         glibc = 2.12-7.2 is needed by glibc-common-2.12-7.2.x86_64      i.e when I install glibc-2.12-7.2 , it says I need glibc-common-2.12-7.2 but now when I install glibc-common-2.12-7.2, it says it need glibc-2.12-7.2 How do break this chicken-egg cycle? **But actually all required glibc are installed**               [root@xilinx busybox-1.22.1]# yum install glibc-*          Package glibc-devel-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-headers-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-utils-2.12-1.7.el6.x86_64 already installed and latest version     Package glibc-common-2.12-1.7.el6.x86_64 already installed and latest version     Nothing to do


Encode directory with GnuPG

Is there any way to encrypt the whole directory using `gpg`? It accepts only file as input argument. But I need to encrypt a lot of files on external HDD.


Defragging an ext partition?

Why don't ext2/3/4 need to be defragmented? Is there no fragmentation at all?


What is a "kernel panic"?

What does it mean when your computer has a **"kernel panic"**? Does it equate to the windows BsoD? Also, what **methods, tips, tricks** are available to the user when a _kernel panic_ strikes?


apt-get returns strange error

I am on kali linux and when I run apt-get update it returns this:               W: Unknown flag value:  yes     W: You may want to run apt-get update to correct these problems      after running `apt-get update` several times it's still the same issue


Testing if a port was forwarded correctly in Ubuntu

I have a Ubuntu box connected to a wifi router. This wifi router is connected to a d-link adsl modem/router. I am preparing this Ubuntu box to run a server that will use some special ports in UDP and TCP. I have setup this wifi router to put my Ubuntu box on a DMZ. So, the Ubuntu is on the DMZ of the wifi router, what means it is still on the local network of the D-link. The big question is: how do I test, using Ubuntu, if these special ports are getting thru? I mean: there is some command I can type to check if a port is getting thru and certify that the computer is really on DMZ? Part on the premise that the D-link is port-forwarding the ports correctly.


Capture user input while doing other things

Is there a way to have the output of a subprocess (something other than 'sleep' below) be dovetailed with the output from a foreground command-loop? For example:               while true     do         echo "updating screen..."         sleep 3 & # Replace with command which takes some time and updates the screen         read -s -n 1 -p "Input: " input         case "$input" in         q)             exit         ;;         f)             echo 'foo'         ;;         esac     done


Text substitution inside compressed files

I have several zip files, each one having several text files inside them. I want to substitute all occurrences of `a` in these text files with `b`, and leave them zipped with the same structure. If I just wanted to find the occurrences of `a`, I know I could use the `zgrep` command, but I also want to perform string substitution. Unfortunately, there is no `zsed` command. Do I have no choice but to write a script with a loop?


Public key for git-.....rpm is not installed

When attempting to install git (and probably other packages), I get this error:               $ sudo yum -y install git          Installing:      git                       x86_64           1.7.11.3-1.el6.rfx           rmit-res-rhel6-local                             7.5 M     ...     Downloading Packages:     warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY               Public key for git-1.7.11.3-1.el6.rfx.x86_64.rpm is not installed      I see from other questions (Public key not found for RPM) that the answer will probably be:               sudo rpm --import <SOMEKEY>      But what is the value of SOMEKEY here? Also, what happened to my system to make this happen? What went wrong? (This is a RHEL VM provisioned by a university ITS group. I have root access [obviously] but don't know its setup terribly well.)


Increment look back value within a configuration file daily +1

I have a configuration file that needs to be incremented daily. E.g.               report.lookback.days.to.retrieve.data=60      This file contains multiple entries such as the one above that contains different values. I need to open the property file search for this specific entry, and increment the value by +1 each day for a total of 30 days. E.g.               report.lookback.days.to.retrieve.data=61          report.lookback.days.to.retrieve.data=62          report.lookback.days.to.retrieve.data=63      I am new to scripting, and I'm not sure what method would accomplish this task. Should I use awk, sed, implement a counter, or a combination of methods?


bash function execution from command line

I love to play with bash script a lot. But I want to enhance the way I use bash script. I have a script(`nepleaks.sh`) as below used during my programming,               ~   1 clean(){                                                                                ~   2  lein clean                                                                                +   3  lein deps                                                                                +   4 }             5                                                                                6 runApp(){                                                                                7   echo("[info] : make sure you've started neo4j.")                                                          8   #lein run -m nepleaks-engine.core           ............        34                 35 clean                                                                                36 #runApp        When I need to `clean` my project, I have been commenting on `runApp` and vice-versa and then fire               $./nepleaks      Now, I want to amend this to something like               $ nepleaks clean or $ nepleaks runApp      I didn't like idea of sourcing `nepleaks.sh` and then call `clean` or `runApp`. Here's one of the lovely thing I used https://github.com/cosmin/s3-bash/blob/master/s3-get, I am looking into but their script looked complex to me. They support something as below,               s3-get -k {accesskey} -s /{path}/{secretid} /{bucketname}


xfce4-power-manager not updating; ACPI finding an unknown battery but working fine?

I recently upgraded my Asus S56CA Ultrabook and unfortunately my battery indicator in xfce4 stopped working. I am running Debian 8 (Jessie). `uname -a` gives me this:               Linux 3.14-2-amd64 #1 SMP Debian 3.14.13-2 (2014-07-24) x86_64 GNU/Linux      The battery indicator in the system tray is not updating at all to anything. If I start the computer with the AC plugged in, it will continue to say it is plugged in at the same percentage it was at when I started my computer even though I unplugged the cord. Running `xfce4-power-manager --debug` returns this message:               Xfce Power Manager: Another power manager is already running      Despite the message, I am almost positive I have no other power manager running on my computer (although I do not know how to check to make sure this is the case). I have tried to purge and reinstall acpi* and xfce4-power-manager* with no success. Running `acpi -V` gives me this when the AC cord is plugged in:               Battery 0: Unknown, 97%     Battery 0: design capacity 2950 mAh, last full capacity 2424 mAh = 82%     Adapter 0: on-line     Thermal 0: ok, 51.0 degrees C     Thermal 0: trip point 0 switches to mode critical at temperature 108.0 degrees C     Thermal 0: trip point 1 switches to mode passive at temperature 110.0 degrees C     Cooling 0: x86_pkg_temp no state information available     Cooling 1: TEFN no state information available     Cooling 2: T_VR no state information available     Cooling 3: TAMB no state information available     Cooling 4: TSKN no state information available     Cooling 5: intel_powerclamp no state information available     Cooling 6: Processor 0 of 3     Cooling 7: Processor 0 of 3     Cooling 8: Processor 0 of 3     Cooling 9: Processor 0 of 3     Cooling 10: LCD 0 of 100      and when the cord is unplugged, `acpi -V` gives me this:               Battery 0: Discharging, 97%, 02:59:50 remaining     Battery 0: design capacity 2950 mAh, last full capacity 2424 mAh = 82%     Adapter 0: off-line     Thermal 0: ok, 49.0 degrees C     Thermal 0: trip point 0 switches to mode critical at temperature 108.0 degrees C     Thermal 0: trip point 1 switches to mode passive at temperature 110.0 degrees C     Cooling 0: x86_pkg_temp no state information available     Cooling 1: TEFN no state information available     Cooling 2: T_VR no state information available     Cooling 3: TAMB no state information available     Cooling 4: TSKN no state information available     Cooling 5: intel_powerclamp no state information available     Cooling 6: Processor 0 of 3     Cooling 7: Processor 0 of 3     Cooling 8: Processor 0 of 3     Cooling 9: Processor 0 of 3     Cooling 10: LCD 0 of 100      I am not sure if this is an error as well, but is the battery supposed to be displayed as unknown? I would like to have my **battery indicator fixed** first and foremost, then any other issues would be bonus. Any alternatives for a battery indicator would be greatly appreciated.


Permission denied when trying to run script as other user

I'm trying to run a script as another user that starts a piece of software (Etherpad), which is run like so (from root): `su -c "/var/www/etherpad- lite/bin/run.sh" -s /bin/bash etherpad` but I'm getting the following error: `bash: /var/www/etherpad-lite/bin/run.sh: Permission denied` This had previously worked perfectly, and only stopped working after I installed a bunch of things for another project I'm working on, none of which should have affected etherpad. /var/log/auth.log shows this:               Aug 12 19:59:21 bhs1 su[7289]: Successful su for etherpad by root     Aug 12 19:59:21 bhs1 su[7289]: + /dev/pts/1 root:etherpad     Aug 12 19:59:21 bhs1 su[7289]: pam_unix(su:session): session opened for user etherpad by root(uid=0)     Aug 12 19:59:21 bhs1 su[7289]: pam_unix(su:session): session closed for user etherpad      I've done some searching and I found a couple of things that could cause this, but none are relevant to my problem:   * The file is chmodded to 777 (`-rwxrwxrwx`) and it's owned by the etherpad user. I only changed it to 777 to make sure it wasn't a permissions issue, it was something like 700 before.    * The file system doesn't have noexec enabled I'm running Debian 7.6 on a dedicated server.


How many volume groups can be created in physical volume?

I want to know the details regarding LVM: please provide some link regarding Linux to study and understand it.


How do I take a screenshot while using Gnome?

There's a pretty detailed set of instructions for how to take screenshots under debian online. The first paragraph suggests that debian supports an inbuilt screenshot facility: > >     "Print Screen" key to take a screenshot of the whole screen. >     Alt+"Print Screen" key to take a screenshot of the current active > window. >   ![debian screenshot popup](http://i.stack.imgur.com/FbPCt.png) The instructions imply that when I press `PrtScn` I should see this popup. However, I am running Debian Jessie and when I press `PrtScn` I just hear a camera shutter sound and don't see a popup. I tried pasting into `GIMP` (`edit`->`paste`) but there was nothing on the clipboard. The fact that I'm hearing the shutter sound suggests that _something_ is happening, but how do I get a copy of the image?


How to compile video4linux for ARM?

I would like to use a webcam using a Linux over ARM board. Through reading, I have discovered video4linux so I would like to compile it for ARM. My unique notes are:               git clone git://linuxtv.org/media_build.git     # (alternately to get only the latest revision without history)     git clone --depth=1 git://linuxtv.org/media_build.git     cd media_build      ./build How would I do this?


Linux (Debian) web server advice

I'm at the start of a new company in which the main activity is building internet web apps. I was very familiar with linux 8-9 years ago, but since then, I've lost a lot of touch with it (couldn't remember basic stuff like `iptables`). I am trying to set up a web application server (I have chosen Debian). Do you have any practices/advices/recommendations for the setup of apache/ftp/mysql and the server in general. What apps to use (such as phpmyadmin for mysql administration ), etc. The server configuration is an Intel E5200 with 2gb RAM wich I belive is more than enough for a start-up company.


Nvidia driver for Debian

Is there a "real solution" or driver for Nvidia Optimus graphic cards? I tested a lot of alternatives but no success. I know a lot of users face the same problem with Debian or Ubuntu-family. This solution does not work.


Problems to install nginx-full on debian 8

I have some problems to install nginx pkg (nginx-full) on debian jessie               # apt-get install nginx-full     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       nginx-common     Suggested packages:       fcgiwrap nginx-doc     The following NEW packages will be installed:       nginx-common nginx-full     0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.     Need to get 510 kB of archives.     After this operation, 1.271 kB of additional disk space will be used.     Do you want to continue? [Y/n]      Get:1 http://debian.c3sl.ufpr.br/debian/ jessie/main nginx-common all 1.6.1-1 [83,6 kB]     Get:2 http://debian.c3sl.ufpr.br/debian/ jessie/main nginx-full amd64 1.6.1-1+b1 [427 kB]     Fetched 510 kB in 1s (266 kB/s)          Selecting previously unselected package nginx-common.     (Reading database ... 170540 files and directories currently installed.)     Preparing to unpack .../nginx-common_1.6.1-1_all.deb ...     Unpacking nginx-common (1.6.1-1) ...     Selecting previously unselected package nginx-full.     Preparing to unpack .../nginx-full_1.6.1-1+b1_amd64.deb ...     Unpacking nginx-full (1.6.1-1+b1) ...     Processing triggers for man-db (2.6.7.1-1) ...     Setting up nginx-common (1.6.1-1) ...     Setting up nginx-full (1.6.1-1+b1) ...     Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.     invoke-rc.d: initscript nginx, action "start" failed.     dpkg: error processing package nginx-full (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      nginx-full     E: Sub-process /usr/bin/dpkg returned an error code (1)          # systemctl status nginx.service     nginx.service - A high performance web server and a reverse proxy server        Loaded: loaded (/lib/systemd/system/nginx.service; enabled)        Active: failed (Result: exit-code) since Sex 2014-09-05 11:39:46 BRT; 1s ago       Process: 2972 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)          #journalctl -xn     No journal files were found.      Someone know how to fix it?


What command do I use to spin up a "power up in standby" drive?

I have 8 drives in my server connected via PATA. The drives are set for no- spin via jumpers on the drive. `hdparm -I` says > powers-up in standby; SET FEATURES subcmd spins-up What command do I use to spin the drives up?


Linux Mint 14.1 with Cinnamon - Mouse Sensitivity not Working

64-bit if that matters. My mouse sensitivity slider does nothing, but my acceleration slider works. I'd like acceleration off and sensitivity how I like it, but it refuses to work. I have tested the option on two computers, and both do not change the sensitivity. Any help?


xterm login prompt not gnome login prompt

instead of loading `gdm3` when i turn my pc on, i want to load into an xterm with just a window manager (no desktop environment) and i want the xterm to have the login prompt as its first action so that i can login as my user within the xterm. i have the following info in my .xinitrc file:               $ ls -la .xsession     lrwxrwxrwx 1 peter peter 8 Oct  7 18:25 .xsession -> .xinitrc     $ cat .xinitrc      #!/bin/bash     [[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources     xterm -maximized &     exec mutter      but this only runs once i login through gnome. i really just want to turn off gnome and run an xterm instead. i'm guessing i will need to modify my `/etc/X11/Xsession` or my `/etc/X11/xinit/xinitrc` file to get rid of the `gdm3 start` and replace it with something. what should i add/remove from these files? i want to bring up a login prompt within the xterm as the first action. i'm on debian 7 and currently have gnome3 desktop environment with mutter window manager


/etc/hosts in debian resets itself on reboot

I've been having a problem where when our vps provider decides to restart the server (running Debian 5.0.8), the server fails to remember changes to `/etc/hosts`. All I need is an database alias that is used for the web applications on the server which points to `127.0.0.1` (`localhost`). I want it to look like this:               # The following lines are desirable for IPv6 capable hosts     # (added automatically by netbase upgrade)          ::1     ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters     ff02::3 ip6-allhosts               127.0.0.1 localhost.localdomain localhost webservice database     # Auto-generated hostname. Please do not remove this comment.     XXX.XX.XXX.XX xxxxxx.net.au  xxxxxx www.xxxxxxx.net.au xxxxxxx      However whenever there is a reboot it resets itself to:               # The following lines are desirable for IPv6 capable hosts     # (added automatically by netbase upgrade)          ::1     ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters     ff02::3 ip6-allhosts               127.0.0.1 localhost.localdomain localhost webservice     # Auto-generated hostname. Please do not remove this comment.     XXX.XX.XXX.XX xxxxxx.net.au  xxxxxx www.xxxxxxx.net.au xxxxxxx      without the database, and I have to manually change the file to get things to work. This has been happening for awhile and has become a nuisance, but I can't seem to find a way to get changes to stick. Anyone know what to do?


What does rpm -H do?

I came across someone's RPM command that wrote:               rpm -ivH ....      and then noticed that option `-H` is not documented anywhere. Command `rpm -H` no longer works with newer version of rpm, however it runs successfully under rpm version 4.8, produces no output and then exits. So what is the command `rpm -H` used to do? System is a Scientific Linux 6.1:               $ rpm --version     RPM version 4.8.0     $ rpm -H     $ echo $?     0


What would I get when sudo a kernel-destructive program?

It suddenly comes to me how easy it will be for a _sudoer_ to crash the kernel, so I tried something like this:               #include<stdio.h>          int main(){         printf("hello world");         int a;         printf("%p", &a);         int *p = (int*)0xffff000000000000; //x86_64, somewhere in the kernel space         printf("%p:%d", p,*p);         *p = 1;         printf("%p:%d", p,*p);     }      Understandably, without `sudo`, running the program turns out a segment fault. **However** , I got **NOTHING** when execute it via `sudo ./a.out`! Even the `hello world` in first line is suppressed without any error or warnings at all. Can someone explain what's happening?


Is there a uniform way to discover information about devices?

**UPD** : Changed question title from `manage devices` to `discover information about devices` One of the frequent thing I do is look up info about devices on my systems. And I am constantly find myself confused about various different commands on Linux to query available disks, network adapters, graphics cards etc. For example, if I need to query all disk drives available, I do:               ls -la /dev/disk/by-id      If I need to query all network cards available, I do:               ls -la /sys/class/net      Is there any single point to query all device ids by type? Maybe there was initiative to unify handling of devices info and make it discoverable/accessible, but it failed? History of the question in order of appearance:   1. /dev/disk/ lists disks, why /dev/net/ doesn't list network interfaces?   2. Why are network interfaces not in /dev like other devices?


How to disable a usb sound device with udev

How can I disable USB device by Vendor ID? So I have:               [root@piotr ~]# lsusb     Bus 001 Device 002: ID 058f:9254 Alcor Micro Corp. Hub     Bus 001 Device 003: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter     Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)     Bus 002 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB     Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 006: ID 0bc2:3320 Seagate RSS LLC SRD00F2 [Expansion Desktop Drive]      I want to disable               Bus 001 Device 003: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter      I need this unit in Windows environment but it disturb me Skype input (and only Skype). As temporary solution I just included snd_usb_audio in modprobe blacklist. But it is only workaround. Or, (maybe better) is it possible to exclude this particular USB device from udev rules? But in /usr/lib/udev/rules.d there is not definition for this device. I mean about VendorID. So my questions are: Why it is working at all and can be seen by ALSA? How can I exclude such VendorID and ProductID fron udev rules? Any idea wanted


What are the side effects of having several UNIX users share one UID?

The sys-apps/shadow package on my GNU / Linux system comes with a `useradd` command that supports an option that I have previously overlooked: `\--non- unique`. For the sake of convenience when shellig home from the university, I have created an alias for my original username (casual name at home) thusly:               useradd --non-unique -u 1001 \          --no-create-home --home-dir /home/casualname \          -g 1001 -G `id casualname -G | tr ' ' ,` universityUsername      This allows me to login from campus with the login universityUsername without creating a ~/.ssh/config alias or specifying the -l option for `ssh`. After logging in, `whoami` reports that I am casualname. This is due to the fact that casualname appears closer to the top of the /etc/passwd file. I wonder how widely supported such aliases are and if there are any drawbacks to using them. And also, is there a way to select the preferred user alias as the acting one (what $USER is set to) on a system where the user can not re- order entries in /etc/passwd?


Building Virtualbox Linux Headers

I am trying to get Virtualbox running on my Acer C7 with Ubuntu 13.04. I ran the script posted here but I am getting the following error after this point in the script.               # make-kpkg kernel_image kernel_headers          make[2]: Entering directory `/usr/src/kernel' SYSHDR     arch/x86/syscalls/../include/generated/asm/unistd_32.h SYSHDR      arch/x86/syscalls/../include/generated/asm/unistd_64.h SYSHDR      arch/x86/syscalls/../include/generated/asm/unistd_x32.h SYSTBL        arch/x86/syscalls/../include/generated/asm/syscalls_32.h HOSTCC      arch/x86/tools/relocs CHK include/linux/version.h UPD      include/linux/version.h CHK include/generated/utsrelease.h UPD      include/generated/utsrelease.h CC kernel/bounds.s cc1: error: unrecognized command line option '-fstack-protector-strong'               make[3]: * [kernel/bounds.s] Error 1 make[2]: [prepare0] Error 2 make[2]:      Leaving directory /usr/src/kernel' make[1]: *** [debian/stamp/conf/kernel-conf]      Error 2 make[1]: Leaving directory/usr/src/kernel' make: **      [debian/stamp/conf/minimal_debian]      Error 2 Failed to create a ./debian directory: No such file or directory at /usr/bin/make-kpkg line 984.


Cannot get TFTP server working on Ubuntu using xinetd

I am trying to get a very simple `tftp` server working. I followed the guides at several websites, including how-to-setup-tftp-on-ubuntu and installing-and- testing-tftpd-in-ubuntudebian, but I haven't been able to get a `tftp` server working. The `xinetd` service is running (I know this because I do a `ps -A | grep xinetd` and see it), but I don't see `tftp` in `netstat -na | grep LIST | grep 69`. In other words, `xinetd` is running but I don't see the `tftp` server. I tried connecting to the server from my Windows `tftp` client but it failed, so I know for sure it's not running. My `/etc/xinetd.d/tftp` config file looks like this:               service tftp     {         protocol = udp         port = 69         socket_type = dgram         wait = yes         user = nobody         server = /usr/sbin/in.tftpd         server_args = -s /tftpboot          disable = no     }      The `/tftpboot` is owned by `nobody:nogroup`, and mode to `777`. I thought maybe it was a firewall issue but ufw says it is inactive. In case it matters, Ubuntu is running inside a VirtualBox VM with the ethernet adapter bridged (not NAT) to my home network. I also tried directly running `/usr/sbin/in.tftpd` and used the `\--foreground` option, but it closes right away.


Limit memory usage for a single Linux process

I'm running `pdftoppm` to convert a user-provided PDF into a 300DPI image. This works great, except if the user provides an PDF with a very large page size. `pdftoppm` will allocate enough memory to hold a 300DPI image of that size in memory, which for a 100 inch square page is 100*300 * 100*300 * 4 bytes per pixel = 3.5GB. A malicious user could just give me a silly-large PDF and cause all kinds of problems. So what I'd like to do is put some kind of hard limit on memory usage for a child process I'm about to run--just have the process die if it tries to allocate more than, say, 500MB of memory. Is that possible? I don't think ulimit can be used for this, but is there a one-process equivalent?


Set memory allocation for applications in Ubuntu

I have an application running under Ubuntu that tries to consume all available memory. Is there a way to specify and restrict the allocations available for a given application?


Steps to configure iPod shuffle in Fedora 19

I am using Fedora 19 GNOME version. After I plugin my iPod to the USB, it is not listed in my filesystem. The output of the `lsusb` command is:               Bus 002 Device 003: ID 090c:237c Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.)      Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 003: ID 05ac:1303 Apple, Inc. iPod Shuffle 4.Gen     Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      the output of `fdisk -l` is:               Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: gpt               #         Start          End    Size  Type            Name  1         2048       411647    200M  EFI System      EFI System Partition  2     411648      1435647    500M  Microsoft basic   3      1435648    976773119  465.1G  Linux LVM                 Disk /dev/mapper/fedora-root: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes               Disk /dev/mapper/fedora-swap: 4177 MB, 4177526784 bytes, 8159232 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes               Disk /dev/mapper/fedora-home: 441.5 GB, 441505021952 bytes, 862314496 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes               Disk /dev/sdb: 2018 MB, 2018496512 bytes, 492797 sectors Units = sectors of 1 * 4096 = 4096 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: dos Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System      So, `sdb` is my iPod. The output of `mount -t hfsplus /dev/sdb /media/ipod/` is:               mount: wrong fs type, bad option, bad superblock on /dev/sdb,            missing codepage or helper program, or other error                 In some cases useful info is found in syslog - try            dmesg | tail or so.      Then I tried checking the logfile `dmesg | tail -30`. The output was:               [254134.677536] usbcore: registered new interface driver usb-storage      [254135.680855] scsi 6:0:0:0: Direct-Access     Apple    iPod   2.70 PQ: 0 ANSI: 2      [254135.681654] sd 6:0:0:0: Attached scsi generic sg2 type 0      [254135.682437] sd 6:0:0:0: [sdb] 492797 4096-byte logical blocks: (2.01 GB/1.87 GiB)     [254135.683072] sd 6:0:0:0: [sdb] Write Protect is off      [254135.683077] sd 6:0:0:0: [sdb] Mode Sense: 6e 00 00 08      [254135.683678] sd 6:0:0:0: [sdb] Incomplete mode parameter data      [254135.683682] sd 6:0:0:0: [sdb] Assuming drive cache: write through      [254165.979596] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254197.054873] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci     [254228.066118] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254259.205331] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254259.294409] sd 6:0:0:0: [sdb] 492797 4096-byte logical blocks: (2.01 GB/1.87 GiB)      [254259.295670] sd 6:0:0:0: [sdb] Incomplete mode parameter data      [254259.295674] sd 6:0:0:0: [sdb] Assuming drive cache: write through      [254290.152447] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254321.227721] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254352.238989] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254383.250192] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254383.337942]  sdb:      [254383.339261] sd 6:0:0:0: [sdb] 492797 4096-byte logical blocks: (2.01 GB/1.87 GiB)      [254383.340499] sd 6:0:0:0: [sdb] Incomplete mode parameter data      [254383.340503] sd 6:0:0:0: [sdb] Assuming drive cache: write through      [254414.261274] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254445.400659] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254476.411854] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254507.423071] usb 1-1.2: reset high-speed USB device number 3 using ehci-pci      [254507.509440] sd 6:0:0:0: [sdb] Attached SCSI removable disk      [254606.269395] hfsplus: unable to find HFS+ superblock      [254921.669943] hfsplus: unable to find HFS+ superblock      I also have gtpod and banshee installed. How do I get the iPod configured and running?


Command tool to create torrent files that includes MD5 hashes of files?

I'm aware of mktorrent, and know how to use it, but for testing purposes I require a utility that will also include the MD5 hash of every file in the torrent in the torrent meta info. I realize that the MD5 hash for each file isn't typically used with most modern torrent apps and is superfluous, but I'm hoping there's a utility out there I missed that supports this. Any suggestions?


How do I export a folder to a subnet using NFS in FreeBSD 9.0

The following NFS exports file does not work on FreeBSD 9.0. How should I be specifying that I wish to share with the whole subnet?               mybox# cat /etc/exports       /storage/build 10.10.0.0/24(rw,no_root_squash)      Error from syslog:               mountd[1133]: bad exports list line /storage/build      10.10.0.0/24(rw,no_root_squash)      /etc/rc.conf               rpcbind_enable="YES"     nfs_server_enable="YES"     mountd_flags="-r"


How can I tell if xscreensaver has my screen locked?

I'm thinking through alerting stuff, and decided that, if my screen is locked, I'm not there so I should push the alerts to my phone. But, I cannot currently tell if the screen is locked. I could put something together with Perl and xscreensaver-command -watch, but I'd rather not have to make sure I have that process always running and all. That seems too heavy. Is there something I'm missing? This seems fairly obvious.


No route to host using ssh

I have a issue with remote server connection using ssh. I have a serverA on xxx.xxx.xxx.xx1 with default port 22. I have an another serverB on xxx.xxx.xxx.xx2 same default port22. Now I want to coonect serverB from serverA using ssh. I used the following command               [userA@localhost~] # ssh userB@serverB      When I run this command then I got the error as below               ssh: connect to host xxx.xxx.xxx.xx1 port 22: No route to host      One more this when I login the serverA then I see the prompt like **[userA@Localhost~] #** I did not understand that why it shows like above bold text while it should be show as `[userA@serverA ~] #` Any one has any idea to resolve this issue. thanks Note: Any query you can ask frenkly. I am newbie for remote connection using ssh updated I already ping but got the below response               [userA@localhost ~]# /bin/ping xxx.xxx.xxx.xx1     PING xxx.xxx.xxx.xx1 (xxx.xxx.xxx.xx1) 56(84) bytes of data.     From 192.168.24.1: icmp_seq=2 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1: icmp_seq=3 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1: icmp_seq=4 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1 icmp_seq=2 Destination Host Unreachable     From 192.168.24.1 icmp_seq=3 Destination Host Unreachable     From 192.168.24.1 icmp_seq=4 Destination Host Unreachable     From 192.168.24.1: icmp_seq=5 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1: icmp_seq=6 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1: icmp_seq=8 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1 icmp_seq=6 Destination Host Unreachable     From 192.168.24.1 icmp_seq=7 Destination Host Unreachable     From 192.168.24.1 icmp_seq=8 Destination Host Unreachable     From 192.168.24.1: icmp_seq=11 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1 icmp_seq=10 Destination Host Unreachable     From 192.168.24.1 icmp_seq=11 Destination Host Unreachable     From 192.168.24.1 icmp_seq=12 Destination Host Unreachable     From 192.168.24.1 icmp_seq=13 Destination Host Unreachable     From 192.168.24.1 icmp_seq=14 Destination Host Unreachable     From 192.168.24.1 icmp_seq=15 Destination Host Unreachable     From 192.168.24.1: icmp_seq=17 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)     From 192.168.24.1 icmp_seq=17 Destination Host Unreachable     From 192.168.24.1 icmp_seq=18 Destination Host Unreachable      Updated-2 I run the netstat command and got the result as               [userA@localhost ~]# netstat -rn     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     192.168.24.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0     169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0     0.0.0.0         192.168.24.1    0.0.0.0         UG        0 0          0 eth0


Are there GPG-signed OpenBSD ISOs with which I can verify an installation disc?

Are there GPG-signed OpenBSD ISOs that I can download and later verify the downloaded file? Or at least a GPG-signed shasum?


Is there an online bash script testing site?

Sometimes I need to help friends with bash scripting. When I'm on a Windows machine, it's a working environment and I can't just setup Cygwin or use a VM. Is there some free scripting website I can use, preferably where I can use Putty to connect it or something similar?


How do you binarize a colored image?

My friend has an colored image with Chinese handwriting (basically by taking photo of or scanning what he wrote on a piece of white paper), and he would like me to convert it into a black and white binary image. Are there applications under Ubuntu that can accomplish that? Here is an example image: ![enter image description here](http://i.stack.imgur.com/hWxAz.png)


Do I need a new zone for each domain I have on my server?

I currently have a working BIND nameserver Running on my dedicated ubuntu server box. I have one zone set up.. example.com with its own nameservers. If I want to add a new domain to point to the server, can I somehow add it to the existing zone? Or do I have to create a new zone and setcoms nameservers to example.com?


Tail multiple files and output as additional column with 'find' results

Would like to pull the last line of text from a specific (multiple) files in a directory. Additionally, I'd like the results to be in a more traditional column format (like `ls`) with path, rather than the typical format of `tail`. From the following results {1}, I'd like to append as an additional column the last row of data {2} Where {1} = `find . -iname 'updated.txt'`, and {2} = `tail -n1` I'm using `bash` in Mavericks


Rotate screen using udl driver (DisplayLink) on Ubuntu 14.04?

Recently got a DisplayLink device, it works, but I would like to rotate counter-clockwise. Apparently the driver does not allow rotation (tried via gnome-shell and xrandr). Searching on google I found this link: http://plugable.com/2010/01/02/displaylink-linux-rotation but it seems a bit outdated. The configuration file / etc/X11/xorg.conf does not exist, I guess xorg uses another configuration structure. Any tips on how I could rotate the screen in Ubuntu 14.04? Kernel: 3.13.0-32-generic   Xorg: 1.15.1   Device: Bus 002 Device 011: ID 17e9: 019e DisplayLink (DL-165?)


When should I not kill -9 a process?

I am always very hesitant to run `kill -9`, but I see other admins do it almost routinely. I figure there is probably a sensible middle ground, so:   1. When and why should `kill -9` be used? When and why not?   2. What should be tried before doing it?   3. What kind of debugging a "hung" process could cause further problems?


Sharing Multiple Folders with Samba

How can I share multiple folders in Samba? If I use mutiple `[public]` sections in `smb.conf` only the last 1 has effect. Then if I try to name each section differently, I samba doesnt seem to recognize them as shares.


Running executables on an NTFS partition?

My system configuration is the following:   * UEFI computer   * Dual-boot with Windows 8 and Linux Mint 15 Olivia I would like to be able to run Linux executables that are stored on an NTFS partition rather than having to copy them each time on a Linux partition. Whenever ticking the _Execute_ check box it de-ticks itself, I guess because it's on an NTFS partition.               ![enter image description here](http://i.stack.imgur.com/PLqDm.png) I've come across this post:   * http://askubuntu.com/questions/11840/how-to-chmod-on-an-ntfs-or-fat32-partition Searching on my system, I have found that mentioned settings can be done in _Disks_ settings dialog:     ![enter image description here](http://i.stack.imgur.com/WjQw0.png) I thought about appending _exec_ at the end of default parameters but I'm not sure about these things:   * According to answer 2 of the above question: _NTFS is a POSIX-compatible_ and _To enable this, you need a "User Mapping File"_.   * So, is the _User Mapping File_ a file stored on the Linux partition? (i.e. stores Linux-specific permissions in my Linux partition instead of directly changing the permissions in the NTFS partition). **In short :** Can I safely do this as I will still use my Windows with this partition?


Should a laptop user switch from ext4 to btrfs?

Related to this. I'd like to take advantage of an OS switch to upgrade to BTRFS.   * BTRFS claims to offer a lot (data-loss resiliency, self-healing if RAID, checksumming of metadata **and** data, compression, snapshots). But it's slow when used with `fsync`-intensive programs such as `dpkg` (I know `eatmydata` and the crappy `apt-btrfs-snapshot` programs) and I won't setup a RAID :p.   * EXT4 allow metadata check-summing only and doesn't compress data. In 6 years, I had to reinstall my OS twice because of HDD corruption (after flight trips). The first making the laptop unbootable, the second bunch of corruptions was identified thanks to a corrupted film and then md5sum check of the OS binaries. (SMART tells me the disk is sane). The lappy currently behave quite strangely. I don't know if the hardware or the software is to blame but I suspect the hardware (it all began right after a flight, once again). Would you advise to switch to BTRFS for a laptop because of data compression and check-summing or should I stick with EXT4? (I don't care about which is "best" relative to whatever variable but I have almost no experience with BTRFS and would like some feedback) **EDIT:** Let's be clearer: BTRFS is still flagged as experimental, I **know** , but SUSE says it shouldn't anymore. So does Oracle (I know who Oracle is). And a bunch of distributions already propose BTRFS for installation and most of them are planning to switch to it in the next few months. Two facts:   * **Backups of corrupted data are worthless**. I don't understand why I seem to be the only one to bother. Isn't that common sense? In the meanwhile:      * Stop telling me I should do backups: I _already_ do.     * Stop implying backups are just enough to keep my data safe except if you are willing to give me TBs of free space to do years worth of backups.   * **A corrupted file =/=> Linux complaining**. So:      * Don't assume your system/data are sane just because the OS is booting.     * I hope you understand that I prefer (meta)data checksumming to an over-engineered and bloated piece of software that would inconveniently do half as a good job as BTRFS to check the data integrity. Is that more clear now that I am not asking for which FS is "better"? The question is, given that I regularly do backups, is BTRFS still too experimental to be used for its data-integrity checking functions or should I stick to EXT4?


Extract Data between comma

I have an output file which contains different numbers seperated by commas. But the issue is I do not know the number of commas. I would in turn like this data to be grep on another file. For example: I have INFO: `10,20,30,55,58,47,52,100` I use               awk '{split($0,a,","); for (i=1; **i <=8**; i++) print a[i]}' TMPFILE to extract the data. But I do not know how long the `for` loop has to be performed. Once I get those numbers like 10, I need to `grep` that on data.txt then 20 on data.txt and so on untill the last number.


How to find the full path of a file from my Desktop in Centos?

My folders in desktop: ![my folder in desktop](http://i.stack.imgur.com/8UpS2.jpg) My folder name about which I'm interested is `Ram`: ![what are the sub folders in my main folders](http://i.stack.imgur.com/xc6mO.png) ![enter image description here](http://i.stack.imgur.com/GlKPT.png) I tried the following command for installing `yoono-desktop`:               [root@localhost mpatil]# tar jxf ~/Ram/Downloads/yoono-desktop-1.8.43.tar.bz2 tar     tar (child): /root/Ram/Downloads/yoono-desktop-1.8.43.tar.bz2: Cannot open: No such file or directory     tar (child): Error is not recoverable: exiting now     tar: Child returned status 2     tar: Error is not recoverable: exiting now      I have root and password. I tried as root.


Locate encfs rootdir

If a rootdir is mounted by encfs to a mount point, I can see the mount point by "mount" command or from the /proc/mounts. However, if I can get the mount point, but I don't know which rootdir I have mounted, how do I locate that encrypted directory?


How to get a string between two special characters using Shell?

I want to get a string between two special characters. For example,               /home/oracle/ggs/text.ext      I want **oracle/ggs** in the above string. How can I do this using bash?


Create an absolute symbolic link to the current directory

I am now under a directory with very long path. For future visiting it quicker, I would like to create a link to it. I tried `ln -s . ~/mylink` `~/mylink` actually links to `~`. So can I expand `~` into the obsolute pathname, and then give it to `ln`?


How do I get my laptop screen backlight brightness controls to work?

What do I need to do to get my laptop screen backlight brightness controls to work? I currently have Ubuntu 13.04 and a Dell Studio 1558. After reading these two links: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1007765   http://ubuntuforums.org/showthread.php?t=2061712 I attempted the following, I change the permissions (since I was having errors editing the files)               sudo chmod a+w /sys/class/backlight/intel_backlight/brightness      And then I overwrote the file with `1000` (appears `max_brightness` is `4882`)               sudo echo 1000 > /sys/class/backlight/intel_backlight/brightness      And lo and behold, my screen dimmed. I've tweaked it before, I'm not sure exactly how, and I don't know why I had to change the permissions on the file again, if I did it that way before. How can I adjust brightness with the standard keys?


Why it is necessary to update /etc/default/grub, and not just save it?

I understand that the grub file contains some instructions that are required before booting such as: booting in text or booting in Graphics mode. My question is why do I need `update-grub`? Why just saving the file after making changes would not work?


multiple background processes in a script

Suppose if i have a situation in which some files need to be copied and it takes long time so i would have to go for parallel processing of the file copy. for example it may look like this               for i in ipaddresslist     do          cp x y &  //running in back ground or some other process in background          done          wait  //will cause till all the files are copied or whatever process if all are finished      now i have used `wait` so that all the backgroud processes are completed but there are cases in it like 1) some file copy may happen earlier so if i have to do some processing on these files i have to wait till all the files are copied. 2) if the copy process (or any other program running in back ground) writes to a log file the log file could be garbled with each background process trying to write to the file at the same time. is there any workaround for such things, 1)i mean if i can know that this process has finished then i could start doing the rest of the processing for that particular instance of the process(say file copy) if its completed. also, moreover writing to log files could be in orderly fashion. please make suggestions


CPU fan extremely fast even with 0% CPU

I just reinstalled my operating system (Crunchbang on Debian testing), and all of a sudden the fan is running as fast as it can even with 0% CPU. The air coming out of it is cold. The only CPU frequency governors available according to `/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors` are performance and powersave, and it was already set to powersave by default. What else could be wrong?               ruukasu@cb-lt:~$ sensors     acpitz-virtual-0     Adapter: Virtual device     temp1:        +38.0°C  (crit = +108.0°C)          pkg-temp-0-virtual-0     Adapter: Virtual device     temp1:        +39.0°C            coretemp-isa-0000     Adapter: ISA adapter     Physical id 0:  +39.0°C  (high = +87.0°C, crit = +105.0°C)     Core 0:         +32.0°C  (high = +87.0°C, crit = +105.0°C)     Core 1:         +39.0°C  (high = +87.0°C, crit = +105.0°C)


I am in **Ubuntu 10.04**. When I install the software updates with " **Update Manager** ", there is a pop up dialog which tells me "The volume "boot" has only 0 byte disk space remaining" How to get rid of this?