Enclose multiple lines in quote Vim

I have blocks of the following form:                   String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes              String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes              String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes              String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes      I need to put the lines that state that they are supposed to be enclosed in quotes in quotes:                   String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"              String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"              String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"              String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"      Is there a semi-automatic way of doing this with Vim? I thought that a possible solution might involve the `g` command.


Determining NIC designation from PCI address

I am in the process of upgrading a legacy system from RHEL 5.4 to 5.8. There are three NICs installed, each with defined IP addresses and attached wiring. After the upgrade, the cards are on the same PCI addresses but the OS has shuffled the NIC designations:               network old  new     net A   eth0 eth1     net B   eth1 eth2     net C   eth2 eth0      The PCI addresses in use are `05.03.0` for `Net C` and the other two are on `03.03.0` and `03.03.1`. There is no `/etc/udev/rules.d/70-persistent-net.rules` file. Is there a way to specify which PCI addresses are used for each interface? **Update** I have found `/etc/sysconfig/hwconf` and `/etc/sysconfig/network- scripts/ifcfg-eth?` files that contain the IP and MAC address values. hwconf also specifies the PCI address, but seems to get re-written on boot. I would prefer to be able to specify the NICs by PCI position as this is effectively what is used to determine the behaviour rather than MAC address which would be changed if a different card was used.


Cannot Recognize ISO in Fedora Core 1 (Yarrow) in VMWare View Player

It's a long story of why I am trying to do this (basically supporting a business that has not updated their servers in a LONG time). In any case, I am trying to mount an ISO in VMWare View player so I can get access to it inside a snapshot of Yarrow. (I am using VMWare View Player 5.) When I "Connect" to the ISO, it does see the drive - it even recognizes the name of the image (FC-1 i386). However, when I try to navigate to /mnt/cdrom and perform 'ls', nothing is listed. The application installer keeps asking me for the CD. Here is my /etc/fstab:               /dev/cdrom  /mnt/cdrom  udf,iso9660  noauto,owner,ro  0 0      There was a "kudzu" option in with the noauto,owner,ro, but I removed that after doing some reading. Unfortunately, nothing seems to be working at this point. I know the ROM is good because I used it to install another image of Fedora Core 1 just to test that out. Anybody have any suggestions/pointers?


What does the noload option do in fstab?

I put `UUID=fb2b6c2e-a8d7-4855-b109-c9717264da8a / ext4 auto,noatime,noload,data=ordered,commit=10,defaults 1 1` in fstab And now server fails to reboot. It can reboot but reject all kind of connections. This is what my provider said:               Yeah, the noload option might be problematic... I can't edit /etc/fstab from     single user mode, but I might be able to edit it using one of my pxe boot tools     to enter the filesystem manually. With regards to your request about     /var/log/messages and /var/log/secure, I'm afraid I can't do that for you     (technically, I'm already bordering on managed services by editing your fstab     for you, but I am justifying it as necessary to restore connectivity)...      I search for the purpose of noload option in google https://www.google.com/search?q=fstab+noload&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en- US:official&client=firefox-a and have no issue. Someone in linux forum says that it disable journaling. > I'm unable to paste the actual error messages without manually typing them > out, but I assure you they're not really very descriptive (basically, system > indicates that it is unable to remount root in read/write mode, and then > errors composed of read/write problems, particularly in /var are printed to > the screen)... It does end in a happy ending: > Your server is back online, and I was able to successfully disable your > iptables (which for reference, I did confirm were causing connectivity > issues), and I am now able to ssh into your server with the credentials > provided earlier in this ticket:


Running a local port scan and found open ports but, don't know what they're used for?

I wrote a very basic python script to port scan my system. I'm running linux- mint lisa:               open_ports = []     for port in xrange(65536):         conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)         try:             conn.connect(('localhost', port))             open_ports.append(port)             conn.close()         except socket.error:             pass      I returned a list of 7 ports and I ran netstat on each one:               sudo netstat -anlp | grep :(each port here)      I found that the first four were for `cups, mysql, polipo, and tor` but, the last three `[44269, 46284, 47650]` were much higher numbers and I didn't get anything back. I ran the script a few times more after this but, I would only return the first four. Any ideas what they could be and what they're being used for?


Do I need to wipe and reinstall after possible hacker attack

Yesterday I noticed that the xterm title I use changed suddenly to something strange. So I suspect that someone hacked my Linux laptop (I'm using Arch). I changed the WiFi parameters (pass, essid) and changed my password on the computer. I also reinstalled all packages to overwrite files that may have been changed. I tried to take a look at the changed files, logs and so on, but I don't have experience in security, so it was like walking in the dark ;) and of course I didn't found any signs of intrusion. Do you think I should wipe the system and install from scratch?


Server no longer responsive after reboot

I changed my fstab into this:               #     # /etc/fstab     # Created by anaconda on Sat Jan 12 02:12:44 2013     #     # Accessible filesystems, by reference, are maintained under '/dev/disk'     # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info     #     UUID=fb2b6c2e-a8d7-4855-b109-c9717264da8a /                       ext4    auto,noatime,noload,data=ordered,commit=10,defaults        1 1     UUID=71362665-f627-41e1-a093-de42a0a356e2 /boot                   ext3    defaults        1 2     UUID=8024a5cd-af4b-4776-af0d-65ad80af8649 swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0     /usr/tmpDSK             /tmp                    ext3    defaults,noauto        0 0     /dev/sdd1               /home4                  auto    auto,noatime,noload,data=ordered,commit=10,defaults        0 0     /dev/sdc1               /home3                  auto    auto,noatime,noload,data=ordered,commit=10,defaults        0 0     /dev/sdb1               /home2                  auto    auto,noatime,noload,data=ordered,commit=10,defaults        0 0      Basically the boot sector remains ext3. I disabled journaling for most drives because it causes heavy writes. Now after rebooting server I can't even access ssh. The message I got from ssh is connection refused.


Is there any rsync parameter for show at the end the changes made?

I have a script that sync (mirror mode) four folders between two disks. While it is running it shows the directory where it is in this very moment, and at the end it shows bytes sent, speed, etc. I'm wondering if there is a parameter that shows the changes made at the end. For example:   * Copied a,b,c from A/asd to B/asd   * Deleted d,e,f from B/asd


How to check physical device contents

I got a server with 2 hard drives. I would like to know what is on 2nd drive. How would I list all contents on physical device ?               lsblk     NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT     xvda    202:0    0  40G  0 disk      └─xvda1 202:1    0  40G  0 part /     xvde    202:64   0  40G  0 disk      └─xvde1 202:65   0  40G  0 part       I run the above code. Does it mean that 2nd drive is empty and not in use ?


Confusion on the cp command when creating a new directory

Let me explain my problem with a simpler scenario. We have these two directories: `~/Foo` and `~/Bar`. Foo contains the files `test1.txt` and `test2.txt`. If I run the command `cp -R Foo Bar`, the Bar directory now contains a Foo folder containing the two text files. However, if I run the command `cp -R Foo Bar` when the `Bar` directory does not yet exist before the command is run, the newly created `Bar` directory will not contain a `Foo` subdirectory but only the two `.txt` files. Why is it when I run the command in the first situation that it creates a subdirectory with the two files but in the second situation it just copies the two files into the new directory? Is the `cp` program supposed to function in this way?


