title: Linksys AE3000 install on linux

text: I bought a Linksys AE3000 wireless adapter hoping I could use it on my Ubuntu 12.04 box. I found a website that walked through using it, but it didn't work. I edited `rtusb_dev_id.c` to add: and then did `sudo make -j10` and got: > >     make -C tools >     make[1]: Entering directory > `/home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/tools' >     gcc -g bin2h.c -o bin2h >     cp -f os/linux/Makefile.6 > /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux/Makefile >     make -C /lib/modules/3.2.0-39-generic/build > SUBDIRS=/home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux > modules >     make[1]: Leaving directory > `/home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/tools' >     /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/tools/bin2h >     make[1]: Entering directory `/usr/src/linux-headers-3.2.0-39-generic' >     CC [M] > /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux/../../common/rtmp_mcu.o >     LD [M] > /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux/rt3573sta.o >     Building modules, stage 2. >     MODPOST 1 modules >     LD [M] > /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux/rt3573sta.ko >     make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-39-generic' >     cp -f > /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux/rt3573sta.ko >   > > /tftpboot then i did the sudo make install:               > make -C     > /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux     > -f Makefile.6 install mkdir: cannot create directory `/etc/Wireless': File exists make[1]: Entering directory     > `/home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux'     > rm -rf /etc/Wireless/RT2870STA mkdir /etc/Wireless/RT2870STA cp     > /home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/RT2870STA.dat     > /etc/Wireless/RT2870STA/. install -d     > /lib/modules/3.2.0-39-generic/kernel/drivers/net/wireless/ install -m     > 644 -c rt3573sta.ko     > /lib/modules/3.2.0-39-generic/kernel/drivers/net/wireless/     > /sbin/depmod -a 3.2.0-39-generic make[1]: Leaving directory     > `/home/eduardop911/Desktop/Linux/DPO_RT3573_LinuxSTA_V2.5.0.0/os/linux'      I finished with:               sudo depmod -a      sudo modprobe -v rt3573sta      but was not able to get the light to light up. Any suggestions?


title: How does this git alias work?

text: Usually, git aliases are confined to a single command:               git config --global alias.ci commit      So, instead of `git commit` you could do `git ci` But it seems you can insert a function in there as well:               git config --global alias.up-sub '!f() { cd $1 && git checkout master && git pull && git submodule update --init --recursive; }; f'      This allows you to call `git up-sub some-submodule` The question is: how does it work? I haven't seen the `!f()` syntax in any other context.


title: Detect attached monitors when X is not running

text: I'm working with machines that are running RHEL6. I need to detect whether a monitor is plugged in when X is either not running or has not started yet, for example during bootup. Is there any way to do this? `lspci` shows video drivers and other hardware, for instance, but that's the closest I've been able to come so far to detecting monitors without going through X.


title: how to delete wine temp files for an application

text: I have been using ultrasurf a proxy server through wine. And yesterday ultrsurf was easting too much memory so I killed it via console. Then I restarted again and it wouldn't start saying some error. I deleted it and the files it created in the same directory(it's a portable version) and re- downloaded and tried to execute but it shows the same error. So I tried to use it by running `wine u1204.exe` as root(I know its not recommended) wine created .wine directory for root and it started working fine! so what I could understand from this is when I killed ultrasurf it messed up with some files or temp files of wine and it won't start now! So If I can remove those temp files I can run ultrasurf again from normal user. Thaks for the help.


title: Prevent GNU screen from terminating session once executed script ends

text: I'm trying to force GNU screen to create a "virtual" terminal, without attaching to it, execute script inside and NOT terminate session once script ends. I tried many combinations, including:               screen -dmS udplistener /share/Sys/autorun/start_udp_listeners.sh      or               screen -S udplistener -X /share/Sys/autorun/start_udp_listeners.sh      and none of them worked. I either get session without executed script, script executes, but session is terminated once it finishes or I'm getting "No screen session found" error. What I'm basically trying to do is to run UDP listener, written in PHP and make it work in infinte loop (don't break listening). Yes -- I could run PHP script with `&` at the end, forcing PHP CLI to run as daemon. The problem is, that I'm using a piece of junk called server (QNAP -- never, ever buy this junk!) which does seems to be ignoring this. As soon as I logoff SSH session, scripts stops. So `screen` seems to be the only option. But I can't understand, why it terminates session once executed command or script ends? **EDIT** : I've also tried example found in the Internet:               screen -dmS name     screen -S name -p windowname -X stuff 'mc     '      No lack! After attaching to it (`screen -R name`) I see that Midnight Commander HASN'T been executed. Though example author said, it will be.


title: How to save the result of printf to a variable in GDB?

text: (gdb)printf "Hello %d", 7     Hello 7     (gdb)set $MyVar = printf "Hello %d", 7 // ???      How to save the result of `printf "Hello %d", 7` to $MyVar?


title: Installing python module pyexiv2 on CentOS?

text: I downloaded the latest pyexiv2 files: pyexiv2-0.3.2.tar.bz2 and I looked at the README file which said:               To build and install the library, while in the top-level directory     (e.g. '~/dev/pyexiv2', which should contain a file named 'SConstruct'),     run the following commands:           $ scons      $ scons install # as administrator, e.g. `sudo scons install`          The result of the build is a dynamic library, libexiv2python.so, in the build/     directory. This is the low-level binding. It is in turn used in a higher level     module, pyexiv2.     The install command installs the two modules in your site-specific directory for     Python modules (e.g. '/usr/lib/python2.7/dist-packages/' on Linux).      I did exactly this, `su` (now running as root) `cp -r 'pyexiv2-0.3.2' ~` Then ran: `scons` It said:               scons: Reading SConscript files ...     scons: done reading SConscript files.     scons: Building targets ...     o build/exiv2wrapper.os -c -fPIC -I/usr/include/python2.6 src/exiv2wrapper.cpp     sh: o: command not found     o build/exiv2wrapper_python.os -c -fPIC -I/usr/include/python2.6 src/exiv2wrapper_python.cpp     sh: o: command not found     o build/libexiv2python.so -shared build/exiv2wrapper.os build/exiv2wrapper_python.os -lboost_python -lexiv2     sh: o: command not found     scons: done building targets.      Any ideas where to go from here?


title: how os running in virtualbox effect original os speed in laptop

text: Suppose I want to run ubuntu on virtual box.. how it effect original windows in terms of speed ?? like we used ram for ubuntu can not be used for windows like that??


title: A command that gives username@hostname:pwd

text: I know that `pwd` gives the current working directory, `hostname` gives the current host and `whoami` gives the current user. Is there a single unix command that will give me the output of               whoami@hostname:pwd      so that I can quickly paste the output into an `scp` command?


title: What's the right way to install an appropriate package containing <signal.h> on a Linux Mint VM?

text: I have Linux Mint installed on a VM: `Linux jonathan-mint-virtual-machine 3.5.0-43-generic #66-Ubuntu SMP Wed Oct 23 17:33:43 UTC 2013 i686 i686 i686 GNU/Linux` I tried to compile something that uses`<signal.h>`, but it couldn't find it. What can I install so that a compiler looking for basic header files will find it?


title: In vim, search backwards for matching braces/parens

text: As most of you probably know, you can use `%` to search forwards on the line to find the next paired brace/bracket/paren and move to its matched partner:               |a|rray[index] = value;     " |e| is the cursor; hit %:     array[index|]| = value;      I am hoping there is a similar key that searches backwards on the line, e.g.:               array[index] = value|;|     " |;| is the cursor again, hit the key I'm looking for:     array|[|index] = value;      Most vim commands have both a backwards and forwards, so it seems this should to. Does it not have a partner? If so, is that because once it's _on_ a paired character they would act the same?


title: Printing and deleting the first line of a file using `sed`

text: I can print the first line of a file using               sed -n 1p file.txt      I can delete the first line of a file using               sed -i 1d file.txt      Is there a way to print-and-delete in `sed`? Kind of like a FIFO `pop()` or Perl's `shift`.


title: Failed make when installing madplay source

