title: How do i deal with HP Device Manager requiring authentication to remove print jobs?

text: I have Fedora 20, with Gnome 3 Classic, and have installed Okular to read and, especially, print pages from, .pdf files. I want to print only a few pages, but in my frustrated attempts to set this up I have created, unintentionally, two print jobs that start printing the whole document each time I turn the printer on. the only ways I know to stop wasting ink and paper are to switch the printer off or take the paper out of the feed tray. Any attempt to print anything at all just starts these jobs off again. If I try to use HP Printer Driver Manager to "Reject" (i.e. remove or delete) the print job I get a window saying that "authentication is required", but no combination of Username and Password that I know of will work, and there is a small twirly "please wait" or "working" symbol that prevents me from closing the HP Printer Driver Manager window, and never goes away. The only way I know of to get out of this is "shutdown" in the command line to turn the computer off. Obviously I am missing something, possibly obvious, beyond my comprehension. Please can anyone help me out of this impasse, even by using different software?


title: Unexpected whitespace using sqsh in command substitution

text: Below shell script instruction behave in weird way               ARG_DATE=`sqsh -S $SERVER -U $DB_USER -P $DB_PASSWORD -D dbname -h<<END     SET NOCOUNT ON     go     select convert(varchar, PRIOR_COB_DATE, 112) from TABLE     go     END`     echo $ARG_DATE          if [ "${ARG_DATE}" != "1" ] && [ "${ARG_DATE}" != " " ]; then         if [ ${ARG_DATE/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/1} = "1" ]; then             PRIOR_POSITION_DATE=${ARG_DATE}             echo "assigned " $PRIOR_POSITION_DATE         else             echo "Date must be in follow format: YYYYMMDD"             echo "POSITION_DATE will be used."         fi     fi                    URL_PARAMS="HttpAutosysJobExecutor/NotificationEmailGenerator.job?prior_cob_date=${PRIOR_POSITION_DATE}"         echo $URL_PARAMS         echo ${CONNECTION_STATUS_FILE} "http://${SERVER_ADDRESS}:${SERVER_PORT}/HTTP/${URL_PARAMS}"             wget -o ${CONNECTION_STATUS_FILE} "http://${SERVER_ADDRESS}:${SERVER_PORT}/HTTP/${URL_PARAMS}"             if [ -f ${CONNECTION_STATUS_FILE} ]; then                 RESPONSE_STATUS=`grep -o '200 OK' ${CONNECTION_STATUS_FILE}`                 if [ -z "${RESPONSE_STATUS}" ]; then                     echo Login failed.                     exit 3                 fi             #    rm ${CONNECTION_STATUS_FILE}             fi      while executing wget I am getting so many whitespaces becasue of whitespaces database procedure is failing to cast string in DB Date, using `sed` I can remove whitespaces but I want to know the possible reason of this. **Log in CONNECTION_STATUS_FILE**               http://XXXXX:7001/MYAPP/HttpAutosysJobExecutor/NotificationEmailGenerator.job?prior_cob_date=%2020130523%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20


title: For output weird

text: This is my script:               #!/bin/bash     E=0;j=0     for i in A B C     do       Erray=$(sed -n '/Local net energy/p' log | awk '{print $7}')       A[j]=j       echo $i = $Erray kJ/mol >> Energy       let j=j+1       echo $j $i $Erray ${A[j]}     done     cat Energy      The output is:               1 A 2.692036739192E+03     2 B 2.679751695663E+03     3 C 4.732453844269E+03     A = 2.692036739192E+03 kJ/mol     B = 2.679751695663E+03 kJ/mol     C = 4.732453844269E+03 kJ/mol      It should not be that. The order of the output is "sorted" and the `${A[j]}` doesn't appear. **Edit** Now I know why the output is sorted. I forgot to add `>> Energy` after the second `echo`. The array problem still remains. My input data is large, I only extract lines which are relevant.               print energy 2 - 1 end       Local net energy (PE 0) = 2.692036739192E+03 kJ/mol       Global net ELEC energy = 2.692036739192E+03 kJ/mol


title: TightVNC shows the window cropped

