title: Packet loss with RX error packets

text: I am seeing packet loss from all my blade servers within the HP Blade C7000 enclosure.               # ping 192.168.2.140     PING 192.168.2.140 (192.168.2.140) 56(84) bytes of data.     64 bytes from 192.168.2.140: icmp_seq=1 ttl=64 time=0.210 ms     64 bytes from 192.168.2.140: icmp_seq=2 ttl=64 time=0.185 ms     64 bytes from 192.168.2.140: icmp_seq=4 ttl=64 time=0.206 ms     64 bytes from 192.168.2.140: icmp_seq=6 ttl=64 time=0.164 ms     64 bytes from 192.168.2.140: icmp_seq=7 ttl=64 time=0.210 ms     64 bytes from 192.168.2.140: icmp_seq=8 ttl=64 time=0.213 ms     64 bytes from 192.168.2.140: icmp_seq=9 ttl=64 time=0.213 ms          --- 192.168.2.140 ping statistics ---     9 packets transmitted, 7 received, 22% packet loss, time 8000ms     rtt min/avg/max/mdev = 0.164/0.200/0.213/0.018 ms          # ping 192.168.2.165      PING 192.168.2.165 (192.168.2.165) 56(84) bytes of data.      64 bytes from 192.168.2.165: icmp_seq=1 ttl=64 time=0.990 ms      64 bytes from 192.168.2.165: icmp_seq=3 ttl=64 time=0.204 ms      64 bytes from 192.168.2.165: icmp_seq=4 ttl=64 time=0.165 ms      64 bytes from 192.168.2.165: icmp_seq=5 ttl=64 time=0.168 ms           --- 192.168.2.165 ping statistics ---      6 packets transmitted, 4 received, 33% packet loss, time 5001ms      rtt min/avg/max/mdev = 0.165/0.381/0.990/0.352 ms               $ /sbin/ifconfig     eth0      Link encap:Ethernet  HWaddr E4:11:5B:D0:36:B0               inet addr:192.168.2.163  Bcast:192.168.2.255  Mask:255.255.255.192               inet6 addr: fe80::e611:5bff:fed0:36b0/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:44022 errors:29632 dropped:0 overruns:0 frame:10025               TX packets:42694 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:4345443 (4.1 MiB)  TX bytes:4549025 (4.3 MiB)          $ netstat -i     Kernel Interface table     Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg     eth0       1500   0     5124  32118      0      0     2651      0      0      0 BMRU     lo        16436   0     4522      0      0      0     4522      0      0      0 LRU                $ route -n      Kernel IP routing table      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface      192.168.4.128   0.0.0.0         255.255.255.192 U     0      0        0 eth0      169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0      0.0.0.0         192.168.4.134   0.0.0.0         UG    0      0        0 eth0          # ethtool -S eth0 | grep -i errors       rx_errors: 43821       tx_errors: 0       rx_crc_errors: 14812       rx_alignment_symbol_errors: 0       rx_in_range_errors: 0       rx_out_range_errors: 0       rx_address_match_errors: 150211     # ethtool -S eth0 | grep -i drops       rx_drops_no_pbuf: 0       rx_drops_no_txpb: 0       rx_drops_no_erx_descr: 0       rx_drops_no_tpre_descr: 0       rx_drops_too_many_frags: 0       rx_drops_invalid_ring: 3215       rx_drops_mtu: 0       rx_drops_no_fragments: 0      Network configuration looks fine . Kindly suggest steps how to resolve the issue.


title: Appending checksum information to file

text: I'd like to embed checksum information into file, that I transfer. It's `tar.gz` or `tar.xz` file and I can only transfer one file to remote side. How do you recommend I embed checksum information? I want checksum of whole archive, not it's contents (I'd like to check it's integrity "before" unpacking). I know I could pack it again in some format supporting checksums (like `rar`) but it's computational cost to "repack" stuff, just for adding checksum (on the other hand I don't like `rar` format). So preffered would be sth like `gzip` & `gunzip` etc , but for adding, checking, and removing checksum. Any tools, ideas, scripts, workarounds? Am I right `.xz` and `.gz` support concatentation? Maybe it's worth to use this feature to append compressed checksum on the end of file ?


title: FreeBSD 8.2 STABLE installation failing on VirtualBox

text: On my pc-bsd box, I installed `VirtualBox` and trying to install FreeBSD 8.2 STABLE in 10GB space. During installation, I selected all the default settings, it looks like this: ![Disk layout](http://i.stack.imgur.com/fjmcc.png) But after this, I get this error: ![error](http://i.stack.imgur.com/26u2o.png) How can I overcome it?


title: xrandr doesn't detect monitor on hdmi port

text: I installed Arch on my laptop but I don't think this problem is specfic to Arch. The only problem at the moment is that the display connected to the hdmi port isn't detected. For example running from the gnome control centre the display applet then 'detect' only detects the laptop display, even though there is a 2nd monitor connected to the laptop via the HDMI port. I suspect that the problem is xrandr is not detecting the monitor connected to the HDMI port. How can I fix this? Output from lspci -v for the vga controllers:               01:00.0 VGA compatible controller: nVidia Corporation Device 0df5 (rev a1) (prog-if 00 [VGA controller])         Subsystem: Dell Device 0446         Flags: bus master, fast devsel, latency 0, IRQ 16         Memory at f0000000 (32-bit, non-prefetchable) [size=16M]         Memory at c0000000 (64-bit, prefetchable) [size=256M]         Memory at d0000000 (64-bit, prefetchable) [size=32M]         I/O ports at 3000 [size=128]         Expansion ROM at f1000000 [disabled] [size=512K]         Capabilities: <access denied>         Kernel driver in use: nouveau         Kernel modules: nvidiafb, nouveau00:02.0 VGA compatible controller:          Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])         Subsystem: Dell Device 0446         Flags: bus master, fast devsel, latency 0, IRQ 49         Memory at f1400000 (64-bit, non-prefetchable) [size=4M]         Memory at e0000000 (64-bit, prefetchable) [size=256M]         I/O ports at 4000 [size=64]         Expansion ROM at <unassigned> [disabled]         Capabilities: <access denied>         Kernel driver in use: i915         Kernel modules: i915      output from xrandr:               Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192     LVDS1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm        1920x1080      60.0*+   40.0         1400x1050      60.0         1280x1024      60.0         1280x960       60.0         1024x768       60.0         800x600        60.3     56.2         640x480        59.9      VGA1 disconnected (normal left inverted right x axis y axis)     HDMI2 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)


title: Use find and tar together

text: I have a directory with many log files, with filenames like `acct.20111001` up to `acct.20111030`. I want to zip them by running:               tar -cvjf acct.20111001.bz2 acct.20111001      How can I use `find` to compress them instead of running the `tar` command for each and every file? I'm thinking something like this, but I know this command doesn't work:               find /home/log/2011/10 -name "acct.201110[0-9]" -exec tar -cvjf {}.bz2 {} \;


title: cURL/wget - SSLv3, TLS handshake, CERT hangs

text: I have problems connecting to https sites using cURL or wget. When I download from a https curl seems to be stuck while doing the TLS handshake, CERT. The problem is independent of the site (I noticed it using github) and wget is hanging too (although I didn't look into the verbose outputs there).               $ curl -v --trace-time https://www.google.de     10:35:21.532822 * About to connect() to www.google.de port 443 (#0)     10:35:21.533091 *   Trying 209.85.148.147... connected     10:35:21.538666 * Connected to www.google.de (209.85.148.147) port 443 (#0)     10:35:21.539119 * SSLv3, TLS handshake, Client hello (1):     10:35:21.544129 * SSLv3, TLS handshake, Server hello (2):     10:35:21.544182 * SSLv3, TLS handshake, CERT (11):      I have waited >10 min but nothing happens. I am using OSX Lion.               $curl --version     curl 7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5     Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp      Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM SSL libz      I don't know where to look for help so I'd be happy if you could give me some pointers. Thanks


title: What's up with "Error in lockf()" just for one particular user?

text: We're running a Java manufacturing/equipment control application on Solaris. Equipment control is done via the serial port on the SunRay terminal at the user station. The interesting thing is that it fails for one particular user. He can go to any machine and have it fail. Works fine for all other users on all machines. The errors returned are:               Error opening "/tmp/SUNWut/sessions/7/unit/dev/term/a"     Error in lockf()      Nothing special about this user account. .profile matches everyone else. Any ideas on what might be broken about this one specific user account that would prevent him from being able to open the serial port?


title: Set Up New Locale On CentOS 6

text: I am trying to set up a new locale for my centos server environment. Here is currently shows for `locale -a` command:               en_AG     en_AG.utf8     en_AU     en_AU.iso88591     en_AU.utf8     en_BW     en_BW.iso88591     en_BW.utf8     en_CA     en_CA.iso88591     en_CA.utf8     en_DK     en_DK.iso88591     en_DK.utf8     en_GB     en_GB.iso88591     en_GB.iso885915     en_GB.utf8     en_HK     en_HK.iso88591     en_HK.utf8     en_IE     en_IE@euro     en_IE.iso88591     en_IE.iso885915@euro     en_IE.utf8     en_IN     en_IN.utf8     en_NG     en_NG.utf8     en_NZ     en_NZ.iso88591     en_NZ.utf8     en_PH     en_PH.iso88591     en_PH.utf8     en_SG     en_SG.iso88591     en_SG.utf8     en_US     en_US.iso88591     en_US.iso885915     en_US.utf8     en_ZA     en_ZA.iso88591     en_ZA.utf8     en_ZW     en_ZW.iso88591     en_ZW.utf8      As you can see, there is no other language locale set up at this moment. I need to add 'de_DE' and 'fr_FR' to add on this list properly. Can anyone please suggest how can I achieve this properly? Here is what I have done so far:   I followed the instructions on this link. With its help, it seems the list is being updated with 'de_DE' locale . But that doesn't doing the work I needed (doesn't working with gettext). So, may be I am doing something wrong or there is more to do.


title: How to get the list of all active X sessions and owners of them

text: I'm implementing USB plug/unplug notification (here's related question), and I need to execute something like `notify-send "device plugged" "My Device Title"`. The problem is that to make this command work, I should firstly set `DISPLAY`, like this:               export DISPLAY=":0.0"      And secondly, this command should be called by appropriate user. Say, for user `dimon`:               su dimon -c "notify-send 'device plugged' 'My Device Title'"      So, I need to get the list of all active X sessions and appropriate users, and call `notify-send` for each user on his `DISPLAY`. I tried to use `w` for that, example output at Linux Mint 13 MATE:               USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     dimon    tty8     :0               Sun15    3days  1:38m  1.95s x-session-manager     dimon    pts/0    :0               Sun15    0.00s  0.20s  0.00s tmux      So we have both username and display. I decided to parse it like that:               declare -a logged_users=(`w |grep -vP "^(USER| )" |awk '{if (NF==8){print $1" "$3} else {print $1" :0"}}' |sort |uniq`)      Now, I have array `logged_users`: `[0]` contains `dimon`, and `[1]` contains `:0`. This would be great, but unfortunately it works not everywhere. Say, on Ubuntu 12.04 with lightdm we have this `w` output:               USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     nui      tty7                      18:22   35:56   1.66s  0.11s gnome-session -     nui      pts/0    :0.0             18:55    5.00s  0.20s  0.00s w      No idea why there's no FROM value for `gnome-session`. And even worse one, at xubuntu:               USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     nui      tty7                      15:50   31:07  52.55s  0.13s /bin/sh /etc/xd      No display at all! If other user is logged in, no display is specified for him too (but actually it's `:1.0`) So, I'm looking for another approach. I also know we have a list of all active X sessions here: `/tmp/.X11-unix` , and I can get the list of them like this:               cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done      But then, I don't know how to retrieve users. So, how to get the list of all active X sessions and appropriate users?