text: I am attempting to get madplay installed on my shared host I've run:               ./configure --prefix=$HOME CPPFLAGS="-I /home/dir/include" LDFLAGS="-L /home/dir/lib"      and then "make", but on that on run into an error I can't understand:               /home/dir/lib: file not recognized: Is a directory     collect2: ld returned 1 exit status     make[2]: *** [madplay] Error 1     make[2]: Leaving directory `/home/dir/madplay-0.15.2b'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/home/dir/madplay-0.15.2b'     make: *** [all] Error 2      Please, point out to me why it is looking for a directory instead of a file? This is preventing me from installing this software.


I'm trying to get this package because I need it to build software on CentOS 6, but I'm getting this error:               No package community-mysql-devel available      I'm logged in as root, using `yum`. Could it be because I installed this from a non-net install CD? I had the same problem with Scientific Linux 6 (non-net CD)


title: What does the *.*;auth,authpriv.none -/var/log/syslog line mean in rsyslog config file?

text: I'm trying to understand the `/etc/rsyslog.conf` file, but I'm missing something. For example, this is a part of the file:               auth,authpriv.*         /var/log/auth.log     *.*;auth,authpriv.none      -/var/log/syslog     cron.*              /var/log/cron.log     daemon.*            -/var/log/daemon.log     kern.*              -/var/log/kern.log     lpr.*               -/var/log/lpr.log     mail.*              -/var/log/mail.log     user.*              -/var/log/user.log      According to this page: > The facility is one of the following keywords: auth, authpriv, cron, daemon, > kern, lpr, mail, mark, news, security (same as auth), syslog, user, uucp and > local0 through local7. > > The priority is one of the following keywords, in ascending order: > debug,info, notice, warning, warn (same as warning), err, error (same as > err) crit, alert, emerg, panic (same as emerg). The keywords error, warn and > panic are deprecated and should not be used anymore. The priority defines > the severity of the message. > > An asterisk ("*") stands for all facilities or all priorities, depending on > where it is used (before or after the period). The keyword none stands for > no priority of the given facility. > > You can specify multiple facilities with the same priority pattern in one > statement using the comma (",") operator. You may specify as much facilities > as you want. Remember that only the facility part from such a statement is > taken, a priority part would be skipped. > > Multiple selectors may be specified for a single action using the semicolon > (";") separator. Remember that each selector in the selector field is > capable to overwrite the preceding ones. Using this behavior you can exclude > some priorities from the pattern. So, this is pretty understandable but what about the file path on the right. It can be just a path, or path with `|` or `-` before it (or maybe even something else). What is the difference between the three?


title: tmux copy mode search highlight

text: Is there any way to highlight the searched term in tmux copy mode? Below is my tmux config:               # remap prefix to Control + a     set -g prefix C-a     unbind C-b     bind C-a send-prefix     bind a send-prefix          # force a reload of the config file     unbind r     bind r source-file ~/.tmux.conf          # set window start from 1     set -g base-index 1          # scrollback buffer n lines     set -g history-limit 5000          # C-a C-a for the last active window     bind-key C-a last-window          # Highlight active window     set-window-option -g window-status-current-bg red          # Default colors     set -g status-bg black     set -g status-fg white          #unbind %     bind - split-window -v     #unbind '"'     bind | split-window -h          setw -g aggressive-resize on     bind-key T swap-window -t 1          # To ensure keyboard shortcuts inside Vim still work, we need to enable XTerm keybindings.     # And to be sure Vim's colors aren't distorted, we enable 256 color mode     #setw -g xterm-keys on     #set-option -g default-terminal "screen-256color"               # make copy mode use hjkl     setw -g mode-keys vi # I especially like being able to search with /,? when in copy-mode     set -g status-keys vi     bind-key -t vi-edit Up   history-up     bind-key -t vi-edit Down history-down          # set shell     set -g default-command /bin/bash     set -g default-shell /bin/bash          # smart pane switching with awareness of vim splits     bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"     bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"     bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"     bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"     bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"          #Sets the appearance of the left sidebar     set -g status-left-length 40     set -g status-left "#[fg=colour39]❐ #S #[fg=yellow]✓ #(whoami)"          #Sets the appearance of the center     setw -g window-status-fg colour211     setw -g window-status-bg default     setw -g window-status-attr dim     setw -g window-status-current-fg white     setw -g window-status-current-bg green     setw -g window-status-current-attr bright     setw -g window-status-activity-bg red     setw -g window-status-activity-fg white     setw -g window-status-bell-fg white     setw -g window-status-bell-bg red     setw -g window-status-bell-attr bold          #Sets the appearance of the right sidebar, i.e time and clock.     set -g status-right "#[fg=colour136, bright]ℹ %d %b %R"     set -g status-utf8 on     set -g status-interval 60     set -g status-justify centre


title: How to troubleshoot failed X11 forwarding with ssh?

text: When I try to establish an X11-forwarding connection to `myserver`, I get the following error:               % ssh -X myserver xlogo     X11 connection rejected because of wrong authentication.     X11 connection rejected because of wrong authentication.     X11 connection rejected because of wrong authentication.     X11 connection rejected because of wrong authentication.     Error: Can't open display: localhost:10.0     %      (I get the same error if I use `-Y` instead of `-X`. Either way, I never see the `xlogo` window.) If I use the same command to connect to a different server it works fine (i.e. the `xlogo` window pops up, as expected), so I suspect the problem is with `myserver` (and not with my local configuration). Also, if instead I use               % ssh -X myserver      the connection succeeds, and I get logged in to `myserver`. If then I run `xlogo`, I get the same error as shown above. BTW, the local ssh client/X11 server is an Ubuntu laptop, and the remote ssh server/X11 client is a workstation running OS X Lion. I've also run `ssh -vvvX myserver xlogo`, but the copious output is not very meaningful to me, and I'm not able to diagnose the problem from it. (FWIW, I've copied this output below.) How can I troubleshoot this problem further? * * *               % ssh -vvvX myserver xlogo     OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /home/yrstruly/.ssh/config     debug1: /home/yrstruly/.ssh/config line 19: Applying options for *     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to myserver [10.0.140.33] port 22.     debug1: Connection established.     debug3: Incorrect RSA1 identifier     debug3: Could not load "/home/yrstruly/.ssh/id_rsa" as a RSA1 public key     debug1: identity file /home/yrstruly/.ssh/id_rsa type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048     debug1: identity file /home/yrstruly/.ssh/id_rsa-cert type -1     debug1: identity file /home/yrstruly/.ssh/id_dsa type -1     debug1: identity file /home/yrstruly/.ssh/id_dsa-cert type -1     debug1: identity file /home/yrstruly/.ssh/id_ecdsa type -1     debug1: identity file /home/yrstruly/.ssh/id_ecdsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.6     debug1: match: OpenSSH_5.6 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1     debug2: fd 3 setting O_NONBLOCK     debug3: load_hostkeys: loading entries for host "myserver" from file "/home/yrstruly/.ssh/known_hosts"     debug3: load_hostkeys: found key type RSA in file /home/yrstruly/.ssh/known_hosts:3     debug3: load_hostkeys: loaded 1 keys     debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: mac_setup: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_setup: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug2: dh_gen_key: priv key bits set: 129/256     debug2: bits set: 521/1024     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Server host key: RSA 3b:5b:22:9e:e4:d1:12:7a:b9:6e:1a:e6:25:6d:b8:0e     debug3: load_hostkeys: loading entries for host "myserver" from file "/home/yrstruly/.ssh/known_hosts"     debug3: load_hostkeys: found key type RSA in file /home/yrstruly/.ssh/known_hosts:3     debug3: load_hostkeys: loaded 1 keys     debug3: load_hostkeys: loading entries for host "10.0.140.33" from file "/home/yrstruly/.ssh/known_hosts"     debug3: load_hostkeys: found key type RSA in file /home/yrstruly/.ssh/known_hosts:4     debug3: load_hostkeys: loaded 1 keys     debug1: Host 'myserver' is known and matches the RSA host key.     debug1: Found key in /home/yrstruly/.ssh/known_hosts:3     debug2: bits set: 511/1024     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /home/yrstruly/.ssh/id_rsa (0xb7a97898)     debug2: key: yrstruly@mylaptop (0xb7a991c8)     debug2: key: yrstruly@mylaptop (0xb7a99398)     debug2: key: /home/yrstruly/.ssh/id_dsa ((nil))     debug2: key: /home/yrstruly/.ssh/id_ecdsa ((nil))     debug1: Authentications that can continue: publickey,keyboard-interactive     debug3: start over, passed a different list publickey,keyboard-interactive     debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password     debug3: authmethod_lookup publickey     debug3: remaining preferred: keyboard-interactive,password     debug3: authmethod_is_enabled publickey     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /home/yrstruly/.ssh/id_rsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Server accepts key: pkalg ssh-rsa blen 279     debug2: input_userauth_pk_ok: fp 0e:d0:ba:5c:c1:39:a9:c7:7b:c4:b7:11:87:33:b7:d7     debug3: sign_and_send_pubkey: RSA 0e:d0:ba:5c:c1:39:a9:c7:7b:c4:b7:11:87:33:b7:d7     debug1: Authentication succeeded (publickey).     Authenticated to myserver ([10.0.140.33]:22).     debug1: channel 0: new [client-session]     debug3: ssh_session2_open: channel_new: 0     debug2: channel 0: send open     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     debug2: callback start     debug2: x11_get_proto: /usr/bin/xauth -f /tmp/ssh-gMzJTOiJ3041/xauthfile generate :0.0 MIT-MAGIC-COOKIE-1 untrusted timeout 1200 2>/dev/null     debug2: x11_get_proto: /usr/bin/xauth -f /tmp/ssh-gMzJTOiJ3041/xauthfile list :0.0 2>/dev/null     debug1: Requesting X11 forwarding with authentication spoofing.     debug2: channel 0: request x11-req confirm 1     debug2: client_session2_setup: id 0     debug2: fd 3 setting TCP_NODELAY     debug1: Sending environment.     debug3: Ignored env PWD     debug3: Ignored env DISPLAY     debug3: Ignored env TERM     debug3: Ignored env TERMCAP     debug3: Ignored env COLUMNS     debug3: Ignored env EMACS     debug3: Ignored env INSIDE_EMACS     debug3: Ignored env _     debug3: Ignored env VENV_DIR     debug3: Ignored env VIRTUALENVWRAPPER_LOG_DIR     debug3: Ignored env VIRTUALENVWRAPPER_HOOK_DIR     debug3: Ignored env WORKON_HOME     debug3: Ignored env VIRTUALENVWRAPPER_PROJECT_FILENAME     debug3: Ignored env RSYNC_GLOBAL_INCLUDES     debug3: Ignored env RSYNC_GLOBAL_EXCLUDES     debug3: Ignored env RSYNC_PARTIAL_DIR     debug3: Ignored env RSYNC_DIR     debug3: Ignored env CVSEDITOR     debug3: Ignored env EDITOR     debug3: Ignored env GIT_PAGER     debug3: Ignored env LESS     debug3: Ignored env PAGER     debug3: Ignored env PERL_RL     debug3: Ignored env HISTCONTROL     debug3: Ignored env HISTFILESIZE     debug3: Ignored env HISTFILE     debug3: Ignored env SAVEHIST     debug3: Ignored env HISTSIZE     debug3: Ignored env LSCOLORS     debug3: Ignored env perld     debug1: Sending env LC_ALL = en_US.utf8     debug2: channel 0: request env confirm 0     debug3: Ignored env LANGUAGE     debug3: Ignored env ZSHVARDIR     debug3: Ignored env ZDOTDIROS     debug3: Ignored env ZDOTDIRLOCAL     debug3: Ignored env ZDOTDIR     debug3: Ignored env OLDPWD     debug3: Ignored env SHLVL     debug3: Ignored env GPG_AGENT_INFO     debug3: Ignored env XDG_SESSION_PATH     debug3: Ignored env USER     debug3: Ignored env HOME     debug3: Ignored env SSH_AUTH_SOCK     debug3: Ignored env PATH     debug3: Ignored env XDG_CURRENT_DESKTOP     debug3: Ignored env SESSION_MANAGER     debug3: Ignored env SSH_AGENT_PID     debug3: Ignored env WINDOWID     debug3: Ignored env XDG_SESSION_COOKIE     debug3: Ignored env XDG_DATA_DIRS     debug3: Ignored env UBUNTU_MENUPROXY     debug3: Ignored env DBUS_SESSION_BUS_ADDRESS     debug3: Ignored env GNOME_DESKTOP_SESSION_ID     debug3: Ignored env GNOME_KEYRING_CONTROL     debug3: Ignored env GDMSESSION     debug3: Ignored env DEFAULTS_PATH     debug3: Ignored env DESKTOP_SESSION     debug3: Ignored env COLORTERM     debug3: Ignored env XAUTHORITY     debug3: Ignored env GNOME_KEYRING_PID     debug3: Ignored env MANDATORY_PATH     debug3: Ignored env LOGNAME     debug1: Sending env LANG = en_US.utf8     debug2: channel 0: request env confirm 0     debug3: Ignored env XDG_CONFIG_DIRS     debug3: Ignored env XDG_SEAT_PATH     debug3: Ignored env SHELL     debug3: Ignored env WINDOW     debug3: Ignored env STY     debug3: Ignored env LD_LIBRARY_PATH     debug1: Sending command: xlogo     debug2: channel 0: request exec confirm 1     debug2: callback done     debug2: channel 0: open confirm rwindow 0 rmax 32768     debug2: channel_input_status_confirm: type 99 id 0     debug2: X11 forwarding request accepted on channel 0     debug2: channel 0: rcvd adjust 2097152     debug2: channel_input_status_confirm: type 99 id 0     debug2: exec request accepted on channel 0     debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384     debug1: client_request_x11: request from ::1 51763     debug2: fd 7 setting O_NONBLOCK     debug3: fd 7 is O_NONBLOCK     debug1: channel 1: new [x11]     debug1: confirm x11     debug2: X11 connection uses different authentication protocol.     X11 connection rejected because of wrong authentication.     debug2: X11 rejected 1 i0/o0     debug2: channel 1: read failed     debug2: channel 1: close_read     debug2: channel 1: input open -> drain     debug2: channel 1: ibuf empty     debug2: channel 1: send eof     debug2: channel 1: input drain -> closed     debug2: channel 1: write failed     debug2: channel 1: close_write     debug2: channel 1: output open -> closed     debug2: X11 closed 1 i3/o3     debug2: channel 1: send close     debug2: channel 1: rcvd close     debug2: channel 1: is dead     debug2: channel 1: garbage collecting     debug1: channel 1: free: x11, nchannels 2     debug3: channel 1: status: The following connections are open:       #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)       #1 x11 (t7 r3 i3/0 o3/0 fd 7/7 cc -1)          debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384     debug1: client_request_x11: request from ::1 51764     debug2: fd 7 setting O_NONBLOCK     debug3: fd 7 is O_NONBLOCK     debug1: channel 1: new [x11]     debug1: confirm x11     debug2: X11 connection uses different authentication protocol.     X11 connection rejected because of wrong authentication.     debug2: X11 rejected 1 i0/o0     debug2: channel 1: read failed     debug2: channel 1: close_read     debug2: channel 1: input open -> drain     debug2: channel 1: ibuf empty     debug2: channel 1: send eof     debug2: channel 1: input drain -> closed     debug2: channel 1: write failed     debug2: channel 1: close_write     debug2: channel 1: output open -> closed     debug2: X11 closed 1 i3/o3     debug2: channel 1: send close     debug2: channel 1: rcvd close     debug2: channel 1: is dead     debug2: channel 1: garbage collecting     debug1: channel 1: free: x11, nchannels 2     debug3: channel 1: status: The following connections are open:       #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)       #1 x11 (t7 r3 i3/0 o3/0 fd 7/7 cc -1)          debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384     debug1: client_request_x11: request from ::1 51765     debug2: fd 7 setting O_NONBLOCK     debug3: fd 7 is O_NONBLOCK     debug1: channel 1: new [x11]     debug1: confirm x11     debug2: X11 connection uses different authentication protocol.     X11 connection rejected because of wrong authentication.     debug2: X11 rejected 1 i0/o0     debug2: channel 1: read failed     debug2: channel 1: close_read     debug2: channel 1: input open -> drain     debug2: channel 1: ibuf empty     debug2: channel 1: send eof     debug2: channel 1: input drain -> closed     debug2: channel 1: write failed     debug2: channel 1: close_write     debug2: channel 1: output open -> closed     debug2: X11 closed 1 i3/o3     debug2: channel 1: send close     debug2: channel 1: rcvd close     debug2: channel 1: is dead     debug2: channel 1: garbage collecting     debug1: channel 1: free: x11, nchannels 2     debug3: channel 1: status: The following connections are open:       #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)       #1 x11 (t7 r3 i3/0 o3/0 fd 7/7 cc -1)          debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384     debug1: client_request_x11: request from ::1 51766     debug2: fd 7 setting O_NONBLOCK     debug3: fd 7 is O_NONBLOCK     debug1: channel 1: new [x11]     debug1: confirm x11     debug2: X11 connection uses different authentication protocol.     X11 connection rejected because of wrong authentication.     debug2: X11 rejected 1 i0/o0     debug2: channel 1: read failed     debug2: channel 1: close_read     debug2: channel 1: input open -> drain     debug2: channel 1: ibuf empty     debug2: channel 1: send eof     debug2: channel 1: input drain -> closed     debug2: channel 1: write failed     debug2: channel 1: close_write     debug2: channel 1: output open -> closed     debug2: X11 closed 1 i3/o3     debug2: channel 1: send close     debug2: channel 1: rcvd close     debug2: channel 1: is dead     debug2: channel 1: garbage collecting     debug1: channel 1: free: x11, nchannels 2     debug3: channel 1: status: The following connections are open:       #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)       #1 x11 (t7 r3 i3/0 o3/0 fd 7/7 cc -1)          debug2: channel 0: rcvd ext data 42     debug2: channel 0: rcvd eof     debug2: channel 0: output open -> drain     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0     debug2: channel 0: rcvd eow     debug2: channel 0: close_read     debug2: channel 0: input open -> closed     debug2: channel 0: rcvd close     debug3: channel 0: will not send data after close     debug2: channel 0: obuf_empty delayed efd 6/(42)     Error: Can't open display: localhost:10.0     debug2: channel 0: written 42 to efd 6     debug3: channel 0: will not send data after close     debug2: channel 0: obuf empty     debug2: channel 0: close_write     debug2: channel 0: output drain -> closed     debug2: channel 0: almost dead     debug2: channel 0: gc: notify user     debug2: channel 0: gc: user detached     debug2: channel 0: send close     debug2: channel 0: is dead     debug2: channel 0: garbage collecting     debug1: channel 0: free: client-session, nchannels 1     debug3: channel 0: status: The following connections are open:       #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)          Transferred: sent 3152, received 2728 bytes, in 0.4 seconds     Bytes per second: sent 8679.2, received 7511.7     debug1: Exit status 1


title: Interacting with X applications programmatically

text: I have an application which is built using GTK+. The application has a very simple interface. When started, the same window always opens, with a few input controls. We want to write a script to fill in text in a couple fields, check a check box, then click a button. Pretty simple, and would be easy to do if a command- line version of the app were available (but it isn't). What's the best way to approach interacting with an X application programmatically?


title: Can't run su after changing permissions to su file

text: I am running Linux Slackware 14.0. I wanted to allow to do `su` only to the members of wheel group, so I modified the permissions of `/bin/su` and `/usr/bin/sudo` files to this:               bash-4.2# ls -la /bin/su     -rws--s--- 1 root wheel 59930 Sep 14  2012 ./su          bash-4.2# ls -la ./sudo     -rws--s--- 1 root wheel 107220 Jun 29 2012 ./sudo      Now when I am a member of wheel group and run `su`, it promts for password, I enter it. No errors are shown, but doesn't switch me to root. Probably, I set some permissions wrong?


title: 'df' command doesn't list /home directory

text: In the book I am reading, the output of `df` command is shown like this:               Filesystem 1K-blocks     Used Available Use% Mounted on     /dev/sda2   15115452  5012392   9949716  34% /     /dev/sda5   59631908 26545424  30008432  47% /home     /dev/sda1     147764    17370    122765  13% /boot     tmpfs         256856        0    256856   0% /dev/shm      But when I run the same command (whilst passing the `-h` parameter) on my Ubuntu server (VirtualBox VM), the output is like this:               Filesystem          Size  Used Avail Use% Mounted on     /dev/mapper/a-root  4.2G  1.1G  3.0G  26% /     udev                741M  4.0K  741M   1% /dev     tmpfs               300M  268K  300M   1% /run     none                5.0M     0  5.0M   0% /run/lock     none                750M     0  750M   0% /run/shm     /dev/sda1           228M   27M  190M  13% /boot      What I want to know is, why is `/home` directory missing? And what exactly is the criteria that the listed directories fulfill? (I mean, `/` is listed, but not `/home`. But `/run` is there, and also `/run/lock` and `/run/shm`. Why the bias?)


title: How can I efficiently dereference all symlinks in `find` *output* filenames?

text: I need paths to be both fully resolved and relative to a given directory. This must be done efficiently, since the number of paths is often greater than 100,000. **Situation** : I have directories which contain _mostly_ symlinks to other directories, as in               foo      123 -> ../baz/123      896 -> ../bar/896      (Note that foo does NOT contain only symlinks to directories, it also contains ordinary files which I have to catch too.) These symlinked directories contain files. . I want to get a list of those files, in the form               baz/123/some.file     bar/123/other.file      That is, when 'find' finds a symlink, I want it to dereference that path **when it is reporting the contents**. So I am running this command from the parent directory of foo:               find -L foo -type f      But that doesn't work. Honestly, you would expect the `-L` option, which claims to 'follow symbolic links', to implement this behaviour. But, its **actual** behaviour is to look _into_ the contents of those directories, but report files inside them with their non-dereferenced names, ie. the results look like               foo/baz/123/some.file     foo/bar/896/another.file      The results will be used for set operations against a list of filepaths that are all 1. _fully resolved_ and 2. _relative to foo's parent directory_ , so every result must also fulfil that criteria. I can guarantee for these purposes that all links are resolvable ie. none are circular or excessively deep. Most, but not all links, point at directories rather than files. At the moment, the best I can do is a Python script that rewrites any non- dereferenced paths into resolved ones. But since the numbers of files involved is in the **100000+** range, this is not very practical (and rather ridiculous, since `find` already had bothered to dereference them, it just didn't return the dereferenced paths). (EDIT: See my comment on this post -- I've found a non-solution (in that it does the job efficiently but in the wrong way -- executing external commands).) I'm convinced that I should be able to do this task just with `find` and no external commands, but I'm not finding the man page enlightening here -- none of `-L`, `-H`, `-P`, `-follow` have the correct behaviour, nor does `-printf %l`. `-exec` is out for obvious reasons -- it is not internal to `find`. Any ideas? EDIT 2: at this point, Stephane has convinced me that there is no particularly good reason why find **would** have this functionality internally, so I'm willing to accept any reasonably efficient answer.


title: What's causing VirtualBox OSE to hang my machine?

text: I'm using VirtualBox OSE and recently, when I run Ubuntu 10.10 on it, my machine tends to hang, forcing me to hard-reset it (not good). How do I start finding where the problem is? Here's the last line from " **/var/log/syslog** ", before the reset:               Jan 27 12:11:22 debian kernel: [  193.400230] warning: `VirtualBox' uses 32-bit capabilities (legacy support in use)      **notes** :   * VirtualBox OSE is version **3.2.10**   * I use 32-bit **2.6.37** kernel on Debian Squeeze   * I can't reproduce this problem when using Fedora 14 VM


