title: Delete key doesn't work on command line

text: * _Note: I asked this same question on SuperUser, but didn't get any response. I now realize this is a more appropriate forum for this particular question._ In a ksh shell, the **Delete key doesn't work appropriately** on the command line. I get a ~ when I press Delete. How do I:   1. bind the functionality of _"Delete the character at the cursor"_ to the Delete keyboard button? (Control-D behaves like I expect the delete button to work and my attempts at using an alias were unsuccessful and likely naive.)    2. bind the functionality of " _Move to the first of the line"_ to the Home keyboard button? (Control A does this now, but I want Home to do it.)   3. bind the functionality of " _Move to the end of the line_ " to the End keyboard button? (Control E does this now, but I want end to do it.) **Final(?) Update** I stumbled across something that works, but I don't understand quite why. This works:               bind '^[[3'=prefix-2     bind '^[[3~'=delete-char-forward      According to http://www.qnx.com/developers/docs/6.3.2/neutrino/utilities/k/ksh.html#bind,               prefix-2     Key binding: ^X, ^[[     Introduces a 2-character command sequence.      So my **updated question is why do I need to use`prefix-2` for this?** Please translate for me so I can understand so I don't have to bug everyone again about this. OLD STUFF FOLLOWS **UPDATE** It turns out that ESC in QNX is `^[`. Using the command `bind '^[[3~'='delete- char-backward'` I am able to get the cursor to overwrite the character under the cursor with a `~`. This is some progress at least--I now know how to spell _Delete Key_ for the shell. Most things I have seen on the web say that the delete key is `^?`, but that doesn't seem to work for me. Also, I should mention I am accessing this via PuTTy. I don't understand because _Control D_ does what I want the delete key to do. I tried binding it to `eot-or-delete` again to no avail. This should be simple, right? **UPDATE 2:**                bind | grep prefix     ^X = prefix-2     ^[ = prefix-1     ÿ = prefix-3     ^[O = prefix-2     ^[[ = prefix-2               bind | grep '[^ -~]'     ÿ = prefix-3     à  = beginning-of-line     à¡ = up-history     à¤ = backward-char     à¦ = forward-char     à¨ = end-of-line     à© = down-history     à¬ = delete-char-forward     à´ = backward-word     à¶ = forward-word      **UPDATE 3: More of my settings** ENV setting                echo $ENV     /etc/kshrc      BIND Complete Output               bind     ^A = beginning-of-line     ^B = backward-char     ^C = abort     ^D = eot-or-delete     ^E = end-of-line     ^F = forward-char     ^G = abort     ^H = delete-char-backward     ^I = complete     ^J = newline     ^K = kill-to-eol     ^L = redraw     ^M = newline     ^N = down-history     ^O = newline-and-next     ^P = up-history     ^R = search-history     ^T = transpose-chars     ^U = kill-line     ^V = version     ^W = kill-region     ^X = prefix-2     ^Y = yank     ^[ = prefix-1     ^\ = no-op     ^] = search-character-forward     ^^ = quote     ^_ = eot     ^? = delete-char-backward     ÿ = prefix-3     ^[^H = delete-word-backward     ^[^X = complete-file     ^[^[ = complete     ^[^] = search-character-backward     ^[  = set-mark-command     ^[# = comment     ^[* = expand-file     ^[. = prev-hist-word     ^[0 = set-arg     ^[1 = set-arg     ^[2 = set-arg     ^[3 = set-arg     ^[4 = set-arg     ^[5 = set-arg     ^[6 = set-arg     ^[7 = set-arg     ^[8 = set-arg     ^[9 = set-arg     ^[< = beginning-of-history     ^[= = complete-list     ^[> = end-of-history     ^[? = list     ^[C = capitalize-word     ^[L = downcase-word     ^[O = prefix-2     ^[U = upcase-word     ^[[ = prefix-2     ^[_ = prev-hist-word     ^[b = backward-word     ^[c = capitalize-word     ^[d = delete-word-forward     ^[f = forward-word     ^[g = goto-history     ^[h = delete-word-backward     ^[l = downcase-word     ^[u = upcase-word     ^[y = yank-pop     ^[^? = delete-word-backward     ^X^X = exchange-point-and-mark     ^X^Y = list-file     ^X^[ = complete-command     ^X? = list-command     ^XA = up-history     ^XB = down-history     ^XC = forward-char     ^XD = backward-char     ^XH = beginning-of-line     ^XP = delete-char-forward     ^XY = end-of-line     ^Xc = forward-word     ^Xd = backward-word     ^Xw = end-of-line     à  = beginning-of-line     à¡ = up-history     à¤ = backward-char     à¦ = forward-char     à¨ = end-of-line     à© = down-history     à¬ = delete-char-forward     à´ = backward-word     à¶ = forward-word      /etc/kshrc               /etc # cat kshrc     case $- in     *i*)         export SHELL_COLOR_BLUE="print -n \\033[0;34m"         export SHELL_COLOR_GREEN="print -n \\033[0;32m"         export SHELL_COLOR_RED="print -n \\033[0;31m"         export SHELL_COLOR_LIGHTGRAY="print -n \\033[0;37m"         export SHELL_COLOR_YELLOW="print -n \\033[1;33m"              export COLOR_BLACK="\\033[0;30m"         export COLOR_BLUE="\\033[0;34m"         export COLOR_GREEN="\\033[0;32m"         export COLOR_CYAN="\\033[0;36m"         export COLOR_RED="\\033[0;31m"         export COLOR_PURPLE="\\033[0;35m"         export COLOR_BROWN="\\033[0;33m"         export COLOR_LIGHTGRAY="\\033[0;37m"         export COLOR_DARKGRAY="\\033[1;30m"         export COLOR_LIGHTBLUE="\\033[1;34m"         export COLOR_LIGHTGREEN="\\033[1;32m"         export COLOR_LIGHTCYAN="\\033[1;36m"         export COLOR_LIGHTRED="\\033[1;31m"         export COLOR_LIGHTPURPLE="\\033[1;35m"         export COLOR_YELLOW="\\033[1;33m"         export COLOR_WHITE="\\033[1;37m"              if [[ `id -u` -eq 0 ]]; then             export PS1=`$SHELL_COLOR_RED`'$(hostname -s):'`$SHELL_COLOR_YELLOW`'$(pwd) # '`$SHELL_COLOR_LIGHTGRAY`         else             export PS1=`$SHELL_COLOR_BLUE`'$(hostname -s):'`$SHELL_COLOR_GREEN`'$(pwd) $ '`$SHELL_COLOR_LIGHTGRAY`         fi          esac      PuTTy settings: ![enter image description here](http://i.stack.imgur.com/2XFT7.png) Notes that may or may not matter, but could provide background: The shell is "PD KSH v5.2.14 99/07/13.2". Yes, I have no option to upgrade... it's an embedded system. "Get a modern shell" is not a viable answer. The operating system is QNX Neutrino 6.4.1. bind shows the following:                bind | grep del     ^D = eot-or-delete     ^H = delete-char-backward     ^? = delete-char-backward     ^[^H = delete-word-backward     ^[d = delete-word-forward     ^[h = delete-word-backward     ^[^? = delete-word-backward     ^XP = delete-char-forward     à¬ = delete-char-forward      infocmp shows the following:               infocmp  #      Reconstructed via infocmp from file:     /usr/lib/terminfo/x/xterm xterm|vs100|xterm terminal emulator,             am, km, mir, msgr, xenl, xon,             cols#80, it#8, lines#65, vt@,             acsc=Oa``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,             bel=^G, blink=@, bold=\E[1m, clear=\E[H\E[2J, cr=^M,             csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,             cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,             cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,             dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,             el=\E[K, el1=\E[1K$<3>, enacs=\E(B\E)0, home=\E[H, ht=^I,             hts=\EH, ich=\E[%p1%d@, ich1=\E[2~, il=\E[%p1%dL, il1=\E[L,             ind=^J, is1=\E=\E[?1l, kBEG=\ENn, kCPY=\ENs, kCRT=\ENt,             kDL=\ENv, kEXT=\ENw, kFND=\ENx, kHLP=\ENy, kOPT=\ENz,             ka3=\EOs, kb2=\EOr, kbs=^H, kc1=\EOq, kcan=\EOm, kclo=\ENc,             kclr=\ENa, kcmd=\EOu, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,             kcuu1=\E[A, kdch1=\E[P, kend=\E[9, kf1=\E[11~, kf10=\E[21~,             kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, kf3=\E[13~,             kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,             kf9=\E[20~, kfnd=\ENf, khlp=\ENh, khome=\E[8, khts=\ENb,             kich1=\E[2~, kmov=\ENi, kmrk=\ENm, kmsg=\ENe, knp=\E[6~,             kopn=\ENo, kopt=\ENk, kpp=\E[5~, kref=\ENl, kres=\ENp,             krfr=\ENg, krpl=\ENr, krst=\ENj, ksav=\ENq, kslt=\EOM,             ktbc=\ENd, kund=\ENu, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,             rmam=\E[?7l, rmkx=\E>, rmso=\E[m,             rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rs2=@,             sc=\E7,             setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,             setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,             sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m,             sgr0=\E[m, smacs=^N, smam=\E[?7h, smkx=\E=, smso=\E[7m,             tbc=\E[3g,      stty shows the following:               stty Name:  /dev/ttyp0 Type:  pseudo Opens: 2     +edit +echok +echonl     +osflow  intr=^C  quit=^\ erase=^?  kill=^U   eof=^D start=^Q  stop=^S  susp=^Z lnext=^V   min=01  time=00   pr1=^[   pr2=5B  left=44 right=43     up=41  down=42   ins=40   del=50  home=48   end=59


title: How do I allocate a key shortcut to moving GNOME 3 workspaces up/down?

text: In GNOME 3, in the Keyboard Shortcuts area of the Keyboard settings page, it is possible to allocate shortcuts to move between workspaces and move windows between workspaces. Unfortunately, however, there is no ability to move workspaces _themselves_ up/down. Is there a way I can achieve this through a custom shortcut? Is there, perhaps, a good extension out there? I haven't been able to find out, so if anyone could answer my questions I would be immensely grateful. :)


title: Fast utility that indexes files/directories on centos 6 for faster searching through the filesystem

text: I need to often search a large directory structure (with 1 G / 13K files of data). find / grep take a lot of time. Is there any utility (or can one make an index of these files) for faster searching.


title: Ubuntu 12.04: Random freezes

text: I get random freezes with Ubuntu 12.04 (kernel 3.2.0-31). The entire system freezes, mouse pointer doesn't move, keyboard input doesn't work. I'd say this happens about once per week on a system that is up 24/7. A hard reboot solves the problem. My questions: (1) Has anyone else experienced this? (2) I have a suspicion that a kernel upgrade may solve this. How much of a pain in the ass is it to upgrade an Ubuntu kernel, and how much will I break things like apt-get if I do upgrade the kernel myself?


title: mplayer -msglevel all=-1 doesn't make it completely silent!

text: I'm trying to open `mplayer` to play video without **any** terminal output using this:               mplayer -msglevel all=-1 /path/to/video      also:               mplayer -really-quiet /path/to/video      but it doesn't make it completely silent! and these are printed to output:               [flv @ 0x9a5d100]Estimating duration from bitrate, this may be inaccurate     [ass] Init     [ass] Updating font cache      How can I make `mplayer` completely silent? Thanks


title: Samba 3 on Arch Linux, streams_xattr behaviour

text: I'm running Samba 3.6.8-1 on my x64 Arch Linux installation. I recently decided to have my samba share support NTFS's Alternate Data Streams by using `streams_xattr` or `streams_depot`. With `streams_xattr` I discovered that if I copy a file having an ADS from a Win7 box to my samba share, on the Linux console I can see the ADS as an `xattr` attached to the file. However when I copy the file back to my Win7 box using Windows Explorer, there are no ADS entries on it. This is not true if I use `streams_depot`. Looking at Wireshark captured network traffic I see that in response to QUERY_FILE_INFO (Query File Stream Info), Samba does not return all streams associated with the file. The response consists of only one stream, which is the file data. Does anyone know what might be going on here? PS: On a side not, when I first enabled `streams_xattr` (true about `streams_depot` too), I was getting an `NT_STATUS_NETWORK_BUSY` from smbd which was also causing Windows to report an 'unexpected error'. Upon some research I found this: https://bugzilla.samba.org/show_bug.cgi?id=7537 . Upon disableing kernel oplocks, this error was gone. I'm wondering if I could still have the kernel oplocks on and there's another way to solve it, since that bug is 2 years old. UPDATE - I've a Macbook Pro running OS X Lion (10.7) with Windows filesharing turned on, and I see the same behavior on that too! .. apparently it uses Samba too


title: Bash command in string is executing when I create the string, not when I use it later

text: I'm relatively new to shell scripting, but have nearly completed a script which makes use of the lftp program. The part of the script I am having trouble with is when I create a long string of commands (separated by `;`).               for var in something     do         ...         commands_to_run+="echo Result is `tail -n 1 $somefile`;"     done      What I'm noticing is that the `tail` program - wrapped in the backticks - is being run when the for loop is iterating, but not when I invoke the string of commands later in my script. Unfortunately, the contents of $somefile isn't at this stage ready to be inspected. How can I get the command to execute when I need it, and not while I'm creating the string?


title: Knowing default clipboard manager

text: There are many Clipboard Manager for _Unix-based_ Operating System but is there a way to actually know which one is being used? I am on _Fedora 20_ under _Gnome 3.10.1_ and I know that I'm using _GPaste 3.10_. But I would like to know if there is a _command line_ which would ouput `GPaste 3.10` (except `gpaste --version` obviously).


title: String replacement in file

text: I have the following file:               <?xml version="1.0" encoding="utf-8"?>     <!--Generated by crowdin.net-->       <string name="test" >- test</string>       <string name="test" >test-test</string>       <string name="test" >test - test</string>      and I would like to replace the `en dash` with its unicode value, but not all of them, just the one in the `string` tag I run several `sed` with different regex, but I couldn't figured it out. One of those was               sed -i.bak "s/-[^-\<\>0-9]/\&#8211\;/g" strings.xml      the output was:               <?xml version="1.0" encoding="utf-8"?>     <!-–enerated by-->       <string name="test" >–test</string>       <string name="test2" >test–est</string>       <string name="test3" >test –test</string>      my problem is that is also replacing _empty spaces_ and the _first char_ of the second word. I have not that big experience with `regex` and `sed`. Could you please explain me what I am doing wrong? Note: I'm using OSX.


title: How do display managers log a user in?

text: I'm about to start working on my own display/login manager. I think I'll be able to handle all of the X11 stuff, but I realized I have no clue what to do when the user types in their username and password. Once a display manager has a username and password, what does it do? How does it log you in? Are there any other specific requirements a login manager has to do, like sourcing any configuration files, or is that all left up to the desktop environment?


title: Networksetup, how do I make an IF loop for error on connection?

text: I'm attempting to connect to a network in Mac OSX with this command: networksetup -setairportnetwork eno "NETWORK_NAME" and can most often connect to the network. But I need to make an IF loop for when the network connection fails for some reason. Can anyone help me with that please? Don't know what responses I get from that command or how to use them.. Thanks!


title: Mounting Windows shares using cifs results in "Error:13(Permission denied)"

text: Ubuntu 12.04.1 LTS, kernel 3.2.0-57-generic Windows Server 2008 R2 SP1 x64 Trying to setup a network share from Ubuntu 12.04 to a Windows Server 2008 R2 however no matter what changes are made the share fails to mount due to error(13): permission denied. Firewall port 445 has been opened between the two servers which enabled me to ping the servers from each other so it's not something on the firewall blocking the connection. The windows server is not part of a domain so I've tried with and without workgroup option. The windows account isn't disabled, I check often to make sure that I haven't locked it. Trying to use a 16 char password with lower/upper alphanumeric. No special characters. Windows Advanced Share permissions has Everyone(full/read/write) and the user account(full/read/write) permissions. Windows Folder Security has Everyone(Full/read/write) and the user account (full/read/write). I can access the windows share from my local box using the same username/password as used for the mount commands below. The windows share is located at C:\Share. Windows Event viewer is reporting it as Unknown user name or bad password with or without the sec=ntlmv2 or sec=ntlm. Any changes to the sec option still provides a error(13). The user account is an administrator on the server and i've typed and retyped and reset the password from something complex to something simple and still not going through. My local box can connect through the windows share no problem with any version of the password set. The windows network connection is considered a public network. Under Network and Sharing Center the Advanced Sharing Settings->Home/Work and Public - Public Folder sharing have been set to turned On. Password protected sharing-> turned on since I'm trying to use an admin account local to the server. The /mnt/share directory has been created and has been tested with rw- rw-r--,rwxrwxrwx,rw-rw-rw-,rwxrwxrw- permissions just in case it had something to do on the linux side. I tried both user= and username= with all of the commands listed below. Also made sure not to use any extra white spaces unless needed. No quotation marks are used anywhere in the commands, I've read some people were doing username='user' **Following received a Error:13(Permission denied)**               sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass}     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},nosuid     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlm     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlmssp     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8,sec=ntlm          sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,nosuid     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlm     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlmssp     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8,sec=ntlm      **Following received a Error:22(Invalid Argument)**               sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlmv2     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlmv2     sudo mount -t cifs //{ipaddress}/share /mnt/share -o sec=ntlmv2,user={user},password={pass},port=445      I also downloaded and tried the outdated SMBFS which also produced a Error:13 Any thoughts?


title: How to get rid of the “scanning for btrfs file systems” at start-up?

text: After upgrading from Ubuntu 12.04 to Ubuntu 12.10, I get a message "scanning for btrfs file systems" at starting-up. I don't have any BTRFS filesystem. It delays the booting for about 15 seconds. How can I get rid of this?


title: How can I kill child processes with start-stop-daemon?

text: I'm writing a simple web server using nc and bash. It looks like this:               #!/bin/bash     rm -f /var/run/streamman/out     mkfifo /var/run/streamman/out     trap "rm -f /var/run/streamman/out" EXIT          while true     do         cat /var/run/streamman/out | nc -l 8080 > >( # parse the netcat output, to build the answer redirected to the pipe "out".         while read line         do           line=$(echo "$line" | tr -d '[\r\n]')           if echo "$line" | grep -qE '^GET /\?action' # if line starts with "GET /"           then             action=$(echo "$line" | cut -d '=' -f2 | cut -d ' ' -f1 | cut -d '&' -f1) # extract the request             query_str=$(echo "$line" | cut -d '&' -f 2-)             args=$(query_string_to_args $query_str)                  fn_exists $action && eval ${action} ${args} || echo "No route for $action"             elif [ "x$line" = x ] # empty line / end of request           then                 header=$(cat /var/www/header.html)                 footer=$(cat /var/www/footer.html)                 echo  "$header somecontent $footer" > /var/run/streamman/out           fi         done       )     done      There are some extra functions in there but I left them out for brevity. I start it as a daemon using the followin init script:               #!/bin/bash     user=streamman     name=streamman-httpd     prog=/usr/sbin/streamman-httpd          case $1 in         start)             start-stop-daemon --start --user $user --chuid $user --background --umask 0000 --exec $prog > /var/log/streamman/streamman.log 2>&1             ;;         stop)             /sbin/start-stop-daemon --stop --user "$user" --name "$name" --retry=TERM/5/KILL/1             ;;         restart)             ;;         *)             ;;     esac      Here is the output of `ps afx` after starting the service:               3023 ?        S      0:00 /bin/bash /usr/sbin/streamman-httpd     3065 ?        S      0:00  \_ nc -l 8080     3066 ?        S      0:00      \_ /bin/bash /usr/sbin/streamman-httpd      As you can see, a child process has started up for some reason. I think it's to do with the way I use nc and the named pipe. Now when I try to stop the service I get this:               Program streamman-httpd, 1 process(es), refused to die.      And the output of `ps afx`:               3065 ?        S      0:00 nc -l 8080     3066 ?        Z      0:00  \_ [streamman-httpd] <defunct>      For some reason the child process won't die. I've tried using pid files, but I can't get my server script to output the _child's_ pid to a file. How can I make it kill both processes?


title: bash function to handle file through symlink : problem with command line arguments

text: I wrote a little code that will copy files given either their name or symlinks to a given directory.               linkcp() {     cp `echo "$(realpath $1)"` "$2"     }      here is the file list:               $ ls -l     drwxr-xr-x 2 user1 users 4096 apr. 30 01:20 temp     -rw-r--r-- 1 user1 users 50 apr. 30 01:20 file1     -rw-r--r-- 1 user1 users 34 apr. 30 01:20 file2     lrwxrwxrwx 1 user1 users 26 apr. 30 01:20 lnk1 -> file1     lrwxrwxrwx 1 user1 users 26 apr. 30 01:20 lnk2 -> file2      This works if I use:               $ linkcp lnk1 temp     $ ls temp/     $ file1      but not if I use wildcards (I need to move all files beginning with lnk):               $ rm temp/*     $ linkcp lnk* temp     $ ls temp/     $      If I do:               $ arg=lnk*     $ cp `echo "$(realpath $arg)"` "temp/"     $ ls temp/     $ file1  file2      I don't know why using `$1` in the function causes a problem?


title: How to execute a remote command and pass in local file as input?

text: Is it possible to do this: `ssh user@socket command /path/to/file/on/local/machine` That is to say, I want to execute a remote command using a local file in one step, without first using `scp` to copy the file.


title: Put Linux server into sleep and wake it up using WOL packets

text: I am looking for a way to put my Linux home server in standby after a period without any "heart beat" network activity. I would like to use WOL packets as a heart beat signal. These packages will be send by several clients each with an interval of, lets say, every 15 minutes. I am quite a rookie concerning Linux scripting, but I can understand code after some studying. An actual example is therefore more than welcome.


title: Driver for Intel 2200BG wireless network card

text: I'm trying to make work my wireless network card `Intel 2200BG` in my laptop `Acer Travelmate 4002WLMI`. I tried so far:               $ sudo lshw -C network     *-network:1            description: Wireless interface            product: PRO/Wireless 2200BG [Calexico2] Network Connection            vendor: Intel Corporation            physical id: 4            bus info: pci@0000:02:04.0            logical name: eth1            version: 05            serial: 00:0e:35:b0:a7:88            width: 32 bits            clock: 33MHz            capabilities: pm bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=ipw2200 driverversion=1.2.2kmprq firmware=ABG:9.0.5.27 (Dec 12 2007) latency=64 link=no maxlatency=24 mingnt=3 multicast=yes wireless=IEEE 802.11bg            resources: irq:10 memory:d0208000-d0208fff          $ sudo modprobe ipw2200      $ dmesg | grep ipw     [   12.087836] libipw: 802.11 data/management/control stack, git-1.1.13     [   12.087839] libipw: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>     [   12.209561] ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.2kmprq     [   12.209566] ipw2200: Copyright(c) 2003-2006 Intel Corporation     [   12.335295] ipw2200 0000:02:04.0: PCI INT A -> Link[LNKB] -> GSI 10 (level, low) -> IRQ 10     [   12.335329] ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection     [   12.652808] ipw2200: Radio Frequency Kill Switch is On:     [   12.667645] ipw2200: Detected geography ZZM (11 802.11bg channels, 0 802.11a channels)     [   55.212245] ipw2200: Failed to send POWER_MODE: Command timed out.     [   57.368256] ipw2200: Failed to send POWER_MODE: Command timed out.      or               sudo apt-get install linux-headers-$(uname -r) build-essential     wget http://aceracpi.googlecode.com/files/acer_acpi-0.11.1.tar.bz2     tar -xvjf acer_acpi-0.11.1.tar.bz2     cd acer_acpi-0.11.1     sudo make # this command never ends      or to search here useful information:               $ uname -r     3.2.0-24-generic          $ sudo rfkill list     0: phy0: Wireless LAN             Soft blocked: no             Hard blocked: no          distribution : Ubuntu 12.04 LTS      Do you know how to solve this? Should I further try to get my wireless card work or is this hopeless and I should give this up?


title: get cpu by user

text: Working with monit I need create an alert that get cpu usage of system users, so:               top -b -n 1 -u user1 | awk 'NR>7 { sum += $9; } END { print sum; }'      seems a good solution but I'm not sure about reliable because when I do above command, every time change (obviously) the value. So, I need an "exact" use of cpu by user within 2-5 seconds, because the VALUE will send like an email alert.


title: How can I have new ~/.vnc/xtartup files be configured for normal desktop by default?

text: When a user first runs `vncserver`, the following `~/.vnc/xstartup` file gets created:               #!/bin/sh          # Uncomment the following two lines for normal desktop:     # unset SESSION_MANAGER     # exec /etc/X11/xinit/xinitrc          [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources     xsetroot -solid grey     vncconfig -iconic &     xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &     twm &      I want to modify the default file so that the following lines are uncommented:               unset SESSION_MANAGER     exec /etc/X11/xinit/xinitrc      How should I go about this?


title: What is a good example of a bash script to study in order to learn good coding conventions?

text: I've learnt the basics of programming in bash. I'd like to study a few examples of bash scripts so that I can learn good habits for bash scripting. In particular, I'm interested in examples of bash scripts that show:   * how to process arguments and trigger conditional functionality   * how to check for input errors   * how to perform command completion   * how to organise a bash script into functions, commands, and so forth   * how to present help messages For example, I learnt a lot from autorandr on github. Are there any other such scripts or script repositories where I could learn about bash scripting conventions?


title: How to write a column of consecutive integers in Vim over existing text?

text: For example, imagine I had the following text:               / apple     / orange     / banana     / bread      How could I efficiently add consecutive integers in a column to make?               /1 apple     /2 orange     /3 banana     /4 bread      Note that in real problems, the list might be 20, 50, or more lines long.


title: how to take the file names from folder

text: i want to write a program for the below logic:   * Take the names of files in a folder   * For each file:      * print file name     * move the file to another new folder (with the name in `dd_mm_yy` format)


title: what is 'nogroup' group's purpose

text: When I list al groups I see one called 'nogroup'. What is this for? Is it supposed to be least privileged one or something? I'm using ubuntu 11.04.


title: HP Deskjet 3050A scanner not working in Debian

text: I have an HP Deskjet All-in-one 3050A. In Debian Testing I installed it through CUPS and the printer works fine. However I can't say the same about the scanner. I've tried install it using HPLIP, but it's the same. SANE or Simple Scan detect the scanner but at the time of use it, both say that there was a problem with I/O. The weird part is that I've tried the scanner in two virtual machines (W7 and Linux Mint 14) hosted in the Debian Testing, and works fine in both VM's.


title: Mint 14 Floppy error

text: Error reported = Error mounting system managed device /dev/fd0. Command line ... /media/flopp0 exited with non-zero . /dev/fd0 is not a valid block device.      I've got a physical floppy drive, working (well it stops boot ups if a floppy is inserted) and occasionally I need to use it, so how do I rectify the error? * * * Reading elsewhere on the web, it appears to be a module as the exact message is:- ''Error mounting system-managed device /dev/fd0: Command-line `mount "/media/floppy0"' exited with non-zero exit status 32: mount: /dev/fd0 is not a valid block device''


title: Is using a read only root file system a good idea for embedded setup?

text: I have been tasked with running Linux as an operating system on an embedded device. The target has an x86 processor and has 8 GB CompactFlash device for storage. I have managed to use buildroot to create the kernel image and cross compilation tools. I have partitioned the CF device into a small FAT partition where the kernel image resides as well as `syslinux` boot configuration and an `ext3` file system where I have decompressed the root file system generated by buildroot to. The system boots successfully using `syslinux` by setting the root directory to the CF ext3 partition where my buildroot file system is located. My question is centred around the need for robustness in the face of immediate (and frequent) power loss as it is crucial for the device to boot successfully after power outages. I have read that mounting the root file system as read only is a way of ensuring data integrity. Is this a sensible way for me to proceed? I have also read about the possibility of loading the root file system into RAM to achieve the same thing but as yet do not know how to do so. Is there a preferred way of achieving this goal and if so what is the best way for me to proceed?


title: ddrescue: reread only good sectors?

text: Before imaging the corrupted filesystem to a file on another hard drive, I decided to dry-run `ddrescue` (throwing rescued output to `/dev/null`) just to see how much data is unreadable:               # ddrescue -d -b 4096 -r 3 -f /dev/sda1 /dev/null sda1.log      In the end it took 3 days to finish. Now I'm ready to make a real image, but I don't want to wait another 3 days until it finishes. But, luckily because I have a logfile, is it possible to force `ddrescue` to rescue only the good sectors and do not touch bad ones? Having read some documentation, I've came up with the following idea:               # ddrescue -d -b 4096 --fill=+ /dev/sda1 /mnt/sda1.img sda1.log      Will this work? Is there another (preferred) way of rereading only good sectors?


title: How to pass a CTRL-D to a command line within a script?

text: I am using this line                ( cat bodyText.txt; uuencode backup.tar ) | mail -s "backup" myEmail@myserver.com      inside a bash script that will be fired by cron. This line is almost perfect, but it hangs waiting for `Ctrl`-`D` to be typed, so the message and the attachement could be sent. How do I include a `Ctrl`-`D` inside a bash script to make this line work?


title: Questions about nmap

text: I have several questions about `nmap`. First, `nmap` can detect servers via:   * link-layer   * network-layer   * transport-layer What are the differences (not in the layer, but in the way that `nmap` does it) and how does `nmap` do this? Second, when I port scan with `nmap`, the UDP scan takes much longer then the TCP scan. Why? Third: are there any different methods to explore the OS then to use the `-O --osscan-guess` command (I mean totally different, not e.)?


title: Ubuntu 12.04, black background for some areas of GTK programs under KDE

text: I use ubuntu 12.04, x86_64, kernel 3.2.0-35-generic. I use KDE desktop. However, under KDE the GTK programs have black background in some areas. e.g. ![enter image description here](http://i.stack.imgur.com/9vF6n.png) How to solve the problem?


title: How to count number of instance of a word starting at another word

text: I need to `grep` the MySQL-error log starting at today's date formatted like:               `date +"%y%m%d"` (140710)       And look for all instances of the word `partitioned`. I've tried various things to no avail. This seemed to work:               more +/"`date +"%y%m%d"`" mysql-error.log | grep -c partitioned      However, if the log file doesn't contain any entries from today, then instead of returning zero, it searches the entire file and returns a number for the entire file. I need it to return zero, if there are no entries from today, not `grep` the entire file and count the results. Is there some better way of doing this, using `sed` or `awk` or something? * * * Technically, what I suppose I need to count is `} partitioned {` followed by a string of alpha numberic characters, }) because portioned { (without any string) } could occur and shouldn't be counted. That's not a strict requirement though. I'd be happy just counting instances of the word `partitioned`. Here is an example of the log file:               140109 12:25:07 [Note] WSREP: view(view_id(PRIM,c4819ddf-7952-11e3-89fc-4f9f1bfa267f,3) memb {         c4819ddf-7952-11e3-89fc-4f9f1bfa267f,     } joined {     } left {     } partitioned {         f85c2e70-7952-11e3-a759-aa8332246e85,     })     140109 12:25:07 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 85)


title: Apply recursive chmod to files or folders only

text: I'd like to apply chmods to files and folders in one line, Basically:               chmod 700 ./* -R # but only apply to folders     chmod 600 ./* -R # but only apply to files      Of course I searched google and read manpages. So the question is, does the following have any drawbacks, risks or is this safe?               find . -type f -print0 | xargs -0 chmod 600 && find . -type d -print0 | xargs -0 chmod 700


title: Any Linux Distros that may work well with intel 965gm gpu?

text: My mom's laptop had ubuntu 12.04 32bit and now 13.10. But they both are extremely slow. makes windows xp look super fast. (which was on it before) on askubuntu they said the gpu is the issue. Lenovo ThinkPad R61e: CPU - Pentium Dual Core t2370 1.73ghz x 2 Ram - 1GB DDR2 667mhz GPU - intel 965gm x86/mmx/sse2 HDD - 80gb sata


title: Why are these xrandr commands not working?

text: I wonder what I am doing wrong. It seems that the video card toggles it through the monitors and resolutions by itself so I want to eliminate the options and leave just the ones I use. As you can see, it hasn't worked.               rt@mach:~$ xrandr --rmmode HDMI1 1280x1024     usage: xrandr [options]       where options are:       -display <display> or -d <display>       -help       -o <normal,inverted,left,right,0,1,2,3>                 or --orientation <normal,inverted,left,right,0,1,2,3>       -q        or --query       -s <size>/<width>x<height> or --size <size>/<width>x<height>       -r <rate> or --rate <rate> or --refresh <rate>       -v        or --version       -x        (reflect in x)       -y        (reflect in y)       --screen <screen>       --verbose       --current       --dryrun       --nograb       --prop or --properties       --fb <width>x<height>       --fbmm <width>x<height>       --dpi <dpi>/<output>       --output <output>       --auto       --mode <mode>       --preferred       --pos <x>x<y>       --rate <rate> or --refresh <rate>       --reflect normal,x,y,xy       --rotate normal,inverted,left,right       --left-of <output>       --right-of <output>       --above <output>       --below <output>       --same-as <output>       --set <property> <value>       --scale <x>x<y>       --transform <a>,<b>,<c>,<d>,<e>,<f>,<g>,<h>,<i>       --off       --crtc <crtc>       --panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l>/<t>/<r>/<b>]]]       --gamma <r>:<g>:<b>       --primary       --noprimary       --newmode <name> <clock MHz>             <hdisp> <hsync-start> <hsync-end> <htotal>             <vdisp> <vsync-start> <vsync-end> <vtotal>             [+HSync] [-HSync] [+VSync] [-VSync]       --rmmode <name>       --addmode <output> <name>       --delmode <output> <name>      .               rt@mach:~$ xrandr --delmode HDMI1 1280x1024     X Error of failed request:  BadAccess (attempt to access private resource denied)       Major opcode of failed request:  150 (RANDR)       Minor opcode of failed request:  19 (RRDeleteOutputMode)       Serial number of failed request:  29       Current serial number in output stream:  30      .               root@mach:/home/rt# xrandr --delmode HDMI1 1280x1024     X Error of failed request:  BadAccess (attempt to access private resource denied)       Major opcode of failed request:  150 (RANDR)       Minor opcode of failed request:  19 (RRDeleteOutputMode)       Serial number of failed request:  29       Current serial number in output stream:  30      .               root@mach:/home/rt# xrandr --rmmode HDMI1 1280x1024     usage: xrandr [options]       where options are:       -display <display> or -d <display>       -help       -o <normal,inverted,left,right,0,1,2,3>                 or --orientation <normal,inverted,left,right,0,1,2,3>       -q        or --query       -s <size>/<width>x<height> or --size <size>/<width>x<height>       -r <rate> or --rate <rate> or --refresh <rate>       -v        or --version       -x        (reflect in x)       -y        (reflect in y)       --screen <screen>       --verbose       --current       --dryrun       --nograb       --prop or --properties       --fb <width>x<height>       --fbmm <width>x<height>       --dpi <dpi>/<output>       --output <output>       --auto       --mode <mode>       --preferred       --pos <x>x<y>       --rate <rate> or --refresh <rate>       --reflect normal,x,y,xy       --rotate normal,inverted,left,right       --left-of <output>       --right-of <output>       --above <output>       --below <output>       --same-as <output>       --set <property> <value>       --scale <x>x<y>       --transform <a>,<b>,<c>,<d>,<e>,<f>,<g>,<h>,<i>       --off       --crtc <crtc>       --panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l>/<t>/<r>/<b>]]]       --gamma <r>:<g>:<b>       --primary       --noprimary       --newmode <name> <clock MHz>             <hdisp> <hsync-start> <hsync-end> <htotal>             <vdisp> <vsync-start> <vsync-end> <vtotal>             [+HSync] [-HSync] [+VSync] [-VSync]       --rmmode <name>       --addmode <output> <name>       --delmode <output> <name>


title: How do I install directx on Debian?

text: How do I install directx on Debian-Gnome-Chromium? Is it possible to do it without wine?


title: Monitor via SSH and execute local script upon change detection

text: I have an environment where I can SSH into a Linux machine via Cygwin, but not the other way around due to a security policy out of my control. I need to automate tasks on the Windows machine but dictate these things to do from scripts or parameters PULL'd from the Linux machine (ie, a watched folder or web service). How can I structure this so that I can keep an SSH connection open and upon detecting this remote variable change, trigger another Cygwin command on the Windows machine? An example use case would be browser automation with parameters. While I could do this via a git repo and a recurring script that first syncs with latest code each time before running, I'd like to have more control, such as to force kill the executing thread via passing another variable or shell script down the line. **UPDATE:** After all that, there was another method to change the Windows firewall which allowed port 22 connections, so this complicated case will thankfully not be required, but I like the suggestions listed below. **UPDATE:** Seems the scenario still exists. Though getting direct access to the system via SSH allowed execution of tasks, these were sandboxed within the SSH user, not the network domain user that I wanted to run GUI tasks in (local Cygwin instance does not have the problems to execute within the domain user's GUI). See my answer below.


title: User systemd PulseAudio service

text: Not much else to this question: I would like to know what I need to create a PulseAudio systemd service to be run with `systemd --user`. I've tried a few different things, including various user services from Google, but I can't get it set up just right between dbus and everything else required for it. **Update:** It seems to work ok with graphical sessions, but I'm still having some inconsistancy with dbus when logging in through console. But PulseAudio is starting rather reliably, so I'm not overly concerned.


title: Bulk rename and resize with Imagemagick

text: I need to convert a very large number of images that are called 1a.jpg, 2a.jpg, 3a.jpg using Imagemagick to be processed and renamed 1.jpg, 2.jpg, 3.jpg (in the same directory). The Imagemagick command is this, where n is the 1, 2, 3... etc.               convert -shave 200x200 -resize 30% na.jpg n.jpg      Please help with a script.


title: Counting the numbers of lines of data as it comes in?

text: I am currently connected to the Twitter Stream, and I would like to count the number of lines of data as they come in. I know I can do `wc-l` to just count the lines, but I want it to be auto-updating. Kind of like how `tail -F` works, but instead, I want a running tally of how many records I've received. Is there a simple command to do this in UNIX?


title: typeset -A is giving error in script

text: I was using associative arrays in my script, hence I used to declare them by the `typeset -A <array_name>` command, and it worked fine in the bash prompt But when I use it in my script, I get the following error ` typeset: -A: invalid option typeset: usage: typeset [-afFirtx] [-p] name[=value] ...` An alternative solution will also be acceptable for me. SIDENOTE: I tried typeset -a but it declares an indexed array. But I want an associative array.


title: case + how to implement equal or less or greater in case syntax

text: My target is to verify a range of number with (only with `case` + `esac`), and print the range. So for example:   * If the number is between 0 and 80, print `>=0<=80`   * If the number is between 81 and 100 then print `>=81<=100`   * etc. The problem with my script below print only `>=0<=90` only if the number between 0 and 9. How to fix my script, so that it will print correct output according to the number range?               #!/bin/ksh     read number      case $number in       [0-80])  echo ">=0<=80";;       [81-100]) echo ">=81<=100";;       [101-120]) echo ">=101<=120";;      [121-300]) echo ">=121<=300";;     esac


title: x11grab from another display server

text: I have ffmpeg with x11grab on my local machine, but I want to capture the screen of an X server on 12.34.56.78. How can I do that? The following doesn't work:                ffmpeg -f x11grab -r 25 -s 800x600 -i 12.34.56.78:0.0 screen.avi


title: How can I add an additional framebuffer device in Linux?

text: I'm running a Ubuntu 12.04 LTS as a home NAS server, without X. Recently I got into tuning it to serve as a video playing media device too. It might've been easier at this point to install X, but I decided to try mplayer with framebuffer playback. It worked, and everything was fine and good. However, for curiosity and maybe for practical consequences too, I can't stop thinking about framebuffers. There seems to be only one framebuffer device, `/dev/fb0`. (Btw. I'm using vesafs driver) If I run multiple programs that use framebuffers, chaos ensues. For example, running mplayer from fbterm just crashes it. Curiously, fbi image viewer manages to view images somehow. Obviously the programs can't share the device, there's no windowing system after all. So, is the number of (vesa) fb devices limited to hardware display devices? Or could there be more in principle, like there are multiple ttys? Would adding some more help running simultaneously software that uses them? How could I add more? Also the logic how the framebuffers are connected to ttys isn't quite clear to me... for example, mplayer shows it's video frame on every tty, but fbi doesn't. Furthermore, Ubuntu default console (fbcon?) shows behind the video overlay, which srikes me odd. What is this all about?


title: Juniper SRX210, how to make DHCP to Static IP?

text: I am very new to Juniper device. I have a SRX210 router, and i am testing how to setup Static IP. So i did:               set interfaces ge-0/0/0 unit 0 description ISP Link     set interfaces ge-0/0/0 unit 0 family inet address 6x.24x.14x.5x/28      Will this work? (i have no idea, but crossed my finger and hope it works)


title: How to make front audio jack work again after waking up from suspend?

text: Sometimes, after I wake up from suspend (using pm-suspend), the front audio jack stops working (no sound) after I wake up my laptop. Only after a full reboot I get it to work again. My laptop is an HP dv6-2030sd and has an Intel sound card. The module loaded is snd_hda_intel, but removing it and adding it again has no effect. I use the ALSA sound system only, so no pulseaudio. My question is, is there a way to get it to work again without a full reboot?


title: What is the need for rsync server in daemon mode

text: I don't understand the need for an rsync server in daemon mode. What are the benefits from it if I can use rsync with SSH or telnet?


title: HTTPS Authentication problem : Polipo

text: I use internet behind http proxy, and that requires authentication. I tried using polipo to bypass the authenticated proxy to 127.0.0.1:9134. Applying these settings to my browser, works fine for http://examplewebsite.com but for https://examplewebsite.com, it asks for authentication. Also my host proxy authentication does not work in the authentication dialog. Settings I have changed in my `/etc/polipo/config`               proxyPort=9134          parentProxy = "172.31.1.10:8080"          parentAuthCredentials = "username:mypassword"


title: How do I enable locate and queue the database to be built?

text: On a new Ubuntu 10.4 instance, I tried to use the `locate` command only to receive the error               locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory      from using this command on other systems I'm guessing that this means the database has not yet been built (it is a fresh install). I believe it is supposed to run daily, but how would I queue it up to run immediately? Also, how is "run daily" determined? If I have a box that I only turn on for an hour at a time will the database ever be built on it's own?


title: Set executable heap

text: The `execstack` program can be used to mark ELF-binaries as needing an executable stack. Is there a similar way to mark the heap as executable? Preferably for a single binary but if that's not possible, a system-wide solution would be useful too.


title: What does this ${@:2} mean in shell scripting

text: I see this in a shell script.               variable=${@:2}      What is it doing?


title: How does handling an interrupt affects a multi-threaded user space process?

text: Say, I put a breakpoint (`int 3` from now on) somewhere in a user space process code. One of the threads hits the breakpoint... And what happens next? My judgement is: this is an interrupt, so it is handled in the kernel. I don't really care about the signals and interrupt handlers and stuff, I just want to know what happens to the other threads of the user space process. Are they stalled until the interrupt handler is executed? How are they scheduled after the interrupt is handled? References on the subject would also be highly appreciated.


title: kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"

text: I got this errors in syslog. Any idea what does it mean? The system is running on Ubuntu 12.04, kernel: `3.8.0-35-generic #52~precise1` It looks to me like failure when trying to write to disk...                [151850.317166] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.      [151850.318428]  ffff8803640f5be8 0000000000000082 0000000034c733da ffff88040e233ec0      [151850.318444]  ffff880408149740 ffff880403c6c5c0 0000000000000001 ffff8803edae80a8      [151850.318468]  [<ffffffff816f41c9>] schedule+0x29/0x70      [151850.318481]  [<ffffffff816f30b7>] __mutex_lock_slowpath+0xd7/0x150      [151850.318497]  [<ffffffff816f2cca>] mutex_lock+0x2a/0x50      [151850.318510]  [<ffffffff811aa006>] path_lookupat+0x236/0x7a0      [151850.318523]  [<ffffffff811aade0>] ? getname_flags.part.31+0x30/0x150      [151850.318537]  [<ffffffff811aaf6e>] ? getname_flags+0x6e/0x80      [151850.318552]  [<ffffffff813141f4>] ? apparmor_inode_getattr+0x54/0x60      [151850.318565]  [<ffffffff811bb929>] ? mntput_no_expire+0x49/0x160      [151850.318578]  [<ffffffff811ab711>] user_path_at+0x11/0x20      [151850.318588]  [<ffffffff811a0c3e>] vfs_lstat+0x1e/0x20      [151850.318602]  [<ffffffff816fdf5d>] system_call_fastpath+0x1a/0x1f      [151850.319634] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.      [151850.376552]  [<ffffffff816f41c9>] schedule+0x29/0x70      [151850.376565]  [<ffffffff816f30b7>] __mutex_lock_slowpath+0xd7/0x150      [151850.376579]  [<ffffffff816f2cca>] mutex_lock+0x2a/0x50      [151850.376590]  [<ffffffff811aa006>] path_lookupat+0x236/0x7a0      [151850.376602]  [<ffffffff811aade0>] ? getname_flags.part.31+0x30/0x150      [151850.376616]  [<ffffffff811aaf6e>] ? getname_flags+0x6e/0x80      [151850.376680]  [<ffffffff813141f4>] ? apparmor_inode_getattr+0x54/0x60      [151850.376691]  [<ffffffff811bb929>] ? mntput_no_expire+0x49/0x160      [151850.376704]  [<ffffffff811ab711>] user_path_at+0x11/0x20      [151850.406554] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.      [151850.465132] sftp-server     D ffff880403bfdf60     0 15199      1 0x00000000      [151850.465158]  ffff8803d2c87fd8 ffff8803d2c87fd8 ffff8803d2c87fd8 0000000000013ec0      [151850.465173]  ffffffff81c15440 ffff88040583ae80 0000000000000001 ffff8803edae80a8      [151850.465263]  [<ffffffff811aa006>] path_lookupat+0x236/0x7a0      [151850.465269]  [<ffffffff81186441>] ? kmem_cache_alloc+0x31/0x140      [151850.465275]  [<ffffffff811aade0>] ? getname_flags.part.31+0x30/0x150      [151850.465283]  [<ffffffff811aa5a4>] filename_lookup+0x34/0xc0      [151850.465289]  [<ffffffff811aaf6e>] ? getname_flags+0x6e/0x80      [151850.465296]  [<ffffffff811ab6b9>] user_path_at_empty+0x59/0xa0      [151850.465303]  [<ffffffff813141f4>] ? apparmor_inode_getattr+0x54/0x60      [151850.465309]  [<ffffffff81087e9a>] ? lg_local_unlock+0x1a/0x20      [151850.465315]  [<ffffffff811bb929>] ? mntput_no_expire+0x49/0x160      [151850.465320]  [<ffffffff811a0946>] ? cp_new_stat+0x116/0x130      [151850.465327]  [<ffffffff811ab711>] user_path_at+0x11/0x20      [151850.465332]  [<ffffffff811a0bc1>] vfs_fstatat+0x51/0xb0      [151850.465337]  [<ffffffff811a0c3e>] vfs_lstat+0x1e/0x20      [151850.465343]  [<ffffffff811a0dea>] sys_newlstat+0x1a/0x40      [151850.465350]  [<ffffffff816fdf5d>] system_call_fastpath+0x1a/0x1f


title: Provide loop device functionality for a regular file under a unique name

text: I want to add a few image files with file systems to a LVM volume group. If I make them available as loop devices changes are pretty high that one day the script gets corrupted due to an increasing number of used loop devices. Rather than increasing my number of loop devices, I'd like to make the file available with loop device functionality (like I would have set it up with `losetup`) under a unique name, like `/dev/program/my_unique_name`, so that `mount -t atype /dev/program/my_unique_name /path/to/mount_point` would do the same like `mount -t atype /dev/loopX /path/to/mount_point`. Background: I tried to acchieve the thing I want by increasing the number of loop devices to `X` and started to assgn `/dev/loopX`, `/dev/loopX-1`, etc. which looks promising as long as   * less than `X - number of images I want to use` loop devices are used on the system[1]   * kernel performance doesn't suffer from an increased number of loop devices   * no one needs similar functionality and start to assign loop devices starting with the highest number -> this complicates the script code, increases test necessity and decreases maintainability It would be no problem to use variable loop devices, i.e. simply query the next free block device with `losetup -f`, assign the file and make it available under a unique name. * * * [1] probability to exceed X is low, so it's more a question of elegance to provide a resource under a unique name rather than under a number in inverval [0;X]


title: What makes the files in my home directory appear, when I log in through SSH then run ecryptfs-mount-private?

text: I'm a bit of a newbie when it comes to using Linux. I've recently installed Ubuntu 12.04 LTS (minimal virtual machine) on a VPS host. I've encrypted the virtual disk and encrypted the home directory of my main user account, that I'm using to access the install through SSH (using public key authentication). So far, so good. The thing is: I can't figure out what exact action it is that is making my hidden files appear and active (such that I am able to use aliases, such as `ll`). When I sign in initially with SSH and issue `ls -al`, all I see is:               dr-x------ 2 username username 4096 Feb 10 01:10 .     drwxr-xr-x 4 root     root     4096 Feb 10 01:10 ..     lrwxrwxrwx 1 username username   56 Feb 10 01:10 Access-Your-Private-Data.desktop -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.desktop     lrwxrwxrwx 1 username username   34 Feb 10 01:10 .ecryptfs -> /home/.ecryptfs/username/.ecryptfs     lrwxrwxrwx 1 username username   33 Feb 10 01:10 .Private -> /home/.ecryptfs/username/.Private     lrwxrwxrwx 1 username username   52 Feb 10 01:10 README.txt -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.txt      (As an en passant: why are permissions set to `lrwxrwxrwx` for most items here? Isn't that far too tolerant?) Then, when I issue `ecryptfs-mount-private` (as per the `README.txt`) and issue another `ls -al`, I keep seeing the same as above. One time, I believed I was able to use aliases after I issued a `sudo` command, but another time I was not able to. Then, another time I issued `cd /home/username` (which is the same directory as `~` already, is it not?), and all of a sudden all other hidden files appeared and I was able to use aliases. But now, after a few minutes in (but perhaps I've actually imagined this), even though I'm still able to see all the hidden files, I'm not able to use aliases anymore. This makes me believe this behavior is somehow coupled with `sudo`, but I can't seem to figure out what exactly is going on here. Can somebody enlighten me and explain what exact actions I need to undertake to see all hidden files in my home directory and enable aliases, and why this is (is it because of the encryption; is it coupled with `sudo`; or perhaps something completely different)? If possible, preferably, I'd like this to automatically be enabled when I login with SSH. Is that possible? **edit** (clarification for Hauke Laging's comment): When I log in with SSH and immediately issue `ll` in `~`, I get `-bash: ll: command not found`. (Although now, it appears to work immediately after I logged out and logged in again, but perhaps this is because the other time it was the first time after boot up? I have no idea, really. It all appears to behave rather random.) Then, one time, I believe I issued a `sudo ls -al`, or some other inane command, after which `ll` appeared to work. Another time `ll` didn't work, and only after I issued `ecryptfs-mount- private` and did an explicit `cd /home/username`, the hidden `.bashrc` (etc.) files appeared with `ls -al`, after which I was finally able to use an alias such as `ll`. But, you know what? I think I'll have to investigate this a bit more thoroughly, since my vague descriptions are probably getting us nowhere. I was hoping my problem would immediately ring a bell, but it appears I have to be a bit more precise about what actions I undertook. What I am trying to accomplish though, is this: When I log in through SSH (whether it be the first time after boot up, or any other time after that), I want all hidden files, in my home directory, to appear immediately when I issue `ls -al` and that aliases, such as `ll`, are immediately available as well. My analysis of the problem, thus far, is that it appears that I first have to decrypt my home dir, before I am able to see the mentioned hidden files (apart from the ecryptfs-related symbolic links) and use aliases. Is that a correct assessment?


title: What happened with my SHLVL?

text: I was messing around with my bashrc, finding better ways to start a newer version of `bash`. Never mind my tests. But this strange thing happened, which I like to understand:               $ bash  ## Probably where the infinite recursion happened             ## terminated by too many access to .bashrc and derived files     $ echo $BASH_VERSION      4.2.0(1)-release     $ echo $SHLVL      362     $ exit     $ echo $SHLVL      2      I think a end up with a infinite recursion (that is already fixed), but how can the shell level go from 362 to 2 with a single `Ctrl`+`D` (produces the `exit`)?


title: How to rename files and directory with *.~1~ suffix to original name?

text: I have a directory named `underscore.~1~` and several files inside with names like `main.js.~1~`, `index.js.~1~` etc. How can I rename the directory `underscore` and the files inside to the original names `main.js`, `index.js` etc.


title: zsh alias being overridden somehow

text: I'm on a system running OS X 10.8.5. I recently tried to alias `ls` to `ls -G -la` command. I opened up `~/.zshrc`, put in the alias, relaunched the terminal, but the change didn't take effect. Upon performing `which ls`, I found out that it's _already_ being aliased to `ls -G`. This isn't behaviour I ever set up. Is there any way to find out where this alias is being set?


title: Set ulimit to defaults

text: I set ulimits to fullfill memory demands of Git. Do we have anyway to reset ulimits to defaults, I mean what they were before I set them. Please keep in mind I am doing it from Python script


title: List of special characters in the shell

text: I am not sure what they are called, but where could I find a list of wild cards? I see things like:   * `$f`   * `%s`   * `$1` Is there a definitive list for what each one represents?


title: Reverse socks5 using SSH

text: Setup:   * Server is a virtual machine   * Server have a local ip adress   * Server is restricted so that it can't reach the internet (not sure how)   * Client machine have access to both server via SSH    * Client have unrestricted access to the internet   * I have root on both server and client (running Arch Linux on client and Gentoo on server)   * Server can't access the client All of this is probably due to heavily locked down firewalls. Problem: I need to be able to fetch packages and source code from the internet. Is it possible to set up the client so that it can proxy internet bound traffic for the server during updates?


title: Scoping variables in ksh

text: In ksh, I have two variables with the same name , one global , other one is local to a function               #!/bin/ksh          LOG_FILE=lf          function exec_script     {        local LOG_FILE=f        print $LOG_FILE     }     exec_script     print $LOG_FILE      If I want to refer the global variable $LOG_FILE within exec_script function, how should I qualify it so that the local does not get referenced ?


title: How to check if ARP is enabled or not

text: I have enabled the arp support on my dell based server running linux on it. I wanted to check that if arptables are enabled or not. Could anyone tell me how do I check the same? Is it enough to run `arp` command here?


title: ssh targetHost &; fg - does not work, but why?

text: I was trying the following combination in order to get the pid of the ssh session (running in the background displays the pid) and than fg to get back to the ssh session and introduce the password:               ssh targetHost &; fg      I get the following error:               -bash: syntax error near unexpected token `;'      Why does the ";" not work to as expected in this case? My aim is to start a ssh session and know its pid and I need to do this in as few lines as possible. I need to start several ssh sessions, put them in the background and at the end kill them - that's why I need the pids.


title: why the size of disk image decreased after mkfs.ext2

text: first, i create a disk image use `dd`:               > dd if=/dev/zero of=disk bs=512 count=2097152     > du -h disk          1.1G   disk      second, `fdisk disk` create a partion:               Command (m for help): p     Disk disk: 1 GiB, 1073741824 bytes, 2097152 sectors     Units: sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disklabel type: dos     Disk identifier: 0x40c73f2f          Device Boot Start       End  Blocks  Id System     disk1        2048   2097151 1047552  83 Linux      blocks column: 1047552, so sectors is : 1024(can fdisk set sector size?). third, `losetup`:                losetup /dev/loop0 -o 2097152 --sizelimit=1072693248 disk      2048*1024 = 2097152 1047552*1024 = 1072693248. at this time the size of disk is 1G:               > du -h disk       1.1G  disk      forth, `mkfs.ext2`:               > mkfs.ext2 /dev/loop0         mke2fs 1.42.8 (20-Jun-2013)         Discarding device blocks: done                                     Filesystem label=         OS type: Linux         Block size=4096 (log=2)         Fragment size=4096 (log=2)         Stride=0 blocks, Stripe width=0 blocks         65408 inodes, 261632 blocks         13081 blocks (5.00%) reserved for the super user         First data block=0         Maximum filesystem blocks=268435456         8 block groups         32768 blocks per group, 32768 fragments per group         8176 inodes per group         Superblock backups stored on blocks:              32768, 98304, 163840, 229376              Allocating group tables: done                                     Writing inode tables: done                                     Writing superblocks and filesystem accounting information: done      and disk image size is decreased:               > du -h disk         19M disk      You know filesystem block size is 4096, and have 8 block groups, 32768 blocks per group. 4096 * 8 * 32768 = 1G.


title: Server running but not serving

text: I have a simple python flask server that is started by start-stop-daemon. It was running well last week, and this monday I see that it is not serving anymore (`curl http://localhost/mypage` takes forever and never returns). Last log is from friday. The strange thing is that `sudo service myService status` is "running" and I see that the process is indeed running (`ps aux | grep $(cat /var/run/myservice.pid)`) Is there a way to know what could have happened? I have no idea where to go next from here.


title: Battery meter only appears when laptop gets plugged in

text: The battery meter refuses to show unless I plug the laptop in. If I remove the applet and then re-add it it still won't show. I am using Mint 17 and here is the screen shot of my Power settings and I don't have any battery status option in it: ![enter image description here](http://i.stack.imgur.com/5Tltu.png) Any Ideas?


title: Stop cron script from destroying my mirrorlist with invalid data

text: I have to following **cron** script that runs daily. As you should be able to see from the code, it outputs the results from `reflector` to `/etc/pacman.d/mirrorlist`.               $ cat /etc/cron.daily/update-mirrorlist     #!/bin/bash          reflector -l 5 -r -o /etc/pacman.d/mirrorlist      Sometimes, `reflector` outputs a empty file and thus a invalid _mirrorlist_ is created. How can I modify the script above to only write to `/etc/pacman.d/mirrorlist` **IF** there is valid output from `relfector`?


title: How to change the name of a vim buffer

text: Is it possible to change the name of a buffer in vim? Specifically, I'm using Conque Shell to open shells in vim (each shell is in a buffer) and with multiple shells, I see:               10: bash - 1     11: bash - 2      in my buffer list. I would like to rename these buffers with more meaningful names (e.g., "mercurial" instead of "bash - 2"). Is it possible?


title: How can I have activity in a Dropbox folder logged?

text: I have a folder shared with others through Dropbox. When a file is added to this folder, I get a system tray notification in KDE --- but of course if I'm not at my computer, I wouldn't see the notification. Is there a way to automatically log any changes within a folder (especially file creation), and/or automatically run a bash script to, say, send an email to myself as a more durable "alert"? A google search turned up incron ... It sounds about right. Has anyone used this software?


title: Home folder unintentionally exposed while using samba shares

text: **Problem** I have some difficulties with sharing folders in a **local area network** by using **samba**. I have managed everything up to the point that every folder that I share is being detected, can be read and can be written to. My problem however is, that next to the folders that I have explicitly shared, also my `/home/carlos` folder can be accessed. So basically **all my data is exposed unintentionally**. Currently I have my firewall blocking samba, so nothing is exposed at the moment, however I want to use samba though. I would like some assistance in correctly configuring samba. **What have I done so far** Copied default configuration file:               cp /etc/samba/smb.conf.default /etc/samba/smb.conf      Changed workgroup from MYGROUP into Baptista and add these lines to the `[global]` section in `/etc/samba/smb.conf`:               usershare allow guests = Yes     usershare max shares = 100     usershare owner only = False      Changed `[homes]` section configuration to read               [homes]         comment = Home Directories         browseable = No         writable = No      Run these commands in a terminal:               # mkdir /var/lib/samba/usershares     # chgrp users /var/lib/samba/usershares/     # chmod 1775 /var/lib/samba/usershares/     # chmod +t /var/lib/samba/usershares/      (these commands and several settings were taken from section 1.7 of https://wiki.archlinux.org/index.php/Samba/Troubleshooting) Share a folder by launching Dolphin, right-click a folder, select properties, select the share tab, configure settings and press OK. **Question** Let assume I shared the folder `/home/carlos/Music`, then not only is `/home/carlos/Music` available through samba, my entire `/home/carlos` is available. How can I fix this, such that **only** the folders than I **explicitly** share, are shared? **System information**   * Chakra Linux, 64-bit   * Linux kernel 3.12.6-1   * KDE 4.12.0   * Qt 4.8.5   * Samba 4.1.1-1   * Two laptops, same OS, same username


title: How can I record the sound output with gtk-recordmydesktop?

text: I am using gtk-recordmydesktop to record the video output to my desktop. However, the videos have no sound. All the tutorials I found regarding this involved getting sound recorded from a microphone, while I am interested in getting the sound output recorded. How can I do this? The official FAQ says "The solution is in your mixer's settings. Keep playing with it ;)." which doesn't clarify anything. How can I get the sound output recorded, while being able to hear it myself also?


title: how to get IP from DHCP in network in redhat which is installed on VMware

text: I'm running Red Hat inside a VMware image (on a Windows XP machine). I want to connect the Red Hat VM to our network; do I need to configure something inside VMware or inside Red Hat? I don't have any IPs set to connect to the internet


title: Problematic build script with quotes

text: Hi I'm trying to create a build script that executes these commands:               cd libiconv     ../../src/libiconv/configure --prefix=/home/ruben/mingw64/build/gcc-libs \                                  --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 \                                  CFLAGS="-mtune=core2 -flto -fomit-frame-pointer -momit-leaf-frame-pointer" LFLAGS="-flto -fwhopr=2"     make -j3 -s     make -s install     cd ..      It looks like this:               #!/bin/sh     HOST=x86_64-w64-mingw32     TARGET=x86_64-w64-mingw32     BUILD=x86_64-w64_mingw32     # options     BUILD_CORES=2 #used as argument for "make -j#"     # directories: SRC_DIR contains full source package.     GCC_LIBS_DIR=$BUILD_DIR/gcc-libs          # optimized for my system.     BUILD_CFLAGS="\"-mtune=core2 -flto -fomit-frame-pointer -momit-leaf-frame-pointer\""     BUILD_LFLAGS="\"-flto -fwhopr="${BUILD_CORES}"\""     CONFIG_OPTS="--prefix="${PREFIX}" --host="${HOST}" --build="${BUILD}" CFLAGS="${BUILD_CFLAGS}" LFLAGS="${BUILD_LFLAGS}       makeopts="-s -j"${BUILD_CORES}          # libiconv     cd libiconv     echo "configuring libiconv: "${CONFIG_OPTS}     ../../src/libiconv/configure "${CONFIG_OPTS}" > configure.log || exit 1     echo "building libiconv"     make $MAKEOPTS > build.log || exit 1     echo "installing libiconv"     make -s install > install.log || exit 1     cd ..      The thing is, the echo command shows the exact configure command I want, but when running configure it doesn't so the right thing. Something goes terribly wrong, after `CFLAGS=-mtunecore2`, when configure tries to use -flto (which is quoted!!) as an argument. What am I doing wrong? Thanks! PS: I'm running MSYS, not _real_ *nix...


title: Mono book recommendations

text: Does anyone know if there are any upcoming book releases for Mono/GTK#? The only book I could find on Amazon with a decent rating is over 6 years old.


title: What is the reconnection policy of "persist" switch on "pon" command from pptp-linux package?

text: I use to establish a connection to my VPN PPTP server by typing:               pon MyVPN persist      I wanna know the reconnection timing details, but I have not found documentation enough about it. Specifically:   - If there is a disconnection, does the PPTP client attemps to reconnect immediately?   - What is the frequency of reconnection attemps (5 mins, 15 mins, variable... etc)?   - The client stop trying to reconnect after some too long period (give-up time) without succeeding (6 hours, 1 day... etc)?


title: How to make vertical bar | work in grep?

text: Here's an example of a grep command line I've tried:               grep '(565172|565173|565175)' /var/log/cups/error_log      It doesn't produce any output, even though all 3 values are in the file multiple times. I tried escaping the bars, and that improved things somewhat - the middle value was detected but not the first or last.               grep '(565172\|565173\|565175)' /var/log/cups/error_log      I also tried double escapes and went back to getting no results.               grep '(565172\\|565173\\|565175)' /var/log/cups/error_log      What am I doing wrong? Thanks.


title: How to combine dmix with ladspa plugins to default device

text: A while I have abandoned all sound daemons and lived happily ever since with just the dmix plugin. However, recently I got annoyed by the different volume levels of youtube videos and decided to plug in a compressor and a limiter. IMHO this is an extremely desirable setup. But alas, I had no luck. I got playback to work or capture, but never both. I suppose the underlying problem is my lack of understanding, so my fundamental questions are:   * Where can I find a good documentation of alsa and .asoundrc, which goes beyond mere examples and which would e.g. explain the error messages (see below) I got.   * Has anyobody succeeded in a daemonless sound setup which included ladspa plugins?   * Does anybody know the reasons, or even a solution for my particular problems (described below)? * * * For those of you who have the patience to follow my woes here they are. I got as far as being able to play sound like this               aplay -D ladspaChain /usr/share/skype/sounds/CallBusy.wav      but I cannot play via the default device.                pcm.!default {         type plug         slave.pcm {         type asym         playback.pcm "ladspaChain"         capture.pcm "dsnooper"        }     }      Without -D ladspaChain, I get               aplay: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion `!snd_interval_empty(i)' failed.**      Alternatively I tried                pcm.!default {         type route         slave.pcm {         type asym         playback.pcm "ladspaChain"         capture.pcm "dsnooper"        }         ttable {             0.0     1       # left channel             1.1     1       # right channel         }      }       In this case playback works, but arecord gives me               arecord: set_params:1081: Sample format non available     Available formats:     - S32_LE


title: Error running Virtual Box on Arch Linux

text: I installed Virtual Box regularly on Arch Linux using pacman:               pacman -S virtualbox      When i run `virtualbox` from the terminal, the GUI of the program is loaded but I can't use a virtual machine and I get this warning:               The vboxdrv kernel module is not loaded. Either there is no module              available for the current kernel (3.12.5-1-ARCH) or it failed to              load. Please reinstall the kernel module virtualbox-host-modules or              if you don't use our stock kernel compile the modules with                     sudo dkms autoinstall      How to solve the problem?


title: du gives two different results for the same file

text: I am a graduate student of computational chemistry with access to a Linux cluster. The cluster consists of a very large (25 TB) fileserver, to which several dozen compute nodes are connected. Each compute node consists of 8 to 24 Intel Xeon cores. Each compute node also contains a local disk of about 365 TB. Since the fileserver is routinely accessed by a dozen or so users in the research group, the fileserver is mainly used for long term file storage (it is backed up nightly, whereas the compute nodes' local disks are never backed up). Thus, the system administrator has instructed us to run simulations on the local disks -- which have faster I/O than the fileserver -- so as to not slow down the fileserver for the other users. So, I run simulations on the local disks and then, after they are finished, I copy the trajectory files -- I am running molecular dynamics (MD) simulations -- to the fileserver for storage. Suppose I have a trajectory file called `traj.trr` in a directory on the local disk of a node, `/home/myusername/mysimulation1/traj.trr`. For long term storage, I always copy `traj.trr` to a directory in the fileserver, `~/mysimulation1/traj.trr`, where `~` represents my directory in the fileserver, `/export/home/myusername`. After copying it, then I habitually use `du -h` to verify that `/home/myusername/mysimulation1/traj.trr` has the same file size as `~/mysimulation1/traj.trr`. This way, I can be at least reasonably sure that the transfer to the fileserver was successful. For example:               cd /home/myusername/mysimulation1/     cp -v traj.trr ~/mysimulation1/     du /home/myusername/mysimulation1/traj.trr -h     du ~/mysimulation1/traj.trr -h      If the two calls to `du -h` give the same human-readable file size, then I can be reasonably sure that the transfer/copy was successful. (My typical `traj.trr` files range in size from about 15 to 20 GB, depending on the exact simulation I have run.) If I run `du` (i.e., without the `-h` switch) on the two `traj.trr` files, their sizes in bytes are usually very, very similar -- usually within just a few bytes. I have been using this overall method for the past year and a half, with no problems. _**However,_** recently I have run into the following problem: sometimes `du -h` reports that the two `traj.trr` files are different in size by several GB. Here is an example:               cd /home/myusername/mysimulation1/            # this is the local disk     cp -v traj.trr ~/mysimulation1/     du traj.trr -h     cd ~/mysimulation1/                           # this is the fileserver     du traj.trr -h      The output from the two calls to `du -h` is as follows, respectively:               20G     traj.trr     28G     traj.trr      I believe that the former (i.e., the `traj.trr` in the local disk, `/home/myusername/mysimulation1/`) is the correct file size, since my simulation trajectories are expected to be about 15 to 20 GB each. But then how could the file on the fileserver actually be _larger_? I could see how it could be smaller, if somehow the `cp` transfer failed. But I don't see how it could actually be _larger_. I get similar output when I execute the same commands as above, but without the `-h` switch given to `du`:               20717480        traj.trr     28666688        traj.trr      Can you think of any reason for the difference? If, by some unlikely chance, `du` is somehow malfunctioning, I can be okay with that. But I just really need to make sure that the copy of `traj.trr` on the fileserver is complete and identical to its source version on the local disk. I need to delete the local file so that I have enough local disk space to run new simulations, but I can't afford to have the version of `traj.trr` on the fileserver be corrupted. The .trr file format (from the Gromacs molecular dynamics package) is a binary format, not text. Thus, I am not sure if the files can be reliably compared by a program such as `diff`.


title: Unable to change backlight level

text: In Manjaro I can't set the backlight. I've tried to add: `acpi_osi=Linux acpi_backlight=vendor` to the kernel's command line but it didn't work. And I also added `Option "RegistryDwords" "EnableBrightnessControl=1"` to the `xorg.conf`, but it didn't work. Why?


title: Why Would Spacing Matter in grub.conf?

text: See my earlier question. GRUB wouldn't recognize the XEN kernel until extra blank lines were added and the title of the GRUB entry matched the version of XEN installed on the server. I've always considered the `title` line to represent a label for the entry, and I never would have thought spacing would have mattered. Is there a code style guideline/wiki for GRUB with CentOS to avoid these types of issues in the future?


title: Default stack size for pthreads

text: As I understand the default stack size for a pthread on linux is 16K. I am getting strange sesults on my 64bit ubuntu install.               $ ulimit -s     8192      Also               pthread_attr_init(&attr);     pthread_attr_getstacksize(&attr, &stacksize);     printf("Thread stack size = %d bytes \n", stacksize);          Prints         Thread stack size = 8388608 bytes      I am quiet sure the stack size if not "8388608". What could be wrong ?


title: Remove rows from tab delimited files based on a common column with another file

text: I am having trouble processing a tab delimited file based on the common column `Column_4` with another file. One file is likely to be very small (less than 100 rows), the second one, however, will be well over 80,000 (both with approximately 30 columns). `file1.txt`:               Column_1    Column_2    Column_3    Column_4     A1          B1          C1          D1     A2          B2          C2          D2     A3          B3          C3          D3      `file2.txt`:               Column_1    Column_2    Column_3    Column_4     Aa1          Bb1          Cc1          Dd1     Aa2          Bb2          Cc2          D2     Aa3          Bb3          Cc3          Dd3      `desired_output.txt`:               Column_1    Column_2    Column_3    Column_4     Aa2          Bb2         Cc2          D2      I've tried a series of `cut`, `grep`, `awk`, etc., but can't seem to get it right. The ultimate goal is to remove all the non-matching rows from `file2.txt`, then compare the output to `file1.txt`.


title: Custom hotkeys in dwm

text: I'm trying to create an array of simple hotkeys on my desktop, running OpenSuse with dwm. Things like:               Ctrl+E    /opt/eclipse/eclipse      Can this be configured from within dwm? If not is there an external application which I can run (in the background) to listen for these hotkeys. Also, is it possible for the hotkeys to only work when I an **not** hovering over a window (so that the windows doesn't grab my input by accident)?


title: Reinstalling Linux with backup

text: I'm using Linux (Ubuntu 10.04) for more than a year and I feel often that I need to reinstall it to newest version. I'd like to take most of my configurations and important settings to the new system. I already have in mind some files and directories that I certainly want to backup, but I'm afraid I will forget something. Is there some checklist or guideline (or even software) I can use to help me with backuping the important things? I don't want to backup whole partition (it's not so critical) How do you cleanly update to newer version? thank you


title: kde install destroys gnome desktop

text: I recently installed KDE 4.7 on my wife's computer. I did not use the recommended Debian 'install task' method, which emulates the full install- from-.iso process. Instead I just did:               # apt-get install kde-plasma-workspace plasma*      She uses GNOME, and wanted KDE because apparently you can take advantage of some additional features in kdenlive when you are running it from KDE. And so I opted to keep both WMs going. Unfortunately, I was not prepared for the consequences of installing two WMs on the same machine. In this case, installing KDE rendered the GNOME _desktop_ non-functional, though not GNOME itself, as in this question: Debian GNOME 2.30, desktop does not respond anymore. Dolphin also made itself the default file manager in GNOME (gdm3), which was a headache. I removed Dolphin, and I have basically removed KDE, but it has not fixed anything of course.


title: Moving from Ubuntu 32bit: Mint 64bit or Mint 32bit?

text: I have decided to try out Linux Mint instead of the horrible Ubuntu Unity experince. I have a separate partition for my `/home` folder, which I'd like to preserve of course. So I'm curious: is it possible for me to install the 64bit version of Mint without user dotfiles making trouble? More specifically, will it matter that the new OS is 64-bit? My instinct tells me - no, a config file is a config file, but I thought it would be better to check here, I simply don't want to lose all the app settings. A more general question would be, will the user dotfiles cause any problem for Mint, regardless of _bit-ness_? Has this been tried by someone?


title: Modify list of devices mounted at boot on Linux

text: Where do you configure or what command do I use to mount device at boot? Is it in the file /etc/fstab ?


title: Gedit: syntax highlighting of echoing self-closing XHTML tags in JavaScript in PHP

text: Reproduction:   * In Gedit, open a new file and manually select the syntax highlighting language (at the bottom right) to `PHP`.   * Write some javascript in `<script>` tags   * Within the `<script>` tags, echo some XHTML with self-closing tags   * Note that all of the code that follows is no longer syntax highlighted Alternatively, paste this in:               <?php         echo 'hello - this is still syntax highlighted! ';     ?>                    <?php         echo 'syntax highlighting returns after the closing </script> tag';     ?>      It's not a big deal, since I can work around it right now by replacing all self-closing tags with their HTML 4 equivalents (e.g. `<input></input>`), but I was wondering if anybody else dealt with this problem...


title: Backintime Linux desktop backup to a Synology DiskStation

text: Backintime doesn't support plain SFTP backends so it does not seem to be easy to setup a remote backup to a Synology Diskstation (in my case a DS214 with DSM 4.3). Backintime supports SSH/rsync based remote backup but the Synology doesn't seem to allow automated SSH logins with trusted entries. What is the best way to backup to a Synology NAS backend with Backintime? So far, I could only manage a backup with mounting the Windows share to the workstation (with CIFS) and configuring Backintime as a local sync to the mounted folder. This works but I would like a solution which doesn't include Samba & Windows shares.


title: Windows / Unix Share

text: I have a NFS + SMB share on my Win server called 'media' (same path).   Both shares are read-only for guests - the Win server add files and both protcols can read them. _Now things getting more complex_ I want to use my CentOS(6.5) server to add files to the NFS share and access them via NFS _and_ SMB from Win clients. But here comes the problem that files added via NFS are not visible via SMB because they don't inherit permissions from the share. I tried the whole day a bunch of different things, I always get weird problems. ### My question Is there a well working solution or should I do not mix win/nix shares together? ### UPDATE #1 The `-nolock` parameter within `mount` seems to help. But this question isn't answered. ### UPDATE #2 @skohrs   After your _update_ **The visibility from my windows client**               create file in unix machine:            SMB hidden  NFS visible       create file in SMB from win client:     SMB visible NFS visible       create file in NFS from win client:     SMB hidden  NFS visible       create file in 'media' from win server: SMB hidden  NFS visible          # Solution The way I mounted my NFS share in CentOS               mount -nolock 192.168.178.5:/MEDIA media


title: How to tail a file over the network?

text: How can I `tail -f` a file that over the network, say at `\\\192.168.2.130\public\print.log`? I have tried the variations of the following:   * `tail -f //192.168.2.130/Southpaw/Tactic/print.log` which erred saying `tail: cannot open `//192.168.2.130/Southpaw/Tactic/print.log' for reading: No such file or directory`   * Mounted the path using the `mount -t cifs` and then tried `tail -f` but that isn't working either, meaning it doesn't output the updates that are made to the file.


title: Why does sudo ignore aliases?

text: I am running Ubuntu 10.04 and I use `upstart` for daemon management. My enterprise application is run as a daemon and must be run as root because of various privileges. E.g.:               sudo start my-application-long-ID     sudo stop my-application-long-ID     etc      I would like to introduce an `alias` to abbreviate these commands as something like:               alias startapp='sudo start my-application-long-ID'      and run it as `>startapp` and that works but I would prefer to not have sudo in the alias.               alias startapp='start my-application-long-ID'      does not when run using `>sudo startapp`, returning `sudo: startapp: command not found`. However, when I added the alias: `alias sudo='sudo '` `>sudo startapp` now works but I am still curious why sudo ignores aliases.


title: bash - replace space with new line

text: How can I replace spaces with new lines on an input like: `/path/to/file /path/to/file2 /path/to/file3 /path/to/file4 /path/to/file5` etc... To obtain the following:               /path/to/file     /path/to/file2     /path/to/file3     /path/to/file4     /path/to/file5      ### Note I'm posting this question to help other users, it was not easy to find a useful answer on UNIX SE until I started to type this question. After that I found the following: ### Related question How can I find and replace with a new line?


title: How can I list the available color names?

text: I'm trying to add some color to my git configuration and I want to know what color names are available on the terminal.   * I only want to use colors by name so it's easier for others to understand   * I don't want to add any new colors - I just want to select from the predefined names   * I would like a solution that works for all distros, but primarily Debian   * It would be nice to see the color that the name indicates Many online references often talk about color names that are not defined on my system, so I just need a way to see what my default options are.


title: How can I make my command more susceptible to system slowdowns so as to use it as a visual QoS widget on my desktop?

text: I had some system slowdown event1 after mistakenly using a command so I thought I could use a desktop "widget" to visually show _quality of service_ or at least show when QoS was degraded and get some timely feedback. We have this natural ability to perceive degradation in the playback of an image sequence so I wanted to leverage this. Therefore I selected an mp4 video sequence2 and made a .gif file out of a segment of it with `ffmpeg`:               ffmpeg -i snf.mp4 -ss 00:01:24.0 -t 00:00:04.03 -s qcif -qscale:v 10 -an output.gif      So this will be a stamp size qcif (176x144) gif image. In this example I extracted some 4.03 seconds starting at 1:24 into the sequence. Makes for a 1,3MiB file. Which I then `animate`:               animate -borderwidth 0 output.gif &      Then I "float" that tiny window in my tiling window manager, and keep that handy. The sequence loops and if you click on the image you get an imagemagick "display"-like menu where you have that (beautiful) _auto-reverse_ option... so the clip plays for its 4 seconds, then plays backwards and back and forth! I thought maybe I could start this with `ionice -c 2 -n 0` (but there can't be i/o here really) or renice it with `renice -n -10` but i can't come to terms with how to "expose" this to "load" so that it would be the first thing impacted if there is a slowdown. From what I understand, if the execution is too nice, it should get impacted all the time but that wouldn't be related to a system slowdown, just to being "bumped". If it's not nice at all, then it wouldn't have to face any slowdowns unless in the most dire of states and that would defeat the purpose. How can I set my command to be impacted _in priority_ (as opposed to having or not having execution priority) to other programs on my desktop so as to serve as a QoS widget? Or is that just misguided and since load balancing is all about _heuristics_ I won't be able to use something like that? * * * `ps aux` spec output for `animate`:               14454  0.3  2.9 228232 118768 pts/5   Sl   05:06   2:36 animate -borderwidth 0 test2.gif      * * * 1. I issued a wrong command using `convert`(ImageMagick) and it eventually exhausted system resources and self-terminated - I thought I was doing something legit so I let it go. During that time, I saw my system slowing down as the load increased; windows not refreshing, htop seemingly freezing, intense disk usage, and jerkiness with the mouse pointer. As the system was coming to a crawl, I noticed that looking at the movement of the pointer gave me a good "feel" of the slowdown so to speak. More so I found than looking at the load indicator reach 7-8 in my status bar(i3). Generally speaking for real time monitoring and information I use `htop` and the `i3 status` bar. But I'm also interested in different kinds of system feedback. 2. To help with my perceptual abilities, I selected a dancing clip. Some time ago I saw on youtube this famous dance sequence from _Saturday Night Fever(Bee Gees - "You should be dancing")_ with _M. John Travolta_ taking on the whole dancefloor. His landmark move is rythmic and the lights beat in a discernable pattern.


title: Convert linux symlink to osx symlink

text: I have transferred a folder from a linux machine to a macbook pro with osx 10.9, now I am having trouble with the symlinks in this folder (lots of them). In linux if I do `vi link2file.txt`, it has the same effect as `vi file.txt`, but in osx, it shows something like this:               IntxLNKh�t�m�l�_�t�e�x�.�s�n�i�p�      Why is this happening and is there a fast method to fix this? To recreate all the symlinks by hand would be a PITA.


title: How to mv and adopt target directory permissions

text: How do I move a file such that the file adopts the target directory permissions?   Surely this is an incredibly common scenario.... any help appreciated.