title: How to enable right click on desktop? (Linux Mint 12 LXDE)

text: I accidentally disabled right clicking on the desktop in LXDE. Does anybody know how to enable it again?


title: VPN tunneling through another VPN

text: in windows you can simply create two pptp connections and after connecting to one of them, easily connect to the other one while maintaining the first. Is there any way to do this (cli or gui) in linux? I also found this resource, but found it rather unhelpful.


title: Cannot exit terminal emulator

text: I have a very strange and intermittent problem. Sometimes, with no pattern I can discern, running `exit` fails to close my terminal emulator. In the screencast below, I open the first terminal and successfully exit with `Ctrl` \+ `D`, open a second one and it hangs: ![enter image description here](http://i.stack.imgur.com/hnxSK.gif) Now the strangeness:   1. This happens sometimes, not always, and I can see no pattern. In the gif above, it is the 2nd terminal, sometimes it is the first or the Nth.    2. The same thing happens whether I run `exit` manually or hit `Ctrl` \+ `D`.   3. I have a shortcut key mapped to `terminator` in my DE's (Cinnamon) keyboard settings. The problem only occurs when launching with this shortcut. It does not seem to ever happen if I launch by running `terminator` manually.   4. It _seems_ to be exclusive to `terminator`, neither `xterm` not `gnome-terminal` display this problem if I assign the same keyboard shortcut to them instead.   5. It happens irrespective of what keyboard shortcut I use (I tried using `Ctrl + O` instead of the `Alt + Z` I normally use)   6. It seems to be specific to Cinnamon, I tried on Mate and xfce and it worked fine. Possibly relevant details:   * This started happening after updating my LMDE to update pack 8.    * The upgrade process was problematic because it wanted to install `libharfbuzz0b` which breaks `libharfbuzz0a` and some packages depend on the latter while others need the former. This has led to a bit of dependency hell which may or may not be relevant here.   * `terminator` is a fork of `gnome-terminal` and Cinnamon is a fork of Gnome. The latest versions of Cinnamon have become completely independent of Gnome and in fact, you can no longer have both Gnome and Cinnamon installed on the same system. This makes me think that there may be some kind of library incompatibility between the Cinnamon-provided libs that `terminator` uses and the Gnome-provided ones it expects. I realize that this is very likely to be an extremely localized problem that only affects my setup but I thought I'd put it out there in case anyone has any ideas on how to solve this or is experiencing similar issues. In the mean time, I have posted a bug report on terminator's bug tracker.


title: Compile all tex files in a directory

text: If I do `pdflatex *.tex` in a directory, only one `tex` file is compiled. Which syntax should I use that all `*.tex` files in the directory are compiled?


title: “tshark: There are no interfaces on which a capture can be done” in Amazon Linux AMI

text: My goal is to capture packets with tshark in Amazon Linux AMI. While typing **tshark** in the command line there's an error: **"tshark: There are no interfaces on which a capture can be done"** How to implement the solution from Wireshark setup Linux for nonroot user               $ sudo apt-get install wireshark     $ sudo dpkg-reconfigure wireshark-common      $ sudo usermod -a -G wireshark $USER     $ gnome-session-quit --logout --no-prompt      in Amazon Linux AMI (it's not Ubuntu)?


title: How do I redirect all writes and reads from /sdcard/whatsapp/ to /sdcard/shared/ on android?

text: I am using bluestacks appplayer beta with a rooted android, I want to redirect all writes and reads from one directory to another, how do I do that? I have a terminal available to put commands in..


title: Change System Time/Date

text: I'm running Linux Mint 15 with KDE 4.10.4+ Here's what I get when I run _date_ : > user:~ > date   >  Die Okt 29 15:47:54 UTC 2013 Where "Die Okt" indicates a German-language setting, which I don't mind. However, I'm not in the UTC timezone, and I'd like to configure my system time/date to display the correct timezone. I've tried going into System Settings and configuring Date and Time, which is temporarily successful, but after restarting the system, it always resets to UTC. How do I solve this problem?


title: locating somebody on IRC servers over the Internet

text: Is there a way to locate somebody by his nick or IP address on the internet's IRC servers? I guess the protocol doesn't seem to support it! Still... can it be done? like crawling the web for IRC servers and injecting bots to query about if that nick/IP is online on one of the channels? Is there a simpler way?


title: Prevent access to files on linux file server

text: I have a linux system running Debian Wheezy stable on it and am using it as a file repository (not a true file server because I am using BitTorrent sync to move files as I move around the world). Some family has expressed a desire to store data similarly but I would like to give them the space without me necessarily having direct access to their files. I know there are some sites that if you store files on them they make it a point to let you know that they can't access it or they can't see it, etc. What mechanism are they using to achieve that level of privacy for their users? Are they able to still scan the directories for viruses or malware or by providing that kind of privacy, do they effectively make it where they cannot see the directory to scan? Or is it something else altogether (encryption, etc)? My apologies if this is better asked somewhere else or if it has already been answered. Thank you for your help! Cheers.


title: Get "date" to understand a timestamp phrase of a different language