title: Downloading the Google search results page using Linux commands

text: When I try using wget command, the page which gets downloaded contains only the lefthand side part. I want the right-hand side part of the search-results page, which is called Knowledge Graph. Can anybody help me out in this please?


title: Running 'make test' on an individual module for Python 2.7.4 build

text: I am working on building Python 2.7.4 on CentOS 6.4. When running the `make test` step, the `test_gdb` step fails, and I would like to get some more info as to why. Build commands I'm running:               ./configure --prefix=/usr/local/python-2.7.4 --enable-ipv6 --enable-unicode=ucs4 --enable-shared     make     make test      Output of make test: > ... test test_gdb failed -- multiple errors occurred; run in verbose mode > for details ... So basically, I'm trying to figure out how to run the `test_gdb` test separately and in verbose mode. Sounds like I should use `regrtest.py`, but I seem to get `invalid syntax` with the various options I've tried. Any ideas?               banjer@somehost:/usr/local/src/Python-2.7.4> python Lib/test/regrtest.py -v test_gdb       File "Lib/test/regrtest.py", line 679         'test_support',                       ^     SyntaxError: invalid syntax


title: How can I set up a samba share accessible via windows 7 to a specific point on the server?

text: A samba share is set up according to the directions here: https://wiki.archlinux.org/index.php/Samba The /etc/samba/smb.conf file looks like this (after some hacking around from googling):               # This is the main Samba configuration file. You should read the     # smb.conf(5) manual page in order to understand the options listed     # here. Samba has a huge number of configurable options (perhaps too     # many!) most of which are not shown in this example     #     # Any line which starts with a ; (semi-colon) or a # (hash)      # is a comment and is ignored. In this example we will use a #     # for commentry and a ; for parts of the config file that you     # may wish to enable     #     # NOTE: Whenever you modify this file you should run the command "testparm"     # to check that you have not made any basic syntactic errors.      #     #======================= Global Settings =====================================     [global]          # workgroup = NT-Domain-Name or Workgroup-Name        workgroup = MYGROUP          # server string is the equivalent of the NT Description field        server string = Samba Server          # This option is important for security. It allows you to restrict     # connections to machines which are on your local network. The     # following example restricts access to two C class networks and     # the "loopback" interface. For more examples of the syntax see     # the smb.conf man page     ;   hosts allow = 192.168.1. 192.168.2. 127.          # if you want to automatically load your printer list rather     # than setting them up individually then you'll need this        printcap name = /etc/printcap        load printers = yes          # It should not be necessary to spell out the print system type unless     # yours is non-standard. Currently supported print systems include:     # bsd, sysv, plp, lprng, aix, hpux, qnx     ;   printing = bsd          # Uncomment this if you want a guest account, you must add this to /etc/passwd     # otherwise the user "nobody" is used     ;  guest account = pcguest          # this tells Samba to use a separate log file for each machine     # that connects        log file = /var/log/samba/%m.log          # Put a capping on the size of the log files (in Kb).        max log size = 50          # Security mode. Most people will want user level security. See     # security_level.txt for details.        security = user     # Use password server option only with security = server     ;   password server = <NT-Server-Name>          # Password Level allows matching of _n_ characters of the password for     # all combinations of upper and lower case.     ;  password level = 8     ;  username level = 8          # You may wish to use password encryption. Please read     # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.     # Do not enable this option unless you have read those documents     ;  encrypt passwords = yes     ;  smb passwd file = /etc/samba/smbpasswd          # The following are needed to allow password changing from Windows to     # update the Linux sytsem password also.     # NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.     # NOTE2: You do NOT need these to allow workstations to change only     #        the encrypted SMB passwords. They allow the Unix password     #        to be kept in sync with the SMB password.     ;  unix password sync = Yes     ;  passwd program = /usr/bin/passwd %u     ;  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*          # Unix users can map to different SMB User names     ;  username map = /etc/samba/smbusers          # Using the following line enables you to customise your configuration     # on a per machine basis. The %m gets replaced with the netbios name     # of the machine that is connecting     ;   include = /etc/samba/smb.conf.%m          # Configure Samba to use multiple interfaces     # If you have multiple network interfaces then you must list them     # here. See the man page for details.     ;   interfaces = 192.168.12.2/24 192.168.13.2/24           # Configure remote browse list synchronisation here     #  request announcement to, or browse list sync from:     #   a specific host or from / to a whole subnet (see below)     ;   remote browse sync = 192.168.3.25 192.168.5.255     # Cause this host to announce itself to local subnets here     ;   remote announce = 192.168.1.255 192.168.2.44          # Browser Control Options:     # set local master to no if you don't want Samba to become a master     # browser on your network. Otherwise the normal election rules apply     ;   local master = no          # OS Level determines the precedence of this server in master browser     # elections. The default value should be reasonable     ;   os level = 33          # Domain Master specifies Samba to be the Domain Master Browser. This     # allows Samba to collate browse lists between subnets. Don't use this     # if you already have a Windows NT domain controller doing this job     ;   domain master = yes           # Preferred Master causes Samba to force a local browser election on startup     # and gives it a slightly higher chance of winning the election     ;   preferred master = yes          # Use only if you have an NT server on your network that has been     # configured at install time to be a primary domain controller.     ;   domain controller = <NT-Domain-Controller-SMBName>          # Enable this if you want Samba to be a domain logon server for      # Windows95 workstations.      ;   domain logons = yes          # if you enable domain logons then you may want a per-machine or     # per user logon script     # run a specific logon batch file per workstation (machine)     ;   logon script = %m.bat     # run a specific logon batch file per username     ;   logon script = %U.bat          # Where to store roving profiles (only for Win95 and WinNT)     #        %L substitutes for this servers netbios name, %U is username     #        You must uncomment the [Profiles] share below     ;   logon path = \\%L\Profiles\%U          # All NetBIOS names must be resolved to IP Addresses     # 'Name Resolve Order' allows the named resolution mechanism to be specified     # the default order is "host lmhosts wins bcast". "host" means use the unix     # system gethostbyname() function call that will use either /etc/hosts OR     # DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf     # and the /etc/resolv.conf file. "host" therefore is system configuration     # dependant. This parameter is most often of use to prevent DNS lookups     # in order to resolve NetBIOS names to IP Addresses. Use with care!     # The example below excludes use of name resolution for machines that are NOT     # on the local network segment     # - OR - are not deliberately to be known via lmhosts or via WINS.     ; name resolve order = wins lmhosts bcast          # Windows Internet Name Serving Support Section:     # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server     ;   wins support = yes          # WINS Server - Tells the NMBD components of Samba to be a WINS Client     #   Note: Samba can be either a WINS Server, or a WINS Client, but NOT both     ;   wins server = w.x.y.z          # WINS Proxy - Tells Samba to answer name resolution queries on     # behalf of a non WINS capable client, for this to work there must be     # at least one  WINS Server on the network. The default is NO.     ;   wins proxy = yes          # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names     # via DNS nslookups. The built-in default for versions 1.9.17 is yes,     # this has been changed in version 1.9.18 to no.        dns proxy = no           # Case Preservation can be handy - system default is _no_     # NOTE: These can be set on a per share basis     ;  preserve case = no     ;  short preserve case = no     # Default case is normally upper case for all DOS files     ;  default case = lower     # Be very careful with case sensitivity - it can break things!     ;  case sensitive = no          #============================ Share Definitions ==============================     [homes]        comment = Home Directories        browseable = no        writable = yes          # Un-comment the following and create the netlogon directory for Domain Logons     ; [netlogon]     ;   comment = Network Logon Service     ;   path = /home/netlogon     ;   guest ok = yes     ;   writable = no     ;   share modes = no               # Un-comment the following to provide a specific roving profile share     # the default is to use the user's home directory     ;[Profiles]     ;    path = /home/profiles     ;    browseable = no     ;    guest ok = yes               # NOTE: If you have a BSD-style print system there is no need to      # specifically define each individual printer     [printers]        comment = All Printers        path = /var/spool/samba        browseable = no     # Set public = yes to allow user 'guest account' to print        guest ok = no        writable = no        printable = yes          # This one is useful for people to share files     ;[tmp]     ;   comment = Temporary file space     ;   path = /tmp     ;   read only = no     ;   public = yes          # A publicly accessible directory, but read only, except for people in     # the "staff" group     ;[public]     ;   comment = Public Stuff     ;   path = /home/samba     ;   public = yes     ;   read only = yes     ;   write list = @staff          # Other examples.      #     # A private printer, usable only by fred. Spool data will be placed in fred's     # home directory. Note that fred must have write access to the spool directory,     # wherever it is.     ;[fredsprn]     ;   comment = Fred's Printer     ;   valid users = fred     ;   path = /homes/fred     ;   printer = freds_printer     ;   public = no     ;   writable = no     ;   printable = yes          # A private directory, usable only by fred. Note that fred requires write     # access to the directory.     ;[fredsdir]     ;   comment = Fred's Service     ;   path = /usr/somewhere/private     ;   valid users = fred     ;   public = no     ;   writable = yes     ;   printable = no          # a service which has a different directory for each machine that connects     # this allows you to tailor configurations to incoming machines. You could     # also use the %u option to tailor it by user name.     # The %m gets replaced with the machine name that is connecting.     ;[pchome]     ;  comment = PC Directories     ;  path = /usr/pc/%m     ;  public = no     ;  writable = yes          # A publicly accessible directory, read/write to all users. Note that all files     # created in the directory by users will be owned by the default user, so     # any user with access can delete any other user's files. Obviously this     # directory must be writable by the default user. Another user could of course     # be specified, in which case all files would be owned by that user instead.          ;[public]     ;   path = /media/seagate/files/     ;   public = yes     ;   only guest = yes     ;   writable = yes     ;   printable = no               # The following two entries demonstrate how to share a directory so that two     # users can place files there that will be owned by the specific users. In this     # setup, the directory should be writable by both users and should have the     # sticky bit set on it to prevent abuse. Obviously this could be extended to     # as many users as required.     ;[myshare]     ;   comment = Mary's and Fred's stuff     ;   path = /usr/somewhere/shared     ;   valid users = mary fred     ;   public = no     ;   writable = yes     ;   printable = no     ;   create mask = 0765               [global]        usershare path = /var/lib/samba/usershares        usershare max shares = 100        usershare allow guests = yes        usershare owner only = False          follow symlinks = yes     wide links = yes     unix extensions = no      This allows access from Windows 7 (under the map network drive function) and currently, the files that are desired are accessed by making a ln -s from a folder to the /media folder. How can I simply mount the share to be not to the user's folder, but /media? See image for illustration below: ![example](http://i.stack.imgur.com/jUkqz.png)