line 7: [: echo: integer expression expected

This is my first script for Shell/Bash and I'm struggling with the syntax. The first command line argument is a string while the second is number.               x='echo $1|wc -m'     count=0     while             [ $count -le $x ]                         #line 7     do             count=$(( $count+1 ))             echo $1     done     if             [ $2 -lt 0 ]     then             echo 'Negative'     else             echo 'Positive'     fi


Any built-in Linux methods for AXI-burst type devices?

I need to communicate with an FPGA device based on an AXI-burst interface. What are the ways to access such a device through Linux without involving a DMA? Burst is an intrinsic property of the AXI standard, which should typically be triggered automatically when large amounts of data are being transferred. And the bigger problem is the FPGA is designed so as to respond only to burst type requests over the AXI bus. So this causes serious issues on Linux when the application tries sequential copy. P.S. I have already tried memcpy and it doesn't work.


Multi-Threading/Forking in a bash script

I have written a bash script which is in following format:               #!/bin/bash     start=$(date +%s)     inFile="input.txt"     outFile="output.csv"          rm -f $inFile $outFile          while read line     do              -- Block of Commands          done < "$inFile"          end=$(date +%s)          runtime=$((end-start))          echo "Program has finished execution in $runtime seconds."      The `while` loop will read from `$inFile`, perform some activity on the line and dump the result in `$outFile`. As the `$inFile` is 3500+ lines long, the script would take 6-7 hours for executing completely. In order to minimize this time, I am planning to use multi-threading or forking in this script. If I create 8 child processes, 8 lines from the `$inFile` would be processed simultaneously. How can this be done?


truncate a log file to zero while another process is continuously writing to it

I'm trying to debug this horribly hacky little program and it's writing a trace of all emulated instructions to a logfile which has grown to 2.5 GB in 45 min. I've only got 800 MB free. Can I truncate the file without disturbing the program writing to it? And if so, how? This is running on Cygwin over Windows 8.


How to 'strace' a unix domain socket?

Kind of hard to explain but I noticed when `strace`ing the PID that has the socket open I cannot see any of the communication. How can I sit in the middle of a socket file to watch communication?


Can proxychains proxify VirtualBox?

I have my proxychains proxiyfied VirtualBox, the guest OS connects to the internet directly that bypassing the proxy setting in /etc/proxychains .cnf. So, which is proxychains can and can't?


How do I get the list of exit codes (and/or return codes) and meaning for a command/utility?

Is there a way I can do what stated in the title from the terminal commands, or will I have to look into the codes?


How to grep for text in a file and display the paragraph that has the text?

Below is the text in the file:               Pseudo name=Apple     Code=42B     state=fault          Pseudo name=Prance     Code=43B     state=good      I need to grep for "42B" and get the output from the above text like:               Pseudo name=Apple     Code=42B     state=fault      Does anyone have idea on how to achieve this using `grep`/`awk`/`sed`?


How do I diagnose problems docker deployments (dokku/git push)?

I'm new to Docker and dokku, and DigitalOcean, and just trying to figure out how all the pieces fit together. I'm deploying my app with git. When I deploy, it seems to succeed from my end, but when I log in and look for the running process with docker ps, I don't see any. A little investigation shows it tried to do something...               # docker ps -a      ID IMAGE COMMAND CREATED STATUS PORTS      e69021b44e45 app/foo:latest /bin/bash -c /start 12 minutes ago Exit 0      Trying to launch manually:               # docker run e69021b44e45 node app.js      Unable to find image 'e69021b44e45' (tag: latest) locally      Pulling repository e69021b44e45      2013/09/21 04:12:02 Internal server error: 404 trying to fetch remote history for e69021b44e45      What could I be doing wrong, and how do I investigate issues like this? For more information, I'm deploying to Docker using dokku on DigitalOcean's Ubuntu/Docker image.


lstat64 fails on existing directory

After trying for a while to debug a failing `move_uploaded_file` call, I tried               strace -s 8192 -o strace.log -f /etc/init.d/apache22 restart      This produced, among a lot more output, the following lines:               5069  lstat64("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     5069  lstat64("/var/apache22", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     5069  lstat64("/var/apache22/var", 0xbffe0f8c) = -1 ENOENT (No such file or directory)      (Yes, I know the path is a bit strange. It's a legacy application.) The issue is that **"/var/apache22/var" _really exists_**. Pasting verbatim (except for [bracketed text]) from a root session:               # ls -la "/var/apache22/var"           total 24     drwxr-xr-x  6 root root 4096 Mar  7  2011 .     drwxr-xr-x  9 root root 4096 Jan 11 19:18 ..     drwxr-xr-x 10 root root 4096 Mar  7  2011 apache22     drwxr-xr-x  3 root root 4096 Mar  7  2011 log     drwxr-xr-x  2 root root 4096 Jan 11 19:36 run     drwxr-xr-x  3 root root 4096 Mar  7  2011 usr          # stat "/var/apache22/var"       File: `/var/apache22/var'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: 804h/2052d  Inode: 539214      Links: 6     Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2012-01-11 19:46:47.000000000 +0100     Modify: 2011-03-07 23:27:57.000000000 +0100     Change: 2011-06-06 19:39:40.000000000 +0200          # mount     /dev/sda1 on / type ext3 (rw)     /dev/sda3 on /usr type ext3 (rw)     /dev/sda4 on /var type ext3 (rw)     sysfs on /sys type sysfs (rw)     /var/[product name] on /var/apache22/var/apache22/export/[product name] type none (rw,bind)      There are no symlinks:               # file / /var /var/apache22 /var/apache22/var     /:                 directory     /var:              directory     /var/apache22:     directory     /var/apache22/var: directory          # uname -r     2.6.29.6


Yocto project installation error

I installed the Yocto project in Ubuntu 12.04 desktop. I followed steps what they given in the yocto website Supported Linux Distributions.               $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib       build-essential chrpath     $ sudo apt-get install libsdl1.2-dev xterm     $ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto     $ sudo apt-get install autoconf automake libtool libglib2.0-dev      After installations I did this steps               $ cd ~     $ git clone git://git.yoctoproject.org/poky     $ cd poky     $ git checkout -b dora origin/dora     $ source oe-init-build-env     $ bitbake adt-installer      I got this errors               Loading cache: 100% |###########################################| ETA:  00:00:00     Loaded 1188 entries from dependency cache.     NOTE: Resolving any missing task queue dependencies          Build Configuration:     BB_VERSION        = "1.20.0"     BUILD_SYS         = "x86_64-linux"     NATIVELSBSTRING   = "Ubuntu-12.04"     TARGET_SYS        = "i586-poky-linux"     MACHINE           = "qemux86"     DISTRO            = "poky"     DISTRO_VERSION    = "1.5.1"     TUNE_FEATURES     = "m32 i586"     TARGET_FPU        = ""     meta                   meta-yocto             meta-yocto-bsp    = "dora:84c2763fa0bf08a83caa2c5ee532b5bef2ff918b"          NOTE: Preparing runqueue     NOTE: Executing SetScene Tasks     NOTE: Executing RunQueue Tasks     WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz;name=archive, attempting MIRRORS if available     WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-001;name=patch1;apply=yes;striplevel=0, attempting MIRRORS if available     ERROR: Fetcher failure: Fetch command failed with exit code 4, no output     ERROR: Function failed: Fetcher failure for URL: 'ftp://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-001;name=patch1;apply=yes;striplevel=0'. Unable to fetch URL from any source.     ERROR: Logfile of failure stored in: /home/openstack/poky/build/tmp/work/x86_64-linux/readline-native/6.2-r4/temp/log.do_fetch.32384     ERROR: Task 347 (virtual:native:/home/openstack/poky/meta/recipes-core/readline/readline_6.2.bb, do_fetch) failed with exit code '1'     NOTE: Tasks Summary: Attempted 190 tasks of which 155 didn't need to be rerun and 1 failed.     No currently running tasks (190 of 373)          Summary: 1 task failed:       virtual:native:/home/openstack/poky/meta/recipes-core/readline/readline_6.2.bb, do_fetch     Summary: There were 2 WARNING messages shown.     Summary: There were 2 ERROR messages shown, returning a non-zero exit code.      How to install Yocto project? Anyone help me.


How do the internals of sudo work?

How does `sudo` work internally? How is it possible that it can become root without having the root password, unlike `su`? What syscalls, etc. are involved in the process? Is it not a gaping security hole in Linux(e.g. why couldn't I compile a heavily-patched `sudo` that just did whatever regular `sudo` did, but didn't ask for the unprivileged user's password)? I have read login and su internals. I have also read How is sudo intended to be used? but despite the title, they mainly deal with the differences between `su` and `sudo`.


changing the names of network interfaces, debian wheezy

I'm trying to set a name for an interface, "ethLan" instead of eth0. Doing so also ensures that the if's name will remain consistent at every reboot and kernel. I did find some articles in the subject, but they are all a couple of years old:   http://www.debian-administration.org/articles/463   http://www.linuxfromscratch.org/hints/downloads/files/nameif.txt I did as they said and added the **ethLan mac** to **/etc/mactabs/**. At this point I have two problems:   1) The `if [...] && /sbin/nameif` script I put at **/etc/network/if-pre- up.d/** does not run. I solved this by adding this to the _/etc/init.d/networking_ , but why doesn't _if-pre-up.d_ work?   2) The interface won't load unless I manually do **ifconfig ethLan up** , in spite of adding it to _/etc/network/interfaces_. What am I doing wrong?


ICMP gives host an impossible redirect

I am having trouble with forwarding on a system which hosts a few headless VirtualBox VMs. I have not changed anything but the configuration has stopped working. The VMs have IP addresses on their own subnet which I have to route to myself. So the host has it's IP and gateway, and an alias which is used as a gateway by the VMs. The host configuration:               root@greece:~# ifconfig     eth0      Link encap:Ethernet  HWaddr 0c:c4:7a:02:5d:36               inet addr:192.99.46.35  Bcast:192.99.46.255  Mask:255.255.255.0               inet6 addr: 2607:5300:60:5123::/64 Scope:Global               inet6 addr: fe80::ec4:7aff:fe02:5d36/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:31246 errors:0 dropped:35 overruns:0 frame:0               TX packets:5818 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:30002593 (28.6 MiB)  TX bytes:3268821 (3.1 MiB)               Memory:fb920000-fb940000          eth0:0    Link encap:Ethernet  HWaddr 0c:c4:7a:02:5d:36                 inet addr:198.50.241.112  Bcast:198.50.241.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               Memory:fb920000-fb940000           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:2191 errors:0 dropped:0 overruns:0 frame:0               TX packets:2191 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:2781224 (2.6 MiB)  TX bytes:2781224 (2.6 MiB)          root@greece:~# route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         192.99.46.254   0.0.0.0         UG    0      0        0 eth0     192.99.46.0     *               255.255.255.0   U     0      0        0 eth0     198.50.241.0    *               255.255.255.0   U     0      0        0 eth0          root@greece:~# iptables -nvL     Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination               1088  987K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED         1    84 ACCEPT     all  --  *      *       198.50.241.0/24      0.0.0.0/0                    1    60 ACCEPT     all  --  *      *       0.0.0.0/0            198.50.241.0/24              1    72 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate INVALID         0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 ctstate NEW        40 13120 UDP        udp  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate NEW         0     0 TCP        tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcpflags: 0x17/0x02 ctstate NEW        40 13120 REJECT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable         0     0 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with tcp-reset         0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-proto-unreachable          Chain FORWARD (policy ACCEPT 109 packets, 7776 bytes)      pkts bytes target     prot opt in     out     source               destination          Chain OUTPUT (policy ACCEPT 854 packets, 1879K bytes)      pkts bytes target     prot opt in     out     source               destination          Chain TCP (1 references)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22          Chain UDP (1 references)      pkts bytes target     prot opt in     out     source               destination     root@greece:~# sysctl net.ipv4.ip_forward     net.ipv4.ip_forward = 1      This configuration should work. I can reach the host's main IP (192.99.46.35) from the VMs. I get an interesting response when I try to ping the hosts gateway (192.99.46.254).               root@minecraft:~# ping -c 2 192.99.46.254     PING 192.99.46.254 (192.99.46.254) 56(84) bytes of data.     From 198.50.241.112: icmp_seq=1 Redirect Host(New nexthop: 192.99.46.254)     64 bytes from 192.99.46.254: icmp_req=1 ttl=254 time=47.1 ms          --- 192.99.46.254 ping statistics ---     2 packets transmitted, 1 received, 50% packet loss, time 1002ms     rtt min/avg/max/mdev = 47.134/47.134/47.134/0.000 ms     root@minecraft:~# ping -c 2 192.99.46.254     PING 192.99.46.254 (192.99.46.254) 56(84) bytes of data.     From 198.50.241.115 icmp_seq=1 Destination Host Unreachable     From 198.50.241.115 icmp_seq=2 Destination Host Unreachable          --- 192.99.46.254 ping statistics ---     2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1011ms     pipe 2      It responds to redirect the host and then after than the host in unreachable. It should work as far as I know. The configuration has not changed. The guest VM has a very simple configuration...               root@minecraft:~# ifconfig     eth0      Link encap:Ethernet  HWaddr 08:00:27:8e:9b:2b                 inet addr:198.50.241.115  Bcast:198.50.241.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe8e:9b2b/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:750 errors:0 dropped:0 overruns:0 frame:0               TX packets:336 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:79663 (77.7 KiB)  TX bytes:30405 (29.6 KiB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:48 errors:0 dropped:0 overruns:0 frame:0               TX packets:48 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:4405 (4.3 KiB)  TX bytes:4405 (4.3 KiB)          root@minecraft:~# iptables -nvL     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination          # route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         198.50.241.112  0.0.0.0         UG    0      0        0 eth0     localnet        *               255.255.255.0   U     0      0        0 eth0      Note: flushing the IP tables and setting the input policy to accept does not change anything. This is not a NAT configuration, the guests have proper internet addresses.


Bluetooth not working in fresh Mint Maya install

I have a fresh Mint Maya install (MATE WM). Out of the box, the bluetooth applet appeared on the taskbar, but it wouldn't launch. After an upgrade from apt, it doesn't even appear on the taskbar anymore. Trying to run the appropriate programs directly fails like this:               $ mate-bluetooth-     mate-bluetooth-applet      mate-bluetooth-sendto     mate-bluetooth-properties  mate-bluetooth-wizard     $ mate-bluetooth-applet           ** (mate-bluetooth-applet:12517): WARNING **: Applet     is already running, exiting     $ mate-bluetooth-properties           (mate-bluetooth-properties:12521): Unique-DBus-WARNING     **: Error while     sending message: Did not receive a     reply. Possible causes include: the rem ote application     did not send a reply, the message bus security policy     blocked the reply, the reply timeout expired, or the     network connection was broken.     $ mate-bluetooth-wizard           (mate-bluetooth-wizard:12602): Unique-DBus-WARNING     **: Error while sending message: Did not receive a     reply. Possible causes include: the remote application     did not send a reply, the message bus security policy     blocked the reply, the reply timeout expired, or the     network connection was broken.


Is there a better way than cp to copy millions of files while preserving hard links?

So in this story on the GNU coreutils ML, someone used cp to copy 430 million files and needed to preserve hard links, and _just barely_ got it to finish after 10 days. The big problem was that, in order to preserve hard links, cp has to keep a hashtable of already copied files, which took up 17GB of memory towards the end and had the system thrashing on swap. Is there some utility that would have handled the task better?


Can I use Unix to load-balance two Linux servers?

I'm trying to work out a solution in my head where two backend linux-servers run HTTP, SMTP, XMPP mirrored and should load balance connections between them. My current solution is an OpenBSD box infront, that can of course be extended with carp to add more in the future to avoid single point of failure. Using PF I could have a pool of servers to send traffic to, using random or round-robin methods. And using relayd I can remove non-functioning pool-servers from it. But I would value the opinions of the community on this matter, so please tell me your best Unix load balancing solution for this type of environment. One goal would be that a single server should be allowed to fail with minimal service interruption.


Print UTF-8 file with command line tools

I want to print a file using a command like `cat filename > /dev/lp0` where the file contains characters like `ùàç` encoded in UTF-8. Is this is possible or do I need to use CUPS? I'm using an embedded Linux with a Debian file system and 3.10 kernel version.


How can I deny internet access to all processes except the chosen ones?

Sometimes I am forced to use really narrow Internet bandwidth of 56kbps. On my Ubuntu desktop I have too many programs, that frequently check something on the net - and hunting and disabling them one-by-one is really troublesome. I'd like to have some tool, that would deny internet access (by whatever means) to every process except the e.g. the mail client. Is it possible at all? If so, how? I imagine, that one way to accomplish it is to open another network device (like `/dev/tap1`) and set it to route into the `/dev/wlan0` (my usual internet device) and guard everything with custom `iptables` rules, that can be switched on and off. But I am no expert at iptables, so that sort solution, unless someone gives me specific instructions, is useless.


Dual Boot with Grub: can't boot Arch Linux

### My history I got a PC with Intel 64 Bit Processor. There I have installed Ubuntu 14.04 LTS at `/dev/sdb1` and Arch Linux at `/dev/sda1`. Both use swap on `/dev/sdb2`. I tried (with success) to install Arch Linux onto a SD-Card (`/dev/sdc`) for my Raspberry Pi. There I tried to install `vim` to the SD-Card using `pacstrap`. This produced a few errors. Then I unplugged my SD-Card reader. After rebooting my PC I saw a `GRUB_RESCUE>` prompt, and the line:               error:no such device:5a28b060-333c-479a-b5ed-58a7b9d8ae77.      **NOTE:** This is the UUID of my Ubuntu partition (`/dev/sdb1`) ### My first try Then I used my _amd64 boot repair disc_ and installed GRUB onto `/dev/sdb`. Then I had to disable `/dev/sda` in the BIOS and Ubuntu is booting nicely. **NOTE:** Arch wasn't showing up at this moment. Then I ran `sudo update-grub` and rebooted. Then Arch Linux was shown up but if I selected: " _Arch on /dev/sda1_ " my sata disk or something like that produced a ugly sound and my PC rebooted. The output was:               :~$ sudo update-grub     Grub-Konfigurationsdatei wird generiert …              #generating grub.cfg     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-35-generic     #Linux-image found     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-35-generic     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-34-generic     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-34-generic     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-33-generic     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-33-generic     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-32-generic     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-32-generic     Found memtest86+ image: /boot/memtest86+.elf     Found memtest86+ image: /boot/memtest86+.bin     Arch auf /dev/sda1 gefunden             #found Arch on /dev/sda1     erledigt                          #done       Interestingly GRUB says that it only found Arch on `/dev/sda1`. ### My second try Then I tried to install GRUB onto `/dev/sda` and activated `sda` in the BIOS. Then my machine produced again this ugly sound and I had to start again with the _boot repair disc_. ### My third try Is this here. I checked the `/boot` folder of Arch and of Ubuntu, the differences are:   * Arch has got two `initramfs.img` (one is fallback) images   * Ubuntu has got a few `initrd.img` images(different versions)   * Ubuntu has got a few `System.map` files(see above)   * Ubuntu has got a few config files(again for the different versions)   * Ubuntu has got a few 'abi' files(what's that?) And the filesystem of my Arch-partition is not damaged. By the way I don't want to re-install Arch because my installation is at a point where it would be really a _lot_ work to rebuild the system. Could it be that my MBR of `/dev/sda` are damaged? Now I want to be able again to start both Operating Systems properly, but I'm at a loss on how to resolve my issue.


Apc is not working in php 5.5

I install APC in ubuntu server where php version is 5.5.9. When I see apc. php it is enabled but it not properly work. In php info               APC support     Emulated       2nd one apcu is               Version     4.0.2     APCu Debugging  Disabled     MMAP Support    Enabled     MMAP File Mask  no value     Serialization Support   php, eval     Revision    $Revision: 328290 $      Please help


How well do Chromebooks support other Linux distributions?

As many manufacturers of Notebooks do not offer any Notebooks without Windows preinstalled anymore, the next best thing would be a Chromebook.   I'd like to know how well do/will other Linux Distributions like Ubuntu and Fedora work on these new Chromebooks? I talk about all kind of drivers, battery lifespan and so on. _Also, is it right to assume that since Chrome OS is a Linux flavor, drivers **will** be released to the Open Source Community?_


rsync gives "chown <...> failed: Invalid argument (22)" with nfs share

I'm trying to back up my entire system to an external disk using rsync, via a shell script which is run as root:               #!/bin/bash     rsync -vSHPhhaX --numeric-ids --delete --exclude-from=/home/rena/.scripts/exclude-list / /home/rena/video/.backup/>/home/rena/video/.backup.log      This script is running on the machine "akira". Originally, /home/rena/video was a USB hard disk attached directly to akira, and the script worked fine. Recently I moved the disk; now it's mounted at the same path on another machine "yuki", and shared via NFS. So akira:/home/rena/video still refers to the same USB hard disk, only now it's attached to yuki and shared via nfs, instead of attached to akira directly. The disk is using ext3 and encrypted with Truecrypt. yuki's /etc/exports is:               /home/rena  akira(rw,subtree_check,nohide,no_root_squash) rei(rw,subtree_check,nohide,no_root_squash)     /home/rena/video    akira(rw,subtree_check,nohide,no_root_squash) rei(rw,subtree_check,nohide,no_root_squash)      Now rsync gives an error for every file:               rsync: chown "/home/rena/video/.backup/boot/System.map-2.6.38-8-generic" failed: Invalid argument (22)      nfs seems to be "squashing" even though it's told not to?               rena@akira $ stat /home/rena/video/.backup/boot/abi-2.6.38-10-generic       File: `/home/rena/video/.backup/boot/abi-2.6.38-10-generic'       Size: 730457          Blocks: 1440       IO Block: 65536  regular file     Device: 19h/25d Inode: 38822526    Links: 1     Access: (0644/-rw-r--r--)  Uid: (65534/  nobody)   Gid: (65534/ nogroup)     Access: 2011-10-19 22:17:12.000000000 -0600     Modify: 2011-06-28 13:19:43.000000000 -0600     Change: 2011-10-19 22:17:12.000000000 -0600          rena@yuki $ stat /home/rena/video/.backup/boot/abi-2.6.38-10-generic       File: `/home/rena/video/.backup/boot/abi-2.6.38-10-generic'       Size: 730457      Blocks: 1440       IO Block: 4096   regular file     Device: fc04h/64516d    Inode: 38822526    Links: 1     Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2011-10-19 22:17:12.000000000 -0600     Modify: 2011-06-28 13:19:43.000000000 -0600     Change: 2011-10-19 22:17:12.000000000 -0600      from akira, the UID and GID appear different; maybe the reason for rsync failing? [edit] In fact it looks like from akira, _every_ file on the share has UID and GID 65534/nobody.


Can not mount internal driver in Archbang 2014

I have just installed archbang 2014 on my laptop Asus K53SV. I followed the instruction on Archbang wiki. I have already installed `ntfs-3g`, but I can not access to the internal (ntfs-formatted) devices. The computer said that : **udevil: denied 88: device /dev/sda5 is an internal device and you're not root** I have already install `udevil` also. What is my problem? I heard that may be the etc/fstab is wrong, and here is mine:               #     # /etc/fstab: static file system information     #     # <file system> <dir>   <type>  <options>       <dump>  <pass>     UUID=9120f084-24b3-4047-b082-58a720a73433 / ext4 defaults 0 1      Here is the result after running `lsblk -f`               NAME   FSTYPE LABEL           UUID                                 MOUNTPOINT     sda                                                                     ├─sda1 ntfs   System Reserved 8E34628434626F61                          ├─sda2 ntfs                   16506B15506AFB3F                          ├─sda3 ext4                   9120f084-24b3-4047-b082-58a720a73433 /     ├─sda4                                                                  ├─sda5 ntfs   D               166016C36016A98F                          └─sda6 ntfs   E               3A07C62FDB62B589                          sr0               Please help me. Thanks.


VirtualBox appliance import locks up system

I have a Windows Vista x64 appliance that I am trying to import into the Open Source Edition of VirtualBox on Linux Mint 11 x86-64. The **ovf** file is 21.3 GB in size. The problem I am having is that every time I attempt to import said appliance, Virtual Box slowly begins to consume all 8 GB of RAM that I have in the system; at which point, the OS locks up. Would limiting the amount of memory the VirtualBox process can _use_ be the best solution?


On Gentoo, how do I rebuild all packages depended on some other package?

I made mistake and changed perl non-threaded version to threaded by unmerge first, change `USE` flags to include ithreads and emerge perl again. Now most packages depending on perl are broken. How do I rebuild them?


convert a hex string to binary and send with netcat

I have a binary file that I can send with `netcat`:               $ nc -l localhost 8181 < my.dat      The file contains this:               $ xxd my.dat     0000000: 0006 3030 3030 4e43                      ..0000NC      What I really want to do is send the hex string directly. I've tried this:               $ echo '0006303030304e43' | nc -l localhost 8181      However, the above command just sends the ascii string directly to `nc`.


virt-install complains "error: no such option: --network-bridge:br0"

I was following the directions here to set up a VM in CentOS 6.4 i386/686. But I'm getting this error:               $ sudo virt-install --network-bridge:br0 --name vm1 --ram=1024 --vcpus=1 --disk path=/var/lib/libvirt/images/vm1.img,size=10 --cdrom ~/winxp.iso     Usage: virt-install --name NAME --ram RAM STORAGE INSTALL [options]          virt-install: error: no such option: --network-bridge:br0      Sure enough, `virt-install --help` doesn't list that as an option. But it also doesn't list `\--cdrom`, `\--disk`... Does it mean I didn't set up `br0` right? (I followed the guide pretty closely. I wasn't sure how to verify that what it's looking for is present.) I ought to specify, I have no GUI installed--used the 'minimal' ISO. **UPDATE**               $ sudo -i brctl show     bridge name     bridge id               STP enabled     interfaces     br0             8000.0040caab50b8       no              eth0     virbr0          8000.525400dfd8ac       yes             virbr0-nic      Maybe I don't understand--I thought a VM needed an OS to be created? Or I guess you create the VM, and it's pretending to be bare metal, and then you can go into the VM and tell it to use a CD ISO as the CD drive, and install the OS from there? So at this point with your modified XML file and restarted libvirtd, I have KVM running and vm1 running on it, ready to have an OS installed? The thing is, virt-install still gives this error. IMO it for some reason doesn't have the switch named --network-bridge built into it, but I have no idea why that would be. Wrong version? Compiled without an option? I forgot to install a dependency of some kind? These all seem improbable to me, I thought network bridging is pretty standard for a VM, hence my posting a question here in the first place. :) Sorry if I'm babbling but I'm really just stuck on the virt-install command step.


Yum Returns Errors when using

When I try to use Yum (e.g. `# yum update`) I get an error and it prevents me from using Yum. Any help on this would be really cool! This is the error that I get when I try to run a Yum command:               # yum update     Setting up Update Process     Setting up repositories     not using ftp, http[s], or file for repos, skipping - 4 is not a valid release or hasnt been released yet     Cannot find a valid baseurl for repo: update     Error: Cannot find a valid baseurl for repo: update      Here is the content of the `CentOS-Base.repo` file:               [base]     name=CentOS-$releasever - Base     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os     #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=1          #released updates      [update]     name=CentOS-$releasever - Updates     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates     #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=1           #packages used/produced in the build but not released     [addons]     name=CentOS-$releasever - Addons     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons     #baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0           #additional packages that may be useful     [extras]     name=CentOS-$releasever - Extras     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras     #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0           #additional packages that extend functionality of existing packages     [centosplus]     name=CentOS-$releasever - Plus     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus     #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/     gpgcheck=1     enabled=0     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0           #contrib - packages by Centos Users     [contrib]     name=CentOS-$releasever - Contrib     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib     #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/     gpgcheck=1     enabled=0     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0      Thanks in Advance! Max Kulik


Is there any guarantee that /usr/bin/env will exist?

Often I will see scripts begin with a shebang line that uses `#!/usr/bin/env interpreter_name` for whatever interpreter, with the rationale that different systems might have the interpreter that they need in order to run installed in different places. For instance, if I assume `python` is installed as `/usr/bin/python` then some user who decided to install it as `/opt/python` for some reason won't be able to use it as easily. But the obvious question is, is there any guarantee that `env` will be installed at `/usr/bin/env` (or for that matter any particular place), or is this just a case of "moving the problem" so to speak? This slightly related question has a comment that says it's a bad idea and it's preferable to install it with the actual path of the interpreter and cites the single unix specification but does not really address this question.


On Gentoo how do I find list of packages installed after some specific date?

I have Gentoo VM that I use to test different puppet recipes and I frequently need to remove packages to bring it to clean initial state. While I could do this by hand when there are only few packages installed (and remove dependencies with `emerge -av --depclean`) but there are some recipes involving installation of few dozen of perl modules which I need to clean after testing. I think about packing them into single virtual ebuild but I already have test system dirty with many installed packages and I want to avoid reviewing them one by one. So question is _how do I find list of packages installed after some specific date_?


Ignore escape characters when printing string in shell script

I just wrote a simple shell script to save a LaTeX expression as a PNG file. It works fine, except for the LaTeX-syntax for "next row", i.e. the double backslash \\. When for instance my input expression is like this:               \left( \begin{array}{cc}1 & 2\\ 3 & 4\end{array} \right)      The double backslash is reduced to a single one. I know I can add more backslashes in my expression, but I want those expressions to be genuine LaTeX, not some weird LaTeX-bash combination. My script:               #!/bin/bash          if [ $# -ne 2 ]; then         echo -e "Er moeten twee argumenten worden opgegeven:\n(1) LaTeX code\n(2) Bestandsnaam zonder extensie"     else         SaveDir="/home/pieter"         echo "\documentclass{article}\usepackage[utf8x]{inputenc}\pagestyle{empty}\begin{document}\[ $1 \]\end{document}" > /tmp/$2.tex         latex -output-directory /tmp -interaction=batchmode $2.tex         dvips -o /tmp/$2.ps -E /tmp/$2.dvi         convert -units PixelsPerInch -density 200 /tmp/$2.ps -trim $SaveDir/$2.png     fi      So, how can I ignore the escape characters and literally print my LaTeX expression? Preferably without using sed.


hibernate / suspend problems

### Problem The `Fn`-`F4` function key combination does not result in hibernating, instead it resets the internet connection instead ### Symptoms `pm-hibernate` and `pm-suspend` just reset the connection. `hibernate` works, as does `s2both`. ### Setup Lenovo X230, updated Debian testing, 3.14 kernel, i3 wm, lightdm, xfce4-power- manager. On Lenovos, `Fn`-`F4` is a special function key, which is supposed to hibernate the machine (moon symbol). Since `pm-hibernate` is not working, the idea was to change the handler to `s2both`. I cannot find the script responsible for handling the key press though. Other system keys work as expected (volume, mute, etc). Things I've tried:   1. Catching `XF86Sleep` or `XF86WakeUp` in `.i3/config` (my window manager config file). This file is handling some of the other special buttons like `XF86AudioRaiseVolume`. Variations on`bindsym XF86Sleep exec "hibernate"`. No effect.   2. Switching out the backend for pm by adding `SLEEP_MODULE=uswsusp` in `/etc/pm/config.d/module`. No effect.   3. Modyfying `etc/acpi/sleep_suspend.sh` to use `hibernate` or `s2both`. No effect.   4. Poking around `xfce4-power-manager` setting GUI. Nothing here. ### Questions   * Can someone please explain who is handling the power options here? ACPI? xfce4-power-manager?   * What is the relationship between these?   * What happens when I press `Fn`-`F4`?   * Who is handling the key press and how do I change / fix it?   * What is the best practice for handling suspends / hibernates gracefully?


On Gentoo is there a way to find a list of installed packages which doesn't have other packages depended on them?

On Gentoo, is there a way to find a list of installed packages which doesn't have other packages depended on them (so called leaf packages)? Or, is there analog of `pkg-orphan` FreeBSD utility?


Shell: How to read the bytes of a binary file and print as hexadecimal?

In shell, how can I read the bytes of a binary file I have, and print the output as hexadecimal numbers?


how to avoid ssh asking permission?

We are attempting to speed up the installation of oracle nodes for RAC installation. this requires that we get ssh installed and configured so that it doesn't prompt for a password. The problem is: On first usage, we are prompted for               RSA key fingerprint is 96:a9:23:5c:cc:d1:0a:d4:70:22:93:e9:9e:1e:74:2f.     Are you sure you want to continue connecting (yes/no)? yes      Is there a way to avoid that or are we doomed to connect at least once on every server from every server manually?


Automated SFTP upload with curl

I want a file to be uploaded daily to remote server using automated ftp command. Can someone please help me on this below command to check whether it's right or wrong?               curl -Tu username:password /path/to/dir/*(om[1]) sftp://sftp.example.com/remote/dir      where   * `username:password` is my own username and password.   * `/path/to/dir/*(om[1])`: to get the latest(updated) file from my local dir   * `sftp://sftp.example.com/remote/dir`: secure file transfer


rsync error: Time value of file truncated on receiver

I run the following rsync command to back up my data. I am on Ubuntu 12.04.               rsync -rt --delete --links --exclude-from '/home/john/rsync-exclude.txt' /media/data/ server:/backup/data      The data partition is NTFS formatted and mounted via `/etc/fstab` as follows.               UUID=371EB137049A5349 /media/data ntfs defaults,umask=007,uid=1000,gid=1000 0 0      The target disc is a RAID formatted with ext4. Some of the files, however, seem to have the wrong time stamp which results in the following error message.               Time value of /media/data/20090513/090513_185507.jpg truncated on receiver.     Time value of /media/data/20090513/090513_194115.jpg truncated on receiver.     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]      Here is what the files look like on the source disc.               -rwxrwx--- 2 john 2.0M May 13  2009 090513_185357.jpg     -rwxrwx--- 2 john 1.5M May 13  2009 090513_185458.jpg     -rwxrwx--- 2 john 1.6M Jul 29  28617 090513_185507.jpg <---     -rwxrwx--- 2 john 1.8M May 13  2009 090513_185520.jpg     -rwxrwx--- 2 john 2.4M May 13  2009 090513_194047.jpg     -rwxrwx--- 2 john 2.2M May 13  2009 090513_194101.jpg     -rwxrwx--- 2 john 2.1M Jul 29  28617 090513_194115.jpg <---     -rwxrwx--- 2 john 2.4M May 13  2009 090513_194135.jpg      This is what the file look like on the target disc.               -rwxr-x---    1 root     root       1863446 May 13  2009 090513_185357.jpg     -rwxr-x---    1 root     root       1863446 May 13  2009 090513_185458.jpg     -rwxr-x---    1 root     root       1573733 Aug  8 04:18 090513_185507.jpg <---     -rwxr-x---    1 root     root       1863446 May 13  2009 090513_185520.jpg     -rwxr-x---    1 root     root       2504805 May 13  2009 090513_194047.jpg     -rwxr-x---    1 root     root       2297826 May 13  2009 090513_194101.jpg     -rwxr-x---    1 root     root       2147897 Aug  8 04:18 090513_194115.jpg <---     -rwxr-x---    1 root     root       2455909 May 13  2009 090513_194135.jpg      Should I try to fix the time stamp of the files or should I add some option to rsync? Whatever you recommend, please give reasons and provide the relevant commands to do so.


Why does my Debian VMWare virtual machine lose all network connections ~15 minutes after boot?

I’m having a strange networking problem with a Debian (6) VMWare virtual machine on my Mac. Around 15 minutes after starting it up, I can no longer SSH into, view websites served from, or ping the VM. I usually run the VM in headless mode, using `vmrun -T fusion start VIRTUALMACHINEPATH nogui`, but the problem occurs when I start the virtual machine via VMWare.app too. When I use `ifconfig` to check the machine’s IP address once the network connections have failed (which I do via the GUI — launching VMWare.app after the server is inaccessible in headless mode gives me a GUI access to the server), the following line is missing:                inet addr:192.168.231.137  Bcast:192.168.231.255  Mask:255.255.255.0      (This line is present when I boot up; it disappears after the network connections go down.) This started happening yesterday, seemingly for no reason — the VM’s been running fine for a couple of weeks. I installed rsync on the VM yesterday, and was writing some Python code that used `subprocess` to start Xvfb and Selenium Server. I don’t know if that code somehow managed to permanently bork networking on the VM. I’ve tried copying the .vdmx files and opening them in a VirtualBox virtual machine. The network issue doesn’t seem to happen there (i.e. the `inet addr` line in `ifconfig` stays present for over an hour); however, VirtualBox VMs don’t by default make the virtual machine accessible on the network, whereas VMWare seems to do so. I haven’t figured out how to turn on NAT port forwarding for incoming connections to the VirtualBox VM in the same way that VMWare is set up. (Both my VMWare and VitualBox virtual machines use NAT for networking.) I’m a total networking idiot, so I don’t know if this is a VMWare issue, something I’ve managed to do in Linux, or some sort of random external attack — hence the cross-posting.


Trouble in script with spaces in filename

I've got a script that scp's a file from remote host back to local. Sometimes the file names contain spaces. scp does not like spaces in its file names. For some reason my attempts at handling the spaces have not resulted in the correct scp path. Code:               PATH=/var/root/Documents/MyFile OG-v1.2.3.pkg     scp $PATH Me@10.1.10.33:/Users/Me/Desktop      Results in               Cannot find directory: var/root/Documents/MyFile     Cannot find directory: OG-v1.2.3.pkg      Enclosing PATH in quotes `"$PATH"` gives the same error. Swapping the spaces for escaped spaces also is not working, although as far as I can tell it should:               ESC_PATH=${PATH/' '/'\ '}      although printing the escaped path shows that the edit worked:               echo $ESC_PATH     > /var/root/Documents/MyFile\ OG-v1.2.3.pkg


How to export a private PGP email key

I have made a keypair for my email address using `gnupg`. I thought that I should probably keep a backup of it so that if I lose my desktop computer I can continue using the same key. Is this the correct thinking? How can I export my _private_ key / the whole pair?


zsh !! and !$ auto execute as it does in bash

I recently made the switch from bash to zsh. I discovered two minuscule issues and differences between zsh and bash. I was slightly disappointed when my favorite two shortcuts `!!` & `!$` don't behave as they do in bash. When I try to the following with the argument shortcuts (sorry I don't know what they're formally called) they would automatically execute like the following in bash:               $ touch foo     $ vim !$     <file opens immediately>      While in zsh they become translated then executed (I have to hit enter one extra time):               $ touch foo     $ vim !$     $ vim foo      Is there a way to have `!$` & `!!`, in zsh, behave the same way as it does in bash?


Unblanking a Linux Terminal Display

I am running an Ubuntu Server that boots to the console. After a long wile, the screen goes blank and I cannot type or unblank the screen. Even the caps lock / num lock do not change states. I am however, able to SSH into the computer. Is there a way I can unblank the tty1 over SSH? Is it possible to do this from the keyboard + not logged in + blank screen?


Should I care for applications that increase the system Load in order to prevent overheating?

I found that my "PCI Adapter" overheats when load is above 4.0 (having 4 cores). It does NOT overheat when the load is below 4.0 (but I had an overclocked memory that was causing trouble as I explain at the end), so my focus is on lowering the system load. What overheats is just the `k10temp- pci-00c3 PCI Adapter` (according to **sensors** ). **The mistake:**   I am trying to track applications that compose that value, and how much each did. From this question, I found `atop`, but reading its output, it is not clear what applications composed the system load... It is like a "simple" column showing _SYSLOAD_ is missing. It seems I could use all that displayed information to calculate something that could show such column, but I just don't know how. The explanations I found about system load seems too generic (I can be wrong..), so I couldn't understand them enough to produce an algorithm; I think I should mix some data like cpu usage, io usage, mem usage and so get the sysload even if it is somewhat fuzzily guessed... **Precise info on how system Load works** :   on this question there is a reference to a pdf explaining it. Load seems not exactly related to specific applications... **Still need a workaround** :   Anyway I still would like to know how possible it is to make an application approach about system load, may be there is some way to prioritize the whole system utilization to some specific application, while all the others clogging it, even when they are NOT using much cpu (less than 3%), calm down? **Tests on-going** :   I set all processes to `nice -n 19`, but the one window/process I am actively using; I saw improvement on the temperature graph with psensor (the graph is a lot less fuzzy); the temperature is holding longer, below the limit, now; all processes seems to be behaving as expected; the system load is still high but I saw it once go til 6.0 and the temperature was still fine; no sudden shutdowns since.. need more test tho... **Finally the culprit was found** :   My memory was supposed to accept 2000MHz. Long ago I set it to work at 1600MHz, because the machine would not boot otherwise. Now I set it to automatic, what made it work at 1333MHz. The temperature _k10temp-pci-00c3_ that was overheating (reaching above 80c) now is consistent around 60c when I run heavy applications! Also the load average is around 3.5 to 4.0 without causing any hardware problems! The _nice 19_ on processes helped postpone the overheating indeed, but wasnt able to totally prevent it!


Why does my X11 forwarding attempt fail with "connect /tmp/.X11-unix/X0: No such file or directory"?

On my local machine, I run:               ssh -X me@remotemachine.com      (For completeness, I have also tested all of the following using -Y with identical results). As expected, this accesses remotemachine.com fine, and all appears well. If I then attempt to run xcalc however, I get:                connect /tmp/.X11-unix/X0: No such file or directory      Error: Can't open display: localhost:10.0      But,               $ ls -la /tmp/.X11-unix/     total 36     drwxrwxrwt 2 root root  4096 2012-11-23 09:29 .     drwxrwxrwt 8 root root 32768 2012-11-29 08:22 ..     srwxrwxrwx 1 root root     0 2012-11-23 09:29 X0      So not only does /tmp/.X11-unix/X0 exist, it has universal r/w/x permissions! I've previously used x-forwarding without issue, though not in some time... uname -a on the server for reference:               Linux machinename 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux      Been searching around on the web for a couple hours now without success. Other mentions of the same problem, but no solutions.


What is a "non-option argument"?

I am trying to understand `info who` but completly fail at the term » _non- option argument_ «. Can someone please explain this term to me in simple words or an example? **UPDATE** : from ' info who' : > If given **no non-option arguments** , `who' prints the following > information for each user currently logged on: login name, terminal line, > login time, and remote hostname or X display. > > If given **one non-option argument** , `who' uses that instead of a default > system-maintained file (often`/var/run/utmp' or `/etc/utmp') as the name of > the file containing the record of users logged on. `/var/log/wtmp' is > commonly given as an argument to `who' to look at who has previously logged > on. > > If given **two non-option arguments** , `who' prints only the entry for the > user running it (determined from its standard input), preceded by the > hostname. Traditionally, the two arguments given are`am i', as in `who am > i'. I [thought to] know the difference between an argument and an option, but this [again] nixes a lot.


Unable to mount raid on my NAS, trying to rescue the data, how should I proceed?

A short backstory: something happened on my Synology NAS, apparently a buggy mailserver program that came with an update stopped the device from seeing the 2x3TB drives I have. After a lot of searching and a trying a lot of different solutions I eventually got the drives to show up again but they would not mount. After struggling, I figured that, because it was set up as a mirror, I could format one drive, mount it and perform the recovery on the other. EDIT: I had it wrong and was trying to mount the wrong disk (not used to messing around with raid), however, I'm still unable to mount the correct disk, `sda`               $ file -s /dev/sda1     /dev/sda1: data               $ mount -t ext4 /dev/sda1 /mnt                    mount: mounting /dev/sda1 on /mnt failed: Invalid argument **Further Info**               $ cat /proc/mounts     rootfs / rootfs rw 0 0     /dev/root / ext4 rw,relatime,barrier=0,journal_checksum,data=ordered 0 0     /proc /proc proc rw,relatime 0 0     /tmp /tmp tmpfs rw,relatime 0 0     none /dev/pts devpts rw,relatime,gid=4,mode=620 0 0     /sys /sys sysfs rw,relatime 0 0     /proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0     /dev/vg1000/lv /volume1 ext4 rw,relatime,synoacl,barrier=0,journal_checksum,data=writeback,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group 0 0     /dev/vg1000/lv /opt ext4 rw,relatime,synoacl,barrier=0,journal_checksum,data=writeback,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group 0 0


Different colour for the KiB range in `ls -l`

Is there any sane way to highlight the 4th, 5th, and 6th columns from the right of the file size in `ls -l`? My intention is to make it easy to read a file size be it in bytes, KiBs, or MiBs. I do know about the `-h` flag, but I find that having to interpret the letters at the end is more cumbersome than just looking and seeing the length of the number (magnitude). This is the same reason why race cars use analogue dials instead of digital. My target shell is Bash. Thanks. **EDIT:** I am looking to highlight the thousands, ten thousands, and one hundred thousands places of the size column. Like this: 123 **456** 789


How to convert a color pdf to black-white?

I'd like to transform a pdf with some coloured text and images in another pdf with only black&white, in order to reduce its dimensions. Moreover, I would like to keep the text as text, without transforming the pages elements in pictures. I tried the following command:               convert -density 150 -threshold 50% input.pdf output.pdf      found in another question, a link, but it does what I don't want: the text in the output is transformed in a poor image and is no longer selectable. I tried with Ghostscript:               gs      -sOutputFile=output.pdf \             -q -dNOPAUSE -dBATCH -dSAFER \             -sDEVICE=pdfwrite \             -dCompatibilityLevel=1.3 \             -dPDFSETTINGS=/screen \             -dEmbedAllFonts=true \             -dSubsetFonts=true \             -sColorConversionStrategy=/Mono \             -sColorConversionStrategyForImages=/Mono \             -sProcessColorModel=/DeviceGray \             $1      but it gives me the following error message:               ./script.sh: 19: ./script.sh: output.pdf: not found      Is there any other way to create the file?


will tail with piping read whole file?

I want to read a big log file with 10000 lines everytime. and I use this command: `tail -c +offset somefile | head -n 10000` my question is, with the piping of head, will tail read the whole file? updated: I know that `tail` will read from the offset pos. what I want to know is that: if the file has 20000 lines left from the offset, and the head will just print first 10000, will the tail read the left 20000 lines? or just read the first 10000 lines?


ffmpeg not found

As I had to install my system from scratch I decided to play it safe this time around and follow the documentation for compiling ffmpeg on Centos via the ffmpeg.org site. I followed every command line by line without any errors until the very final one which was to do with the bash_profile. If I look for ffmpeg on my system it just keeps saying command not found? I don't understand why the documentation installs everything in `~/` when I thought it needs to be in `/usr/bin`. I don't understand why the documentation doesn't include ldconfig command or any kind of instructions on setting the path and executing the software. update: I decided to undo what I had done because couldn't work out file paths and instead I downloaded and installed ffmpeg with rpmforge and yum and finally it is all working. I literally began learning terminal last year and it has been a very steep learning curve for me so what may seem very obvious to some eg file paths for setting up ffmpeg is not for me. Hence my great confusion.


Dell D610 6.5 CentOS Installation - Undetected Network Adapters

I've spent the better part of the day attempting to install CentOS 6.5 on an older Dell D610 laptop, using everything from a Minimal Install to the Full DVD. After multiple attempts I was able to finally install the OS, but find both the ethernet and wifi adapter remain undetected. Labels on this laptop are unreadable and I cannot determine what adapters are in fact installed. Is there any easy solution to resolving this problem, or am I better served re-installing another distro?


Who is behind LXLE?

Canonical is behind Ubuntu, and RedHat is behind RHEL/Fedora, but who funds and who manages LXLE? The website says, "User contributions through donations and store purchases help cover the administrative and hosting cost of the distribution". But, there must some company collecting and dispersing those funds. For those who aren't aware, LXLE is a "respin" of LUbuntu, and stands for "Lubuntu Extra Life Extension. This question isn't intended to be nosy. It looks like a distribution I would like to try, and I am just trying to do "due diligence" before installing software on my computer.


Ulimits and pam modules

Can you explain me the relation of ulimit setting on a proccess and line `session required pam_limits.so` in pam module. In wich modules i really require this line? I have this line in `pam.d/su` `pam.d/sudo` Do I require it in `common- session` as suggested this post for example: http://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit- for-a-non-root-user. And why do I require it if i do ? ) And one more question: if i have               root            soft    nofile  8192     root            hard    nofile  8192      in `/etc/security/limits.conf` it automatically forbids setting all nofile ulimits for other users that wants more open files than `8192` and are allowed to do this by file in `/etc/security/limits.d/` directory ? Why does this happen ? If i don't have directives in `/etc/security/limits.conf` and spawn a program in a shell that drop's it's privileges everything is right: process has `nofile 65535` files open. But if i add               root            soft    nofile  8192     root            hard    nofile  8192      why the process can't grab it's own limits? I know that the process should inherits all limits from parent, but why in this case it is possible for a process to get higher privileges, than defaults of `root` when no `root` has no explicitly limited in `/etc/security/limits.conf` ?


apt-get prompts for CDs when installing packages, how do I make it stop?

I used ubuntu linux before, and I installed debian OS on my labtop using DVDs that I burned. But when I'm trying to use apt-get to install software, the system always asks me to insert disk to proceed. I wonder if there is a way to change the repository configuration so that I can retrieve installation files online instead of using disks.


Unable to receive data from /dev/ttyACM0 device

Using USB based CAN device connected on AR9350 mips processor based Atheros reference board with linux kernel 2.6.32.61. Which is coming up as `/dev/ttyACM0` device. In which Able to transmit data from application to the H/W device, but not able to receive data from the CAN device to the board. Tested this on Fedora12 with linux 2.6.31 kernel where every thing is working fine. Also tested on AR71xx mips based Atheros reference board with linux kernel 2.6.32.61, here also every thing is working fine. # Device entry output: `cat /proc/bus/usb/devices`               T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  5 Spd=12   MxCh= 0     D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 8 #Cfgs=  1     P:  Vendor=04d8 ProdID=00df Rev= 1.01     S:  Manufacturer=Microchip Technology Inc.     S:  Product=MCP2200 USB Serial Port Emulator     S:  SerialNumber=0000472727     C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=100mA     A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=02 Prot=01     I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm     E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=2ms     I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm     E:  Ad=03(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms     E:  Ad=83(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms     I:* If#= 2 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)     E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms     E:  Ad=01(O) Atr=03(Int.) MxPS=  16 Ivl=1ms      ### Device terminal settings: Below are the terminal settings used for `/dev/ttyACM0` device on both AR9350 and AR71xx boards,               [root@localhost /root]# stty -a < /dev/ttyACM0     speed 460800 baud; rows 24; columns 80; intr = ^C; quit = ^\; erase =     ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch =     <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;     lnext = ^V; flush = ^O; min = 1; time = 0;     -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel     -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     -isig -icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke      ### Main Problem: When we open the device, `acm_rx_tasklet` is getting invoked but the list in acm `filled_read_bufs` is empty. And also `acm_read_bulk` function is not getting called for adding receive buffer into `filled_read_bufs` list. ### Note: Have observed the same problem as mentioned above in AR71xx board and Fedora12 system when baud-rate is other than 460800. ### Debug Log: Below is the debug log with enabling CONFIG_USB_DEBUG option in kernel and DEBUG option in `cdc-acm.c` file. Here `acm_read_bulk` function is not getting called which is needed.               drivers/usb/class/cdc-acm.c: Entering acm_tty_open.     ehci_urb_enqueue:910: LOCAL DEBUG: within PIPE_INTERRUPT     usb 1-1.1: link qh2-0601/83ae1b40 start 1 [1/2 us]     ehci_urb_enqueue:893: LOCAL DEBUG: PIPE_CONTROL     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82cd8200 ep0out len 0, qtd     a38d8ae0  [qh 83ae17c0]     submit_async:1125:MANOJ calling qh_link_async      ath-ehci ath-ehci.0: irq status cc089 Async Periodic FLR INT     ath-ehci ath-ehci.0: ehci_urb_done 1.1 urb 82cd8200 ep0out status 0     len 0/0     drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x22 val: 0x3 len:     0x0 result: 0     drivers/usb/class/cdc-acm.c: Entering acm_rx_tasklet     acm_rx_tasklet:418:  calling filled read buf list empty. goto urbs     label.     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82e1c300 ep3in len 128, qtd     a38d8b40 [qh (null)]     submit_async:1125:MANOJ calling qh_link_async      drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82e1c300,     rcv 0x83a43b18, buf 0x83a43c58     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82e1c280 ep3in len 128, qtd     a38d8ba0 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82e1c280,     rcv 0x83a43b04, buf 0x83a43c44     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82e1c200 ep3in len 128, qtd     a38d8c00 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82e1c200,     rcv 0x83a43af0, buf 0x83a43c30     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82e1c180 ep3in len 128, qtd     a38d8c60 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82e1c180,     rcv 0x83a43adc, buf 0x83a43c1c     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82e1c100 ep3in len 128, qtd     a38d8cc0 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82e1c100,     rcv 0x83a43ac8, buf 0x83a43c08     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82e1c080 ep3in len 128, qtd     a38d8d20 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82e1c080,     rcv 0x83a43ab4, buf 0x83a43bf4     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82e1c000 ep3in len 128, qtd     a38d8d80 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82e1c000,     rcv 0x83a43aa0, buf 0x83a43be0     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 82c60700 ep3in len 128, qtd     a38d8de0 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82c60700,     rcv 0x83a43a8c, buf 0x83a43bcc     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0:submit_async 1.1 urb 82c60200 ep3in len 128, qtd     a38d8e40  [qh83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x82c60200,     rcv 0x83a43a78, buf 0x83a43bb8     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 8390dd80 ep3in len 128, qtd     a38d8ea0 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x8390dd80,     rcv 0x83a43a64, buf 0x83a43ba4     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 8390d800 ep3in len 128, qtd     a38d8f00 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x8390d800,     rcv 0x83a43a50, buf 0x83a43b90     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 8390da00 ep3in len 128, qtd     a38d8f60 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x8390da00,     rcv 0x83a43a3c, buf 0x83a43b7c     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 83a77e80 ep3in len 128, qtd     a2e21000 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x83a77e80,     rcv 0x83a43a28, buf 0x83a43b68     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 839a2f80 ep3in len 128, qtd     a2e21060 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x839a2f80,     rcv 0x83a43a14, buf 0x83a43b54     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 839a2080 ep3in len 128, qtd     a2e210c0 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x839a2080,     rcv 0x83a43a00, buf 0x83a43b40     LOCAL DEBUG: tty->name = ttyACM1, acm->is_int_ep = 0     ehci_urb_enqueue:902: LOCAL DEBUG: DEFAULT     ath-ehci ath-ehci.0: submit_async 1.1 urb 839a2c00 ep3in len 128, qtd     a2e21120 [qh 83ae1bc0]     drivers/usb/class/cdc-acm.c: acm_rx_tasklet: sending urb 0x839a2c00,     rcv 0x83a439ec, buf 0x83a43b2c      ### Help needed: Please suggest some tips to debug this issue. May be some more terminal settings needed to make this working. Not able to understand why only RX is not happening but able to do TX from board to Device.


Determine what program is in my MBR code

I've done a lot of partitioning / dual booting on my Macbook Pro. Right now I have Mac OS X installed along with Ubuntu 12.04, with Grub installed on the Ubuntu partition. I am wondering - what is the code in my MBR (the first 446 bytes)? Because Macs use EFI and GUID partitioning, the MBR is only a protective/hybrid MBR (in my case, it is a hybrid MBR). **Q: How can I identify what program is in my MBR** (based on its hexdump)? Is there some sort of a signature? **I'm guessing it's grub** but I did a hexdump of it and it didn't match the code I found in this article detailing the Grub MBR ("Stage 1") code. EDIT: I am runnning rEFInd, an EFI bootmanager program. It is an EFI application, and thus resides on my EFI system partition. This program is what runs immediately following bootup, but I do not think it places any code in the 446 bytes of the MBR. EDIT2: I should add that I have had Windows installed for dual-boot as well.


How to let networkmanager repeat trying to connect DSL until succeeded?

I'm using nm-applet to dial up DSL pppoe connections. As there are a great number of users in my local network, I sometimes have to try many times to establish a successful connection. I wonder is there some way to set nm-applet or network-manager repeat trying automatically until connecting successfully. My system is Gentoo and desktop environment is Gnome.


2 or more programs in same USB serial converter

Having a network of lets say 10 devices in RS-485, connected to the linux PC with a RS-485 to USB Converter. Already there is a C program interacting with the serial converter at /dev/ttyUSB0. My question is, What would happen if 2 or more programs interact with the same /dev/ttyUSB0? Will Linux automatically lock /dev/ttyUSB so only one program uses it?


Can any shell do argument-level interactive search?

Sometimes I need to reuse certain long arguments like paths. If I use history search (`CTRL`+`R`), I may find some command that contains the path, but I still need to delete anything else in the old command, and then move cursor around to write the new command. Worse is that I cannot do this for more than once in a line. I wonder if any shell provides an argument-level history search? Tab-completion that looks into history commands (and arguments) somehow helps. But completion has to match the prefix you type, instead of any substrings.


How do I enforce system-wide custom keyboard shortcuts / macros?

I would like to be able to apply the same custom key bindings and shortcuts I use on my text editors to my entire desktop environment. I want to basically remap my keyboard system-wide, not just in a specific application window. That is, when I remap `alt + j = Down`, I want pressing `alt + j` to be the same as pressing the "down" key, as far as my desktop environment is concerned. The shortcuts I use are optimised for keeping hands in a natural position close to the home row at all times:               # Note how     # system-wide remapping of *single* keys is possible with xmodmap.     Caps Lock           --> Escape     Escape              --> Caps Lock    # Switch caps lock with                                          # the more useful escape key.                                          # As far as *all* applications                                           # are concerned, pressing caps lock                                           # is actually pressing Escape.           # However, I've not found a good way do the same for multiple keys:     alt + space         --> Right Arrow     alt + Escape        --> Enter     shift + alt + h     --> Backspace     alt + x             --> Delete     shift + alt + l     --> Delete          ctrl + alt          --> Alt           # Default alt functionalities                                            # remapped to ctrl + alt      In my text editor, this has done wonders for my accuracy, speed, and has helped me tremendously with tendon pains I was having, since my hands now barely need to leave their natural resting position. ## First almost-successful attempt at a solution: Using xbindkeys to call up xvkbd (x virtual keyboard). This is a sample from my `.xbindkeysrc`:               # h-j-k-l Movement     ###################         "xvkbd -xsendevent -text "\[Down]""             alt + j              "xvkbd -xsendevent -text "\[Up]""             alt + k              "xvkbd -xsendevent -text "\[Left]""             alt + h              "xvkbd -xsendevent -text "\[Right]""             alt + l      ### Problems: The `alt` key is usually the default key for calling the menu of an application (for example, `alt + F` brings up the *F*ile dropdown menu in most applications). Also, this seems to work with some applications, while others seem to ignore it. xbindkeys isn't really remapping the keyboard, it's just telling xvkbd to send a signal, which can sometimes create conflicts with the active application (unlike xmodmap, which truly remaps the keyboard). ## Goal A system-wide remapping of my keyboard, implemented in a way that is easily portable (an rc file or something similar). `alt` is the optimal key of choice, since `ctrl` is heavily used across applications, and the mod key is taken up by my windows manager (Xmonad). ## My setup I'm running Ubuntu 12.10, with the Xmonad desktop environment. * * * Is this doable? I don't yet know much about OS-level stuff and how it processes input.


su: Permission denied despite correct password

In my new Gentoo installation, su doesn't work as my non-root user: After entering the correct password I get the message "su: Permission denied". What could be causing this? I have already tried reinstalling the package containng `/bin/su`. EDIT: sudo works.


Gmake macro expansion: macro calls macro with variable in arguments

In the following makeffile one macro process it's arguments to call another macro. I expect that makefile below will generate two targets and correct list of the targets in $TARGETS. But in fact it only generates one target with correct list. How to do such macro call in correct way?               all: $TARGETS     define f2     .PHONY: target$(1)     target$(1):         echo "We are in $(1)"     TARGETS+=target$(1)     endef          define f1     VAR$(1)=ValueWith$(1)     $(eval $(call f2,$$(VAR$(1))))     endef          $(eval $(call f1,CallOne))     $(eval $(call f1,CallTwo))          $(warning Warning: $(TARGETS))      output of make:               test.mk:16: warning: overriding recipe for target `target'     test.mk:15: warning: ignoring old recipe for target `target'     test.mk:18: Warning: targetValueWithCallOne targetValueWithCallTwo     gmake: Nothing to be done for `all'.


How to acquire image of disk on Linux computer?

Pertaining to computer forensics, if the suspect's computer (which cannot be removed from the scene), is Linux, can you directly use tools such as _dd_ or _dcfldd_ on his computer to acquire the disk image? Or do you need to use forensic live cds like Helix, Penguin sleuth or FFCU on top of the existing OS?


How to specify additional parameters for GNU sort's --compress-program option?

`sort --compress-program=/bin/gzip` works fine, but how can I pass options down to the compression programm (e.g. `\--best` or `\--fast`)? `sort --compress-program=/bin/gzip\ --best` failes with the error message > couldn't execute compress program as do `sort --compress-program="/bin/gzip --best"` and `sort --compress- program=/bin/gzip\\\\\ --best` (as a desperate guess). Google-ing the error returned nothing but the source code generating the message. Is there any way to do this without writing a wrapper or defining an alias?


iptables forward all traffic to interface

I have two interfaces `eth1` and `eth0`. I want all traffic on `eth0`to be forwarded to `eth1`. I created an iptable rule like this:               iptables -A FORWARD -s 0/0 -i eth0 -p tcp -o eth1 -j ACCEPT      But this doesn't work. Is this the correct way of doing this?


Enable second monitor from shell

So... I have two monitors on my Ubuntu machine. And every time I launch some Windows OpenGL application under Wine it turns off the second monitor. And leaves it turned off when the application exits. I wonder, is there a shell command which will instantly turn the second monitor on?


Camera to check if I'm watching the computer?

Is there a program to do following: I have a webcam on my laptop. I would like that my computer starts a screensaver if I'm not watching my laptop and stop the saver when I'm watching the screen. Is there a program for reading the webcam? I'm using Ubuntu 14.04.


tcpdump and nc with udp

I don't understand the behaviour of netcat. Let's say that I have one host acting as server:               [root@localhost tmp]# nc -u -l -p 670      Then I try to connect from a client:               root@debian:/tmp#  nc   -u   192.168.0.109 670      Meanwhile I try to capture those packages:               [root@localhost sergio]# tcpdump -nn -i wlp7s0 port 670      I see no packets at all, only when I issue something like:               root@debian:/tmp#  echo "Hola Mundo" | nc   -u   192.168.0.109 670          [root@localhost sergio]# tcpdump -nn -i wlp7s0 port 670     tcpdump: verbose output suppressed, use -v or -vv for full protocol decode     listening on wlp7s0, link-type EN10MB (Ethernet), capture size 65535 bytes     01:37:39.425276 IP 192.168.0.114.44287 > 192.168.0.109.670: UDP, length 12      I wonder if is it the proper behaviour of netcat. Why is the reason why it's not seen any packets except when I send something from stdin?


Use encrypted /home in fresh Debian created in Mint

I usually use my Linux Mint 15 installation on my PC. I have separate `/` and `/home` partitions. `/home` is encrypted with ecryptfs, which I did not configure myself, I just ticked the "encrypt home" when installing Mint. I have today installed Debian, with it's own `/`-partition. I also chose the same `/home` partition I use on Mint, because I want to share all files in `/home` between the two. I was hoping that Debian would automatically recognize `/home` as encrypted with ecryptfs and decrypt it for me with my user password. But it did not. When I log in on Debian I get this error message:               Could not update ICEauthority file /home/fridge/.ICEauthority.      My only option is to log out. The `/etc/fstab` entry in Mint does not mention `ecryptfs` anywhere, `/home` is just mounted as `ext4`. That was my first thought, that it would mount in `fstab`. How do I configure Debian to automatically decrypt `/home` for me when I log in? * * * **EDIT:** I belive I misunderstood the problem! Today I started up Debian and instead of logging in through the greeter I pressed Ctrl+Alt+F2 and logged in through the command line. The `/home` partition was decrypted! Apparently Debian does that for you like Mint. I tried `startx` but encountered the same problem as I was logging in through the GUI `xauth: timeout in locking authority file /home/fridge/.Xauthority`. Should I close this question now?


Graphical Btrfs tool

Is there a graphical tool for creating Btrfs sub-partitions and in particular, subpartitions like "GParted" or "system-config-lvm"? I'm running Debian squeeze. In response to the first comment, Btrfs can do thinks like RAID and sub- partitions, much like LVM. I've read that Btrfs can be seen as a replacement for LVM. LVM has a graphical tool to manage these aspects, does Btrfs have the same?


Can't install "libdvdcss" with yum anymore after update on "Fedora 20 Heisenburg"

I couldn't update my system today, because of dependency problems with `libdvdcss`, I removed `libdvdcss` and it's dependency `libdvdcss2`. Update was successfull after that but now I can't install `libdvdcss` back, because it's not in the repositories.               Dependencies Resolved          ===================================================================================      Package             Arch            Version                Repository        Size     ===================================================================================     Removing:      libdvdcss2          x86_64          1.2.13-7.fc20          @atrpms           34 k     Removing for dependencies:      libdvdcss           x86_64          1.2.13-7.fc20          @atrpms           98 k          Transaction Summary     ===================================================================================     Remove  1 Package (+1 Dependent package)      .....................................................................................................................................................................               ~]$ sudo yum install libdvdcss     .......          No package libdvdcss available.     Error: Nothing to do      ....................................................................................................................................................................               ~]$ sudo yum repolist     [sudo] password for user:      Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks, refresh-                   : packagekit, versionlock     Loading mirror speeds from cached hostfile      * fedora: www.fedora.is      * fedora-debuginfo: www.fedora.is      * rpmfusion-free: www.fedora.is      * rpmfusion-free-debuginfo: www.fedora.is      * rpmfusion-free-updates: www.fedora.is      * rpmfusion-free-updates-debuginfo: www.fedora.is      * rpmfusion-nonfree: www.fedora.is      * rpmfusion-nonfree-debuginfo: www.fedora.is      * rpmfusion-nonfree-updates: www.fedora.is      * rpmfusion-nonfree-updates-debuginfo: www.fedora.is      * updates: www.fedora.is      * updates-debuginfo: www.fedora.is     repo id                                       repo name                      status     adobe-linux-i386                              Adobe Systems Incorporated          2     adobe-linux-x86_64                            Adobe Systems Incorporated          2     fedora/20/x86_64                              Fedora 20 - x86_64             38,597     fedora-debuginfo/20/x86_64                    Fedora 20 - x86_64 - Debug      6,881     home_tpokorra_mono                            mono and monodevelop (Fedora_2     89     mysql-connectors-community/20/x86_64          MySQL Connectors Community         13     mysql-tools-community/20/x86_64               MySQL Tools Community              10     mysql56-community/20/x86_64                   MySQL 5.6 Community Server         73     rpmfusion-free/20/x86_64                      RPM Fusion for Fedora 20 - Fre    468     rpmfusion-free-debuginfo/20/x86_64            RPM Fusion for Fedora 20 - Fre    166     rpmfusion-free-updates/20/x86_64              RPM Fusion for Fedora 20 - Fre    402     rpmfusion-free-updates-debuginfo/20/x86_64    RPM Fusion for Fedora 20 - Fre    132     rpmfusion-nonfree/20/x86_64                   RPM Fusion for Fedora 20 - Non    203     rpmfusion-nonfree-debuginfo/20/x86_64         RPM Fusion for Fedora 20 - Non     60     rpmfusion-nonfree-updates/20/x86_64           RPM Fusion for Fedora 20 - Non    288     rpmfusion-nonfree-updates-debuginfo/20/x86_64 RPM Fusion for Fedora 20 - Non    113     tor/x86_64                                    Tor experimental repo               2     tor-source                                    Tor experimental source repo        0     updates/20/x86_64                             Fedora 20 - x86_64 - Updates   18,678     updates-debuginfo/20/x86_64                   Fedora 20 - x86_64 - Updates -  2,405     virtualbox/20/x86_64                          Fedora 20 - x86_64 - VirtualBo      9      From rpmfind.net link: > libdvdcss is a simple library designed for accessing DVDs as a block device > without having to bother about the decryption. What has happened? Do I lose the ability to play dvd's for some time or have they changed something so it comes from somewhere else? EDIT: It seems that I originally installed it with `yum` from the `atrpms` repository following this guide. I thought it should have been standard for `rpmfusion` but it didn't come from there.


Why would the "real" time be much higher than the "user" and "sys" times combined?

I execute and `time` many commands (i.e. `nslookup`) through `SSH` and I collect the total time needed for the implied service to complete (i.e. **DNS** ). So I collect the `user` and `sys` time as the `real` time counts time when my process is blocking which I do not need...I guess. But some of my tests had results as such:               real 3m22.033s     user 0m0.009s     sys 0m0.014s      I execute these tests on limited resources linux boxes but still, the `real` time is significantly high. Would this only indicate that the box is VERY busy running different processes ? Is it still correct to add up the `user` and `sys` times to know how much the service took ?


How to pass arguments to 'source' command?

My `source` command in the CShell goes like this :               source /directory/of/script/script.csh      The `script.csh` executes and in between, waits for my password to confirm the identity. I am tired of typing the password everytime I have to `source`. So, since my password is constant, I was thinking of creating an alias which goes like this :               alias <alias name> 'source /directory/of/script/script.csh; <my password>'      The only catch is that, it is not taking in my password because, technically, `my password` is executed after the complete execution of the `source`. How do I go about it? If anyone needs any further info, I am happy to provide. * * * EDIT: The original `script.csh` CAN NOT be modified to exclude the password because, I am not authorised to make such changes. * * * EDIT (2) : The actual need is to pass on a value (a particular number, depending on what I am about to do after this) to the shell script `script.csh` while it is being executed, without user intervention. I used the word 'password' because, it was easier to explain using that example as authentication is some thing that is usually asked repeatedly _in between_ a process, every time one tries something, and the execution does **not** proceed without it, or stops if a wrong input is given.. And, my case is synonymous : I have to give an input for the script to proceed, and it halts if a wrong input is given.


How to record a flash movie from a live cam on the Internet?

I am watching some webcams live from the Internet, showing some big cities around the world. I'd like to record some to show to my friends at home. Is it possible?


How to limit ssh access for localhost only?

I need to forbid ssh access (except localhost) for specified user. So. `ssh localhost` should work. `ssh hostname` from outside should not work for that user. All other users should work as usual.


Partition /usr/local : Can I use the software there after reinstall?

I want to reinstall Linux OS, and before that, I think I will partition my hard disk again. (I just use a simple one partition `/` for root, and make Linux automatically put all other directories there). I often save software installations in `/usr/local`. So, my question is: suppose I create a new partition, `/usr/local`, and save data there; if I reinstall Linux again, can I continue to use this software and not need to install again? I'm new to Linux World, so I'm not sure of these things.


How to configure Exim to forward all incoming mail to new server?

I am moving servers, both of them running Debian (oldstable and stable). Both are running Exim4. When I switch the DNS entries over to the new server, I'd like the old server to still forward incoming mail to my new server for processing, so that users do not see any outage. How can I do this?