text: My web-scraping scripts have long enjoyed using `date -d` to read in human- formatted time and date stamps like "March 11, 1999" and convert to any other format I need via the -s parameter. How might I get it to understand dates printed in other locales like `27 Kwi, 13:54` in Polish? I can artifically prepend/append the year (2012) if needed. I checked my `env` and tried the following, but no luck:               LOCALE=PL date -d "30 Kwi, 17:02"     LANGUAGE=pl_PL:pl date -d "30 Kwi, 17:02"     LC_CTYPE=pl_PL:pl date -d "30 Kwi, 17:02"     LANG=pl_PL:pl date -d "30 Kwi, 17:02"     LC_COLLATE=pl_PL:pl date -d "30 Kwi, 17:02"     LC_MESSAGES=pl_PL:pl date -d "30 Kwi, 17:02"     date: invalid date `30 Kwi, 17:02'      In my system as installed,               LANGUAGE=en_US:en     LC_CTYPE=en_US.UTF-8     LC_MESSAGES=en_US.UTF-8     LC_COLLATE=en_US.UTF-8


How to create a file even root user can't delete it ?


title: dd write vs read performance

text: I have recently done some performance tests on a new server (using dd) and wonder why read performance is so much worse than write performance? Shouldn't it be another way around? file size was in both tests 550GB, read: in seconds: 3704 in MB/s: 148 and write: in seconds: 1539 in MB/s: 357 write command:               time sh -c "dd if=/dev/zero of=/local/postgresql/bigfile      bs=8k count=67108864 && sync"      read command:               time dd if=/local/postgresql/bigfile of=/dev/null bs=8k      bash time command output:               real: 61m44.335s     user: 0m12.721s     sys: 10m35.884s      Bonnie++ results command:               bonnie++ -f -D -n 0 -u root -d /local/postgresql/      results are for file that was twice as big as RAM size. write: 419 918 K/sec read: ~ 187 000 K/sec


title: Connect Windows printer to Linux machine via samba

text: How can I connect my Windows printer to a Linux (RHEL5) box via samba? I'm looking for a clear configuration file


title: Why does my mapping of <C-PageX> to :bY not work in gvim?

text: In my `.vimrc` file, I have the following two lines:               noremap! <C-PageDown> :bnext <CR>     noremap! <C-PageUp>   :bprev <CR>      but they do not work! In insert mode, typing               <C-v><C-PageDown>      returns               <C-PageDown>      (literally) and similarly so for `<C-PageUp>` and if I try to execute the command I get               :bnext      (plus a newline). In normal mode there's no effect. Thus, I know that the key map isn't being gobbled up by `X` or my shell but what else could be the problem? Other key maps work fine.


title: Install rEFInd on OS X 10.10 Yosemite

text: I want to dual boot my macbook with Arch Linux and thus tried to install `rEFInd` using the install script, however, after install `rEFInd` doesn't seem to start at all? Anyone experienced the same issue or have possible solutions on how to fix this? Best Regards Rawa


title: Why does SSH hosts keys differ when connecting if the host_keys are the same?

text: There are 3 machines: A (from where I connect to B and C), B, and C.   B and C have the same SSHD host keys (they have been copied, so they are 100% the same, SSHD has been restarted too, identical sshd_config file). On C the known_hosts file looks like this:               C:~/.ssh # grep B *     C:~/.ssh # grep A *     known_hosts:ssh-rsa xxxx...xxxx     C:~/.ssh #       When we try to connect from C to A then "A" offers it's RSA hosts key.   When we try to connect from C to B then "B" offers it's ECDSA hosts key. **Question:** Why? Wouldn't it be logical that the "A" and "B" server should offer both the ex.: their RSA SSHD hosts keys?


When I restart the named service, it gives me this error:               ./etc/init.d/named restart          Stopping named:                                            [  OK  ]     Starting named:      Error in named configuration:     zone enum4red.com/IN: has 0 SOA records     zone enum4red.com/IN: has no NS records     zone enum4red.com/IN: not loaded due to errors.     _default/enum4red.com/IN: bad zone     zone localhost.localdomain/IN: loaded serial 0     zone localhost/IN: loaded serial 0     zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0     zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0     zone 0.in-addr.arpa/IN: loaded serial 0                                                                [FAILED]     umount: /var/named/chroot/var/named: device is busy.             (In some cases useful info about processes that use              the device is found by lsof(8) or fuser(1))      logs are:               Oct  7 04:35:46 localhost named: zone enum4red.com/IN: has 0 SOA records     Oct  7 04:35:46 localhost named: zone enum4red.com/IN: has no NS records     Oct  7 04:35:46 localhost named: zone enum4red.com/IN: not loaded due to errors.     Oct  7 04:35:46 localhost named: _default/enum4red.com/IN: bad zone     Oct  7 04:35:46 localhost named: zone localhost.localdomain/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone localhost/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone 0.in-addr.arpa/IN: loaded serial 0      any idea what went wrong?


title: How can I replace text in the last non-blank line?

text: I want to find the last line of text in a file, and delete the comma at the end of it. I asked about this already, but, after I got an answer I realized my question was not specific enough. This `sed` command will go to the last line of a file and take action on it. In my case, I want to remove the trailing comma:               sed -i '$ s/",/"/g' file.txt      So this:               blah blah blah,     blah blah blah,     blah blah blah,      ... becomes this:               blah blah blah,     blah blah blah,     blah blah blah      However, **this won't work if there are blank lines after the last line of text** in the file. I've been searching for ways to get the last line of text but haven't come up with anything that I can understand and apply. I've also looked for ways to remove all trailing blank lines, and found this command:               sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' *.txt      But it doesn't work for me (it just seems to output the contents of my files on the command line). In any case, it's inelegant. I'd rather not delete the trailing blank lines, it would be much better to just identify the last line with text in it and act on that. How do I remove the comma from the last line _of text_ in multiple files in a directory?


title: * not interpreted in ftp, lftp?

text: I'd been seeing that `*` isn't interpreted on ftp or lftp. Suppose I want to change a directory from current to say `./japan` In ftp> of lftp>, if I give:               $ cd jap*      it would show this error:               No such file or directory      So, I'm forced to give the complete name:               $ cd japan      ### EDIT #1 @thomas, @gold: Thank you for your valuable information. As `*` isn't interpreted with all commands (like `cd`), is there any way so that I can get away from typing every time the complete file name.


title: Why does ln -sf silently fail?

text: `ln -sf source_file target_file` succeeds even when source_file does not exist. `ln -f source_file target_file` on the other hand fail, as expected. How can it be tuned to give error on the first case _without_ first testing for the file existence explicitly (i.e. not `[[ -e source_file ]] && ln -sf source_file target_file`)


title: tmpfs performance

text: I use avconv to make screen recording of gameplays on linux (yeah, I'm sorry, I am one of them, but I get more excited about the scripts than playing it self), but recently my harddrive has gone and while waiting for the warranty I'm using one from an old notebook. The problem is that I already knew that I cannot record using this HD for it's to much slower than my old one, as it turns out to be true, I gave up trying to record and started to search for other options. That was when I remembered of tmpfs/ramfs, and this is how I'm trying to work things out: 1) I mount the tmpfs:               $ sudo mount -t tmpfs -o size=2048M captura ~/Videos/capture/memoria/     $ df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda1       286G   63G  209G  24% /     ...     captura         2.0G   62M  2.0G   3% /home/rarlei/Videos/capture/memoria      2) Start gaming (Minecraft, heavy memory usage?) 3) Start recording: `avconv $thousands_of_parameters -v:c libx264 -preset fast memoria/video.mp4` (video only) After some playing I just stop recording to see what I have, but what I see is no different from what I see recording to harddrive. I have 8GB of some pretty good memory (1.2ghz or something like that, I don't know how I can see from linux) I'm not using any specific video card, it's just some regular Intel, but this never afected the recording with my previous harddisk. Wasn't tmpfs supposed to be much faster? Does minecraft affect this? Does encoding affect this? Any thoughts? **UPDATE** I think I'm not being clear, what I am doing is compare two videos, one writen onto harddisk partition, and other writen into tmpfs (memory?), both with same codecs, both from X11 display, my expected result was that tmpfs video had much less lags than harddisk (lags that don't appear while playing), but the result is that both video shows lags, in almost same quantity. Worth saying that those lags didn't occur back with my previous harddisk, so I know it's storage related, and not processor/codec. **UPDATE - Solved (?)** Turns out that something seems to happen in the encoding process that is much more memory consuming (which is obvious now, since it need to load each frame into memory and process there, and then write back into another section of the very same memory) than I foresaw, so, doing everything in memory really caused those lags/framedrops while encoding. I tried to record using rawvideo, and after re-encoding back to mp4 there was no lag in the video. Too bad it takes 1GB for every 10 seconds and I don't have enought memory. There was no way to record rawvideo right to harddisk, doing that slowed the game to the point of stopping it until I stop recording. :( Thank you guys anyway :)


title: emacs shell mode (M-x shell)

text: When I am using the emacs M-x **shell** mode I see strange characters on my screen which I believe are related to my prompt (which includes an End-Of- Line) and the use of colors. So, here's what I see on the terminal:               mperdikeas@thorin:~#     $       And here's what I see inside Emacs **shell** buffer:               ^[]0;mperdikeas@thorin: ~^Gmperdikeas@thorin:~#     $        Here's the relative section of my **.bashrc** :               if [ "$color_prompt" = yes ]; then       PS1='${debian_chroot:+($debian_chroot)}\[\033[1;32m\]\u@\h\[\033[00m\]:\[\033[1;33m\]\w\[\033[00m\]#\n$'     else       PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w#\n$ '     fi       How can I configure emacs to properly display the prompt in the **shell** buffer?


title: How to log output to maillog?

text: On my current Debian setup, I have a file /var/log/mail.log which Dovecot, Postfix, and Spamassassin's spamd all output messages to. I know that the `logger` command can output to syslog, but is there some command that easily lets me output to the mail log from a bash script, or do I have to manually open it and append to it?


title: Newly installed arch linux problems

text: First off, I've installed arch before, but managed to not encounter any of the problems I'm having at the moment (not sure how). But I'm well and truly stuck. First, my network interface is now called enp3s0 rather than eth0, so every time I start arch, I need to run               ip link set enp3s0      and then               dhcpcd enp3s0      how do I configure this so it happens automatically? My second issue seems more peculiar; after booting into arch, I installed the enlightenment WM with pacman, and tried to run it, but apparently I did not have a couple of xorg packages, namely xorg-xinit, and another which I forget. After installing these however, editing the .xinitrc file, and running startx, I just got 3 white bash boxes on a black screen. Though if I run enlightenment_start in one of those boxes, enlightenment starts fine (albeit with 3 terminal boxes open, 2 I can close fine, but if the third is closed, enlightenment exits). I am certain this is not normal behaviour, and any help as to what I'm doing wrong here would be much appreciated.


title: Linux Arch Unity not writeable settings

text: I am running Linux Arch with KDE till yet. Now I want to move to Unity because of some personal favors. I used the tutorial proposed in the arch wiki for installation (the recommended way using the repositories). https://wiki.archlinux.org/index.php/unity#From_repository_.28recommended.29 The ui seems to be running fine, except that I can't change a lot of settings. For example: I can't set an option to the nautilus, to the gnome-terminal, to the compiz config manager. I also can't add a program to my starter. Everything gets reset one second after I set an option. So it seems to me like a permissions problem, that I have no write access to my profile configs, but I don't know how to tackle it.


title: Modify sound volume per application

text: In Fedora 12 + Gnome 2 I used to be able to modify the volume of each application seperately. Now, I'm on Fedora 20 + MATE 1.6.2, and this option is gone. If I click `Notification Area > Sound > Preferences` or `System > Control Centre > MATE Volume Control`, a window opens that shows Master volume and other stuff like Headphones, Speaker, ACM etc., but I can't control each application's volume settings from here. Is there any way how to achieve this? I'm in particular interested in dimming Firefox sounds quite, but only sometimes, and sometimes it's other applications, too.


title: Ibus input method not work in wine application

text: I use ibus input mehod to input chinese，and it doesn't work in wine application. When I type in Chinese mode, there are only english letters left in wine application. I found it is related to windows manager. When I use it in fedora+openbox, it works. But when I use it in fedora+icewm, it doesn't work. So my question is:   * How to debug this kind of wine-X-related problem?   * How the windows managers affect behaviors of wine?


title: Using FACLs to restrict default group but allow others

text: So, I'm running RHEL 6.x with acls enabled, etc. and I've been fighting this ACL issue for a bit now and I can't seem to get it down. I'm trying to make it so that: /var/www/html/* are owned root:apache   /var/www/html/* are 644   /var/www/html/* are rw- for a group we'll call 'html-slingers'   ./html's getfacl looks like this:               # file: html     # owner: root     # group: apache     # flags -s-     user::rwx     group::r-x     group:html-slingers:rwx     mask::rwx     other::r-x     default:user::rwx     default:group::r---     default:group:html-slingers:rw-     default:mask::rw-     default:other:r--      I would /think/ that would mean files would be created with a default of user:apache, 640 (but with an extra acl entry for html-slingers to have rw) ...and the file ends up being created /looking/ that way via getfacl, but the POSIX permissions end up being 664, and the apache group is able to write to the file (even though getfacl says group::r-- Why does this happen? Is there a way to fix or mitigate this? Any help or advice will be greatly appreciated!


title: In zsh, how can I dump all configuration?

text: How can I print my current configuration including defaults and key bindings? This would allow me for example, to find what action is bound to say `^P` in emacs mode and find binding in `vi` mode or set if it is not there instead of browsing manuals.


title: Run a simple http server locally on a non-80 port

text: I have access to a Linux server with a non-root user. What I need is to run a simple, HTTP server that will not listen to port 80, but to a different port. I'm looking for the most easiest and quickest solution. Don't need any authentication or whatever. Would be also nice to run it in a SCREEN. Linux version is Red Hat 4.1.2-50


title: How can I bind Ctrl-Alt-[0-9] in Tmux?

text: I am able to bind Ctrl-Alt-[a-z] using M-C-a, M-C-b etc. However, when I attempt to bind Ctrl-Alt and a number key I get:               .tmux.conf: 45: unknown key: M-C-0      Any idea why? I'm running tmux ver 1.7 Related: How to bind "Ctrl-Alt-b" to the prefix of tmux?


title: Is PAE harddrive dependent?

text: I have two M1400 and I can successfully boot and installed Bodhi Linux on one of them. When I try to boot it on the second one I get a Kernel Error saying that the CPU doesn't support PAE. The two PC's are practically Identical, The same Bios version, same internals. The only difference is that one of them has about 756Mb memory, while the other only has 256Mb... My original question was about if there was a memory requirement but then I had the idea of switching them, but I got the same message. Even the System information indicates that the CPU are exactly the same. I'm not familiar with what difference PAE does exactly, so I'm wondering if maybe because the two hard drives are from different manufacturers? Any explanation? (The model number is the same too?, I'm confused why one works and the other doesn't.


title: -e option with various terminal emulators

text: I didn't like how xterm behaved when I tried to scroll the output of less with my mouse (it scrolls the command history instead of scrolling less). So I got Sakura, and it behaved the way I wanted. However, the '-e' option doesn't seem to work well. When I type               xterm -e "ls /usr/bin | less"      I get a new xterm where the command `ls /usr/bin | less` has been executed. However,               sakura -e "ls /usr/bin | less"      seems to ignore my request, and simply starts a new Sakura terminal. In fact, I've experimented with other terminal emulators and options with no success...               sakura -x "ls /usr/bin | less"     xfce4-terminal -e "ls /usr/bin | less"     roxterm -e "ls /usr/bin | less"     lxterminal -e "ls /usr/bin | less"     lilyterm -e "ls /usr/bin | less"      Some of them ignore my request, and sometimes they claim they say "Failed to execute child process ... (No such file or directory)" I'm currently on Arch. I've come across http://osdir.com/ml/general/2013-07/msg06468.html, which seems to suggest Sakura had at one point behaved as I would have wished it (I currently have version 3.1.0). Any help in getting `sakura` or some other 'nice' terminal emulator to behave as expected would be much appreciated (that is, have the command $TERM -e "ls /usr/bin | less" open up a terminal emulator with the given command executed and have the output of less be scrollable with mouse wheel).


title: Change Folder Permissons in Debian

text: I have some folders with account/user " **OpenERP** " and i created new folder (web_theme) under this directory . When i try to open/read this folder (web_theme) it throws " **Do not have the Permissions** " I have pointed new folder is in root               drwxrwxr-x 7 openerp openerp 4096 Oct  7 10:25 web     drwxrwxr-x 4 openerp openerp 4096 Oct  7 10:30 web_calendar     drwxrwxr-x 4 openerp openerp 4096 Oct  7 10:30 web_rpc     drwxrwxr-x 4 openerp openerp 4096 Oct  7 10:30 web_tests     drwx------ 4 root    root    4096 Oct 18 02:42 web_theme      Tried below commands               su/sudo chmod -R 0770 web_theme     chmod -R 0755 web_theme     chmod 666 web_theme      It Throws Error:               chmod: changing permissions of `web_theme': Operation not permitted     chmod: cannot read directory `web_theme': Permission denied      How do i resolve.