title: How to fix "org.freedesktop.PolicyKit1" error when unmounting USBs in Thunar?

text: I recently installed Debian Wheezy with XFce4. Whenever I try to unmount a USB, I get this error message:               GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided      How can I fix this?


title: Redirection of output from the terminal to a file in unix/linux

text: I am facing a slight problem in my project. I have a menu driven program and one of my options is _Display all_ , which displays all the entries from a map using a loop. The display is on the terminal and I am not being able to view all the entries because it only shows the last few entries before my prompt comes again. I want the output to be redirected to a file so that I can use more commands and give the user a view accordingly. Please suggest few commands or code.


title: Debian, virtualenv, IPython notebook and matplotlib inline plots

text: I have been using IPython notebook on both OSX and Windows 7 for a while. Now I'm trying to create a minimal system for me to work on Debian 7 (Wheezy). I installed:   * LXDE    * Python2.7    * python-dev    * python-pip then did a               apt-get build-dep python-matplotlib      Then did a               pip install pip --upgrade     pip install virtualenv      then in virtualenv, installed via pip:   * numpy    * pandas    * matplotlib    * ipython   * tornado with this, I can run the IPython notebook, but when I plot anything, I only get the object (not the figure), as in               <matplotlib.axes.AxesSubplot at 0x42bf6d0>      I would really like to see the figures. Can anyone help?