text: I am running debian live cd in qemu (kvm), and when I connect to VNC via `vncviewer localhost:5900` the window is cropped to some static width and height combination. Making window fullscreen or resizing it doesn’t have any effect. ![enter image description here](http://i.stack.imgur.com/4sipU.png)


title: Absolute link pointers, able to work in another system

text: I have a folder and within it there are many links. I make those links absolute, so that I can move them about within the folder and they still point to the same data. Relative links would break if I moved them within the folder. But the problem arises when i move the folder to another system, say an external hard drive or server. Then all the absolute links have the wrong base in their address. If it were possible to have the links have a variable within their address pointing, then that would solve this problem. Is that possible?


title: How to submit a Linux module upstream?

text: I've written a useful kernel module for a specific fan controller that I want to submit upstream. Where can I find an address to submit my module? Do I need it make GPL or can I use a less restrictive licence?


title: Automated ssh login with passphrase?

text: Logging onto a machine over ssh typically requires a password to be entered before access is granted. Alternatively, a key/certificate (without a passphrase) can be installed onto the remote machine so that logging on no longer requires a password. This is particularly useful for automated or scripted solutions. However, it is considered inadvisable and unsafe to create a key/certificate without a passphrase. Solutions involving `ssh-add` and `ssh-agent` are proposed as a means to enter a passphrase only once per session, but to still use a key/certificate with a passphrase. What is the solution for automated connections between machines? How can a machine automatically update from a remote Bazaar repository (via `bzr+ssh`?) on a regular basis, as in a cron job? How can a machine automatically backup data from another machine (via rsync) as part of a cron job? `rsyncd`? This would not be encrypted though, which is a major disadvantage. I haven't looked at Bazaar daemon/server options.


title: openvpn routing

text: So far I have successfully created a virtual link between server A and server B using an unencrypted openvpn tunnel. I am trying to route some of server B's traffic through server A. Server B has 5 external IPs and I would like to add 5 local vpn IPs that redirect traffic to 5 IPs at server A, which would give server B 10 distinct outgoing IPs to the world. Obviously some routing needs to be done on both servers but I'm not getting anywhere after a day of googling and reading. I did               ip route add default via 10.0.0.2 dev tun0 table vpn_table     ip rule add from 10.0.0.1/32 table vpn_table     ip rule add to 10.0.0.2/32 table vpn_table     ip route flush cache      on server B, and the same on server A but with IPs swapped. However, on server B when I do `wget --bind-address=10.0.0.1 somewebsite` it's not working, I guess because server A doesn't know what to do with the request. Could anyone point me in the right direction? EDIT Someone suggested that server A doesn't need ip rules, so the situation I have right now is:   1. setup openvpn link   2. on server B I do the four ip command mentioned above I think I'm still missing some routing info on server A. This is what tcpdump on server A outputs when I do `wget --bind-address=10.0.0.1 http://www.cnn.com` on server B:               tcpdump: WARNING: arptype 65534 not supported by libpcap - falling back to cooked socket     tcpdump: verbose output suppressed, use -v or -vv for full protocol decode     listening on tun0, link-type LINUX_SLL (Linux cooked), capture size 96 bytes     07:11:58.787908 IP 10.0.0.1.42802 > 157.166.248.10.80: S 2416144580:2416144580(0) win 14600 <mss 1410,sackOK,timestamp 858359606 0,nop,wscale 7>     07:11:59.786129 IP 10.0.0.1.42802 > 157.166.248.10.80: S 2416144580:2416144580(0) win 14600 <mss 1410,sackOK,timestamp 858359856 0,nop,wscale 7>     07:12:01.788535 IP 10.0.0.2 > 10.0.0.1: ICMP host 157.166.248.10 unreachable, length 68     07:12:01.788545 IP 10.0.0.2 > 10.0.0.1: ICMP host 157.166.248.10 unreachable, length 68      Wget on Server B says               Connecting to www.cnn.com (www.cnn.com)|157.166.248.11|:80... failed: No route to host.      **EDIT 5/19/2014** Added SNAT on server A, right now tcpdump on server A is giving me (93.184.216.119 = www.example.com, 1.2.3.4 = server A's external IP that is now the source of packets coming from 10.0.0.1)               09:29:44.114475 IP 10.0.0.1.54691 > 93.184.216.119.80: S 717252699:717252699(0) win 14600 <mss 1410,sackOK,timestamp 903625938 0,nop,wscale 7>     09:29:45.113546 IP 10.0.0.1.54691 > 93.184.216.119.80: S 717252699:717252699(0) win 14600 <mss 1410,sackOK,timestamp 903626188 0,nop,wscale 7>     09:29:47.116587 IP 1.2.3.4 > 10.0.0.1: ICMP host 93.184.216.119 unreachable, length 68     09:29:47.116668 IP 1.2.3.4 > 10.0.0.1: ICMP host 93.184.216.119 unreachable, length 68     09:29:47.119289 IP 10.0.0.1.54691 > 93.184.216.119.80: S 717252699:717252699(0) win 14600 <mss 1410,sackOK,timestamp 903626689 0,nop,wscale 7>     09:29:50.120591 IP 1.2.3.4 > 10.0.0.1: ICMP host 93.184.216.119 unreachable, length 68      So it looks like SNAT on server A is working but somehow it is unable to connect to the requested website. Server A iptables list:               SNAT       all  --  10.0.0.1             anywhere            to:1.2.3.4      Server A ip rule list:               0:      from all lookup local     32766:  from all lookup main     32767:  from all lookup default      Part of server A 'route -n':               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     10.0.0.1        0.0.0.0         255.255.255.255 UH    0      0        0 tun0      Could the gateway being 0.0.0.0 have something to do with it?


title: How to "grep" a string of a returned result

text: How to grep the number `50.0` from the string `temp=50.0'C` In JavaScript I can use the expression `/temp=(.*?)'C/` to get it. But I cant get it running in grep.


title: How can I use CNAME in Bind properly?

text: I'm new to Bind/DNS and want to point/map SMTP, webmail and IMAP to my domain but a check in nslookup is failing. How can I nslookup SMTP this way? The error I get is: `smtp.stylez24.com: NXDOMAIN` In my forward zone file I have this, wich lets me nslookup my domain but not SMTP:               ; BIND data file for local loopback interface;     $TTL    604800     @       IN      SOA     server.stylez24.com.     admin.stylez24.com. (                               2         ; Serial                          604800         ; Refresh                           86400         ; Retry                         2419200         ; Expire                          604800 )       ; Negative Cache TTL       ;                  stylez24.com.            IN      NS              stylez24.com.        stylez24.com.            IN      A               192.168.10.1             @                       IN      A               127.0.0.1        @                       IN      AAAA            ::1        www                     IN      CNAME           stylez24.com.        smtp                    IN      CNAME           stylez24.com.        stylez                  IN      A               192.168.10.1        smtp.stylez24.com       IN      A               192.168.10.2


title: How to configure screen-restore in a terminal?

text: Depending on the terminal/environment following sequence has different effects:               $ ls     1     2     $ man ls     enter q      Either I see last displayed man-page screen above the current prompt or the ls output and previous shell output is restored. Same effect is observed e.g. when using `vim` and then suspending it to do something on the shell. On Fedora 19 - the default of screen seems to be no-restore, a gnome- terminal/xterm uses do-restore by default. On Solaris it depends on the used terminal/terminfo db it seems. I want to configure the restore behavior consistently between different systems/terminals.


title: Can I make a special file in linux that is actually the output of a script?

text: Can I make a special file in linux, perhaps using mknod, that is actually the output of a script? example: `cat specialfile` output: `testing 123` inside specialfile: `echo "testing 123"` So instead of actually showing `echo "testing 123"`   it shows the result of the script output `testing 123` I realize the script name and the output handle may have to be two different files so it can be edited ie. `specialfile.sh` for the script and `specialfile` for the handle


title: Deleting Lines if there is a dot in the 5th Column

text: I have a file and I want to remove all the line if it has a dot in the 5th Column. **Input File:**               sc2/80         20      .        A        C        80      PASS    N=2       F=5;U=4     sc2/60         55      .        G        .        72      PASS    N=2       F=5;U=4      sc2/68         20      .        T        A        71      PASS    N=2       F=5;U=4      sc2/10         24      .        T        .        31      PASS    N=2       F=5;U=4     sc2/40         59      .        T        .        31      PASS    N=2       F=5;U=4     sc2/24         24      .        A        G        38      PASS    N=2       F=5;U=4      **Expected Output:**               sc2/80         20      .        A        C        80      PASS    N=2       F=5;U=4     sc2/68         20      .        T        A        71      PASS    N=2       F=5;U=4     sc2/24         24      .        A        G        38      PASS    N=2       F=5;U=4      Note: The file has a size of 64G and it has 690,000,000 lines in it. Is there an efficient solution as it is quite a big dataset. I would prefer Awk and Sed as I am new in the field. Thanks for your help.


title: how to enable command history of shell

text: I am using ubuntu 13.04, in this the command history of the shell is getting erased on close. Can someone tell me how to prevent this from happening?


title: C-library HMAC_MD5 questions

text: We are working with an older software product that has some limited programming capabilities - specifically, no bit manipulation functions. This has created a significant problem as we need to implement a HMAC-MD5 Hash to interface with an industry standard software interface. The older software does have the ability to call a C program/dll and pass that information and obtain a returned value. We have no experience with the C language or how to set up the shared libraries required. So specifically: • How should we set up and install a simplistic C compiler environment? • Where can we find an existing open source C implementation of the HMAC-MD5 algorithm? • If this does not exist, where can we find a resource to implement this algorithm? Our environment is Unix CENTOS 4.9 and Apache/1.3.42 Any help or direction would be greatly appreciated and thank you kindly for your time.


title: Why does it temporarily look like the pv command transfer limit is no longer enforced when I come out of suspend to ram?

text: I have this _perl_ script and I discovered the `pv` command and decided to use it to get some feedback into what is going on with the randomness in terms of throughput. After a few tests1 I decided to throttle the command, like so:               perl_commands < /dev/urandom | pv -L 512k | tr -cd SET          5.5MiB 0:00:11 [ 529kiB/s] [                    <=>                             ]      I suspend to ram using `systemctl suspend`( _Archbang_ ). When I resume, the command still runs and includes the elapsed time since suspend in its dialog but it looks as if the _limit_ I set is no longer enforced, throughput is 2-3MiB/s and CPU is higher - like without a limit. After some time, this _subsides_ and I can see that the limit is still enforced. For example, if I run the command for only a few seconds it'll take seconds for the throughput to come back to its set limit. On the other hand, generating 815Mb of data during an hour, then suspending for 30 mins, it then takes about 5 mins for the command to return to the limit I had set - and CPU usage is like with no throttling during that time. So it is not that the limit isn't enforced, it's rather that coming out of suspend to ram seems to impact the throughput in this context. Why and can this behavior be changed? * * * 1. The command uses one CPU core when not throttled. With a limit of 512KiB\s, CPU usage is about 10-15% or less. It takes about 2gb of randomness(and some time) to fill my 80x40 terminal window (depending on SET).


title: How do I find out what process is putting my machine to sleep?

text: My laptop is going to sleep after about 10 minutes of inactivity, and I don't know why. I verified the standard power options, are they're not set to put my machine to sleep. ![enter image description here](http://i.stack.imgur.com/KVhOQ.png) Here is grep's output for 'power'.               ~$ ps aux | grep [p]ower     a         2554  0.0  0.0 274276  3332 ?        Sl   07:30   0:00 /usr/lib/x86_64-linux-gnu/indicator-power/indicator-power-service     root      2575  0.0  0.0 231156  4560 ?        Sl   07:30   0:00 /usr/lib/upowe /upowerd     a        10604  0.0  0.6 1159700 53516 ?       Sl   16:53   0:00 /usr/bin/gnome-control-center.real power      Grep'ing for 'screen' shows no useful results as well. How do I find out which process is putting my computer to sleep?


title: Does the command execute automatically when setting it to a variable?

text: I'm getting familiar with all about linux & shell/bash scrpiting. I'm configuring a backup script & it will compress an entire dir. I wanna know if I have to print the variable where the command that will compress will be allocated or only by setting it to the variable will execute it? I have this:               x1=$(tar cfz "/dir_destination" "/dir_to_compress/")     echo "$x1"      I'm wondering if I could safely remove 'echo' line


title: Linux File Permissions Enforce Order

text: I just ran into something unexpected (for me) regarding file permissions on Linux (Arch Linux). Basically I have:   * `userX` in `groupX`   * `fileX userX:groupX ---rwx----` What puzzles me: I cannot perform any action (`rwx`) on `fileX`. Is this right? Can someone please confirm this is indeed the expected behaviour? The only actions I can perform are `mv` and `rm` because I have write permissions on the parent directory. The thing is, I always thought these permissions collapse on each other, starting with the most general one (other -> group -> user). In other words, if `o=rwx` who cares what the persmissions for group and user are? Apparently this is not the case but it doesn't make much sense to me; it seems counterintuitive. The only thing this approach seems to be useful at, is to easily exclude a very specific person / group, which doesn't seem like a smart way to go at it (imho). Besides, the owner (and group?) should be able to `chmod` anyway right? Any thoughts on this matter?


title: can you only input the password once and then execute the su command without entering a password?

text: I am copying files from a remote server to my local server. Here is the code that does this:               sshpass -p "password" ssh -q username@$192.168.162.156 "mkdir -p /temp ;                                                         su -lc 'cp /some/file/path /temp' ;                                                          chmod 777 -R temp/"          ssshpass -p "password" scp -rq username@$192.168.162.156:temp/ somewhere/on/my/local_server          sshpass -p "password" ssh -q username@$192.168.162.156 "su -lc 'rm -r /temp' "       I am making a temporary folder in the remote server and changing its permission to facilitate copying. Then I copy its content to my local sever. I am using this code segment in a for loop so it will prompt for a password for every iteration. Is there a way to only input the password once for `su` and continue the program? (without using rsync or sudo)


title: Hot partition CentOS 6 and add boot pick?

text: I have an existing CentOS 6 installation working wonderfully and its owner now wants to add a separate Debian installation onto the same machine. He only accesses this host via the command line and via a NoMachine VNC-type GUI connection, since it's located in a data center and thus out of reach. My questions:   1. Can I create a "hot partition" on the existing CentOS 6 installation without destroying what we have now?   2. If I can safely add a new partition, is there any tool or method the user could use to choose which OS it will boot into? Something like a boot picker. Remember he does not have physical access to the machine. I'm coming from a Mac/Windows background and thus don't know the answers. Suggestions or ideas are welcome.


title: No core dump on Ubuntu on a Parallels shared folder

text: I have an application that I'm working on, and I'm having trouble getting a core dump when it segfaults. In fact, I'm having trouble getting real core dump files at all. A simple test case will generate a core dump file, but it's zero length. I've got `ulimit -c unlimited` set. This is 64-bit Ubuntu Maverick. ~~Any hint what to do next?~~               [dlee@dlee-oak t]$ ulimit -c     unlimited          [dlee@dlee-oak t]$ cat mkcore.cpp     int main() { *((int *)0) = 0; }          [dlee@dlee-oak t]$ g++ -g mkcore.cpp -o mkcore          [dlee@dlee-oak t]$ ./mkcore      Segmentation fault          [dlee@dlee-oak t]$ ls -l core*     -rw-r--r-- 1 dlee dlee 0 2010-12-21 15:00 core.2993      _Edit:_ More information               [dlee@dlee-oak t]$ tail -n +1 /proc/sys/kernel/core_*     ==> /proc/sys/kernel/core_pattern <==     core          ==> /proc/sys/kernel/core_pipe_limit <==     0          ==> /proc/sys/kernel/core_uses_pid <==     1          [dlee@dlee-oak t]$ tail /var/log/kern.log     <snip/>     Dec 21 16:07:40 dlee-oak kernel: [  133.863045] mkcore[1589]: segfault at 0 ip 000000000040043d sp 00007fffbd025510 error 6 in mkcore[400000+aa000]      I've just realized that the filesystem the core file is being generated on is a Parallels Shared Folder. (This Ubuntu instance is running on a Parallels VM on my Mac). When I run the app from a directory that's on local disk, core file is generated as expected. So I'll change the question slightly: why isn't it generating the core file on the prl_fs filesystem? Just curious... _Edit #2:_ You'll note that when it generates the zero length core file, it does not print `(core dumped)`. I did double check my sanity, and yes the zero length core file is really being created.               [dlee@dlee-oak t]$ X=$(pwd)     [dlee@dlee-oak t]$ ls -l core*     ls: cannot access core*: No such file or directory     [dlee@dlee-oak t]$ ./mkcore      Segmentation fault     [dlee@dlee-oak t]$ ls -l core*     -rw-r--r-- 1 dlee dlee 0 2010-12-22 00:41 core.6009          [dlee@dlee-oak t]$ cd ~     [dlee@dlee-oak ~]$ $X/mkcore     Segmentation fault (core dumped)


title: Where is the libstdc++ test suite?

text: I have GCC/g++ 4.7 and it works fine. But I need to run the libstdc++ testsuite but I don't find where the testsuite is on the system and how to run it. How can I do that?


title: How to access storage device related events with Zeitgeist?

text: I am trying to get my mind around Zeitgeist, using the Python DBus API. To get the latest accessed files and application is not so hard, here is what I do:               #! /usr/bin/env python          from zeitgeist.client import ZeitgeistDBusInterface     from zeitgeist.datamodel import Event, Interpretation, TimeRange, \      StorageState, ResultType          zg = ZeitgeistDBusInterface()     events = zg.FindEvents(      TimeRange.always(),      [Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT)],      StorageState.Available, 3, ResultType.MostRecentEvents)          for e in events:         event = Event(e)         subjects = event.get_subjects()         for s in subjects:             print "subject", s.text, s.uri      The interpretation flag `Interpretation.ACCESS_EVENT` returns all matching events, i.e. files and application accessed. Much more interpretation flags are available, but I do not succeed in getting results from events other than with `Interpretation.EVENT_INTERPRETATION` and its subclasses. More specifically I would like to access `Interpretation.DATA_CONTAINER` and its subclass, but it never returns any result. So am I doing something wrong in that case? Could you suggest anything?


title: How does the system know when a file has been modified? In particular memory mapped files

text: If I am looking at a process from outside the process how can I tell which files it modifies? One thing I can do is track calls to write, but a process can map a file to memory and write to the memory modifying the file. The kernel needs to keep track for two reasons. It needs to know what to flush when a sync is called, and it needs to update the mtime on the file. So how does the system know? Also are there any other ways to modify files other then write and mmap?


title: How to set visudo to use a different editor than the default on Fedora?

text: Fedora 14 uses vi by default when one runs visudo. Is there a way to change this to something else?


title: How to make Fedora user a sudoer?

text: I want to give a Fedora user `sudo` privileges. How do I do that?


title: Which GUI svn client allows searching through history?

text: I'm looking for GUI tool that allows searching svn history, and more than just log messages.


title: What is an inode?

text: > **Possible Duplicate:**   >  What is a Superblock, Inode, Dentry and a File? Documentation of Unix-file-systems contains often the term 'inode'. What is that and what does that? Why have DOS/Windows-filesystems no inodes (or do they)?


title: Large ext4 partition ridiculously slow when writing

text: We have four identical Linux servers with a large (5T) hard disk partition. We have Scientific Linux with this kernel:               Linux s3.law.di.unimi.it 2.6.32-358.18.1.el6.x86_64 #1 SMP Tue Aug 27 14:23:09 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux      The servers are identically configured, installed, etc. But one, and only one of the servers, is ridiculously slow when writing with ext4. If I do a               dd if=/dev/zero of=/mnt/big/analysis/test          l -tr     total 11M     -rw-r--r-- 1 root    root  11M Apr 20 10:01 test     10:01:42 [s3] /mnt/big/analysis     l -tr     total 16M     -rw-r--r-- 1 root    root  16M Apr 20 10:02 test     10:02:13 [s3] /mnt/big/analysis      So 5MB in 30s. All other servers write more than an order of magnitude faster. The machines are 64GB, 32-core and have no I/O or CPU activity, albeit 90% of memory is filled by a large Java process doing nothing. Only _one_ machine is writing slowly. SMART says everything is OK               # smartctl -H /dev/sdb     smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.32-358.18.1.el6.x86_64] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          SMART Health Status: OK      hdparm reads with no problems:               # hdparm -t /dev/sdb          /dev/sdb:      Timing buffered disk reads:  1356 MB in  3.00 seconds = 451.60 MB/sec      The partition is mounted as follows:               /dev/sdb1 on /mnt/big type ext4 (rw,noatime,data=writeback)      and we set               tune2fs -o journal_data_writeback /dev/sdb1      for performance. I tried to find _anything_ that could explain why this specific server writes so slowly, that is, any difference in the output of a diagnostic tool, with no results. Just to complete the picture: we started on all servers a crawl, partitions essentially empty. The crawl created a number of files on the partition, and in particular a 156G file (the store of the crawl). The crawl started OK, but after a few hours we saw slowdowns (apparently, as the store was growing). When we checked, we noticed that writing to disk was getting slower, and slower, and slower. We stopped everything--no CPU activity, no I/O--but still dd was showing the behaviour above. The other three servers, in identical conditions, same files, etc., work perfectly, both during the crawl and using dd. Frankly, I don't even know _where_ to look. Does anyone hear a bell ringing? Which diagnostic tools might I use to understand what's happening, or which tests should I try? # Update Beside the link posted, I thought it would have been a good idea to run the same tests on two servers running the crawler. It's interesting. For instance, vmstat 10 gives ## Good               procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----      r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st      4  0  68692 9009864  70832 29853400    0    0    15   214    9    2 11  1 88  0  0      10  0  68692 8985620  70824 29883460    0    0    48  7402 79465 62898 12  1 86  0  0        11  0  68692 8936780  70824 29928696    0    0    54  6842 81500 66665 15  1 83  0  0        10  2  68692 8867280  70840 30000104    0    0    65 36578 80252 66272 14  1 85  0  0        15  0  68692 8842960  70840 30026724    0    0    61  3667 81245 65161 14  1 85  0  0         ## Bad               procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----      r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st     13  0   8840 14015100  92972 25683108    0    0    11   104    3    9  4  1 94  0  0          2  0   8840 14015800  92984 25696108    0    0    49 16835 38619 54204  2  2 96  0  0        1  0   8840 14026004  93004 25699940    0    0    33  4152 25914 43530  0  2 98  0  0        1  0   8840 14032272  93012 25703716    0    0    30  1164 25062 43230  0  2 98  0  0        2  0   8840 14029632  93020 25709448    0    0    24  5619 23475 40080  0  2 98  0  0        And iostat -x -k 5 ## Good               Linux 2.6.32-358.18.1.el6.x86_64 (s0.law.di.unimi.it)   04/21/2014  _x86_64_    (64 CPU)          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               10.65    0.00    1.02    0.11    0.00   88.22          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.11  3338.25   17.98   56.52   903.55 13579.19   388.79     7.32   98.30   1.23   9.18     sda               0.39     0.72    0.49    0.76    11.68     5.90    28.25     0.01   11.25   3.41   0.43          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               15.86    0.00    1.33    0.03    0.00   82.78          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.00  1106.20    9.20   31.00    36.80  4549.60   228.18     0.41   10.09   0.39   1.58     sda               0.00     2.20    0.80    3.00     4.80    20.80    13.47     0.04   10.53   3.21   1.22          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               15.42    0.00    1.23    0.01    0.00   83.34          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.00  1205.40    8.00   33.60    40.80  4956.00   240.23     0.39    9.43   0.33   1.38     sda               0.00     0.60    0.00    1.00     0.00     6.40    12.80     0.01    5.20   4.20   0.42      ## Bad               Linux 2.6.32-358.18.1.el6.x86_64 (s2.law.di.unimi.it)   04/21/2014  _x86_64_    (64 CPU)          avg-cpu:  %user   %nice %system %iowait  %steal   %idle                4.37    0.00    1.41    0.06    0.00   94.16          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.06  1599.70   13.76   38.23   699.27  6551.73   278.96     3.12   59.96   0.99   5.16     sda               0.46     3.17    1.07    0.78    22.51    15.85    41.26     0.03   16.10   2.70   0.50          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               11.93    0.00    2.99    0.60    0.00   84.48          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.00 14885.40   13.60  141.20    54.40 60106.40   777.27    34.90  225.45   1.95  30.14     sda               0.00     0.40    0.00    0.80     0.00     4.80    12.00     0.01    7.00   3.25   0.26          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               11.61    0.00    2.51    0.16    0.00   85.71          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.00  2245.40   10.60   51.20    42.40  9187.20   298.69     3.51   56.80   2.04  12.58     sda               0.00     0.40    0.00    0.80     0.00     4.80    12.00     0.01    6.25   3.25   0.26      So (if I understand correctly the output) it appears that, yes, as it was apparent from the JVM stack traces the slow server is taking forever to do I/O. It remains to understand why :(. I also ran a `strace -c ls -R /`. I didn't realize it had to run for a while, so the previous data is not very meaningful. The command was run _while the crawler was running_ , so with massive I/O ongoing. ## Good               % time     seconds  usecs/call     calls    errors syscall     ------ ----------- ----------- --------- --------- ----------------      99.62   14.344825         114    126027           getdents       0.25    0.036219           1     61812        12 open       0.07    0.009891           0     61802           close       0.06    0.007975           0     61801           fstat       0.01    0.000775           0      8436           write       0.00    0.000043          22         2           rt_sigaction       0.00    0.000000           0        12           read       0.00    0.000000           0         1           stat       0.00    0.000000           0         3         1 lstat       0.00    0.000000           0        33           mmap       0.00    0.000000           0        16           mprotect       0.00    0.000000           0         4           munmap       0.00    0.000000           0        15           brk       0.00    0.000000           0         1           rt_sigprocmask       0.00    0.000000           0         3         3 ioctl       0.00    0.000000           0         1         1 access       0.00    0.000000           0         3           mremap       0.00    0.000000           0         1           execve       0.00    0.000000           0         1           fcntl       0.00    0.000000           0         1           getrlimit       0.00    0.000000           0         1           statfs       0.00    0.000000           0         1           arch_prctl       0.00    0.000000           0         3         1 futex       0.00    0.000000           0         1           set_tid_address       0.00    0.000000           0         1           set_robust_list     ------ ----------- ----------- --------- --------- ----------------     100.00   14.399728                319982        18 total      ## Bad               % time     seconds  usecs/call     calls    errors syscall     ------ ----------- ----------- --------- --------- ----------------      99.81   24.210936         181    133618           getdents       0.14    0.032755           1     63183        14 open       0.03    0.006637           0     63171           close       0.02    0.005410           0     63170           fstat       0.00    0.000434           0     15002           write       0.00    0.000000           0        12           read       0.00    0.000000           0         1           stat       0.00    0.000000           0         4         1 lstat       0.00    0.000000           0        33           mmap       0.00    0.000000           0        16           mprotect       0.00    0.000000           0         4           munmap       0.00    0.000000           0        25           brk       0.00    0.000000           0         2           rt_sigaction       0.00    0.000000           0         1           rt_sigprocmask       0.00    0.000000           0         3         3 ioctl       0.00    0.000000           0         1         1 access       0.00    0.000000           0         3           mremap       0.00    0.000000           0         1           execve       0.00    0.000000           0         1           fcntl       0.00    0.000000           0         1           getrlimit       0.00    0.000000           0         1           statfs       0.00    0.000000           0         1           arch_prctl       0.00    0.000000           0         3         1 futex       0.00    0.000000           0         1           set_tid_address       0.00    0.000000           0         1           set_robust_list     ------ ----------- ----------- --------- --------- ----------------     100.00   24.256172                338259        20 total


title: How to configure user.c file for checkpoint VPN in Shrew Soft

text: I download the latest VPN client Shrew Soft VPN Client 2.2.1 - ike-2.2.1-release from: https://www.shrew.net/download/ike. I need to install this VPN on my Linux Red Hat machine – version 6.3. I read that shrew VPN client should support connecting checkpoint gateways. But from shrew documentation I don't see any explanation about how to configure the `user.c` file on the Linux machine, In order to connect checkpoint VPN gateways? So my questions about shrew are:   1. What the CLI to connect the checkpoint VPN gateway ( VIA shrew VPN )   2. how to configure the user.c file under shrew VPN?   3. How to install the shrew on linux red-hat machine and what the limitation?  I want to give Just short example from my windows XP machine - what the command line that need in order to activate checkpoint VPN (in this case I use Checkpoint VPN client).   * scc connect customer (while customer actually represent the user.c file).   * More details about - `user.c` C file: https://sc1.checkpoint.com/documents/R77/CP_R77_VPN_AdminGuide/14658.htm   * shrew doc: http://www.ceme.gsras.ru/software/Util/VPN/vpnhelp.pdf


title: Merge partitions

text: Due to some unfortunate partitioning I ended up with the following layout:               /dev/sda1  (0-120MB)      128MB  (boot)     /dev/sda2  (128MB-500GB)  500GB  (empty)     /dev/sda3  (500GB-1TB)    500GB  (zfs)     /dev/sda4  (1TB-1.1TB)    100GB  (ext4)     /dev/sda5  (1.1TB-end)    100GB  (zfs)      I created a ZFS pool on `sda5`, moved the files previously residing on `sda3` there, added `sda3` to the pool and moved the files from `sda2` there. I intend to add `sda2` as well, move the stuff from `sda4` (my current root) and use ZFS as the root. However, the root ZFS may not consist of multiple vdevs, and once the whole disk can be used by ZFS, it would be more reasonable to just merge the partitions into this layout:               /dev/sda1  (0-128MB)    128MB   (boot)     /dev/sda6  (128MB-end)  1200GB  (zfs)      I have free space at the start in `sda2`, I could create a new pool, move everything there and then just edit the `sda2` partition to reach to the end of the disk. But does ZFS maybe support this without moving around everything again? Could I just replace my existing partitions with the `sda6` one and coax ZFS into finding the root blocks it placed on `sda3` and `sda5`?


title: Why do some characters show as squares in Chrome?

text: For example in the dev tools I get something like: ![Chrome dev tools](http://dl.dropbox.com/u/22257420/Dump/img/2012-04-12-- 1334224091_1680x1050_scrot.png) Some of these squares are at the end of lines, initially I thought they were carriage returns but it turns out they aren't. Also, squares appear after `=` or `>` in many places where there is no newline, and looking at the file in a hex editor shows that there isn't any character at all between `=` and `"` (e.g. `id="` is showing as `id=? "`) This also turns up very occasionally in web pages, for example I saw: ![Google search result](http://dl.dropbox.com/u/22257420/Dump/img/2012-04-12-- 1334225465_1680x1050_scrot.png) I copied that sentence, looked at it in a hex editor, and again there is no character between `e` and `:`. Nothing shows up in the source code either. I have never seen this before, and its only since I re-installed arch a few days ago. Chrome is: Version `19.0.1084.15 dev`   Arch is: Kernel `3.3.1-1-ARCH`, `x86_64` `locale.gen` has `en_GB` locales uncommented (both `UTF-8` and `ISO-8859-1`). The encoding in chrome defaults to `ISO-8859-1`, but switching it to `UTF-8` makes no difference. This is the html file I was using: test.html A fix would be fantastic, an explanation would be great, confirming that this is (or isn't) just a problem with my setup would also be good. Edit: After investigating fonts, I found that in both cases it was trying to use arial, which in arch is part of the `ttf-ms-fonts` package. Installing that resulted in the font changing, but the squares remained (although a different shape). In both cases the font does not adhere to the default fonts for the system. ![Chrome dev tools - with arial](http://dl.dropbox.com/u/22257420/Dump/img/2012-04-12-- 1334244281_1680x1050_scrot.png)


title: Remove a directory level from a website URL

text: Can anyone tell me how to configure apache to not display a website folder name at the end of a base URL, please? - but only for one out of many websites. Let me describe the scenario ... I have a test server with a number of websites in separate folders inside `/var/www`. Because it a test server, I am accessing it via it's IP address (64.244.144.78). So I would access a website via `64.244.144.78/a_website_folder` The trouble began when I needed one of the sites, which is called `applications`, to have a sub-domain name of `applications.ourorganisation.org` instead of using the IP Address format as above. The sub-domain was created by our IT guy on our currently existing Windows server. He then pointed the sub-domain at my Linux test server's IP address of 64.244.144.78 (apparently he could not add the subdirectory information leading to the applications website). To counter this problem, I created an `index.php` file in `64.244.144.78/var/www` and used PHP code to redirect to the applications website folder. All that worked but I now when I visit `applications.ourorganisation.org`, I am redirected to `applications.ourcompany.org/applications`. It not a disaster but I would like to NOT have the `applications` directory name at the end.


title: The TIME field in ps -ef

text: When I do ps -ef, I see "TIME" field. What does this field mean? From what I understand, this tells the actual CPU time, that the process got (amidst all the context switching). Does the TIME field include the disk read/write time also or only the CPU time?


title: CLI & Markup language

text: I often find myself editing files for my personal use that are plaintext. Either those are notes, annotations in project directories or sometimes the output of programs that I annotate. However, sometimes I need to make a "nicer" document out of these plain text files in either MS Word or Latex. Now my question is: is there a simple tool that allows me to convert my plain text files into let's say directly a pdf, tex or doc for further editing that takes Wiki-Syntax into account? I.e. I'm looking for a rapid prototyping tool for documents where I can annotate them in plain text with a syntax that is as simple as possible but then creates more complicated documents out of them for further editing.


title: How can I resolve a stale nfs handle?

text: I noticed once when I shut down my home server while my desktop was connected via NFS that I kept getting "stale NFS handle warning" when entering my home dir, this caused issues with some programs that looked in those folders. How do I resolve this issue without restarting my machine? Debian Squeeze/Wheezy


title: Spliting `File` and `directory name with space' via shell script

text: I've got a file called `Files.txt` having following content:               TestApp/Resources/Supporting Files/main.m     TestApp/Resources/Supporting Files/AppDelegate.h     TestApp/Resources/Supporting Files/AppDelegate.m      I am pulling file and directory names as following and passing them to another process.               files=$(cat Files.txt)          for item in $files ; do           dn=$(dirname $item)            printf $item       printf "\n"       printf $dn       printf "\n\n"            # passing to another process     done      However, this is getting me this:               TestApp/Resources/Supporting     TestApp/Resources          Files/main.m     Files          TestApp/Resources/Supporting     TestApp/Resources          Files/AppDelegate.h     Files          TestApp/Resources/Supporting     TestApp/Resources          Files/AppDelegate.m     Files      What I need is this:               TestApp/Resources/Supporting Files/main.m     TestApp/Resources/Supporting Files          TestApp/Resources/Supporting Files/AppDelegate.h     TestApp/Resources/Supporting Files          TestApp/Resources/Supporting Files/AppDelegate.m     TestApp/Resources/Supporting Files      I tried prefixing space with `\` in `Files.txt` as:               TestApp/Resources/Supporting\ Files/main.m      and with `%20` as:               TestApp/Resources/Supporting%20Files/main.m      with no luck!


title: How to assign correct permissions to both webserver and svn?

text: I've an issue with files ownerships in unix. I have a drupal website and the "files" folder needs to be owned by "www-data" in order to let the users to upload files with php. However I'm now using svn and I need all folders and files to be own by "svnuser" in order to work. So now, I guess I need to add both users to a group with proper permissions. I'm not sure what exactly to do, could you tell me what are the exact necessary steps ? thanks


title: Removing abstraction from Ubuntu boot process

text: I have been using Linux after almost 5 years and observed that boot process has been almost abstracted. I mean, not much is visible to the user what is going on behind the scenes (Due to splash screens etc). Now, this might be good for the end users but not for the geek :) I want to bring back the verboseness of old times. Here is what I have done: I have been able to get rid of some of it by removing the "splash" and "quiet" parameters from the command line. However, I still cannot see the services being started one by one (like the ones in init.d). I assume its because of init daemon being replaced by upstart. Are there some configs file which I can tweak to bring back the verboseness of what is going on. Also, as soon as the login screen comes, it erases the boot log history. Is there a way to disable that ? Note: I know I can do that by simply switching the distro to Arch or Slackware. But I don't want to do that.


title: How to stop Mod4-P from switching the display?

text: I use `Ctrl-P` very frequently to scroll backward in the command history, but I often mistype it as `Mod4-P`, which is bound to the switch display function. I've searched around Keyboard shortcuts and CompizConfig, etc., but I couldn't find where `Mod4-P` is bound. What controls that?


title: Extlinux boot error

text: Another question recommented I use extlinux. It displays the rather unhelpful message "Boot error". Why wouldn't it work? How can I debug the problem? **Disk layout:** on /dev/sda rEFIt is installed. /dev/sda4 is / and there is no separate /boot partition. **Method of installation:**               extlinux /boot      **extlinux.cfg**               DEFAULT Gentoo     LABEL Gentoo       KERNEL /boot/kernel       APPEND -


title: Can the --prefix path be the same as the directory where I downloaded/unzipped the source?

text: I was trying to build R myself and put it in a `temp_R` folder because I wrote `.configure --prefix=/dir/where/I/wanted/to/put/R`, but it seems that some of the important stuff was put in the temp_R folder all the same. So should I have extracted the archive to the folder where I wanted to have R before compiling or what?


title: Why does this iptables rule doesn't get configured after a reboot once in a while?

text: On my Android network device, `iptables` firewall rules service script is started by the `init.rc` scripts during boot time. One of the firewall `INPUT` chain rules doesn't get configured in the iptables firewall configuration once in 50 reboots. In the following rule present in the iptables script:               #SYNFLOOD DEFEND 10 pps     $IPTABLES -A INPUT -p tcp --syn -m limit --limit 10/s --limit-burst 5 -j ACCEPT     $IPTABLES -A INPUT-p tcp --syn -j LOG --log-level 4  \         --log-prefix "iptables: synflood dropped packet:"     $IPTABLES -A INPUT -p tcp --syn -j DROP      Here in the above sequence of rule `ACCEPT` rule doesn't get configured once in a while after a reboot and `DROP` rule drops all the TCP packets. Verified `dmesg` and `/var/log/messages` for kernel logs, but error logs doesn't get logged to find the reason due to which the rule got missed. The Rule doesn't get set in the firewall INPUT chain configuration with out any error Is there any way to enable the kernel debug messages to find out the reason of the failure? Has any one faced a similar problem, or could someone throw some light on how to enable the diagnostic logs for the `iptables` rules in kernel?               ~ # iptables -v     iptables v1.4.11.1: no command specified     Try `iptables -h' or 'iptables --help' for more information.      Android version of the device is 4.3.


title: Linux - Delete last two files automatically

text: In Linux, one folder is created every morning and 5 files are created in that folder. At the end of the day (Midnight), the last two files in that folder have to be deleted. How can I accomplish this?


title: Extend the scrollable content of gnu-screen?

text: Using the `screen` terminal environment, I ofen enter copy mode by using `Ctrl`-`a``Esc`. However, the scrollable output is often too short for me to view the desired information. What do I modify to extend the length of this output?


title: What does the following Bash script mean/do?

text: What does the following script mean?               exec 4<&0 0</etc/XX/cfg     read line1     exec 0<&4      **UPDATE** Thanks for the answer, just one part I'm not sure: It redirects fd0 to fd4, and "/etc/XX/cfg" to fd0. So why does `read` still work, shouldn't that be empty?


title: How to resize ext3 image files

text: I have created an 200MB ext3 using the following commands.               dd if=/dev/zero of=./system.img bs=1000000 count=200     mkfs.ext2 ./system.img     tune2fs -j ./system.img      How can I resize it to 50MB and 300MB? The problem is I have only some binaries in my system. They are : `badblocks,e2fsck, mke2fs, mke2fs.bin, parted, resize2fs, tune2fs`


title: vimrc mapping line numbers

text: I have these lines in my .vimrc file:               :map <F9> :exe ':!gdbset bp "%:'.line(".").'"'<CR><CR>     :map <F8> :exe ':!gdbset clear bp "%:'.line(".").'"'<CR><CR>      They work great for adding and removing break points in gdb! Only one problem (that I know of)... for some reason line numbers in the 80's don't work. If I put my cursor on line 85 and press F9 then it should put a breakpoint on line 85. If I put my cursor on line 75 and press F9 it should put a breakpoint on line 75. The resulting breakpoints look like this:               b myfile.cc:5     b myfile.cc:75      Line 85 did not work. I've tested the 80's. None of them work. All other lines seem to work. Why? I'm sure one of you VIM experts can explain this to me. It's almost like the ":8" are being interpreted as some other command or something.


title: amazon cg1 instance does not include nvcc

text: I am using Amazon CG instance to run cuda on nvidia GPUs. It seeems that this is running Linus Suse instance and doesn't have nvcc. Shouldn't it have nvcc already? If not, how can I install it. I realize zypper is the package/installer manager but I cannot manage to install nvidia-cuda-toolkit.               $ sudo rpm --install cuda-repo-<distro>-<version>.<architecture>.rpm     $ sudo zypper refresh     $ sudo zypper install cuda      yet, I don't see any examples how to fill the distro , version , and architecture. so I wasn't able to get past the rpm command.


title: Vim visual mode to system clipboard?

text: Using the vim text editor, I am looking for a method to copy content highlighted in visual mode to the system clipboard (i.e. I would then be able to `Ctr-v` that content say in a browser window). Is there a standard way to copy content directly to the system clipboard? If not is there a suited hack to enable it for Mac OS 10.7.3?


title: How to set the default tag for jEdit windows in Awesome WM?

text: The following rule works as expected:               { rule = { class = "Firefox" },       properties = { tag = tags[2][2] } },      That is, Firefox instances are started on the second tag of the second screen. However, I have not been able to do the same for jEdit with this rule on the next line:               { rule = { class = "jedit" },       properties = { tag = tags[2][3] } },      jEdit instances always pop up on the first tag of the first screen. The window class looks correct:               $ xprop | grep "^WM_CLASS\|^WM_NAME"      WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "jedit"     WM_NAME(STRING) = "jEdit - Untitled-1"      Except for the capitalization it's very similar to the result for Firefox:               $ xprop | grep "^WM_CLASS\|^WM_NAME"      WM_CLASS(STRING) = "Navigator", "Firefox"     WM_NAME(STRING) = "How to place jEdit window in Awesome WM? - Unix & Linux Stack Exchange - Mozilla Firefox"      Mocking the WM name doesn't work either - after running the following the window still appears in the wrong place:               sudo pacman --sync wmname     wmname LG3D     jedit &      Java version:               $ java -version     java version "1.7.0_45"     OpenJDK Runtime Environment (IcedTea 2.4.3) (ArchLinux build 7.u45_2.4.3-1-x86_64)     OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)      What's happening here?


title: buffer cache and free memory

text: Below is the output of free in Ubuntu:               $ free                  total       used       free     shared    buffers     cached     Mem:       8173180    8013092     160088          0    1076276    3091136     -/+ buffers/cache:    3845680    4327500     Swap:     11719380        312   11719068      Total physical memory is 8 gb. Total used memory is close to that, but the total memory used by buffer cache is half that, approximately 4 gb. Hardly any memory is being used as swap. Now the buffer cache is derived because we have had read/writes to disk and then after first time, the applications are loaded in memory until no longer needed to speed up read/writes. So the total of read/writes for disk buffering is the 4 gb. Ok, but what kind of processes are using the other 4 gigs of physical memory (excluding buffer cache)? How can I determine that?


title: Create a iptables rule if the rule does not all ready exist

text: Hi I've created a script to setup Nagios on my remote servers. My Script checks iptables to see if a firewall rule all ready exists and then is **supposed** to add the rule if it's not all ready there. Right now the script just echo's out the rule but it's not actual able to write it any help would be greatly appreciated.               ssh -t -t root@$serverName << EOF       service nrpe restart       chkconfig nrpe on       if [ "cat /etc/sysconfig/iptables | grep -- "5666"" != "-A INPUT -p tcp -m tcp --dport 5666 -j ACCEPT" ] ; then echo "iptables -I INPUT -s 0/0 -p tcp --dport 5666 -j ACCEPT" ; fi       service iptables save       exit     EOF


title: Create an image of an existing linux installation

text: I have installed fedora 19 Xfce and removed a bunch of packages. I need to do a similar installation in multiple other machines. Repeating the process is time consuming. Is there some way by which I can create an image of the installed OS in its current form? I followed this guide to create the minimized linux version: Check here I started off with a live CD, but this time I would like to have something that would directly install into the system and not follow the live CD procedure, where it first loads the system for live usage and then we can proceed with installation.


title: Can't seem to connect to my Debian Mysqli Server?

text: So I have a simple PHP script which I attempted to do something along the lines:               $db = mysqli_connect("localhost", "root", "PASSWORD HERE", "database name");     mysqli_query($db, "SELECT STATEMENT HERE") or die (mysqli_error($db));      to try something out. But it won't make a connection to the database. The script is working fine as I tried it on a homeserver and so on, but it won't work on the vps, so I know it's that the mysql server is screwed up. I'm using Debian 7. I used               apt-get install apache2     apt-get install mysql-server mysql-client     apt-get install php5     apt-get install phpmyadmin      and a bunch of php-* (* = different modules or whatever) I tried:               mysql -u root -p      and then wrote in the password, and it worked. So what could be wrong?


title: Use IP tables to port forward behind a router?

text: Is it possible to use IP tables to port forward behind a router? My setup is thus: I have a Raspberry Pi running a small website on port 80, and a beefier computer running a Minecraft server on port 25565. I've setup the router to take requests for each port and forward them to the correct location, but I also have a Minecraft 'website' (with the map and such) running on the Minecraft server, also on port 80. I also have myurl.com. My question is: Using IP tables, can I have mc.myurl.com:80 forward to the Minecraft server website, while myurl.com:80 continues to go to the Raspberry Pi? How do I set this up? What if I remove the Raspberry Pi from the equation? Have mc.myurl.com forward to :81 on the same server? (Would I have to open :81 on the router?)


title: Encrypt OfflineIMAP Password

text: I'm trying to set up OfflineIMAP to authenticate via a gpg encrypted file (that way I can consolidate all my encryption to my gpg-agent process). From the documentation, it seems the only way to encrypt one's server passwords is to use gnome-keyring (which I'd prefer not to run on my headless server). Is there a way to pipe in my password from a gpg file the way you can with mutt? I know you can add extra features to offlineimap with the extension python file, but I'm afraid I wouldn't know where to start with that.


title: Is there any advantage of using Iceweasel and Firefox?

text: I used Mozilla Firefox in Windows, and now I'm using Iceweasel in Debian 6. Is there any difference to the two programs? What are the advantages and disadvantages to each program? Which one seems better?


title: Can I change uuid for network interface in ifcfg-eth* using uuidgen?

text: I'm creating a script which configuration the network interfaces. The script which generates `/etc/udev/rules.d/70-persistent-net.rules` and names interfaces to my preference. In `CentOS 6.5`, my understanding is that I also need to update files in `/etc/sysconfig/network-scripts/ifcfg-eth#`. My question is about the UUID listed in `ifcfg-eth#`. Can I change this value to any random number using `uuidgen`? For a network device is it important to do it based on the MAC address or does it not matter? In other words, could i use the the function below, or will modifying the UUID in this manner cause problems?               function make_ifcfg() {         cat > ifcfg-eth0 <<EOF                                                                      DEVICE=eth0                                                                                HWADDR=${intel_MAC_addresses[0]}                                                                TYPE=Ethernet                                                                                UUID=$(uuidgen)                                                                               ONBOOT=yes                                                                                NM_CONTROLLED=yes                                                                               BOOTPROTO=dhcp                                                                                EOF                                                                                }      Thank you.


title: Black screen TTYs1-6 (KDE)

text: Since I installed KDE and removed Gnome, when I switch to any TTY1-6 I got a black screen. Switching back to TTY7 works fine. I don't know why is this happening, but I guess that some needed package was removed when Gnome was removed. Any ideas of how to fix this?


title: Troubleshooting internet connectivity

text: Recently I see that I often lose internet connectivity on my Linux machines. I am starting to think that it may be a router problem, but I have no idea to check if this is indeed the problem. Basically what happens is that if I type `ifconfig` I get the list of all the interfaces, but none of them have an assigned IP address. Even when I use `dhclient` to pull a random IP address, I still am not able to ping or surf the web. This is an example of `ifconfig` output:               eth0      Link encap:Ethernet  HWaddr 08:00:27:b3:da:a1                 inet6 addr: fe80::a00:27ff:feb3:daa1/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:7 errors:0 dropped:0 overruns:0 frame:0               TX packets:25 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:1351 (1.3 KB)  TX bytes:6466 (6.4 KB)      How can I troubleshoot internet connectivity issues? What files do I have to look at?


title: How do I only copy files to a destination that exist in the folder from the source, everything else should not be copied

text: How can I copy files from source to destination, where in all the files existing in destination (with directory structure), only should be copied from the source, overwritten in the destination. Rest of the files (including the directory structure) should not be copied from source to destination. I think `rsync` can achieve this, not sure on the options we have to select.


title: Binding domain name to Apache Virtual host on VPS

text: recently company I work for has rented VPS. Now i need to have multiple websites hosted on this VPS, that is not a problem, I'v set up virtual hosts, databses, etc. Now i wanted to test it, see if I could access website on the VPS by domain name ( **bennyben.cz** ). Domain is registered at different registrar, I've pointed DNS A record to IP address of VPS ( **193.105.159.72** ) and it works fine (displays apache default site), but i need to route this domain name (bennyben.cz) to virtual host on the VPS (bennyben.cz.vhost). After some googling, I thought that I needed to add new primary DNS zone record (i have ISPConfig installed on VPS) and direct it to virtual host, so i binded the virtual host to local IP address (192.168.1.1) and set A record on VPS to this address, but if i type the domain name, it still serves the default site. So my question is, what do i need to host multiple websites with domain names on one VPS (only one WAN IP address available), i did a lot of googling, messed around with BIND, but nothing seems to work. System details               Ubuntu 13.04     ISPConfig     1 WAN IP address      P.S. I'm sure this is pretty basic stuff, but I work there as a programmer, so servers aren't my specialization, but, unfortunately we currently do not have anybody who could take care of the VPS, so it has fallen to me.               Listen 80       is present in /etc/apache2/ports.conf * _The vhosts config files are generated for me by ISPconfig_ Configuration files: **/etc/apache2/sites-enabled/100-bennyben.cz.vhost**               <Directory /var/www/bennyben.cz>         AllowOverride None         Order Deny,Allow         Deny from all     </Directory>          <VirtualHost *:80>     DocumentRoot /var/www/bennyben.cz/web              ServerName bennyben.cz         ServerAlias www.bennyben.cz         ServerAdmin webmaster@bennyben.cz              ErrorLog /var/log/ispconfig/httpd/bennyben.cz/error.log              Alias /error/ "/var/www/bennyben.cz/web/error/"         ErrorDocument 400 /error/400.html         ErrorDocument 401 /error/401.html         ErrorDocument 403 /error/403.html         ErrorDocument 404 /error/404.html         ErrorDocument 405 /error/405.html         ErrorDocument 500 /error/500.html         ErrorDocument 502 /error/502.html         ErrorDocument 503 /error/503.html              <IfModule mod_ssl.c>         </IfModule>              <Directory /var/www/bennyben.cz/web>                 Options FollowSymLinks                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>         <Directory /var/www/clients/client4/web5/web>                 Options FollowSymLinks                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>                             # suexec enabled         <IfModule mod_suexec.c>             SuexecUserGroup web5 client4         </IfModule>         # Clear PHP settings of this website         <FilesMatch "\.ph(p3?|tml)$">                 SetHandler None         </FilesMatch>         # php as fast-cgi enabled     # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html         <IfModule mod_fcgid.c>                 FcgidIdleTimeout 300                 FcgidProcessLifeTime 3600                 # FcgidMaxProcesses 1000                 FcgidMaxRequestsPerProcess 5000                 FcgidMinProcessesPerClass 0                 FcgidMaxProcessesPerClass 100                 FcgidConnectTimeout 3                 FcgidIOTimeout 360                 FcgidBusyTimeout 300                 FcgidMaxRequestLen 1073741824         </IfModule>         <Directory /var/www/bennyben.cz/web>                 AddHandler fcgid-script .php .php3 .php4 .php5                 FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php                 Options +ExecCGI                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>         <Directory /var/www/clients/client4/web5/web>                 AddHandler fcgid-script .php .php3 .php4 .php5                 FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php                 Options +ExecCGI                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>                   # add support for apache mpm_itk         <IfModule mpm_itk_module>             AssignUserId web5 client4         </IfModule>              <IfModule mod_dav_fs.c>         # Do not execute PHP files in webdav directory             <Directory /var/www/clients/client4/web5/webdav>                 <ifModule mod_security2.c>                     SecRuleRemoveById 960015                     SecRuleRemoveById 960032                 </ifModule>                 <FilesMatch "\.ph(p3?|tml)$">                     SetHandler None                 </FilesMatch>             </Directory>             DavLockDB /var/www/clients/client4/web5/tmp/DavLock             # DO NOT REMOVE THE COMMENTS!             # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!       # WEBDAV BEGIN             # WEBDAV END         </IfModule>          </VirtualHost>      **/etc/apach2/sites-available/bennyben.cz.vhost**               <Directory /var/www/bennyben.cz>         AllowOverride None         Order Deny,Allow         Deny from all     </Directory>          <VirtualHost *:80>         DocumentRoot /var/www/bennyben.cz/web              ServerName bennyben.cz         ServerAlias www.bennyben.cz         ServerAdmin webmaster@bennyben.cz              ErrorLog /var/log/ispconfig/httpd/bennyben.cz/error.log              Alias /error/ "/var/www/bennyben.cz/web/error/"         ErrorDocument 400 /error/400.html         ErrorDocument 401 /error/401.html         ErrorDocument 403 /error/403.html         ErrorDocument 404 /error/404.html         ErrorDocument 405 /error/405.html         ErrorDocument 500 /error/500.html         ErrorDocument 502 /error/502.html         ErrorDocument 503 /error/503.html              <IfModule mod_ssl.c>         </IfModule>              <Directory /var/www/bennyben.cz/web>                 Options FollowSymLinks                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>         <Directory /var/www/clients/client4/web5/web>                 Options FollowSymLinks                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>                             # suexec enabled         <IfModule mod_suexec.c>             SuexecUserGroup web5 client4         </IfModule>         # Clear PHP settings of this website         <FilesMatch "\.ph(p3?|tml)$">                 SetHandler None         </FilesMatch>         # php as fast-cgi enabled     # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html         <IfModule mod_fcgid.c>                 FcgidIdleTimeout 300                 FcgidProcessLifeTime 3600                 # FcgidMaxProcesses 1000                 FcgidMaxRequestsPerProcess 5000                 FcgidMinProcessesPerClass 0                 FcgidMaxProcessesPerClass 100                 FcgidConnectTimeout 3                 FcgidIOTimeout 360                 FcgidBusyTimeout 300                 FcgidMaxRequestLen 1073741824         </IfModule>         <Directory /var/www/bennyben.cz/web>                 AddHandler fcgid-script .php .php3 .php4 .php5                 FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php                 Options +ExecCGI                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>         <Directory /var/www/clients/client4/web5/web>                 AddHandler fcgid-script .php .php3 .php4 .php5                 FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php                 Options +ExecCGI                 AllowOverride All                 Order allow,deny                 Allow from all         </Directory>                   # add support for apache mpm_itk         <IfModule mpm_itk_module>             AssignUserId web5 client4         </IfModule>              <IfModule mod_dav_fs.c>         # Do not execute PHP files in webdav directory             <Directory /var/www/clients/client4/web5/webdav>                 <ifModule mod_security2.c>                     SecRuleRemoveById 960015                     SecRuleRemoveById 960032                 </ifModule>                 <FilesMatch "\.ph(p3?|tml)$">                     SetHandler None                 </FilesMatch>             </Directory>             DavLockDB /var/www/clients/client4/web5/tmp/DavLock             # DO NOT REMOVE THE COMMENTS!             # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!       # WEBDAV BEGIN             # WEBDAV END         </IfModule>          </VirtualHost>      ## SOLVED Got it working, all I had to do was add               Satisfy any      to               Directory      statement. e.g:               <Directory /var/www/bennyben.cz/web>         Satisfy any         Options FollowSymLinks         AllowOverride All         Order allow,deny         Allow from all     </Directory>


title: Efficiency of Linux Kernel

text: In a documentary, **Linus Torvalds** says that even in the future, if anyone wishes to make a new OS from the scratch, they could use the **Kernel** which he wrote. It was very inspiring. Is it true that the Linux kernel is efficient enough that there is no need to write an entirely new kernel in the future?


title: Rsyncing files with special characters to USB FAT32

text: I want to copy a large number of files to a USB drive that is formatted FAT32 (and cannot be formatted anything else, unfortunately). Many of these files have names with characters such as `:` and `?` that FAT32 does not allow. Trying to use `cp` or `rsync`, these files are not copied and an error is reported stating so. I do not want to rename the files at the source, but I also do not care what the files are renamed to on the destination USB drive. Clarification on the purpose (applies to the other comments as well): This is for an mp3 player in a car and the software only allows FAT32. So it's not for backup purposes. And the reasons the filenames have strange characters is because they are, e.g. titles of mp3s, or names of artists. I have tried a couple of things:   1. rsync's `\--iconv` option. This didn't seem to work but perhaps I didn't use it correctly.   2. `rdiff-backup`, which I read does this conversion by default. However, the source files are symbolic links that I want followed (i.e. rsync's `-L` option), and from the manpages it doesn't seem that `rdiff-backup` has this option. Any other suggestions?


title: Display problem - Random grid appears on screen

text: I have recently started using Arch with nvidia driver (I had a lot of problems getting nouveau to even work so I decided to try nvidia) and I started experiencing rather odd problems. Every now and then, at random, the screen starts displaying grid over all windows. Screenshot Dock (cairo-dock) seems to be unaffected: Screenshot I am running Arch 3.4.3-1 (x86_64) with Compiz-Fusion and Cairo-Dock under Gnome 3.4.1. Nvidia was installed using nvidia package in [extra]               Name           : nvidia     Version        : 302.17-1     URL            : http://www.nvidia.com/     Licenses       : custom     Depends On     : linux>=3.4  linux<3.5  nvidia-utils=302.17     Conflicts With : nvidia-96xx  nvidia-173xx     Architecture   : x86_64     Description    : NVIDIA drivers for linux.      Window manager is Emerald. Graphics card is GT220. There is nothing relevant in the log (that I can see). The only way (that I found) to solve this is restart X server. I would appreciate any help - I have been trying to find any way to solve this but haven't had any luck. **EDIT:** I have been using gnome-shell for past 45 minutes and it hasn't crashed yet. Could it be a problem with compiz/emerald? **EDIT:** Nope, sadly gnome shell experiences the issue as well. However it turns out that youtube videos are unaffected. **EDIT:** Downgrading to 295.59 seems to have solved the problem.


title: After Arch Linux install it just shows the text "No bootable device found"

text: I've been trying to install Arch Linux. After the installation, it shows the BIOS screen and after that there just comes a message that says "No bootable device found". I have retried the whole scenario now some times, still it just shows the same message... At installing, I have followed the Unofficial Beginner's Guide from the ArchLinux wiki. Here is what I did: First of all, I wiped the hard drive (on which before the wipe was Windows Vista installed) and put GPT on it by using gdisk. Then I set up some partitions, which now look as the following (output of parted):               Model: ATA ST9160310AS (scsi)     Disk /dev/sda: 160GB     Sector size (logical/physical): 512B/512B     Partition Table: gpt     Disk Flags:          Number  Start   End     Size    File system     Name                 Flags      1      1049kB  2097kB  1049kB                  BIOS boot partition  bios_grub      2      2097kB  107MB   105MB   ext2            Linux filesystem           3      107MB   21.6GB  21.5GB  ext4            Linux filesystem           4      21.6GB  30.2GB  8590MB  linux-swap(v1)  Linux swap                 5      30.2GB  160GB   130GB   ext4            Linux filesystem           Then I mounted the root partition (sda2) to /mnt, after that also the boot and the home partition (sda3 and sda5) to /mnt/boot and /mnt/home and at the end formatted and activated the swap partition (sda4). Now I began installing the base system. After selecting the mirrors, I installed base and base-devel. At the end of the install I generated an fstab. Then I finally chrooted into /mnt, set up some Locales, set a root password and then installed and configured Grub2, exactly as it is explained here. At the end I exited from the chroot environment, unmounted the partitions and rebooted. You know the rest... It just showed the message that it coudn't find any bootable devices. By the way, I tried to install it on this computer. Hopefully someone finds out what I did wrong, thanks in advance!


title: Mapping intr to del key

text: I am in the process of migrating a legacy 4GL application from SCO OpenServer 5.0.7 to CentOS (Red Hat) Linux 5.9. There are a number of screens that prompt the user to press "DEL to ABORT" but is actually trapping the interrupt signal. How can I map `stty intr` to the `DEL` key for consistency? Is it possible to map interrupt to an ansi sequence? PuTTY is generating the following control codes for each of these keys: `DEL`: `^[[3~` `BACKSPACE`: `^?` `SHIFT` `BACKSPACE`: `^H` I can't find an option within PuTTY to remap the `DEL` key specifically.


title: How to find files in Linux using "locate"?

text: I would like to use this command to find some files.


title: Linux: Apple Wireless A1314 Fn key not registered, looks like software bug

text: I'm trying to set up my Apple Wireless Keyboard with my Kubuntu systems. These are PC hardware powered by Intel Atom and Intel i5 respectively. The keyboard has a US keyboard layout and has model number A1314 written on the back. It takes two AA batteries. I'm saying that because it appears there are multiple types of model A1314. I have tried this on a 10.04, 11.04, 11.10 and 12.04 system with no success. Every time using a bluetooth dongle and the KDE bluetooth notification tray applet, the keyboard can be connected. In both cases it shows up as "Apple Wireless Keyboard". Almost everything works as expected, in fact, I'm typing on it right now. But one thing doesn't: The Fn key. I'd like to use Fn + Down Arrow as PgDn / Page Down, I understand this is default behaviour on Apple keyboards. And of course I'd like the same for Page Up, Home and End. I'll stick to Page Down in my example. I used the xev tool to see the keycodes the system receives, and if I press on Fn nothing happens, and nothing is registered. If I press Fn + Down Arrow, xev only registers the down arrow. Here's the output from my 11.04 system to illustrate: Press just the Fn key: no output Press Down Arrow key: KeyPress event, serial 36, synthetic NO, window 0x4400001, root 0x15d, subw 0x4400002, time 2699773, (44,45), root:(1352,298), state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False               KeyRelease event, serial 36, synthetic NO, window 0x4400001,         root 0x15d, subw 0x4400002, time 2699860, (44,45), root:(1352,298),         state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False      Press Fn+Down Arrow Keys together:               KeyPress event, serial 36, synthetic NO, window 0x4400001,         root 0x15d, subw 0x4400002, time 2701548, (44,45), root:(1352,298),         state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 36, synthetic NO, window 0x4400001,         root 0x15d, subw 0x4400002, time 2701623, (44,45), root:(1352,298),         state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False      I've been searching this forum and other Linux-related forums for hours but I still have not found a solution. I mostly found advice on how to fix this when using an actual apple laptop or desktop, but I don't have that. They said to try something like the following `echo 2 > /sys/module/hid_apple/ ...` But since there's no hid_apple directory present on my systems, I've needed to `modprobe hid_apple` first. That didn't help either. I'm cool with changing some config files, or compiling my own patched kernel if that's necessary. I currently have a 10.04 and 12.04 system available to test. The same issue occurs when hooked up to Windows 7. Fn key still does nothing, not by itself or in combination with other keys. With some AutoHotkey fiddling, I was able to confirm the key is registered as pressed, but ignored by default. A custom AutoHotkey script can fix that. But AutoHotkey is only for Windows, I want my problem fixed on Linux. Hooked up to an iPad 2 it only works in combination with the F1-F12 keys. Not with the arrow keys. If the screen of the ipad is off, and I press just the Fn key, the screen will come on, so the key itself is registered as pressed. So to sum up my question: Can anyone help me get Page Up, Page Down, Home and End to work on this keyboard, when that requires me to use an Fn key which is currently not registered? Edit 4 July 2012: Still no luck. Thought perhaps KDE was interfering something, but here in XFCE the problem persists. Here is some output from Syslog:               Jul  4 13:15:31 comp kernel: [ 1561.377849] usb 1-1.4: new full-speed USB device number 8 using ehci_hcd     Jul  4 13:15:31 comp kernel: [ 1561.449864] usb 1-1.4: device descriptor read/64, error -32     Jul  4 13:15:31 comp kernel: [ 1561.629402] usb 1-1.4: device descriptor read/64, error -32     Jul  4 13:15:32 comp kernel: [ 1561.805100] usb 1-1.4: new full-speed USB device number 9 using ehci_hcd     Jul  4 13:15:32 comp bluetoothd[911]: HCI dev 0 registered     Jul  4 13:15:32 comp bluetoothd[911]: Listening for HCI events on hci0     Jul  4 13:15:33 comp bluetoothd[911]: HCI dev 0 up     Jul  4 13:15:33 comp bluetoothd[911]: Adapter /org/bluez/911/hci0 has been enabled     Jul  4 13:15:44 comp kernel: [ 1573.712323] input: Apple Wireless Keyboard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/bluetooth/hci0/hci0:42/input8     Jul  4 13:15:44 comp kernel: [ 1573.712569] generic-bluetooth 0005:05AC:0255.0006: input,hidraw3: BLUETOOTH HID v0.50 Keyboard [Apple Wireless Keyboard] on 00:09:DD:50:75:A1


title: Autologin question with LightDM & Ubuntu 14.04

text: I have set up a batch of workstations at a library using DRBL. These workstations are running Ubuntu 14.04. I want these workstations to autologin to a specific user (a different one for each workstation, since the `/home` file system is NFS mounted). I have a custom copy of `/etc/lightdm/lightdm.conf` for each workstation and I have set `autologin- user-timeout=30` and `autologin-user=workstationuser` (different for each workstation). This mostly works, but there are some 'weirdnesses' I would like to resolve.   1. Doing a Shutdown from the gear menu and then restarting the machine does not always log the user in. Sometimes it behaves like the user 'locked' the screen and it is expecting to unlock a running session. I want a shutdown to imply a full logout (it is too much to ask the library staff people to logout and then shutdown). Always. These are guest accounts, so there is never a session to save (screen locking is also disabled).   2. Doing a logout from the gear menu brings up the list of all possible users. This is OK (sometimes someone wants or need to login as a 'real' user). But if the login screen is left alone and/or after the 'real' user logs out, it does not automagically re-login to the autologin-user. What do I need to do to fix this? I am not very experienced with Ubuntu -- I am an old hand with CentOS and RedHat.


title: Player or plugin that can transcribe audio to real time subtitles

text: I'm searching for a Linux player (or a plugin for an existent player) with a similar functionality to Youtube: transcribe the audio to real time subtitles. I would like this to help me watch videos on foreign languages. If the player/plugin can translate too, that would be nice, but, just transcribe will work to me. Is there one? My favorite player is SMPlayer, so a solution using it is preferable to me.


title: ssh command unexpectedly continues on other system after ssh terminates

text: I'm running the below command, and monitoring the output file on the other system:               ssh $ip_address 'for n in 1 2 3 4 5; do sleep 10; echo $n >>/tmp/count; done'      If I kill the ssh command using `^C` or by just killing the terminal I'm logged in on, I'd expect the remote command to terminate, too. This doesn't happen, though: `/tmp/count` gets all the numbers 1–5 regardless, and `ps -ejH` shows the shell and its `sleep` child continues running. Is this expected behaviour, and is it documented anywhere? Can I disable it? From reading around, I'd expected to have to explicitly enable this sort of behaviour with nohup, not for it to be the default. I've taken a look through the man pages for ssh and sshd, but not spotted anything obvious, and Google points me at instructions for turning this behaviour on, not for turning it off. I'm running Red Hat Enterprise Linux 6.2, with a root login and bash shell on both systems.


title: Skype/Video drivers problems on Linux Mint 16

text: If I or the people I'm talking with turn on the camera, my system becomes so sluggish that nothing can be done (I can't even hang up the call). Event after the other party hangs up, the system keeps acting sluggish, with a 1-2 second delay per action (the most affected is the browser, Chrome in this case) I have a VM with win7 and have made skype calls in Mint, with the VM turned on. The video was awful, like always (it would be awesome if I could fix this too btw), but the weird thing, is that I could hang up and use the browser and all the OS behaved normally after the finishing the call. It continued for hours, with the VM turned on. Then, as soon I shutdown the VM, the browser becomes unusable, like before. I'm suspecting this is related to the video drivers, i have the optimus option enabled in the BIOS, so the PC will switch to the dedicated graphics when more processing is needed.Looks like when i have the VM turn on and require more graphic resources, skype works almost normally, as it's using the nvidia drivers and hardware. When i shutdown the VM, it has to come back to the integrated graphics, and then all got screw up. I'm providing hardware info to see if someone has some kind of fix, hint or solution for this :) The version of the nvidia drivers is the 304.88 **lspci**                 00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)       00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)       00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)       00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)       00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)       00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)       00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)       00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)       00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d5)       00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)       00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)       00:1f.0 ISA bridge: Intel Corporation HM86 Express LPC Controller (rev 05)       00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)       00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)       01:00.0 3D controller: NVIDIA Corporation GK107M [GeForce GT 745M] (rev a1)       07:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)       08:00.0 Ethernet controller: Qualcomm Atheros QCA8171 Gigabit Ethernet (rev 10)      **inxi -Fxi**                 System:    Host: shadowlap-Lenovo-Z710 Kernel: 3.11.0-20-generic x86_64 (64 bit, gcc: 4.8.1)             Desktop: N/A Distro: Linux Mint 16 Petra       Machine:   System: LENOVO product: 20250 version: Lenovo Z710            Mobo: LENOVO model: Durian 7A1 version: 31900003Std Bios: LENOVO version: 7FCN35WW date: 09/02/2013       CPU:       Quad core Intel Core i7-4700MQ CPU (-HT-MCP-) cache: 6144 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 19153.9             Clock Speeds: 1: 800.00 MHz 2: 800.00 MHz 3: 800.00 MHz 4: 800.00 MHz 5: 800.00 MHz 6: 800.00 MHz 7: 2401.00 MHz 8: 800.00 MHz       Graphics:  Card: Intel 4th Gen Core Processor Integrated Graphics Controller bus-ID: 00:02.0             X.Org: 1.14.3 drivers: intel (unloaded: fbdev) FAILED: vesa Resolution: 1920x1080@60.0hz             GLX Renderer: Mesa DRI Intel Haswell Mobile GLX Version: 3.0 Mesa 9.2.1 Direct Rendering: Yes       Audio:     Card-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio       Controller driver: snd_hda_intel bus-ID: 00:03.0            Card-2: Intel 8 Series/C220 Series Chipset High Definition Audio Controller driver: snd_hda_intel bus-ID: 00:1b.0            Sound: Advanced Linux Sound Architecture ver: k3.11.0-20-generic       Network:   Card-1: Intel Wireless 7260 driver: iwlwifi ver: in-tree: bus-ID: 07:00.0            IF: wlan0 state: up mac: 0c:8b:fd:58:24:3d            Card-2: Qualcomm Atheros QCA8171 Gigabit Ethernet driver: alx port: 3000 bus-ID: 08:00.0            IF: eth0 state: down mac: 54:be:f7:5f:69:e0            WAN IP: 190.231.143.97 IF: vmnet8 ip: 172.16.239.1 ip-v6: fe80::250:56ff:fec0:8             IF: eth0 ip: N/A ip-v6: N/A IF: wlan0 ip:  ip-v6: fe80::e8b:fdff:fe58:243d             IF: vmnet1 ip: 192.168.101.1 ip-v6: fe80::250:56ff:fec0:1       See the FAILED on the drivers section? I suppose this is from loading the nvidia drivers. It means that when the optimus switch to the integrated drivers is on, it is still using the nvidia ones, and that's why the performance is so crappy. That would explain why the lag didn't happened when the VM was turn on.


title: MySQL 5.1 to 5.5: all UTF-8 characters lost!

text: I decided to upgrade my Debian installation, and after some days using MySQL 5.5, I found that `mysql` prints garbage to the terminal intead of UTF-8 characters. I had a look at the SQL file that was produced by `mysqldump`, and noticed it already contained the garbage. Today I dropped the database and got a copy of the old `/var/lib/mysql/database_name/*` which was working well and, to my surprise, I still get the same results. The file produced by `mysqldump` includes the following lines:               /*!40101 SET NAMES utf8 */;     /*!40101 SET character_set_client = utf8 */;     ) ENGINE=MyISAM DEFAULT CHARSET=latin1;      `/var/lib/mysql/database_name/db.opt` from the old and new databases are the same:               default-character-set=latin1     default-collation=latin1_swedish_ci      What can I do now? I hope I won't lose the entire database! **UPDATE**               show session variables like 'character%';     +--------------------------+----------------------------+     | Variable_name            | Value                      |     +--------------------------+----------------------------+     | character_set_client     | utf8                       |     | character_set_connection | utf8                       |     | character_set_database   | latin1                     |     | character_set_filesystem | binary                     |     | character_set_results    | utf8                       |     | character_set_server     | latin1                     |     | character_set_system     | utf8                       |     | character_sets_dir       | /usr/share/mysql/charsets/ |     +--------------------------+----------------------------+          SELECT charset(name), hex(name), name FROM table WHERE id='123';     +---------------+----------------------------------------------+----------------------------+     | charset(name) | hex(name)                                    | name                       |     +---------------+----------------------------------------------+----------------------------+     | latin1        | 457361C3BA204A6F73C3A92064652053616E74616E61 | EsaÃº JosÃ© de Santana     |     +---------------+----------------------------------------------+----------------------------+      The output of name in the last command should be `Esaú José de Santana`


title: missing symbols or unicode character?

text: Once I finished installing elementary OS, it's all good. After I did some changes for language, and switched it back, some symbols(unicode character?) are missing from terminal ![enter image description here](http://i.stack.imgur.com/HFIes.png) those are two of missing symbols ‘╭─’ ‘╰─’


title: Redundant array of NTFS disks

text: I have a number of NTFS disks with unused capacity. They are leftover external hard drives with a Windows history. I have a very limited number of USB ports on my machine, and want to find a cheap way to combine these disks as one logical disk, as it appears to the OS. Are there any methods in Linux to implement this? Is this like RAID or span arrays?


title: How can I enable mouse in Vim?

text: How can I use mouse with panes in vim? I tried `:set mouse=a` but it does not seem to work when doing `:sp` or `:vsp` or `vim -O`


title: Mails flagged as ****spam***

text: I have Exim mail server. Mails generated by PHP code are flagged as spam in mail subject. Please help to stop that ****spam**** subject in my mail which generated by PHP code.


title: Why would someone use joe?

text: I've seen some skilled unix/linux users use joe instead of vi(m) or nano. Why would they prefer using it over the provided alternatives?


title: Is it possible to change the spacing between files using ls

text: I'm fairly new to unix and I was wondering if there's some attribute of `ls` that I can use to change the spacing between the files. Currently I've aliased my `ls` to output `ls -G`, so that I have colored folders. However, the downside of that is that the files/folders show up a little more squooshed/close together.


title: How do I make pasted shell commands invisible?

text: I'm using an AutoHotkey macro to run some shell commands, _i.e._               ^`::     SendInput set c=".cshrc-acheong"{ENTER}     SendInput set v=".vimrc-acheong"{ENTER}     SendInput foreach d ( /home/acheong /home/tcama /userhome/andrew.cheong ){ENTER}     SendInput if ( -e $d/$c ) source $d/$c{ENTER}     SendInput if ( -e $d/$v ) alias vim "vim -N -u $d/$v"{ENTER}     SendInput end{ENTER}     return      If you're not familiar with AutoHotkey, no problem—it's the same as pasting several lines of shell commands at once—and many of us have seen how the command prompt appears "asynchronously" as each line executes: ![enter image description here](http://i.stack.imgur.com/6llNE.png) **Is there a command or trick to hiding (perhaps blocking)`stdin` and then executing the input without displaying it (or its outputs)?** Sort of like typing passwords. * * * Please be sparing of judgments regarding the above :-( To preemptively disclaim some things:   1. I don't use `csh` by choice; yes, I've read the Top 10.   2. I work with hundreds of servers that don't all mount the same network share for `/home`—that's why I'm using `rsync` to push a "master" `.cshrc` and `.vimrc` to a location per distinct network share, so that the above keyboard macro will find and load whichever is found, wherever I am. * * * **Update** I tried adding `stty -echo`, _i.e._               ^`::     SendInput stty -echo{ENTER}     SendInput set c=".cshrc-acheong"{ENTER}     SendInput set v=".vimrc-acheong"{ENTER}     SendInput foreach d ( /home/acheong /home/tcama /userhome/andrew.cheong ){ENTER}     SendInput if ( -e $d/$c ) source $d/$c{ENTER}     SendInput if ( -e $d/$v ) alias vim "vim -N -u $d/$v"{ENTER}     SendInput end{ENTER}     SendInput stty echo{ENTER}     return      However the prompts continue to appear: ![enter image description here](http://i.stack.imgur.com/kJG4A.png) (I thought about unsetting `$prompt` but I'm reluctant as one of the things my `.cshrc` does is precisely to replace `$prompt`.)


title: Can We Have Different Wallpapers For Each Workspace under Gnome?

text: I was wondering whether we can have different wallpapers in each workspace of a Linux distro using Gnome. Googled it. Solutions I found require desktop effects to be enabled. My laptop can't take up that much load. So I wanted to know if their's a way to do so without enabling any effects. [ **note** ] My distro is Fedora 14.


title: What is the real-world use of the bg command?

text: This is the output:               [USER@SERVER ~] ping localhost     PING localhost (127.0.0.1) 56(84) bytes of data.     64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.037 ms     64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.024 ms     64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.030 ms     64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.026 ms     64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.026 ms     ^Z     [1]+  Stopped                 ping localhost     [USER@SERVER ~] jobs     [1]+  Stopped                 ping localhost     [USER@SERVER ~] bg %1     [1]+ ping localhost &     64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.034 ms     [USER@SERVER ~] 64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.030 ms     64 bytes from localhost (127.0.0.1): icmp_seq=8 ttl=64 time=0.032 ms          [USER@SERVER ~] ^C     [USER@SERVER ~] ^C     [USER@SERVER ~] 64 bytes from localhost (127.0.0.1): icmp_seq=9 ttl=64 time=0.031 ms     ^C     [USER@SERVER ~] 64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.031 ms     64 bytes from localhost (127.0.0.1): icmp_seq=11 ttl=64 time=0.028 ms     ki64 bytes from localhost (127.0.0.1): icmp_seq=12 ttl=64 time=0.030 ms     ll %64 bytes from localhost (127.0.0.1): icmp_seq=13 ttl=64 time=0.031 ms     1     [1]+  Terminated              ping localhost     [USER@SERVER ~]       of:      1) I start to ping localhost   2) CTRL+Z   3) bg %1   4) CTRL+C doesn't work.   5) I have to type "kill %1" to kill it..         What is the real-life use of the "bg" command? Where is it used in the real world?