title: Remapping shifted function keys in XKB

text: I'm working on a keyboard layout for the Khmer language and I'm quickly running out of space. My aim is to create a keymap that includes all the characters in the Khmer script as well was their corresponding International Phonetic Alphabet characters. I'd like to be able to remap the `Shift`+`F _n_` , `Alt`+`Fn`, and `Shift`+`Alt`+`F _n_` key combinations to new Unicode code points, but currently it appears that these key combinations are reserved for system shortcuts. How can I override this and remap these keys? The layout I've made in XKB successfully remaps the unmodified `Fn` keys, but `Shift` \+ `F _n_` , `Alt` \+ `F _n_` , etc. are treated the same as if I pressed the `F _n_` key by itself. I'm running Ubuntu 10.04.


title: Security drawbacks of disabling tty password check

text: I found that, in `/etc/inittab`, this modification (`-a username`) for the user `u` disables the login/password check for all tty:s:               1:2345:respawn:/sbin/getty -a u 38400 tty1     2:23:respawn:/sbin/getty -a u 38400 tty2     3:23:respawn:/sbin/getty -a u 38400 tty3     4:23:respawn:/sbin/getty -a u 38400 tty4     5:23:respawn:/sbin/getty -a u 38400 tty5     6:23:respawn:/sbin/getty -a u 38400 tty6      That would be great for me, not having to type the password all the time! Question is, apart from the case when the computer gets stolen, the thief could use the system (which I would prefer, come to think of it), what security implications does this configuration have? Possibly relevant: The second column (runlevels).


title: What are the special characters to print from a script to move the cursor?

text: I found that by printing `\r` from a script the cursor moves to the beginning of the line. What character will move the cursor up one line? Where is a list of these special characters? EDIT: Working in OSX. Also, `\a` rings the bell.


title: Controlling openvpn auth-user-pass in ifup scripts?

text: I have the following configured in /etc/network/interfaces:                iface companyvpn inet manual      openvpn company      This allows me to:                ifup companyvpn      But unfortunately I am unable to provide my credentials as it appears to stop/place the process in the background?                ifup companyvpn       Starting virtual private network daemon: companyEnter Auth Username:      [1]+  Stopped                 ifup companyvpn      Any ideas how to allow the acceptance of username and password at the prompt?


title: Can't locate shell script