title: Specifying a generic interpreter for a program like expect?

text: I am writing expect script which can be used on mulple operating systems but the problem is i can't use `#!/usr/bin/expect` evreywhere so instead i tried to do                #!`which expect`      at the top but it failed               [sesiv@itseelm-lx4151 ~]$ ./sendcommand     -bash: ./sendcommand: `which: bad interpreter: No such file or directory      any solution for this.


title: Wrapper script to list sourced/executed files

text: Is it possible to write a command which runs `my.sh` and _prints every path sourced or executed by this script recursively_ - That is, _without altering the original code_ at all? The idea is to verify which files are actually used for a specific execution path, without time-consuming and error-prone manual tracing. For example:               $ > my.sh cat <<'EOF'     #!/bin/sh     . ./foo.sh     EOF     $ > foo.sh cat <<'EOF'     #!/bin/sh     ./bar.sh     EOF     $ > bar.sh cat <<'EOF'     #!/bin/sh     echo bar     EOF     $ chmod u+x my.sh bar.sh     $ magic command     [...]     ./my.sh     ./foo.sh     ./bar.sh


title: View Script Over SSH?

text: A friend, using a remote machine, SSHed to my machine and ran the following python script: * * * while (1): ....print "hello world" * * * (this script simply prints 'hello world' continuously). I am now logged in to my machine. How can I see the output of the script my friend was running? * * * if it helps, I can 'spot' the script my friend is using: me@home:~$ ps aux | grep justprint.py **friend 7494 12.8 0.3 7260 3300 ? Ss 17:24 0:06 python TEST_AREA/justprint.py** friend 7640 0.0 0.0 3320 800 pts/3 S+ 17:25 0:00 grep --color=auto just * * * what steps should I take in order to view the "hello world" messages on my screen?


title: How to pass the output of one command as the command-line argument to another?

text: So I have a script that, when I give it two addresses, will search two HTML links:               echo http://maps.google.be/maps?saddr\=$1\&daddr\=$2 | sed 's/ /%/g'      I want to send this to `wget` and then save the output in a file called `temp.html`. I tried this, but ut doens't work. Can someone explain why and/or give me a solution please?               #!/bin/bash     url = echo http://maps.google.be/maps?saddr\=$1\&daddr\=$2 |  sed 's/ /%/g'     wget $url


title: How can I customize the look of Thunderbird's mailbox list, message list, and headers?

text: Mozilla Thunderbird's message list, mailbox list, and headers use a font size that is so large, I can barely see any content in the message preview pane. I'd like to reduce these to 10px, and reduce the headers to 8px or less. How can I do this?


title: Proper location to install services

text: I originally posted this question over on AskUbuntu but it didn't get any traction so I'll ask here. In ubuntu or linux in general is there a "correct" location to install services that you download from the internet and want to run. I would like to have services such as redis or ventrilo auto run but to me it doesn't make sense to put them in the ~/redis or ~/ventrilo directories since they aren't user specific. Keep in mind that I'm relatively new to the linux world having been a .Net developer for about 4 years now.


title: Copy the file created newly in UNIX

text: I have a directory where so many files created daily and need to copy the new files which were generated. And all files will be created with starting name abc_ Ex:I have a file abc_0520123.pdf on the next day two files were created abc_0521234.pdf and abc_0521254.pdf now I want to copy only these two files created newly. Please help me how can I compare old files with new one and to copy them.


title: Permisison/Ownership issue with secondary FTP account

text: I have Centos 6.5 final. I have chroot setup and working properly and I also installed vsftpd. I now need to create a new user named `extDeveloper` and give this user access to a specific account. I setup the user using (adding the new account to an existing account):               adduser extDeveloper -d /var/www/vhosts/domain.com     passwd extDeveloper       I also added this user to the apache group so they could access the files. The issue I have is the extDeveloper user is not able to write new files. I thought about making the group writable but then was concerned over security for this. What I am trying to do is create a secondary account (eventually more for this purpose) that I can give access to a few domains. Currently I only need 1 domain but this user may need to access more. I need the user to modify files and push new files but I need these files associated to the proper account:group. My accounts are setup using `domain_user:apache` where apache only has read access. Isn't it bad to let apache have write access? Is the setup I want possible? I assume so as I have been able to have multiple FTP accounts on other servers and they wrote files back using the proper permissions. Rackspace told me this is not how Linux works... I am learning as I go so any assistance or push in the right direction is very much appreciated. Thanks


title: how to stop kernel threads preempting real time user space processes?

text: I created some processes in user space and tried to visualize its working in **kernelshark** with the trace recorded using **trace-cmd.** But kernel processes like the ones shown below are preempting my processes with real-time priority 98. I use the scheduler SCHED_FIFO for the processes that I have created in user space.               PID  PPID CLS PRI RTPRIO CMD          359     1 TS   19      - mount.ntfs /dev/disk/by-uuid/AC72763B72760A7A /root     366     2 TS   39      - [loop0]      What can I do to run my processes uninterrupted by these kind of kernel processes?


title: How to migrate from Proxmox to VMWare?

text: I am wondering how it is possible to migrate a full hardware VM in Proxmox (qemu) to a full hardware VM in VMWare (vmdk). I have been searching all over the place, and it seems almost impossible to find anything at all. The Linux kernel version from the Proxmox VM is Linux 2.6.32-19-pve. Anyone got any ideas, or even better experience, with migrating from Proxmox -> VMWare?


title: Application in terminal still running but not directly accessible

text: > **Possible Duplicate:**   >  How to suspend and bring a background process to foreground I have kind of an odd problem which I haven't encountered before. Here's what I did: I started an application with `./myApp`. No command line arguments, no `&` to make it run in background. Unfortunately, my system froze at some point. No access via the GUI was possible, so I decided to first stop all CPU-intensive tasks. So I brought up a `tty` (Shortcut `Ctrl` + `Alt` + `F2` on Ubuntu) and did `kill -STOP pid`, after getting the right `pid` of `myApp` with `top`. Luckily, after some extra time, the system became unfrozen. So I restarted the process with `kill -CONT pid`. But here's what I see in the terminal:               [2]+ Stopped  ./myApp      And now the terminal is in the state as if the application isn't running (i.e. I can do `ls` or whatever I like), but the process manager still reports the application to be running. I'm very glad it does, because I would lose 34 hours of computing time (and yes, it's an extremely bad app; not written by me, of course), since there is no output at all to file. When the heavy task of the application is finished (expectedly in a couple of hours), I need to enter a specific task inside of the application to make it write to file (it is somewhat of a custom shell prompting for input, so I guess `cin` is in use). So the question is: How to bring me back to the application such that I see its output and can interact with it? If not possible: is it possible to stream into the app and initiate the required command without restarting the app? **Update** The application does still output to the exact same terminal. FYI, as you might need it: I'm running Ubuntu x86 with kernel 3.2.0-36


title: How to ssh to a server using another server with key from the second server?