text: I created a shell script that logs me in to a server. The script was in a directory that was added to `$PATH` I think I might have deleted the script when not paying attention (not on purpose). I cannot find the script anymore. I tried several things:   1. use Spotlight (I'm using a Mac - spotlight does pretty much the same as `locate` afaik)   2. use `which [scriptname]`   3. go to root and type `find * | grep [scriptname]` None of these solutions located the script. HOWEVER: the script is still working. Even after a reboot. What is going on here? Is the script still somewhere on my drive?


title: How to change output of time command?

text: How would you change the output of the time command from:               real    0m12.304s     user    0m10.187s     sys     0m1.699s      To:               12.30s      EDIT: Using bash (OSX)


title: Set internet connection order or preference

text: I have SL 6.3 installed on two machines. Machine A is a workstation and has two interface `eth0` and `wlan0`. Using `eth0`, it is connected to Machine B (public facing server) with static IP address. Both connect to the internet through their respective `wlan0` interface. The problem is when the workstation is connected to the server, it sends all the packets including those of the internet to `eth0` and therefore fails. To use the internet on workstation, I need to disconnect `eth0` and if I do so then my SSH connection (over `eth0`)to the server hangs! Is there someway, I can compel my workstation to send internet packets to `wlan0` irrespective of the connection state of `eth0`.


title: Whole disk image incremental save and restore

text: I want to create a whole disk image and some incremental of them. First I created a disk backup with               dd if=/dev/disk1 of=/Volumes/USBDrive/diskimage.img bs=1024k      and there is my problem: how can I create an incremental disk image of diskimage.img? And how is the way back from the incremental image to a complete disk?


title: sed remove end of line for specific lines

text: I'm trying to find the sed command to remove the end of the line (meaning, get the next line to the current), but only if line starts with the string NOTOK. example input:                  NOTOK something detected             details are                : some info      output should be:               NOTOK something detected        details are                : some info


title: Linux kernel 3.3 power regression

text: I am using Fedora 16 in my DELL n4110. I recently upgraded the kernel from 3.2 to 3.3. In contradiction to the official claim, my system still drains battery as hell. It only provides 1:30 to 2 hrs of backup under normal stress as before, where as Windows provides 3hrs/+ of backup under similar stress. Below are some screen shots from `powertop`, stats on the services running in my box and few lines from grub.cfg. Hope these will help. `Overview` ![enter image description here](http://i.stack.imgur.com/5gjxu.png) `Idle stats` ![enter image description here](http://i.stack.imgur.com/k5M1f.png) `Frequency stats` ![enter image description here](http://i.stack.imgur.com/SncZ1.png) `Device stats` ![enter image description here](http://i.stack.imgur.com/UvK2B.png) `tunable` ![enter image description here](http://i.stack.imgur.com/7UwE8.png) `services`               /etc/init.d/ceph: ceph conf /etc/ceph/ceph.conf not found; system is not configured.     dc_client.service - SYSV: Distcache is a Distributed SSL Session Cache Client Proxy.           Loaded: loaded (/etc/rc.d/init.d/dc_client)           Active: inactive (dead)            CGroup: name=systemd:/system/dc_client.service     dc_server.service - SYSV: Distcache is a Distributed SSL Session Cache server.           Loaded: loaded (/etc/rc.d/init.d/dc_server)           Active: inactive (dead)           CGroup: name=systemd:/system/dc_server.service     # Generated by ebtables-save v1.0 on Sat Apr 21 09:35:32 NPT 2012     *nat     :PREROUTING ACCEPT     :OUTPUT ACCEPT     :POSTROUTING ACCEPT     httpd.service - The Apache HTTP Server (prefork MPM)           Loaded: loaded (/lib/systemd/system/httpd.service; disabled)           Active: inactive (dead)           CGroup: name=systemd:/system/httpd.service     No active sessions     iscsid.service - LSB: Starts and stops login iSCSI daemon.           Loaded: loaded (/etc/rc.d/init.d/iscsid)           Active: active (running) since Sat, 21 Apr 2012 08:11:58 +0545; 1h 23min ago          Process: 1011 ExecStart=/etc/rc.d/init.d/iscsid start (code=exited, status=0/SUCCESS)         Main PID: 1069 (iscsid)           CGroup: name=systemd:/system/iscsid.service               ├ 1056 iscsiuio               ├ 1068 iscsid               └ 1069 iscsid     libvirtd.service - LSB: daemon for libvirt virtualization API           Loaded: loaded (/etc/rc.d/init.d/libvirtd)           Active: active (running) since Sat, 21 Apr 2012 08:11:58 +0545; 1h 23min ago          Process: 1086 ExecStart=/etc/rc.d/init.d/libvirtd start (code=exited, status=0/SUCCESS)         Main PID: 1111 (libvirtd)           CGroup: name=systemd:/system/libvirtd.service               ├ 1111 libvirtd --daemon               └ 1183 /usr/sbin/dnsmasq --strict-order --bind-interfaces...     started     No open transaction     netconsole module not loaded     Configured devices:     lo Auto_ADW-4401 Auto_PROLiNK_H5004N Auto_korky p4p1     Currently active devices:     lo p4p1 virbr0     radvd.service - router advertisement daemon for IPv6           Loaded: loaded (/lib/systemd/system/radvd.service; disabled)           Active: inactive (dead)           CGroup: name=systemd:/system/radvd.service     sandbox is running     svnserve.service - LSB: start and stop the svnserve daemon           Loaded: loaded (/etc/rc.d/init.d/svnserve)           Active: inactive (dead)           CGroup: name=systemd:/system/svnserve.service      `grub.cfg`               ### BEGIN /etc/grub.d/10_linux ###     menuentry 'Fedora (3.3.1-5.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='(hd0,msdos6)'         search --no-floppy --fs-uuid --set=root 2260640d-2901-49e4-b14f-bf9addb04eb7         echo 'Loading Fedora (3.3.1-5.fc16.x86_64)'         linux   /vmlinuz-3.3.1-5.fc16.x86_64 root=/dev/mapper/vg_machine-lv_root ro pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 rd.lvm.lv=vg_machine/lv_root rd.md=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 rd.lvm.lv=vg_machine/lv_swap LANG=en_US.UTF-8         echo 'Loading initial ramdisk ...'         initrd /initramfs-3.3.1-5.fc16.x86_64.img     }     menuentry 'Fedora (3.3.1-3.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='(hd0,msdos6)'         search --no-floppy --fs-uuid --set=root 2260640d-2901-49e4-b14f-bf9addb04eb7         echo 'Loading Fedora (3.3.1-3.fc16.x86_64)'         linux   /vmlinuz-3.3.1-3.fc16.x86_64 root=/dev/mapper/vg_machine-lv_root ro pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 rd.lvm.lv=vg_machine/lv_root rd.md=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 rd.lvm.lv=vg_machine/lv_swap LANG=en_US.UTF-8         echo 'Loading initial ramdisk ...'         initrd /initramfs-3.3.1-3.fc16.x86_64.img     }           Is this normal? Are there still problems with power consumption in 3.3? `Is there any way to report this problem to the official kernel group???`


title: Start a GNU screen window in the background/without focus

text: The following command `screen -t 'fubar' cmd` will create a new screen window with the command cmd running in it and will set the focus to this window. How can I keep the focus in the current screen window, not the new one?


title: CUPS compilation fails on Cygwin

text: I was brave and tried to compile CUPS in a 32-bit Cygwin environment. I used the standard sources from the tarball. All went fine until linking. http://pastebin.com/QSKvLSmT Here's the end of the transcript:               Compiling raster.c...     raster.c:1: warning: -fPIC ignored for target (all code is position independent)     Linking libcupsimage.so.2...     ../cups/libcups.a(file.o): In function `cupsFileRewind':     /opt/cups/cups-1.4.8/cups/file.c:1465: undefined reference to `_inflateEnd'     ../cups/libcups.a(file.o): In function `cups_fill':     /opt/cups/cups-1.4.8/cups/file.c:2096: undefined reference to `_crc32'     /opt/cups/cups-1.4.8/cups/file.c:2098: undefined reference to `_inflateInit2_'     /opt/cups/cups-1.4.8/cups/file.c:2133: undefined reference to `_inflate'     /opt/cups/cups-1.4.8/cups/file.c:2136: undefined reference to `_crc32'     ../cups/libcups.a(file.o): In function `cupsFileSeek':     /opt/cups/cups-1.4.8/cups/file.c:1569: undefined reference to `_inflateEnd'     ../cups/libcups.a(file.o): In function `cups_compress':     /opt/cups/cups-1.4.8/cups/file.c:1873: undefined reference to `_crc32'     /opt/cups/cups-1.4.8/cups/file.c:1900: undefined reference to `_deflate'     ../cups/libcups.a(file.o): In function `cupsFileOpenFd':     /opt/cups/cups-1.4.8/cups/file.c:996: undefined reference to `_deflateInit2_'     /opt/cups/cups-1.4.8/cups/file.c:1002: undefined reference to `_crc32'     ../cups/libcups.a(file.o): In function `cupsFileClose':     /opt/cups/cups-1.4.8/cups/file.c:121: undefined reference to `_inflateEnd'     /opt/cups/cups-1.4.8/cups/file.c:150: undefined reference to `_deflate'     /opt/cups/cups-1.4.8/cups/file.c:174: undefined reference to `_deflateEnd'     collect2: ld returned 1 exit status     Makefile:331: recipe for target `libcupsimage.so.2' failed     make[1]: *** [libcupsimage.so.2] Error 1     Makefile:34: recipe for target `all' failed     make: *** [all] Error 1      What to do?


title: How to change Grub 2 default permanently?

text: Fedora now uses Grub 2. Whenever it does a kernel upgrade, it loses my default boot option (Windows). How can I fix this? I resent Grub 2 over this, because the old Grub respected my choices.


title: Determining media format/encoding for DLNA system

text: How do you determine what parameters are needed by a DLNA renderer and server? I have a Samsung TV that is a DLNA renderer. I also have a Western Digital NAS running Debian and have Twonky and MediaTomb 0.12.0 installed. The Samsung TV seems to have trouble playing some AV formats. I have tried copying streams with **ffmpeg** to different containers. In some cases, it seems that the **DLNA Server** affects the ability to play back. For instance, _Twonky_ never seems to allow seeking, where as _MediaTomb_ will depending on the AV file; typically only AVI's allow seeking with _MediaTomb/Samsung Tv_. I don't know whether the render or server is responsible. In some cases, it appears that _Twonky_ will not play files that _MediaTomb_ will; Ie, the **DLNA Server** can give up on a media file. Most likely the media server gives up parsing/processing the media file; occasionally this has happened mid-stream. I have _mp4/x264_ files that play and many that don't. Is there some suite of programs I can use to analyze the media files to determine how I need to transcode to ensure play back? I have tried the `midentify.sh` script with **mplayer** and `ffprobe` from **ffmpeg**. Maybe I haven't turned on enough options? Mainly some _x264_ encoded files have trouble playing. _Xvid_ encoded files never have trouble playing. Hopefully it is possible to get _MediaTomb_ to trancode the files on the fly, but I hope it is not the video stream. Is there something better than trial/error encodes? How can I help to zero in on encoding/container parameters that work? Related:   What is the difference between DLNA and UPNP?   Samsung supported formats. **Edit:** Page 34 of the UC6300 user's manual has a list of supported container formats, audio and video codecs, display resolutions and frame and bit rates. For MP4 and AVI, apparently only 1920x1080 resolutions are supported. However, I have been able to play many videos at lower resolutions. 6-30fps is supported. Most encodes are ~24fps so that is not an issue. 8Mbps bit rate for all codecs except H.264BP/MP/HP which lists as 25Mbps (but I think must be 2.5). AVI/MKV and MP4 supports the following audio codecs,   1. MP3   2. ADPCM   3. AAC (MP4 only)   4. AC3 (AVI/MKV)   5. LCPM (AVI/MKV)   6. DTS core (AVI/MKV) I typically use _MP3_ or _AC3_ with the _spdif_ pass-thru to an amp. AVI/MKV/MP4 supports the following video codecs,   1. Divx 3.11/4.x/5.1/6.0 (AVI/MKV)   2. XviD   3. H.264 BP/MP/HP   4. MPEG4 SP/ASP Additionally, H.264 level 4.1 is supported. H.264 FMO/ASO/RS, VC1 SP/MP/AP L4 and AVCHD are not supported. GMC is not supported, H.263 is not supported. How do I translate this to `midentify.sh` or `ffprobe` output?


title: LANG environment variable not respected

text: OS: Mint13 I have set my preferred language to zh-cn via the language support option. This has changed the language of a small handful of things (synaptic, dates and times). However everything else is still in English. When i set my LANG and MDM_LANG variables to zh-CN.UTF-8 manually in the terminal, and open an application - the correct language is displayed. However even having placed `export LANG="zh-CN.UTF-8"` and `export LANG="zh- CN.UTF-8"` in my `.bashrc` everything is still in English. (even if run from the terminal which reports the correct LANG etc). EDIT:               ~ $ locale     LANG=en_AU.UTF-8     LANGUAGE=     LC_CTYPE="en_AU.UTF-8"     LC_NUMERIC=zh_CN.UTF-8     LC_TIME=zh_CN.UTF-8     LC_COLLATE="en_AU.UTF-8"     LC_MONETARY=zh_CN.UTF-8     LC_MESSAGES="en_AU.UTF-8"     LC_PAPER=zh_CN.UTF-8     LC_NAME=zh_CN.UTF-8     LC_ADDRESS=zh_CN.UTF-8     LC_TELEPHONE=zh_CN.UTF-8     LC_MEASUREMENT=zh_CN.UTF-8     LC_IDENTIFICATION=zh_CN.UTF-8     LC_ALL=          ~ $ cat /etc/environment     LC_NUMERIC="zh_CN.UTF-8"     LC_TIME="zh_CN.UTF-8"     LC_MONETARY="zh_CN.UTF-8"     LC_PAPER="zh_CN.UTF-8"     LC_IDENTIFICATION="zh_CN.UTF-8"     LC_NAME="zh_CN.UTF-8"     LC_ADDRESS="zh_CN.UTF-8"     LC_TELEPHONE="zh_CN.UTF-8"     LC_MEASUREMENT="zh_CN.UTF-8"     LANGUAGE="zh_CN:en_AU:en"     LANG="zh_CN.UTF-8"


title: Is any extended logging available for cron jobs?

text: I have 3 scripts under `/etc/cron.daily`. My cron logs are written in `/var/log/cron`. The below is an entry for the above cron that has run.               (root) CMD (run-parts /etc/cron.hourly)      Here the `stdout` or `stderr` of the scripts inside the cron is unavailable, it shows that `run-parts` command has run over this folder. Is there any tricks that can help to log what happened while the 3 scripts were executed? NOTE: I cannot edit the scripts in `cron.daily` to redirect outs and errs to a log file.


title: How do I set up several interfaces all bridged onto eth0?

text: I have found several guides to bridging a single interface (eg `br0`) onto `eth0` but none for multiple interfaces (eg `br0`, `br1` etc). Is this possible?


title: view file containing ISO-8859 text, CRLF line terminators, and escape sequences

text: I have stumbled upon a strange text file in an archive of an old dos game downloaded from some abandonware site. The text file is named `WHY_NOT.TXT`. I assume the file is some sort of .NFO file from the group of people who ... um ... 'liberated' the game. I had not much luck viewing the file using cat or less or even nfoview. The question is: how can I view the content of the file as intended? Output from nfoview: ![nfoview](http://i.stack.imgur.com/m6lVy.png) Here is the output of cat and less. I use screenshots because I fear the encoding will get messed up more by the browser and the internets. ![catless](http://i.stack.imgur.com/1iyNn.png) Output of file:               $ file WHY_NOT.TXT      WHY_NOT.TXT: ISO-8859 text, with CRLF line terminators, with escape sequences      Here is the file in raw hex dump created using `xxd -p WHY_NOT.TXT`:               1b5b34306d0d0a1b5b33396d1b5b34306d0d0a1b5b33396d1b5b34431b5b     303b33346ddb1b5b316ddbdfdfdfdfdfdf201b5b303b33346ddb1b5b316d     dbdfdfdfdfdfdb201b5b34346d201b5b34306ddbdfdfdfdfdfdb201b5b30     3b33346ddb1b5b316ddbdfdfdbdfdfdb201b5b303b33346ddb1b5b316ddb     1b5b36431b5b34346d201b5b34306ddbdfdfdfdfdfdb201b5b303b33346d     db1b5b316ddbdfdfdb201b5b303b33346ddb1b5b316ddb201b5b303b3334     6ddb1b5b316ddbdfdfdfdfdfdc0d0a202020201b5b303b33346ddb1b5b31     6ddbdcdcdcdcdcdc201b5b303b33346ddb1b5b316ddbdcdcdcdc1b5b3434     6ddc1b5b34306ddb201b5b34346d201b5b34306ddbdcdcdcdc1b5b34346d     dc1b5b34306ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb     1b5b316ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b     316ddb1b5b36431b5b34346d201b5b34306ddbdcdcdcdc1b5b34346ddc1b     5b34306ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b     316ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b316d     db202020201b5b303b33346ddb1b5b316ddb0d0a1b5b3130431b5b303b33     346ddc1b5b316ddb201b5b303b33346ddb1b5b316ddb1b5b37431b5b3434     6d201b5b34306ddb202020201b5b303b33346ddc1b5b316ddb201b5b303b     33346ddb1b5b316ddb202020201b5b303b33346ddb1b5b316ddb201b5b30     3b33346ddb1b5b316ddb1b5b36431b5b34346d201b5b34306ddb20202020     1b5b303b33346ddc1b5b316ddb201b5b303b33346ddb1b5b316ddb201b5b     303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b316ddb201b5b303b     33346ddb1b5b316ddb202020201b5b303b33346ddb1b5b316ddb0d0a2020     20201b5b303b33346ddc1b5b316ddcdcdcdcdc1b5b34346ddc1b5b34306d     db201b5b303b33346ddb1b5b316ddb1b5b37431b5b34346d201b5b34306d     db202020201b5b34346d201b5b34306ddb201b5b303b33346ddb1b5b316d     db202020201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b31     6ddbdcdcdcdcdc201b5b34346d201b5b34306ddb202020201b5b34346d20     1b5b34306ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b     5b316ddbdc1b5b34346ddc1b5b34306ddb201b5b303b33346ddb1b5b316d     dbdcdcdcdc1b5b34346ddc1b5b34306ddf0d0a1b5b306d1b5b323535440d     0a      You can recreate the original file by copying that string to a file and then use `xxd -r -p filename`. Here is the md5sum to be really sure that you have the identical original file: `e64665b3f6e5fb3ec71c8fbf6cc63875`


title: How to view bad blocks on mounted ext3 filesystem?

text: I've ran fsck -c on the (unmounted) partition in question a while ago. The process was unattended and results were not stored anywhere (except badblock inode). Now I'd like to get badblock information to know if there are any problems with the harddrive. Unfortunately, partition is used in the production system and can't be unmounted. I see two ways to get what I want:   1. Run badblocks in read-only mode. This will probably take a lot of time and cause unnecessary bruden on the system.   2. Somehow extract information about badblocks from the filesystem iteself. How can I view known badblocks registered in mounted filesystem?


title: Dump Page table layout (KERNEL CONFIG)

text: While configuring kernel for debugging found this option: > CONFIG_X86_PTDUMP: Export kernel pagetable layout to userspace via debugfs Does this mean RAM page-table layouts ? any guides on how to use debugfs and view this layout ?


title: Filesystem and journal layout

text: Is there any tools or some way in linux which can be used to view internals of filesystems ? How to view the inode related structures and journal ? and cached pages of files (pagecache).


title: command line audio with mpg123 - how to save position in audio and begin from that location next time?

text: I am contemplating using mpg123 as an audiobook player. I can't find any other good audiobook players for Linux, and I think mpg123 may be my best option. My audiobooks are organized by directories and the track names are numbered (e.g., Track-01.mp3, Track-02.mp3, etc.). What I am seeking is a way to save the last location played (the track and the position within the track) when I stop listening, and then be able to start mpg123 at that place in the audiobook the next time I listen. It would be ideal to have this "last location" info saved in a text file in the directory. That way I could start each audiobook at the last location by using the text file stored in that audiobook's directory. A similar bookmark feature would be nice too. It would be almost the same implementation, it seems. The "last location" info could be saved in a text file named e.g. "last" and each bookmark could be saved in a text file named bookmark.N (where N simply increments). Is a trivial implementation possible, maybe as a simple bash script? I'm not a developer.


title: Host not found trying to restrict access to yahoo.com in elinks using squid

text: I added this in squid.conf               acl blocked_sites dstdomains .yahoo.com     http_access deny blocked_sites      and this in elinks.conf               set protocol.http.proxy.host = "proxy.localhost:3128"     set protocol.http.proxy.passwd = ""     set protocol.http.proxy.user = ""      And i get HOST NOT FOUND I need some help


title: core i7 processor - x86-64 , cross compile kernel

text: I would like to know whether all core i7 processor is of type x86_64.(as per wiki it says so) I have a core i7 machine (from /proc/cpuinfo) where only 32bit kernel in installed on the same. Also, it has 32 bit gcc compiler installed. If core i7 supports x86_64 kernel , I would like to install the same. I hope all the 32 bit binaries can run on x86_64 kernel , so I am not going to do anything with applications. Now, My questions are:   1. whether core i7 supports x86_64?   2. How to install a 64 bit cross compiler in order to build a kernel (64 bit type). My machine is Fedora FC15.   3. I hope all 32 bit apps should work fine with this 64 bit kernel. ?   4. How to get 64 bit cross compiler for fedora (x86_64)? Note, I am aware about cross compiling kernel.


title: Java NullPointer Exception for Sencha CMD

text: I've been trying to solve this problem for a few weeks now and it just occured to me, I might be asking the wrong question. I am learning and developing building Sencha Touch 2 applications on my Ubuntu web server. You need an utility called Sencha CMD, which utilizes Java, to execute specific commands in the build process. The problem is after creating a few applications, I got the following error:               > Sencha Cmd v4.0.1.4     >         [INF] Workspace does not have framework touch at /var/www ... copying     >     [ERR] java.lang.NullPointerException     >          at com.sencha.util.Version.<init>(Version.java:36)     >          at com.sencha.command.generator.GeneratorCommands$WorkspaceCommand.getParameters(GeneratorCommands.java:130)     >          at com.sencha.command.BasePluginCommands$BasePluginCommand.doExecute(BasePluginCommands.java:23)     >          at com.sencha.command.generator.GeneratorCommands$WorkspaceCommand.execute(GeneratorCommands.java:89)     >          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     >          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     >          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     >          at java.lang.reflect.Method.invoke(Method.java:622)     >          at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)     >          at com.sencha.cli.Command.dispatch(Command.java:42)     >          at com.sencha.cli.Commands.dispatch(Commands.java:64)     >          at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:124)     >          at com.sencha.command.generator.GeneratorCommands$AppCommand.generateWorkspace(GeneratorCommands.java:397)     >          at com.sencha.command.generator.GeneratorCommands$AppCommand.execute(GeneratorCommands.java:240)     >          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     >          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     >          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     >          at java.lang.reflect.Method.invoke(Method.java:622)     >          at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)     >          at com.sencha.cli.Command.dispatch(Command.java:42)     >          at com.sencha.cli.Commands.dispatch(Commands.java:64)     >          at com.sencha.cli.Commands.dispatch(Commands.java:64)     >          at com.sencha.command.Sencha.dispatch(Sencha.java:80)     >          at com.sencha.command.Sencha.main(Sencha.java:148)      My java version is as follows:               java version "1.6.0_27"     OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.10.4)     OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)      And I'm working with **Sencha Touch 2** and **Sencha Cmd 4.0.2.67** **I've been thinking it's a Sencha issue but is it possible this have little or nothing to do with Sencha and more to do with Java?** If that's the case, can anyone suggect solutions, please?


title: Read a file and copy to another file

text: I'm having a issue, I need to copy the file contents and remove a couple of lines if they match the output from a previous command. But so far, I'm having an issue in maintaining the file lines exactly the same. I'm putting the simple part of the script as the if to omit the copy are not part of the problem as this happens with unaffected lines. For the example: In the original file I have the following               Testing,      resuming text      When run the script the fields become:               Testing, resuming text      I'm doing the following:               #!/usr/bin/bash     rm /tmp/dest_file     while read line     do        echo $line >> /tmp/dest_file     done < $1      The problem I have with this is that the files will become different due to the tab formatted fields.


title: why is my php script slower on debian than freebsd?

text: We moved a web-based application to a new server recently, but the new server seems to run slower than the old one. The old server was FreeBSD 7 with Apache 2.2, mod_php 5.3, and mySQL 5.1. The new server is Debian 7 with Apache 2.2, mod_php 5.4, and mySQL 5.5. As far as I can tell, the configurations are pretty much stock. The old server took a long time to display results (10+ seconds, 30 at times), but it displayed results as it got them. The new server seems to take about the same amount of time, but it doesn't display any results until the entire page is ready. This makes the application "feel" slower, because anything you do results in a 10+ second delay before you get any response while it loads the page. Why would the new server be buffering the page (if that's what it's doing). Is there some configuration setting I can change to make it stop?


title: Daemon file access denied while it shouldn't

text: I recently installed a new SSL certificate and then also decided to tighten security a bit by make the private key less readable. This caused a problem with exim. The certificate is now 640 with user `root` and group `ssl`. The user `Debian- exim` is in this group. I can access the private key file just fine from the shell:               #sudo -u Debian-exim cat key     -----BEGIN RSA PRIVATE KEY-----     ...     -----END RSA PRIVATE KEY-----      However, the log file of exim says otherwise:               2012-04-21 00:00:00 <Message-id> unable to open private key file for reading: /.../key     2012-04-21 00:00:00 <Message-id> == some@email <some@email> R=dnslookup T=remote_smtp defer (-1): smtp transport process returned non-zero status 0x0100: exit code 1     2012-04-21 00:00:00 <Message-id> Frozen      Using _auditd_ I checked the filesystem access:               time->Sat Apr 21 00:00:00 2012     type=PATH msg=audit(1335027881.290:6): item=0 name="/.../key" inode=1794200 dev=09:01 mode=0100640 ouid=0 ogid=105 rdev=00:00     type=CWD msg=audit(1335027881.290:6):  cwd="/var/spool/exim4"     type=SYSCALL msg=audit(1335027881.290:6): arch=c000003e syscall=2 success=no exit=-13 a0=16184f8 a1=0 a2=0 a3=0 items=1 ppid=11831 pid=11847 auid=4294967295 uid=100 gid=102 euid=100 suid=100 fsuid=100 egid=102 sgid=102 fsgid=102 tty=pts1 ses=4294967295 comm="exim4" exe="/usr/sbin/exim4" key="sslkey"      Which shows that it indeed fails (though I don't know why). In comparison an as-identical-as-possible successfull calle (file group is changed to `Debian- exim` as opposed to `ssl`)               time->Sat Apr 21 00:00:00 2012     type=PATH msg=audit(1335028586.882:34): item=0 name="/.../key" inode=1794200 dev=09:01 mode=0100640 ouid=0 ogid=102 rdev=00:00     type=CWD msg=audit(1335028586.882:34):  cwd="/var/spool/exim4"     type=SYSCALL msg=audit(1335028586.882:34): arch=c000003e syscall=2 success=yes exit=11 a0=24f74f8 a1=0 a2=0 a3=0 items=1 ppid=13958 pid=13961 auid=4294967295 uid=100 gid=102 euid=100 suid=100 fsuid=100 egid=102 sgid=102 fsgid=102 tty=(none) ses=4294967295 comm="exim4" exe="/usr/sbin/exim4" key="sslkey"      **I have no idea what goes wrong**. Why can the exim daemon access the "key" file when the file group is `Debian-exim` (primary group of `Debian-exim` user) but not when the file group is `ssl` (a secondary group of `Debian-exim` user)?


title: Why I have two /dev/sdx entries with a single disk?

text: In my laptop (running Linux) I have only one SSD, connected to the SATA3 port. Why I have two **sdx** entries in `/dev` directory? In particular I see `/dev/sda` and `/dev/sdb`, and `/dev/sda` is the SSD:               # fdisk -l          Disk /dev/sda: 128.0 GB, 128035676160 bytes, 250069680 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Identificativo disco: 0x00034e4b          Dispositivo Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   125954047    62976000    7  HPFS/NTFS/exFAT     /dev/sda2       125954048   190466047    32256000   83  Linux     /dev/sda3       190466048   222210047    15872000   83  Linux     /dev/sda4       222210048   250068991    13929472    7  HPFS/NTFS/exFAT          $ cat /sys/block/sda/queue/rotational      0      The surprising thing is the following:               $ cat /sys/block/sdb/queue/rotational      1      So it looks like that `/dev/sdb` is considered as a magnetic hard disk drive. What's the point? EDIT:               # lshw -C disk       *-disk                              description: SCSI Disk            product: xD/SD/M.S.            vendor: Generic-            physical id: 0.0.0            bus info: scsi@8:0.0.0            logical name: /dev/sdb            version: 1.00            serial: 3            capabilities: removable            configuration: sectorsize=512          *-medium               physical id: 0               logical name: /dev/sdb       *-disk            description: ATA Disk            product: SAMSUNG SSD 830            physical id: 0.0.0            bus info: scsi@0:0.0.0            logical name: /dev/sda            version: CXM0            serial: S0Z3NSAC905663            size: 119GiB (128GB)            capabilities: partitioned partitioned:dos            configuration: ansiversion=5 sectorsize=512 signature=00034e4b


title: Copy paste problem on KDE

text: I've been extremely annoyed with this issue for a while. I'm using TeXMaker on KDE to write my class notes in LaTeX and I sometimes need to copy paste text from it to some other applications while editing, the flashcard program Anki being one of them. TeXMaker uses syntax highlighting and for some reason hitting copy paste will copy the color tags with it together with tags for formatting. The end result is that Anki will treat the color tags as part of the LaTeX code and feed the code together with color tags into LaTeX, which of course makes any LaTeX compile fail. It seems like KDE apps include formatting and color data in the data that is sent to the clipboard. In other words it won't just be a sequence consisting of the characters you've typed, but it will contain various tags that essentially look like HTML. Anyone else stumbled on the same problem? Any way to fix it?


title: Enabling or disabling one monitor in nVidia Twinview on the command line, like with nvidia-settings

text: For some reasons, most native games as well as Wine have a problem with Twinview. So when starting SC2 I have to manually disable one of my two screens in nvidia-settings. (By going in X Server Display Configuration > click on second monitor > Display > Resolution: off) I searched hard but couldn't find a way to do that automagically. nvidia- settings itself has non-GUI options (see "nvidia-settings -q all") but none of them seems to do what I want. I want to put that in my startup script for games, which already replaces Compiz with metacity (and back when it exits). Help appreciated.


title: How do I make my pc speaker beep

text: Using bash, how can I make the pc speaker beep? Something like `echo 'beepsound' > /dev/pcspkr` would be nice.


title: How do you correctly extract all command synopses from manpages in /usr/share/man/man1?

text: I'm trying to extract all _command synopses_ from manpages in `/usr/share/man/man1` using:               #!/usr/bin/env bash     ## synopses - extract all synopses in /usr/share/man/man1          cd /usr/share/man/man1     for i in *.gz; do         echo "$i:" | sed -E "s/.1.gz|.gz//g"         man "./$i" | sed -n '/^SYNOPSIS/,/^[A-Z][A-Z][A-Z]/p' | sed -e '1d; $d' | tr -s [:space:]     done      ...which provides _some_ measure of success - I get complete output for commands from _a_ to _z_. But I'm also getting many errors on _stderr_ using both `for i in ./*.gz; do man "$i"` and `for i in *.gz; do man "./$i"` _as I output to file_ (`synopses > file`)1:               <standard input>:27: expected `;' after scale-indicator (got `o')     <standard input>:29: expected `;' after scale-indicator (got `o')     <standard input>:283: name expected (got `\{'): treated as missing     <standard input>:674: warning: macro `as',' not defined (possibly missing space after `as')     <standard input>:174: name expected (got `\{'): treated as missing     <standard input>:161: warning [p 1, 5.5i]: can't break line     <standard input>:594: warning [p 5, 3.8i, div `an-div', 0.0i]: can't break line     <standard input>:569: warning [p 6, 0.0i]: can't break line     <standard input>:147: warning [p 1, 1.8i]: can't break line     <standard input>:205: warning [p 2, 0.2i]: can't break line     <standard input>:525: warning [p 5, 4.5i]: can't break line     <standard input>:157: warning [p 1, 4.8i]: can't break line     <standard input>:351: warning [p 3, 1.8i, div `an-div', 0.0i]: can't break line     <standard input>:147: a space character is not allowed in an escape name     man: can't open man1/zshmisc.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshexpn.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshparam.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshoptions.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshbuiltins.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshzle.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcompwid.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcompsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcompctl.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshmodules.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcalsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshtcpsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshzftpsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcontrib.1: No such file or directory     man: -:423: warning: failed .so request     <standard input>:423: can't open `man1/zshmisc.1': No such file or directory     <standard input>:424: can't open `man1/zshexpn.1': No such file or directory     <standard input>:425: can't open `man1/zshparam.1': No such file or directory     <standard input>:426: can't open `man1/zshoptions.1': No such file or directory     <standard input>:427: can't open `man1/zshbuiltins.1': No such file or directory     <standard input>:428: can't open `man1/zshzle.1': No such file or directory     <standard input>:429: can't open `man1/zshcompwid.1': No such file or directory     <standard input>:430: can't open `man1/zshcompsys.1': No such file or directory     <standard input>:431: can't open `man1/zshcompctl.1': No such file or directory     <standard input>:432: can't open `man1/zshmodules.1': No such file or directory     <standard input>:433: can't open `man1/zshcalsys.1': No such file or directory     <standard input>:434: can't open `man1/zshtcpsys.1': No such file or directory     <standard input>:435: can't open `man1/zshzftpsys.1': No such file or directory     <standard input>:436: can't open `man1/zshcontrib.1': No such file or directory      What are those `<standard input>` errors about (something escaped?) and why is `man` ending up not finding some files? How could I make this more robust/efficient? * * * 1\. It seems the errors on _stderr_ are the same whatever the implementation/solution I use for the same data. It is striking.


title: Serialize shell variable in bash or zsh

text: Is there any way to serialize a shell variable? Suppose I have a variable `$VAR`, and I want to be able to save it to a file or whatever, and then read it back later to get the same value back? Is there a portable way of doing this? (I don't think so) Is there a way to do it in bash or zsh?


title: Crontab does not run?

text: # crontab -e               0 */4 * * * root /usr/bin/rsnapshot hourly     30 3 * * * root /usr/bin/rsnapshot daily     0  3 * * 1 root /usr/bin/rsnapshot weekly     30 2 1 * * root /usr/bin/rsnapshot monthly      # tail /var/log/cron               Jun 13 21:01:01 web-backups run-parts(/etc/cron.hourly)[2795]: starting 0anacron     Jun 13 21:01:01 web-backups run-parts(/etc/cron.hourly)[2806]: finished 0anacron     Jun 13 22:01:01 web-backups CROND[2810]: (root) CMD (run-parts /etc/cron.hourly)     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2810]: starting 0anacron     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2819]: finished 0anacron     Jun 13 22:01:01 web-backups CROND[2822]: (root) CMD (run-parts /etc/cron.hourly)     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2822]: starting 0anacron     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2831]: finished 0anacron     Jun 13 22:44:59 web-backups crontab[2854]: (root) BEGIN EDIT (root)     Jun 13 22:45:07 web-backups crontab[2854]: (root) END EDIT (root)      But I am not seeing my cronjobs run. I can run the tasks manually and they run fine.


title: Gnome Terminal appearance

text: Is it possible to get the gnome-terminal in GNOME 3 to be borderless, similar to how urxvt looks? Without the big top of it that says Terminal with your working directory or the menu bar?


title: Download file linked in MySQL DB, extract text and insert into db with bash script?

text: I want to download a file (only download if the url ends with a certain string), which URL is in a MySQL database, extract the text and write the text to the database, by replacing the url.   And this have to be done for every row (approx. 25k rows). Is there a way to do this with a bash script (or something else e.g Java)? The MySQL server runs on my linux root, I have full access to it. My desktop OS is also linux (Linux Mint with many customizations). This is what I made so far:               #!/bin/bash          for (( i=1; i <= 5; i++))     do             DBQUERY=`mysql -B -ss -uuser -ppassword -e "USE table; SELECT column FROM table WHERE pid='$i';"`             if [[ $DBQUERY == *.pls ]] ;        then             wget -O tempfile.pls $DBQUERY             while read line             do                 if [[ $line == File1=* ]] ;                 then                     mysql -B -ss -uuser -ppassword -e "USE table; UPDATE table SET column = '${line:6}' WHERE pid = '$i';"                 fi             done <tempfile.pls        fi     done      How can I secure it?


title: Is there a way to get *actual* (uninterpreted) shell arguments in a function or script?

text: I have a function `posix` that I use in the Git bash shell on Windows to transform DOS-style paths to normal Unix-style paths. Since DOS-style paths use a backslash as separator, I have to quote the path argument to prevent the backslashes as being used by the shell to denote the next character as a literal. Is there any way to get the _uninterpreted_ argument from inside my function, so that I don't need to quote it? Here is my function, if it helps:               function posix() {       echo $1 | sed -e 's|\\|/|g' | sed -re 's|^(.)\:|/\L\1|'     }      (By the way, I welcome any _comments_ with tips for improving the function in other ways unrelated to solving the quoting/shell-interpretation problem.)


title: Auto-expansion problem with array elements containing an '*' (asterisk)

text: I'm trying to write me a `find` script that should later be able to read a list of directories to be excluded from an external file. Whilst I can accomplish that part myself, it's the annoying array expansion that makes the task difficult. First, some "preparations" in order to obtain a suitable sample directory tree:               $ mkdir tmp && cd tmp     $ mkdir excl1_dirx excl2_dirx excl3_dirx     $ touch excl1_dirx/dummy1.txt excl2_dirx/dummy2.txt excl3_dirx/dummy3.txt     $ mkdir excl1_diry excl2_diry excl3_diry     $ touch excl1_diry/dummy4.txt excl2_diry/dummy5.txt excl3_diry/dummy6.txt     $ touch dummy00.txt dummy01.txt      If the script works, only `dummy00.txt` and `dummy01.txt` may be shown.               #!/bin/bash     excl_d=("excl*_dirx" "excl*_diry")          find_str=" . -type f ! ( "          for ((i=0 ; i<$((${#excl_d[*]})) ; i++)); do        if [[ $i > 0 ]]; then          find_str+=" -o "        fi            find_str+=" -path \"./${excl_d[i]}/*\""     done          find_str+=" )"          # this is just for debugging     echo "[debug] value of str = find $find_str"          find $find_str      First of all: why so (seemingly) complicated in the line before the "`done`"? Well, `bash` sometimes likes to annoy the users by doing things they don't expect. Without those quotes, it will **expand** each array element; e. g. `excl*_dirx` will become `excl1 dirx excl2 dirx excl3 dirx`, which (obviously) breaks the `-path` line! And that although I've used a pair of double quotes per array element, which was actually supposed to prevent bash from doing its expansion mischief! However, the best is yet to come: the second last line - when the `(` `)` are escaped to `\(` `\)` \- will work fine in the shell, but not in a standalone script. Even though it won't throw any errors, the result in the latter implementation will be wrong. I've tried all kinds of combinations with single and double quotes in the               find_str+=" -path \"./${excl_d[i]}/*\""      line, but I just can't get it to work even though it looks absolutely perfect when displayed as in the second last line. It seems that `bash` internally treats my escaped quotes `\"` differently from non-escaped ones. Ah, and quotes inside quotes work near everywhere _but_ for some reason will get filtered out when using that `+=` operator. Not only am I looking for an explanation for this behavior but also for a solution how it could be made work in a standalone script. It must really be a stupid mistake I've made. :-/


title: How to setup 3 screens with 2 ATI GPU Debian Squeeze

text: I want to use 3 screens on my computers with 2 graphics card ATI Radeon HD 5450. I've installed fglrx ATI drivers. Here is the result of lspci :               root@dev1:~# lspci | grep VGA     01:00.0 VGA compatible controller: ATI Technologies Inc Cedar PRO [Radeon HD 5450]     06:00.0 VGA compatible controller: ATI Technologies Inc Cedar PRO [Radeon HD 5450]      And here is my xorg.conf               root@dev1:~# cat /etc/X11/xorg.conf     Section "ServerLayout"         Identifier     "aticonfig Layout"         Screen      0  "Screen0" 0 0         Screen      1   "Screen1" RightOf "Screen0"         Screen      2   "Screen2" LeftOf "Screen0"     #   Option      "Xinerama" "true"     EndSection          Section "Module"     EndSection          Section "Monitor"         Identifier   "Monitor0"         Option      "VendorName" "ATI Proprietary Driver"         Option      "ModelName" "Generic Autodetecting Monitor"         Option      "DPMS" "true"     EndSection          Section "Monitor"         Identifier   "Monitor1"         Option      "VendorName" "ATI Proprietary Driver"         Option      "ModelName" "Generic Autodetecting Monitor"         Option      "DPMS" "true"     EndSection          Section "Monitor"         Identifier   "Monitor2"         Option      "VendorName" "ATI Proprietary Driver"         Option      "ModelName" "Generic Autodetecting Monitor"         Option      "DPMS" "true"     EndSection          Section "Device"         Option      "ZaphodHeads" "VGA-0"         Identifier  "Device0"         Driver      "fglrx"         BusID       "PCI:1:0:0"         Screen      0     EndSection          Section "Device"         Option      "ZaphodHeads" "DVI-0"         Identifier  "Device1"         Driver      "fglrx"         BusID       "PCI:1:0:0"         Screen      1     EndSection          Section "Device"         Identifier  "Device2"         Driver      "fglrx"         BusID       "PCI:6:0:0"         Screen      2     EndSection          Section "Screen"         Identifier "Screen0"         Device     "Device0"         Monitor    "Monitor0"         DefaultDepth     24         SubSection "Display"             Viewport   0 0             Depth     24         EndSubSection     EndSection          Section "Screen"         Identifier "Screen1"         Device     "Device1"         Monitor    "Monitor1"         DefaultDepth     24         SubSection "Display"             Viewport   0 0             Depth     24         EndSubSection     EndSection          Section "Screen"         Identifier "Screen2"         Device     "Device2"         Monitor    "Monitor2"         DefaultDepth     24         SubSection "Display"             Viewport   0 0             Depth     24         EndSubSection     EndSection      When I start the X server, it log this :                   root@dev1:~# /etc/init.d/kdm restart && tail -f /var/log/Xorg.0.log     Stopping K Display Manager: kdm...^[[Adone.     Starting K Display Manager: kdm.     xorg-server 2:1.7.7-14 (Julien Cristau <jcristau@debian.org>)     Current version of pixman: 0.16.4         Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.     Markers: (--) probed, (**) from config file, (==) default setting,         (++) from command line, (!!) notice, (II) informational,         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     (==) Log file: "/var/log/Xorg.0.log", Time: Fri Sep 28 17:59:07 2012     (==) Using config file: "/etc/X11/xorg.conf"     (==) Using system config directory "/usr/share/X11/xorg.conf.d"     (==) ServerLayout "aticonfig Layout"     (**) |-->Screen "Screen0" (0)     (**) |   |-->Monitor "Monitor0"     (**) |   |-->Device "Device0"     (**) |-->Screen "Screen1" (1)     (**) |   |-->Monitor "Monitor1"     (**) |   |-->Device "Device1"     (**) |-->Screen "Screen2" (2)     (**) |   |-->Monitor "Monitor2"     (**) |   |-->Device "Device2"     (==) Automatically adding devices     (==) Automatically enabling devices     (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.         Entry deleted from font path.     (==) FontPath set to:         /usr/share/fonts/X11/misc,         /usr/share/fonts/X11/100dpi/:unscaled,         /usr/share/fonts/X11/75dpi/:unscaled,         /usr/share/fonts/X11/Type1,         /usr/share/fonts/X11/100dpi,         /usr/share/fonts/X11/75dpi,         /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,         built-ins     (==) ModulePath set to "/usr/lib/xorg/modules"     (II) The server relies on udev to provide the list of input devices.         If no devices become available, reconfigure udev or disable AutoAddDevices.     (II) Loader magic: 0x7c8a40     (II) Module ABI versions:         X.Org ANSI C Emulation: 0.4         X.Org Video Driver: 6.0         X.Org XInput driver : 7.0         X.Org Server Extension : 2.0     (++) using VT number 8              (--) PCI:*(0:1:0:0) 1002:68f9:174b:e233 ATI Technologies Inc Cedar PRO  Radeon HD 5450] rev 0, Mem @ 0xe0000000/268435456, 0xf7e20000/131072, I/O @ 0x0000e000/256, BIOS @ 0x????????/131072     (--) PCI: (0:6:0:0) 1002:68f9:174b:e233 ATI Technologies Inc Cedar PRO [Radeon HD 5450] rev 0, Mem @ 0xd0000000/268435456, 0xf7d20000/131072, I/O @ 0x0000c000/256, BIOS @ 0x????????/131072     (II) Open ACPI successful (/var/run/acpid.socket)     (II) "extmod" will be loaded by default.     (II) "dbe" will be loaded by default.     (II) "glx" will be loaded by default.     (II) "record" will be loaded by default.     (II) "dri" will be loaded by default.     (II) "dri2" will be loaded by default.     (II) LoadModule: "extmod"     (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so     (II) Module extmod: vendor="X.Org Foundation"         compiled for 1.7.7, module version = 1.0.0         Module class: X.Org Server Extension         ABI class: X.Org Server Extension, version 2.0     (II) Loading extension SELinux     (II) Loading extension MIT-SCREEN-SAVER     (II) Loading extension XFree86-VidModeExtension     (II) Loading extension XFree86-DGA     (II) Loading extension DPMS     (II) Loading extension XVideo     (II) Loading extension XVideo-MotionCompensation     (II) Loading extension X-Resource     (II) LoadModule: "dbe"     (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so     (II) Module dbe: vendor="X.Org Foundation"         compiled for 1.7.7, module version = 1.0.0         Module class: X.Org Server Extension         ABI class: X.Org Server Extension, version 2.0     (II) Loading extension DOUBLE-BUFFER     (II) LoadModule: "glx"     (II) Loading /usr/lib/xorg/modules/extensions/libglx.so     (II) Module glx: vendor="FireGL - ATI Technologies Inc."         compiled for 7.5.0, module version = 1.0.0     (II) Loading extension GLX     (II) LoadModule: "record"     (II) Loading /usr/lib/xorg/modules/extensions/librecord.so     (II) Module record: vendor="X.Org Foundation"         compiled for 1.7.7, module version = 1.13.0         Module class: X.Org Server Extension         ABI class: X.Org Server Extension, version 2.0     (II) Loading extension RECORD     (II) LoadModule: "dri"     (II) Loading /usr/lib/xorg/modules/extensions/libdri.so     (II) Module dri: vendor="X.Org Foundation"         compiled for 1.7.7, module version = 1.0.0         ABI class: X.Org Server Extension, version 2.0     (II) Loading extension XFree86-DRI     (II) LoadModule: "dri2"     (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so     (II) Module dri2: vendor="X.Org Foundation"         compiled for 1.7.7, module version = 1.1.0         ABI class: X.Org Server Extension, version 2.0     (II) Loading extension DRI2     (II) LoadModule: "fglrx"     (II) Loading /usr/lib/xorg/modules/drivers/fglrx_drv.so     (II) Module fglrx: vendor="FireGL - ATI Technologies Inc."         compiled for 1.7.1, module version = 8.77.5         Module class: X.Org Video Driver     (II) Loading sub module "fglrxdrm"     (II) LoadModule: "fglrxdrm"     (II) Loading /usr/lib/xorg/modules/linux/libfglrxdrm.so     (II) Module fglrxdrm: vendor="FireGL - ATI Technologies Inc."         compiled for 1.7.1, module version = 8.77.5     (II) ATI Proprietary Linux Driver Version Identifier:8.77.5     (II) ATI Proprietary Linux Driver Release Identifier: 8.771     (II) ATI Proprietary Linux Driver Build Date: Aug 25 2010 21:38:26     (II) Primary Device is: PCI 01@00:00:0     (WW) Falling back to old probe method for fglrx     (II) Loading PCS database from /etc/ati/amdpcsdb     (WW) fglrx: No matching Device section for instance (BusID PCI:0@6:0:0) found     (--) Chipset Supported AMD Graphics Processor (0x68F9) found     (--) Chipset Supported AMD Graphics Processor (0x68F9) found     (--) Chipset Supported AMD Graphics Processor (0x68F9) found     (WW) fglrx: No matching Device section for instance (BusID PCI:0@1:0:1) found     (WW) fglrx: No matching Device section for instance (BusID PCI:0@6:0:1) found     (II) AMD Video driver is running on a device belonging to a group targeted for this release     (II) AMD Video driver is signed     (II) fglrx(0): pEnt->device->identifier=0x18d46c0     (II) fglrx(1): pEnt->device->identifier=0x18d46c0          Backtrace:     0: /usr/bin/X (xorg_backtrace+0x28) [0x4667b8]     1: /usr/bin/X (0x400000+0x67d49) [0x467d49]     2: /lib/libpthread.so.0 (0x7f37d3167000+0xeff0) [0x7f37d3175ff0]     3: /usr/lib/xorg/modules/drivers/fglrx_drv.so (atiddxProbe+0x7d6) [0x7f37cf6edb66]     4: /usr/bin/X (xf86CallDriverProbe+0x2bd) [0x47255d]     5: /usr/bin/X (InitOutput+0x343) [0x4729e3]     6: /usr/bin/X (0x400000+0x25a8a) [0x425a8a]     7: /lib/libc.so.6 (__libc_start_main+0xfd) [0x7f37d1c6ac8d]     8: /usr/bin/X (0x400000+0x257e9) [0x4257e9]     Segmentation fault at address 0x30          Fatal server error:     Caught signal 11 (Segmentation fault). Server aborting               Please consult the The X.Org Foundation support         at http://wiki.x.org     for help.     Please also check the log file at "/var/log/Xorg.0.log" for additional information.      Specially, I don't understand this line :               (WW) fglrx: No matching Device section for instance (BusID PCI:0@6:0:0) found      So could you help me to configure my xorg.conf to have 3 screens on 2 GPU ?


title: Get line number in a Bourne shell script

text: I'd like to be able to print the current line number in a shell script. I know about the `$LINENO` variable in Bash shells, but it doesn't seem to exist in Bourne shells. Is there any other variable or way I can get the line number?


title: GKrellM vs. udev's asynchronous drive mappings on bootup

text: Well, supposing you had multiple drives (3 in this example), `udev` would always play dice with them on each system reboot. And now, let's make things a little more quirky by adding one USB flash drive you have connected. So the setup may (or may not) look like this at system start: `/dev/sda` HDD #1   `/dev/sdb` HDD #2   `/dev/sdc` Flash drive   `/dev/sdd` HDD #3 Since you're a clever "admin" of your own system, you've remembered to use _disk labels_ in your `/etc/fstab` so you will not have to care about `/dev/sdX` assignments. But `GKrellM` does not understand disk labels! That is, as far as I know. So if you want to assign e. g. a command to _two specific drives_ out of your three, how do you ensure that these commands are always executed on the drives you do want them executed onto? Remember, on next reboot, HDD #3 might be on `/dev/sdb`, and your Flash drive on `/dev/sdd`. Totally random; as predictable as the lottery. So does anyone know how to handle this issue?   (except for setting up hard `udev` rules in `/etc`, that is)


title: Programmatically extract private IP address(es)

text: I'm looking for an easy way to programmatically extract the **private** IPv4 address(es) of a computer. Something similar to this question, but restricted to private IPs. As an example, I can extract **all** the IPv4 addresses with the following command:               ifconfig | grep 'inet addr' | cut -d ':' -f 2 | awk '{ print $1 }'      Example output:               6.11.71.78     10.0.2.15     127.0.0.1      In a similar way, I'd like to get just IPs in the private address space. So, referring to the same example, the output should be:               10.0.2.15


title: Bash - setting environment vars from bash invocation line

text: I'm looking for a way to manipulate some env var, which will be available for processes spawned by bash. Something like the below (of course, the syntax is not correct)               /bin/bash VAR_X=2      and then later command being run from bash script can do               if [ "$ENV_VAR_X" = 2 ] ..       Notice that I'm invoking bash from a windows Console2/Msys setup, so doing `VAR_X=2 bash` is not an option. Does anyone know how it can be done?