text: How to configure ssh to imitate this:               ssh server1-user-name@server1.net -i /path/to/.ssh/server-1-ssh-key -t ssh server2-user-name@10.0.0.10 -i /home/server1-user-name/.ssh/server2-ssh-key      When I execute               ssh server2      Explanation:   * I'm login to server1.net with a key from my local machine (`/path/to/.ssh/server-1-ssh-key`)              ssh server1-user-name@server1.net -i /path/to/.ssh/server-1-ssh-key        * then I log in to a server with the following IP 10.0.0.10. To do this I use the key (`/home/server1-user-name/.ssh/server2-ssh-key`), which is stored on server-1 How should the ssh configuration look like for this case on my local machine? I tried the following configuration:               Host server2       Hostname 10.0.0.10       User server2-user-name       ForwardAgent yes       ProxyCommand ssh -i /path/to/.ssh/server-1-ssh-key -W %h:%p      But it does not work.


title: USB modalias. Meaning of numeric values

text: For the USB modaliases, I know that the values corresponding to the device's vendor and product ids can be found here: http://www.linux-usb.org/usb.ids Which online resources and/or kernel source files, I could use to find the meaning for the rest of the ids: d, dc, dsc, dp, ic, isc, ip, in? For example, I've got this modalias:               usb:v0525pA4A5d0001dc02dsc00dp00ic02isc02ip01in00      Finding the meaning of vendor id (0525) and product id (a4a5) is easy using aforementioned web-page. But I have no idea where to look up the rest of the ids. Update: I understand what the letters mean (v, p, d, dc, etc). But the numeric values are in question. Update2: Take this article for example. Among other things the author says that "The 0900 device class/subclass means hub" and that "Interface class 0E01 is video control". But where does this knowledge come from? In my case: device class/subclass (dc:dsc) is 0200. interface class/subclass (ic:isc) is 0202. What does these numbers mean? Where to lookup them?


title: Kernel panic not syncing : Attempted to kill init

text: OEL 5.9 (Tikanga) 2.6.18-371.6.1.0.1.el5 On boot I get the following errors: > ... > > exec of init (/sbin/init) failed!!!: No such file of directory > > Kernel panic - not syncing - Attempted to kill init! > > ... After this I booted to the OEL 5.9 CD in recovery mode. I tried to chroot to `/mnt/sysimage` with the following error: > chroot: cannot run '/bin/sh' : No such file or directory If I cd to `/mnt/sysimage` all of my files are there in `/bin` and `/sbin` (all files appear to be OK permissions and else). I am even able to open a new shell env by executing `/mnt/sysimage/bin/sh` without any issue.


title: Find records dated before today

text: how to find record form bellows data having "Last Date" before today's date. i.e : if today date is 09-04-2014 then finding record having "Last Date" before 09-04-2014 -               Email ID : abc@domain.com      Last Date : 30-04-2014     --     Email ID : abc@domain.com      Last Date : 18-03-2014     --     Email ID : abc@domain.com      Last Date : 18-02-2013     --     Email ID : abc@domain.com      Last Date : 18-05-2015     --     Email ID : abc@domain.com      Last Date : 01-05-2012     --     Email ID : abc@domain.com      Last Date : 09-04-2014      Expected output will be:               Email ID : abc@domain.com      Last Date : 18-03-2014     --     Email ID : abc@domain.com      Last Date : 18-02-2013     --     Email ID : abc@domain.com      Last Date : 01-05-2012


title: Is it possible to get uid table in Linux?

text: I'm a student in a university and I can `finger` and `id` all users (students etc) through SSH. Here is the id command               e147200@beluga:~$ id e201634     uid=22678(e201634) gid=3561(stat_bs) groups=3561(stat_bs)      Here I can see that the student with id e201634 is agraduate student (bs) at Statistics department (stat). Is there a way to download this gid (or groups) table?               3561 stat_bs     3562 stat_ms     3611 chem_bs     3687 biol_bs     ...


title: Intel Advanced-N 6235 wireless monitor mode problem

text: As far as I know, iwlwifi drivers (and this particular wireless card) support monitor mode. The only requirement is to install the latest driver from http://wireless.kernel.org/en/users/Drivers/iwlwifi (in this case, _iwlwifi-6000g2b-ucode-18.168.6.1_ will do the trick). The scenario is the following: BackTrack LiveCD booted in a laptop with this wireless card. The wireless does not work until the above driver is downloaded and loaded into the kernel via `modprobe`. After that, wireless do work (can connect to different networks, being stable, etc). However, when trying to activate monitor mode (`airmon-ng start wlan0`), it will never activate _mon0_ (monitor interface). I have some experience on this with an Alfa 1W and I was expecting a similar result with this card, but it seems that I am missing something, or maybe the drivers does not support monitor mode (using the wrong ones?). I have been googling around but I did not found any specific solution, so hopefully someone can suggest some workaround!


title: rename files with rename command

text: Please advice what is wrong with the following command               find /tmp/dir -name "* *" -type f | rename 's/*/fixed_/g'      remark - I prefer to do that with one command not loop syntax What I want is to rename all the files under /tmp/dir , by adding the name **fixed_** before each file For example ( the files )               Fevc.txt     Ddve.txt      Should rename to:               fixed_Fevc.txt     fixed_Ddve.txt


title: Linux always send ICMP redirect

text: I have several Debian Squeeze (6.0.6 up to date) used as routers.   When a link is down, they send ICMP redirects to local hosts. This is the default behaviour of Debian and several others. So once the link comes back to life, the hosts can't reach it until reboot. I don't want any ICMP redirect to be sent from those routers. I tested `echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects` and `sysctl -w net.ipv4.conf.all.send_redirects=0` and putting `net.ipv4.conf.all.send_redirects=0` into `/etc/sysctl.d/local.conf`   Every of those solution put the right value into `/proc/sys/net/ipv4/conf/all/send_redirects` But...   the kernel keep sending ICMP redirects. Even after a reboot :               $ tcpdump -n -i eth0     00:56:17.186995 IP 192.168.0.254 > 192.168.0.100: ICMP redirect 10.10.13.102 to host 192.168.0.1, length 68      And the routing table of local hosts (Windows computers) are polluted. I can prevent this with netfilter :   `iptables -t mangle -A POSTROUTING -p icmp --icmp-type redirect -j DROP` Any idea about why the usual method doesn't work ?   And how to prevent ICMP redirect to be sent, without using netfilter ?


title: Closing a file descriptor, >&- vs <&-

text: In the bash tutorial I am reading, it says that if you open a file descriptor for reading, i.e.               exec 3< echolist      Then you must close it like this,               exec 3<&-      However, if you open a file descriptor for writing, it must be closed like this:               exec 3>&-      Yet when I look on the internet, I see people opening files and then closing them with this:               exec 3>&-       **NOTE:** when, according to the tutorial, they should be using `exec 3<&1`. So my question is, can all file descriptors be closed via `exec n>&-` where n is the file descriptor number? Regardless if it was opened for reading, writing, or both?


title: Will a running program be killed if I suspend my OS?

text: I am running a program. If I suspend my OS (Ubuntu 12.04) in the middle, will the process of the running program be killed? If not, when I wake up my OS, how can I resume the process? Thanks!


title: Tracing executable without read permissions

text: I found some surprising behavior on Ubuntu 14.04 when using `strace` on an executable, which I do not have read permission on. I wonder if this is a bug, or if some standard mandates this obscure behavior. First let's see what happens when I start an ordinary executable in the background and attach to it. As expected this works:               $ /bin/sleep 100 &     [2] 8078     $ strace -p 8078     Process 8078 attached     restart_syscall(<... resuming interrupted call ...>      Next I try with an executable, which I have no read permissions on:               ---x--x--x 1 root root 26280 Sep  3 09:37 sleep*      Attaching to this running process is not permitted:               $ ./sleep 100 &     [1] 8089     $ strace -p 8089     strace: attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted      This is also what I would expect. Granting execute permission without read permission wouldn't do much good, if I could simply attach a debugger to the process and effectively have read permissions on the executable that way. But if I start the executable under an already traced process, I am permitted to do so:               $ strace ./sleep 100     execve("./sleep", ["./sleep", "100"], [/* 69 vars */]) = 0     brk(0)                                  = 0x9b7a000      This is unexpected for me. Is this a security bug, or is it a feature mandated by a standard?


title: Lock screen w/ slock after a certain time?

text: I am running OpenBox in Arch Linux, how can I set it up so that I can have slock lock my screen after a certain amount of time (with no activity)? Thanks!


title: Job to keep a count of XML files

text: My friend works in a IT company where he is required to keep a count of XML files inside a directory (including subdirectories). However the count using `ls -LR | grep .xml` or similar takes a lot of time as the count of files is in the millions. I was thinking what can be a better approach? Can some kind of background process take care of this, so that whenever there is a new file created or modification time change, it affects the counter (no. of files)?


title: Execute a command for each entry in a file

text: How can I execute a command for file which has address of jar files. The command that I want to execute is `jar xf entry.jar`. I d like to execute that command and sent the outputs to another file. Assume my file contains following entries.               a.jar     b.jar     c.jar      What I want is simply extract these jar files and sent the output to another file.


title: how to touch files like report-07/05/13

text: when I want to touch files like `report-05/07/13` with command `touch report-$(date +%D)` it gives me an error like this: `touch: cannot touch`report-07/05/13': No such file or directory` How can I build one? By the way there is "NO FOLDER" it is JUST THE FILENAME.


title: Change name of em1 to eth0 in Fedora 19?

text: I have already followed the instructions here but it doesn't seem to work, as my ifconfig output still shows the same "em1","em2" and "lo". I just need a way to rename one of these to eth0 in Fedora 19, since other methods dont seem to work. Matlab needs eth0 to activate, and I am stuck.


title: Can I share /usr/local between multiple Linux distributions?

text: I tried Ubuntu 12.04 and based on my understanding I made the following partitions:   * 2GB Swap (I have 2GB of RAM)   * 1GB `/boot`, since I'll be installing different kernel versions (I'm starting kernel development)   * 35GB `/var`   * 40GB `/usr/local`   * 407GB `/home`   * 15GB `/` (root) Now I want to install OpenSUSE 12.2 alongside Ubuntu 12.04. Can I share `/var` and `/usr/local` among the two OSes? I know they are two different distros with different packages, but is there any way I can share the disk space? So that both OSes can have their own `/usr/local` in the same partition or something like that?


title: Grep to search directories for patterns inside a text file

text: I have a file where it contains a list of search patterns (`searchPattern.txt`). Its contents is similar to the contents below where there are 3000+ of them.               123456     234567     345678     .     .     .      What I wanted to do is to use `grep` and search directories using the patterns listed in the file if they exist. It would be similar to this kind of command but instead of one search string there are many and its listed in a file.               grep searchPattern.txt diagnostics*      Although the command above doesn't work its just an idea as to what I wanted to happen. Can this be done with `grep`? If it can't be done can someone suggest a better way to do this?


title: Mac OSX vs Linux Unix-ness

text: So I know that Linux is considered "Unix-like" while OSX _is_ Unix. Why is this? I feel like Linux is much more "Unix-like" than OSX is. What makes OSX more "Unix" than Linux?


title: Find out extension of executable files?

text: When I am building software from source on a GNU+Linux system, during the `./configure` stage I frequently see the following line:               checking for suffix of executables...      How do I create such a check in a bash script? The reason I want to know this is that I want to create a makefile in which it compiles with suffix .exe on Cygwin, but no suffix on true GNU+Linux.


title: How can I autologin to desktop with systemd?

text: How can I configure systemd to automatically log me in to my desktop environment, preferably without using login manager? I'm using Arch.


title: automatically download latest stable tarball from sourceforge from command line?

text: I'd like to install a program from sourceforge sources. Is there a way to download the latest stable source from SourceForge? an example for `ntopng` would be very welcome.


title: How can I stop dolphin from reading my entire home directory tree in order to make it usable on AFS?

text: At work, I would like to use KDE's `dolphin` as a file manager. However, our home directories reside on an AFS share [1]. When starting dolphin, it becomes unresponsive for dozens of minutes. stracing it reveals that it tries to open all the nodes in our AFS tree:               openat(AT_FDCWD, "/afs/somewhereElse.tld", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC      I need to stop dolphin from doing that; this behaviour makes the program completely unusable on AFS trees. Is there some setting that controls this? * * * [1] If you have never worked with AFS before, for the sake of this question, assume that there is a root directory that has subtrees from different universities, research institutes etc. mounted below it. The data in those subtrees really reside at the remote sites, so access is slow and resource- intensive.


title: Piping content with multiple spaces

text: I was attempting to copy files listed in a text file into a directory such as:               cat files.txt | xargs  -I{} cp "{}" ~/Desktop/temp      However I noticed that some files would not copy over. The files that wouldn't copy over had double spaces in the name such as "My   Document.pdf". I did a little testing and simply piping an echo removes all the spaces except for one. For example:               echo "Hello         World" | xargs echo      simply returns "Hello World". Is there a way when piping to tell it to preserve spacing in the content? Thanks in advance, Scott


title: trapping signals inside grouping commands

text: I recently ran into a strange behavior. Trap doesn't get executed if inside grouping command:               $ cat ./1.sh     #!/usr/bin/env bash     set -eu     trap 'echo exit' EXIT     $ ./1.sh     exit     $ cat ./2.sh     #!/usr/bin/env bash     set -eu     echo test | { trap 'echo exit' EXIT; }     $ ./2.sh      Is it as it's supposed to be?


title: What is the terminal's graphic API?

text: How can certain programs set background and font colors, write characters to the same location on screen (e.g. to the third row, fifth column) more than once? Some examples are the progress bar displayed by `curl google.com > a`, some installation screens and nearly any text editor.


title: install php5-fpm on Debian Squeeze

text: I tried in many ways to install php5-fpm in om Debian squeeze, but couldn't. I was wondering if I have to upgrade php5.3.3 to higher version because it doesn't seem to work on lower than php5.4 I have no idea if Php5-fpm can be installed on Debian squeeze php5.3 base or not?? I used this commend line to do so, but returned an error:               apt-get install php5-fpm      any help is appreciated!


title: Sed --- replace a character in a matched line in place?

text: In a file containing lines like this one:               # lorem ipsum blah variable      I would like to remove `#` (comment) character in the same line that contains a specific string, in place. Is `sed` good for this? I'm struggling to get this conditional working. I have a "clumsy" way of doing this; I can find the matching line number with `awk` or `sed` and then use this number in a separate `sed` command, but I believe that this can be done in a much better way.


title: Why ACPI Namespace keeps changing

text: Does anyone know why the ACPI namespace keeps changing? I had a script a while back on a Red Hat system which read the CPU temperature from '/proc/acpi/thermal_zone/THRM'. Now I have a new (but similar hardware) and relatively same distro (except for a few drivers here and there) and it has changed to '/proc/acpi/thermal_zone/TZ00' and '/proc/acpi/thermal_zone/TZ01'? Is this even the CPU thermal? Or is it for something else? I know most will say, read the ACPI docs... But that's beyond the point. Why and who keeps changing the namespace?


title: Is it safe to leave a enc folder mounted?

text: I was looking at this and ecryptfs seems cool. I'd like to use it on my server to encrypt git pushes. I dont want to ssh in everytime to mount/unmount the encrypted folder. However once in a while when i reboot or whatever it is fine. I like the idea that someone at my provider cant see my folder when scanning through a bunch of harddrives but is it relatively safe that the folder is always mounted? I dont think the password would be in memory plaintext? nor can someone connect to my server due to it being on the network and be able to access files? (the enc/prv folder would be 700) Do i really have anything to worry about if i leave it mounted all the time? My server is debian 6 (squeeze) if thats interesting.


title: How can I update the OS on an Iphone on a Linux machine

text: As I understand it, the iPhone will pop up some options on a Windows computer to update the system when you plug it into the computer. Honestly, I don't own an iPhone, but my friend wants to use my computer to update hers, because it's not receiving data properly. So is it possible for me to mount the phone and push some data to it? or otherwise update it? only relevant looking link I found via google was suggesting a VM, which more than I want to do. Tutorial links are of course welcome. Also please advise if there's a decent chance doing this this way could brick the phone.


title: Save display settings for specific monitor

text: When i'm connecting an external Monitor to my notebook (specs below), whether with VGA or Displayport, I always have to configure the screen resolution and display position. At the moment i'm doing this with an GUI utility for XRandR calld arandr. Another issue is, that always the lowest possible display resolution is used, instead of the highest, when connecting a monitor. Is it possible to automatically recall a previously made configuration every time I connect a specific monitor? For example, when I connect the monitor at work, I want to the displays setup side-by-side, at home instead, I use a vertical layout. This problem exists with both of my laptops. They are running Fedora 18 and Xubuntu 13.04, all with XFCE as Window Manager. They are the same devices, Lenovo X220, with the integrated Intel HD3000 graphics. **Update** I tried to make a per monitor setting, but unfortunately fedora don't uses a xorg.conf file , instead it tries to do an automatic configuration every time X is started (see create xorg.conf) Creation of xorg.conf file with `Xorg :1 -configure`, like described in the fedora wiki, fails with `Number of created screens does not match number of detected devices. `. **Workaround** I've made a little workaround that solves the problem, but only for displays connected at the displayport. Arandr can save the display setup as shell script, so i used the saved settings and putted them into the `.xinitrc`. `cat ~/.screenlayout/<name_of_your_settingsfile>.sh > ~/.xinitrc` `chmod u+x ~/.xinitrc` That should do the trick, if someone has a better way to do it, please let me know.


title: Why does Debian under-report the space available when installing Qt?

text: I want to install Qt on my Debian but it doesn't detect the whole free space! I tried to install it in /home/Qt but it says that only 23.87 MiB of space is available while `df -h` says that there is still 7.2G free. ![enter image description here](http://i.stack.imgur.com/rvQQl.png)


title: Append line to many files

text: I want to add some text to over 200,000 files I am trying this               find . -name *.txt -print | xargs -I % echo "hello world" >> %      But nothing is happening. When i run `find . -name *.txt` it work by itself as does `echo "hello world" >> myfile.txt`


title: How to make startx use alternate xinitrc?

text: I don't have a desktop manager installed (and I don't want to). After logging in through the terminal I use `startx` to start the GUI. I have entries in `~/.xinitrc` for my GUI sessions. Right now I have xmonad in there, but sometimes I want to run a GNOME session, and sometimes a KDE session. I used to edit `~/.xinitrc` for that purpose, but I think there should be a more elegant way (something like using alternate configurations). However, I can't find anything in `man startx` or `man xinit`. I plan to have several configuration files (one for each GUI session), and then tell `startx` to load them when I want. How can I do that?


title: How do I reimage OpenWRT?

text: How do I reimage openwrt in such a way that all my settings will be lost. I've been having some issues, and I want to ensure that it's not a lingering setting, I want this to be a fresh install.


title: On-the-fly monitoring HTTP requests on a network interface?

text: For debugging purposes I want to monitor the http requests on a network interface. Using a naive `tcpdump` command line I get too much low-level information and the information I need is not very clearly represented. Dumping the traffic via `tcpdump` to a file and then using `wireshark` has the disadvantage that it is not on-the-fly. I imagine a tool usage like this:               $ monitorhttp -ieth0 --only-get --just-urls     2011-01-23 20:00:01 GET http://foo.example.org/blah.js     2011-01-23 20:03:01 GET http://foo.example.org/bar.html     ...      I am using Linux.


title: Can't shutdown mandriva 2010.2

text: I can't seem to shutdown my machine from mandriva,I have to restart to shut it down from GRUB it says "System Halted" and just freezes there I'm using the x86_64 GNOME version I've already asked on mandriva forums and they couldn't determine the cause of this problem P.S. I'm using the 2.6.36.2-desktop-2mnb kernel


title: How do I know from a BeagleBone Black if it is connected via USB (as a client/slave)?

text: BeagleBone Black has an USB port which allows the user to access it through ssh. In general, we could say that when you plug it to a PC, the PC is the USB host and the BBB is the USB client. On the other hand, it is also possible to turn the BBB on without the USB cable, through its AC cable. I would like to know if it is possible to check, from the BBB point of view, if there is an USB cable plugged to the BBB or not.


title: Install rcp on RHEL

text: I have a Linux Red Hat machine version 6.4 (64-bit). I notice that the `rcp` command does not exist on my machine (no `rcp` binary). I also searched in Google in order to find an `rcp` binary that will fit for my Linux machine but with no success. Where I can download `rcp`?


title: Merge 2 files based on all values of the first column of the first file

text: I need to merge below 2 files:   * **file1** :  > TABLES REF-IO HEAD-IO DIFF-IO   >  test 200 500 -300   >  exam 2 3 -1   >  final 2 1 1   >  mail 4 2 2   >  TOTAL 208 506 -298   >   * **file2** : > TABLES REF-SELECT HEAD-SELECT DIFF-SELECT   >  test 5 7 -2   >  game 3 3 0   >  exam 0 7 -7   >  final 12 6 6   >  TOTAL 20 23 -3   > **merged file should be as shown below:** > TABLES REF-IO HEAD-IO DIFF-IO REF-SELECT HEAD-SELECT DIFF-SELECT   >  test 200 500 -300 5 7 -2   >  exam 2 3 -1 0 7 -7   >  final 2 1 1 12 6 6   >  mail 4 2 2 0 0 0   >  TOTAL 208 506 -298 20 23 -3   >


title: Change kernel parameters at runtime

text: While trying to fix an obscure hardware bug, it was suggested that adding a couple of parameters to the kernel might resolve the issue. I can of course do that, but I was wondering whether I can make these changes to a running kernel. In particular, I know that `procfs` and `sysfs` provide a way to make changes to the running kernel, but I am unsure how to map kernel parameter names to file paths. (I also presume that not _all_ settings are changable at runtime, and these particular parameters might well not be configurable once the system is booted.) The specific parameters I'm interested in are               i8042.nomux=1 i8042.reset      I'm particularly unsure as to whether it's possible to issue the reset command on a running system. If these parameters _are_ tweakable at runtime, where would I find them?


title: RHEL6 Can't make my script run on shutdown and reboot

text: I'm trying to execute a script in each shutdown and reboot but the script never runs.   1. I created the script baseRhel64 and save it to `/etc/rc.d/init.d`   2. I did `chkconfig --add baseRhel64`   3. I included in the script              #chkconfig --list     # chkconfig: 06 10 10        4. I verified that the S10 script where created under `/etc/rc0.d/S10baseRhel64` and `/etc/rc6.d/S10baseRhel64` The following is my script:               #!/bin/sh          #chkconfig --list     # chkconfig: 06 10 10          start(){         echo "`basename $0` start"         touch /root/installscripts/test1     }          stop(){         echo "`basename $0` stop"         touch /root/installscripts/test2         touch /root/installscripts/"`basename $0`"     }          case "$1" in         start) start;;         stop) stop;;         *)          echo $"Usage: $0 {start|stop}"         RETCAL=1     esac     exit 0


title: Using xargs with git

text: I am trying to practice using `xargs`. I tried the following, passing the SHA1 via `xargs`:               $ git show SHA1 --name-only      I also tried:               $ git log --author=jim --grep="patch" |head -n 1|cut -d ' ' -f2|xargs {} git show {} --name-only      It returned `xargs: {}: No such file or directory` So, I moved on to this:               $ git log --author=jim --grep="patch" |head -n 1|cut -d ' ' -f2|xargs -0 -I {} git show {} --name-only      Which returned:               fatal: ambiguous argument 'a1237ac27321f2daea365787664e4119b339c483': unknown revision or path not in the working tree.     Use '--' to separate paths from revisions, like this:     'git <command> [<revision>...] -- [<file>...]'      The SHA mentioned is the correct one, but I don't understand why this does not work either


title: init: /etc/init.conf: Unable to load configuration: No such file or directory

text: Running Linux 6 on VMWare, I noticed this in the system message log: > init: /etc/init.conf: Unable to load configuration: No such file or > directory What's the cause of this error? How do I resolve it?


title: find -exec in bash script with variable expansion

text: I'm trying to run a command similar to the one below in a bash script. It should search through all subfolders of $sourcedir and copy all files of a certain type to the root level of $targetdir.               #!/bin/bash          # These are set as arguments to the script, not hard-coded     sourcedir="/path/to/sourcedir"     targetdir="/path/to/targetdir"          find "$sourcedir" -type f -name "*.type" -exec sh -c 'cp "$1" "$2/`basename "$1"`"' "{}" "$targetdir" \;      This seems to be pretty close, except that {} isn't being passed in as $2 to "-exec sh -c ..." I would like to do this as close to the "right way" as possible, with tolerance for special characters in filenames (specifically single quote characters). Thanks in advance! **Edit:** I see people suggesting using xargs or argument chaining. I was under the impression that this is only ok for a limited number of arguments. If I have, for example, thousands of .jpg files I'm trying to copy from a number of gallery directories into a giant slideshow directory, will the solutions chaining arguments still work? **Edit 2:** My problem was I was missing a _ before my first option to sh in the -exec command. For anyone who is curious about how to make the find command work, add the _ and everything will be fine:               find "$sourcedir" -type f -name "*.type" -exec sh -c 'cp "$1" "$2"' _ "{}" "$targetdir" \;      I have accepted an answer below though because it accomplishes the same task, but is more efficient and elegant.


title: repair the static route to allow traffic to right place

text: I recently was taking an online test and I got the below question. The server has been configured with a TUN device `tun-aib0` that acts as an endpoint for a VPN tunnel. The IP address of the device is **192.xxx.xx.xx** and the network it is on is using a 22 bit netmask ( **255.255.252.0** ). The problem is that the server needs to be able to communicate with the **10.xx.xxx.x** network with a 24 bit netmask ( **255.255.255.0** ) but none of the traffic appears to be reaching the other VPN endpoint and instead is trying to be sent out to the public internet over `eth0`. Please repair the static route for **10.xx.xxx.0** so that traffic goes to the right place. I read the topics on subnet and kernel virtualization. I have a basic understanding on setting up of network. I am trying to figure out how should I approach the above problem. I believe it has to do something with `/etc/sysconfig/network` and setting up a bridge for eth0 in that file. However, I am not sure if am correct.


title: How to find inode number using "find" command?

text: How do you find the inode number of the name of files that start with a particular keyword like "test"? We'll assume that there are files called: test, test1, test2.


title: Error compiling drivers for Ralink RT2870

text: Im trying to install drivers for a rosewill RNX-N600UBE wireless card (Ralink RT2870 chipset) on Kali Linux. I downloaded the drivers form their website and unpacked/unzipped them, but now when i try to run the 'make' command i get this error.               /home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.c:1156:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’     /home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.c:1157:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’     make[4]: *** [/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.o] Error 1     make[3]: *** [_module_/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux] Error 2     make[2]: *** [sub-make] Error 2     make[1]: *** [all] Error 2      Im new to linux so any help is appreciated.


title: Postfix Relay Multiple Domains with Multiple Origins

text: I currently have Postfix relaying multiple hosted customer solutions which all works as expected. There are no local accounts and it is used solely as a relay server. In the config I have the following:               mydomain = hostdomain.com     myorigin = $mydomain      In email headers sent from the relay the following lines are seen:               Received: from mailrelay.hostdomain.com ([123.123.123.123])     Received: from sendername (unknown [1.1.1.1])         by mailrelay.hostdomain.com (Postfix) with ESMTP id 6119FA0441         for <end.user@gmail.com>; Wed, 16 Apr 2014 01:00:00 +0100 (BST)      We have multiple customers who wish to relay presenting themselves rather than as the server name. Examples being: Customer Domain - customer1a.com   Desired Headers:               Received: from mailrelay.customer1a.com ([123.123.123.123])     Received: from sendername (unknown [1.1.1.1])         by mailrelay.customer1a.com (Postfix) with ESMTP id 6119FA0441         for <end.user@gmail.com>; Wed, 16 Apr 2014 01:00:00 +0100 (BST)      Customer Domain - customer2b.com   Desired Headers:               Received: from mailrelay.customer2b.com ([123.123.123.123])     Received: from sendername (unknown [1.1.1.1])         by mailrelay.customer2b.com (Postfix) with ESMTP id 6119FA0441         for <end.user@gmail.com>; Wed, 16 Apr 2014 01:00:00 +0100 (BST)      Is this possible to achieve? The documentation I have read includes virtual aliases but I can't see a way listed to achieve the above?


title: How to get address of connected USB modem?

text: I just connected my N81 telephone as USB modem to Linux Mint 14. All works fine, just wondering how to find a full path to this device, something like `/dev/tty*`.


title: How can I identify lines in files over a certain length

text: I'd like to find lines in my code which exceed a certain length. My code is in multiple files. What's a good way to do this? I'd like to know the files and line numbers; content would be preferred, but not necessary. The purpose of the exercise is to then figure out how to break the lines (probably manually).


title: what will ¬ do in bash?

text: While wanting to start `gitg` as backgrounded through writing `gitg &` I accidentally typed `gitg ¬`. This did not cause an error, instead I got with a later command in the same terminal (translated): `[1]+ Finished gitg` I am not sure if the two things were related. Anyway: Does anybody know what `<programm> ¬` will do?


title: how to disable flareget from firefox?

text: Hello I want to disable flareget from mozilla firefox. Whenever I click on some download button flareget starts downloading the file. But I want to download by the browser downloader.


title: Read the middle of a large file

text: I have a 1 TB file. I would like to read from byte 12345678901 to byte 19876543212 and put that on standard output on a machine with 100 MB RAM. I can easily write a perl script that does this. sysread delivers 700 MB/s (which is fine), but syswrite only delivers 30 MB/s. I would like something more efficient, preferably something that is installed every Unix system and that can deliver in the order of 1 GB/s. My first idea is:               dd if=1tb skip=12345678901 bs=1 count=$((19876543212-12345678901))      But that is not efficient. Edit: I have no idea how I measured syswrite wrong. This delivers 3.5 GB/s:               perl -e 'sysseek(STDIN,shift,0) || die; $left = shift; \              while($read = sysread(STDIN,$buf, ($left > 32768 ? 32768 : $left))){ \                 $left -= $read; syswrite(STDOUT,$buf);              }' 12345678901 $((19876543212-12345678901)) < bigfile      and avoids the `yes | dd bs=1024k count=10 | wc` nightmare.