DHCP IP lease attempt failed over ethernet and dhcp with netctl

My dhcp ethernet works fine in Windows but not in Arch Linux with netctl and dhcpcd. What am I doing wrong? **Output of "ip link"**               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: wlp2s0: [...]     3:  eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000         link/ether [my mac adress] brd ff:ff:ff:ff:ff:ff      **My netctl profile**               $ cat /etc/netctl/dhcp     Description='ethernet dhcp'     Interface=eno1     Connection=ethernet     IP=dhcp     #IP6=dhcp     #IP6=stateless      **Error message after "sudo netctl start dhcp"**               $ sudo journalctl -xn     -- Logs begin at Fr 2013-12-27 13:25:36 CET, end at Mo 2014-01-13 12:45:22 CET. --     Jan 13 12:44:50 laptop2 network[697]: DHCP IP lease attempt failed on interface 'eno1'     Jan 13 12:44:50 laptop2 network[697]: Failed to bring the network up for profile 'dhcp'     Jan 13 12:44:50 laptop2 systemd[1]: netctl@dhcp.service: main process exited, code=exited, status=1/FAILURE     Jan 13 12:44:50     laptop2 systemd[1]: Failed to start Networking for netctl profile dhcp.      Ok so it has problems getting the network up, doing it myself...               $ sudo ip link set eno1 up     ~$ sudo netctl start dhcp     Job for netctl@dhcp.service failed. See 'systemctl status netctl@dhcp.service' and 'journalctl -xn' for details.     ~$ sudo journalctl -xn     [...]     Jan 13 12:47:20 laptop2 network[1304]: Starting network profile 'dhcp'...     Jan 13 12:47:20 laptop2 network[1304]: The interface of network profile 'dhcp' is already up     Jan 13 12:47:20 laptop2 systemd[1]: netctl@dhcp.service: main process exited, code=exited, status=1/FAILURE     Jan 13 12:47:20 laptop2 systemd[1]: Failed to start Networking for netctl profile dhcp.      **This doesn't help either, setting it down again.**               ~$ sudo ip link set eno1 down      **Trying it with dhcpcd...**               $ sudo systemctl start dhcpcd     ~$ ping www.google.de     connect: Network is unreachable     $ ip link     [...]     3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000     [...]     $ sudo systemctl stop dhcpcd          ~$ sudo netctl start dhcp     Job for netctl@dhcp.service failed. See 'systemctl status netctl@dhcp.service' and 'journalctl -xn' for details.          ~$ sudo journalctl -xn     -- Logs begin at Fr 2013-12-27 13:25:36 CET, end at Mo 2014-01-13 12:53:06 CET. --     Jan 13 12:52:36 laptop2 dhcpcd[1753]: version 6.1.0 starting     Jan 13 12:52:36 laptop2 dhcpcd[1753]: eno1: soliciting a DHCP lease     Jan 13 12:53:06 laptop2 dhcpcd[1753]: timed out     Jan 13 12:53:06 laptop2 dhcpcd[1753]: exited     Jan 13 12:53:06 laptop2 network[1707]: DHCP IP lease attempt failed on interface 'eno1'     Jan 13 12:53:06 laptop2 network[1707]: Failed to bring the network up for profile 'dhcp'     Jan 13 12:53:06 laptop2 systemd[1]: netctl@dhcp.service: main process exited, code=exited, status=1/FAILURE     Jan 13 12:53:06 laptop2 systemd[1]: Failed to start Networking for netctl profile dhcp.      After deleting the lease at /var/lib/dhcpcd/dhcpcd-eno1.lease6 and trying again, I still get the same error message. Writing "TimeoutDHCP=40" to /etc/netctl/hooks/timeout and making it executable also changes nothing.


Cannot start Glassfish server on CentOS 5: port is supposedly in use, but it really isn't

I asked our sysadmin to install CentOS 5 on a virtual server within our company, on which I plan to experiment with Glassfish. The server is up and running, I can ssh to the server, and I do have root access to this server. Next I installed Glassfish. More precisely, I followed this link on the Oracle GlassFish Downloads site, and downloaded the file `java_ee_sdk-6u4-jdk- linux-x64.sh`. Then I `ssh -X`'ed to the server as `root`, run the installer file I just downloaded, choose _Typical Installation_ , and left mostly every option at its default, except the installation directory that I set to `/opt/glassfish`. The installation itself worked fine, **except that it failed to start the domain after successful installation**. It gave me the same error message as when I now try to manually start the domain:               # /opt/glassfish/bin/asadmin start-domain     There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.     Command start-domain failed.     # /opt/glassfish/bin/asadmin restart-domain     Server is not running, will attempt to start it...     There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.     Command restart-domain failed.      However, **there is no process running on port 4848**!               # netstat -tulpn | grep 4848     # /sbin/fuser 4848/tcp     # /usr/sbin/lsof -i :4848     # grep 4848 /etc/services      appserv-http    4848/tcp                        # App Server - Admin HTTP     appserv-http    4848/udp                        # App Server - Admin HTTP      From my own PC:               # nmap -P0 my-experimentation-server          Starting Nmap 6.40 ( http://nmap.org ) at 2014-01-13 12:37 CET     Nmap scan report for mbpc09.cs.uni-saarland.de (134.96.225.191)     Host is up (0.018s latency).     Not shown: 997 filtered ports     PORT     STATE  SERVICE     22/tcp   open   ssh     631/tcp  closed ipp     2222/tcp closed EtherNet/IP-1          Nmap done: 1 IP address (1 host up) scanned in 11.84 seconds      Just to be sure, I uninstalled Glassfish altogether, purging `/opt/glassfish`, then reinstalled it, but this time I configured the admin port to be `12345`. Same result, it's telling me there is already a program running on port `12345`. Except there isn't. At no point could I ever reach `http://my- experimentation-server:4848`, resp. `http://my-experimentation-server:12345`. Any suggestions? **Update:**   1. Starting an Apache server on the my-experimentation-server on port 80 works _fine_ , and I can reach the server from my own PC.   2. On my-experimentation-server I issued the command `nc -l 4848` which opens a TCP socket in listenting mode on port 4848. This works! From my own PC, I can then use `nc my-experimentation-server 4848` to transfer messages back and forth between the two computers. So, port `4848` is not blocked by another process, or filtered by a firewall, or whatever. This is definitely a Glassfish problem.


Copy website from RedHat to CentOS

We currently have our website and website's CMS hosted on a dedicated host which runs Red Hat. We want to remove Red Hat and install CentOS instead. My question: is there a straight forward way of replicating all the server settings, PHP, Apache, SQL data, website files, and CMS settings from the Red Hat install, and moving them over to a new CentOS install? To make things easier, I don't mind installing the equivalent version of CentOS, based on the Red Hat version we currently have. So if we have Red Hat 6.0, I am happy to install CentOS 6.0 if it makes things more straight forward. The CMS we use is Express Engine.


What are the differences between rdesktop and xfreerdp?

`rdesktop` and `xfreerdp` are both linux clients for RDP. However from their respective websites it is not clear what advantages/drawbacks of using one over other are there. I found one post, which indicated that `xfreerdp` has more features than `rdesktop`.   * But what are these extra features?   * How is the performance (or responsiveness) and clipboard support in both of them? I am looking forward to use a RDP client (on Linux Mint 17) to connect to few Windows computers (Win 7 and 8) and linux servers running `xrdp`.


Multiple tar processes writing to the same archive file at once

I am running many tasks on a Linux cluster. Each task creates many output files. When all tasks are finished, I run something like `tar cf foo.tar output_files/`to create a `tar` archive. This is a very slow process since there are many thousands of files and directories. Is there any way to do this in parallel as the output files are being created? Is it possible to have multiple `tar` processes, spread across multiple machines, all adding their files to the same archive at once? The cluster has a shared filesystem. I am not interested in compression since it slows things down even more, and because all of the input files are themselves already compressed. Ideally the output would be a `tar` file, but I would consider other archive formats as well.


How to move windows between displays in KDE-KWin

So I'm using kde and I have two monitors: HDMI2 (primary), VGA1, configured as as extended desktop. I'm looking for a way to move windows between displays be means of a keyboard shortcut (akin to using `Win`+`Shift`+`Left`/`Right` in MS-Windows). compiz seems to have the Put extension just for this reason. Is there anything for KDE that could do this? I'm using KDE 4.9.5


How to add a program to be indexed by Synapse?

I downloaded the IntelliJ community edition and I'm currently running it by clicking the shell script that is in the folder of IntelliJ I was wondering how I can make Synapse recognize the `idea.sh` file so I can launch it quickly


process memory usage

What is usually meant by the phrase _process memory usage_ , what does this actually mean, i.e. what does this memory consist of? And what column does it correspond in `ps aux` output, RSS or VSZ?


CentOS: what impact does a kernel update have?

When running this on CentOS 6:               yum update      I get this:               --> Finished Dependency Resolution     Error: Package: 2:irqbalance-1.0.4-6.el6.x86_64 (base)         Requires: kernel >= 2.6.32-279         Installed: kernel-2.6.32-71.el6.x86_64 (@anaconda-CentOS-201107091641.x86_64/6.0)            kernel = 2.6.32-71.el6            kernel = 2.6.32-71.el6         Installed: kernel-2.6.32-220.4.2.el6.x86_64 (@updates)            kernel = 2.6.32-220.4.2.el6            kernel = 2.6.32-220.4.2.el6     You could try using --skip-broken to work around the problem     You could try running: rpm -Va --nofiles --nodigest      What exactly does a kernel update do and is this just a routine update or something that should be treated as a major change?


Prevent USB storage from using different device on reset

I have a hard drive in a USB enclosure that I am doing some data recovery on. The drive is in extremely bad shape and frequently resets on reads. The device registers as `/dev/sdb`. Sometimes, probably about once in every few thousand resets, for some reason it switches over to `/dev/sdc`. The only way to get it to go back is to physically unplug the USB connection for a few seconds then reattach, at which point it registers as `/dev/sdb` again. This is very disruptive and causing a lot of issues for me, as some of the operations I'm performing can take hours or days, and if this happens at any point in that process (e.g. while I am at work or asleep) I either have to try to determine _when_ it happened and resume from that point, or start over. Both are very difficult. A "normal" set of resets, which I expect and are OK, look like this:               Jun 12 11:15:28 ubuntu kernel: [199944.703449] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:29 ubuntu kernel: [199945.574141] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:29 ubuntu kernel: [199946.017483] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:30 ubuntu kernel: [199946.460816] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:30 ubuntu kernel: [199946.904151] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:30 ubuntu kernel: [199947.347659] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:31 ubuntu kernel: [199947.690737] sd 16:0:0:0: [sdb] Unhandled error code     Jun 12 11:15:31 ubuntu kernel: [199947.690747] sd 16:0:0:0: [sdb]  Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK     Jun 12 11:15:31 ubuntu kernel: [199947.690757] sd 16:0:0:0: [sdb] CDB: Read(10): 28 00 00 01 1d cd 00 00 01 00     Jun 12 11:15:31 ubuntu kernel: [199947.690780] end_request: I/O error, dev sdb, sector 73165     Jun 12 11:15:35 ubuntu kernel: [199951.585312] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:36 ubuntu kernel: [199952.455995] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:36 ubuntu kernel: [199952.899329] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:36 ubuntu kernel: [199953.342669] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:37 ubuntu kernel: [199953.786009] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:37 ubuntu kernel: [199954.229346] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 11:15:38 ubuntu kernel: [199954.572710] sd 16:0:0:0: [sdb] Unhandled error code     Jun 12 11:15:38 ubuntu kernel: [199954.572721] sd 16:0:0:0: [sdb]  Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK     Jun 12 11:15:38 ubuntu kernel: [199954.572730] sd 16:0:0:0: [sdb] CDB: Read(10): 28 00 00 01 1d cd 00 00 01 00     Jun 12 11:15:38 ubuntu kernel: [199954.572754] end_request: I/O error, dev sdb, sector 73165 This is the expected behavior. A problematic reset, which switches over to `sdc`, looks like this:               Jun 12 12:57:42 ubuntu kernel: [206070.288681] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 12:57:43 ubuntu kernel: [206070.732013] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 12:57:43 ubuntu kernel: [206071.175603] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 12:57:44 ubuntu kernel: [206071.618695] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 12:57:44 ubuntu kernel: [206072.062224] usb 1-1.2: reset high-speed USB device number 23 using ehci_hcd     Jun 12 12:57:44 ubuntu kernel: [206072.095010] usb 1-1.2: USB disconnect, device number 23     Jun 12 12:57:44 ubuntu kernel: [206072.098317] scsi 16:0:0:0: rejecting I/O to offline device     Jun 12 12:57:44 ubuntu kernel: [206072.098327] scsi 16:0:0:0: [sdb] killing request     Jun 12 12:57:44 ubuntu kernel: [206072.098345] scsi 16:0:0:0: [sdb] Unhandled error code     Jun 12 12:57:44 ubuntu kernel: [206072.098349] scsi 16:0:0:0: [sdb]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     Jun 12 12:57:44 ubuntu kernel: [206072.098356] scsi 16:0:0:0: [sdb] CDB: Read(10): 28 00 03 66 90 8b 00 00 01 00     Jun 12 12:57:44 ubuntu kernel: [206072.098387] end_request: I/O error, dev sdb, sector 57053323     Jun 12 12:57:44 ubuntu kernel: [206072.309890] usb 1-1.2: new high-speed USB device number 26 using ehci_hcd     Jun 12 12:57:45 ubuntu mtp-probe: checking bus 1, device 26: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2"     Jun 12 12:57:45 ubuntu mtp-probe: bus: 1, device: 26 was not an MTP device     Jun 12 12:57:45 ubuntu kernel: [206072.755377] scsi17 : usb-storage 1-1.2:1.0     Jun 12 12:57:46 ubuntu kernel: [206074.240443] scsi 17:0:0:0: Direct-Access     HTS72101 0G9SA00               PQ: 0 ANSI: 6     Jun 12 12:57:46 ubuntu kernel: [206074.242675] sd 17:0:0:0: Attached scsi generic sg2 type 0     Jun 12 12:57:46 ubuntu kernel: [206074.243800] sd 17:0:0:0: [sdc] 195371568 512-byte logical blocks: (100 GB/93.1 GiB) The issue there starts with a USB disconnect instead of a reset. That is the problem I need to avoid. I would like to force it somehow to stay on `/dev/sdb`. Is there any way I can do this? Alternatively, while it seems like this type of hard reset is unavoidable, is there some setting somewhere I can temporarily change to perhaps prevent this from happening? Some retry timer or something? Or maybe a way to force `/dev/sdb` to become available again right away so that it is reused? The application I am currently running opens the device once on start and holds it open the entire time while attempting recovery. I wrote this application and can control its behavior, so a solution in code is also a possibility but I'd like to see if there is a system-level solution first (I have not attempted a software workaround yet, I want to see if there is an easier way). I also wonder if it is perhaps a power problem although I see no power-related issues in the log. I have not tried a powered hub yet. The machine is a Lenovo ThinkPad T520 (running on AC power) which has never failed me in terms of available USB current in the past. System is Ubuntu 12.04 LTS, kernel 3.2.0-64, 64-bit.


Linux replacement for Apple Keynote software?

Sorry for my ignorance, this is a newbie question: I am trying to migrate from Mac OS X to a Linux distribution, maybe/probably Ubuntu. One of my favorite applications for the Mac was Apple Keynote, which makes amazing sideshow presentations. Is there an equivalent solution for Linux distributions that matches/comes close to Keynote in terms of its polish and ease of use? I know about OpenOffice.org Impress but, no pun intended, I am not very Impress-ed...


Using rsync to move (not copy) files between directories?

I have been using **rsync** to copy files for some time. My understanding is that **rsync** is faster than **cp** when some of the files to transfer are already in the destination directory, transferring only the incremental difference (i.e. the "deltas"). If this is correct, would there be any advantage to using **rsync** to moving the contents of a folder **A** , to say, a folder **B** , with **B** being empty? The folder **A** has close to 1TB of data (and millions of files in it). The transfer would be done over a local **network** ( **A** and **B** being on **different** filesystems, both **mounted** on a supercomputer, e.g. **A** is NFS and **B** is lustre). Aside from that, what flags should I use to ask **rsync** to move (not copy) files from **A** to **B** (i.e. to delete **A** when the transfer has successfully finished)?


Find files alphabetically before a given string

If I have a directory full of files and sub directories. What is the best way to list just the regular files which fall alphabetically before a given string? Currently the best I can do using bash is the following:               for x in `find . -maxdepth 1 -type f | sort`     do        if [[ "$x" > './reference' ]]        then           break        fi             echo $x     done      I feel like there is a more concise way to do this, but I'm not sure what it is. Any ideas?


What's the conf file reading between login and non-login shell?

I found that those are `.bash_profile`, `.bashrc`, `.bash_login`, `.profile`. What's the reading sequence between them?


Why .bash_profile couldn't set PS1 variable?

I set .bash_profile to                exec env -i HOME=$HOME TERM=vt100 PS1='\h' /bin/bash      But when I login, it also show:                lfs@sam:~$ env      TERM=vt100      PWD=/home/lfs      PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$       SHLVL=1      HOME=/home/lfs      _=/usr/bin/env      lfs@sam:~$      What happened? How to set PS1 when login? Thank you~


"inotifywait" to watch several dirs simultaneously

I want to trigger action, when in one of specified dirs new file will be created. I want to use inotifywait for this purpose. But the problem is that I don know how to use inotifywait to watch several dirs simultaneously. Watching single dir even recursively is not a problem, but several? Is it possible or I have to run several processes with "inotifywait" in parallel?


Udev taking 15 seconds to detect mouse

Whenever my mouse, a SteelSeries Xai, is plugged in, there is a 15 second delay until the mouse is properly recognized and starts working. This is specially troublesome at boot, where udev waits for 15 seconds doing nothing. The following is the relevant information that I found on `dmesg` at boot:               [    1.238572] hidraw: raw HID events driver (C) Jiri Kosina     [   16.249791] usbcore: registered new interface driver usbhid     [   16.249794] usbhid: USB HID core driver     [   16.250382] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input1     [   16.250463] hid-generic 0003:1038:1360.0001: input,hidraw0: USB HID v1.00 Mouse [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input0     [   16.250608] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1/input/input2     [   16.250642] hid-generic 0003:1038:1360.0002: input,hidraw1: USB HID v1.00 Keyboard [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input1     [   16.254873] hid-generic 0003:1038:1360.0003: hiddev0,hidraw2: USB HID v1.00 Device [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input2      As you can see, for 15 seconds, `udev` is doing nothing. However, when I unplug it and then re-plug it, the process is a bit different:               [22660.547752] usb 6-1: new full-speed USB device number 3 using uhci_hcd     [22665.718517] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input19     [22665.718676] hid-generic 0003:1038:1360.0004: input,hidraw0: USB HID v1.00 Mouse [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input0     [22670.724539] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1/input/input20     [22670.724665] hid-generic 0003:1038:1360.0005: input,hidraw1: USB HID v1.00 Keyboard [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input1     [22675.735427] hid-generic 0003:1038:1360.0006: hiddev0,hidraw2: USB HID v1.00 Device [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input2      Now it seems like it's recognizing parts of the mouse at 5 second intervals. The problem might be with the mouse. I had problems with it in the past on Linux, so I won't discard it. However, I'm interested in _at least_ a workaround so my boot process doesn't take so long (it's about 45s to the DE, so 15s of nothing is _a lot_ ). If whenever I plug it in I still have to wait 15 seconds, that's fine. The mouse works OK and doesn't reconnect by itself. So: Is there a way to speed up the detection of a device, even if it's manually? Or: Is there anything I can do to `udev` so it doesn't wait at boot for this particular device to respond?


How to display `top` results sorted by memory usage in real time?

How can I display the `top` results in my terminal in real time so that the list is sorted by memory usage?


What exactly are commands? How to identify?

I want to know what exactly are Linux commands? & how to identify and locate them?


How to check if string starts with value containing #, tab, and maybe space?

In my `bash` script, I want to check whether a string starts with `# modified:` or `# new file:`. In both instances, the character after # is a tab. In the latter instance, the character between "new" and "file" is a space. I tried: `if [[ $outline == "#\tmodified:*" ]]; then` and `if [[ $outline == "# modified:*" ]]; then` (hit actual tab after #) But neither worked. How do I do this?


will the same pid be used after getting killed?

I had a file opened using `vim` editor. It was in a `ssh` session and since I had been idle for a long time, the session got closed and I had to establish the connection again. I opened the file again using `vim` editor and it reported me saying,               E325: ATTENTION     Found a swap file by the name ".latest2.sh.swp"               owned by: ramesh   dated: Sun May 11 11:54:08 2014              file name: ~ramesh/latest2.sh               modified: no              user name: ramesh   host name: xxx.xxx.edu             process ID: 1466 (still running)     While opening file "latest2.sh"      Since I did not change much in the file, I did,               kill -9 1466      I checked if the process is gone using,               ps -aef | grep ramesh      and **PID 1466** was not there. Now, when I opened the file again, it gave me the same message,               E325: ATTENTION     Found a swap file by the name ".latest2.sh.swp"               owned by: ramesh   dated: Sun May 11 11:54:08 2014              file name: ~ramesh/latest2.sh               modified: no              user name: ramesh   host name: xxx.xxx.edu             process ID: 1466     While opening file "latest2.sh"      However the process was **not in still running** state. Now, I have a question regarding the _PID_ usage. As per the wikipedia entry, > Under Unix, process IDs are usually allocated on a sequential basis, > beginning at 0 and rising to a maximum value which varies from system to > system. Once this limit is reached, allocation restarts at zero and again > increases. However, for this and subsequent passes any PIDs still assigned > to processes are skipped. Now, assuming I have used up all the available PIDs, will the **PID 1466** be _used_ or _skipped_? Since, I already killed it, I assume it should be used. However, in my second attempt to open the file I still see the **PID 1466**. What will happen in this case?


Indirect SCP connection

I use ssh and scp to connect to a remote server. Due to a ip/proxy limitation on the remote server, I have to connect first to another server. For example, if I want to connect to "SERVER-A", I have to ssh to SERVER-0 and from SERVER-0 ssh to SERVER-A. Thats ok, just a simple additional step on the login. Now im trying to connect using Nautilus. Its there any way to indicat it to connect via the intermediate server?


how to automatically cleanup failed PHP uploads in /tmp?

How can I automatically cleanup failed uploads? PHP is storing them in `/tmp` and all file names look like `phpAbCDeF` (basically php followed by 6 characters). I know that I can use the command:               find /tmp -name php\*      BUT this also removes other temp files that begins with php (created by other processes) that I don't want to delete. Please suggest a solution.


PBX randomly loses network connectivity and restores itself

I'm using a QBX appliance, which is just a microATX desktop system with FreePBX connecting to asterisk and some other slapped together stuff running on CentOS 5.4. It's horribly out of date (which I plan to correct really soon). It has been very reliable until recently. Since Monday morning or so the device has been acting randomly. Sometimes it will just drop all network traffic (web gui/ssh/SIP) and not re-establish itself, but sometimes it will re-establish itself. Other times it will just cut a user off after just over 2 minutes of calling (unsure if coincidental). Other times it will just stop responding to SSH but calls will work. I suspect the network stack, however nothing in it has changed in weeks. The only thing that has changed was about two weeks ago when I added an extension for a softphone to use. The softphone was used last week before this even started happening, so I don't suspect that. Otherwise nothing has changed, no updates, and I'm the only one working on it. I can't find anything in the logs just yet, but can someone possibly throw some ideas at me please? Asterisk 1.4.30, i686


Audio cuts in and out after upgrading from Ubuntu 12.10 -> 13.10

So my audio was working perfectly fine (XBMC, VLC, Flash in Chrome, etc) before the upgrade. Now that I've upgraded, I can still play audio, but it plays for a second or two at a time before cutting out for a second or two (or sometimes even longer). I've removed ~/.pulse ~/.config/pulse, run pulseaudio -k, and tried logging out/in. I've even purged pulseaudio and reinstalled it, but none of it makes a difference. I ran across a post that suggested running commands like so: "env PULSE_LATENCY_MSEC=30 vlc file.mp4" but that didn't solve the issue either. In case it's relevant: I'm attempting to play the audio via my ATI/AMD card's HDMI output, and I'm running Gnome 3. Has anyone encountered this issue before and found a way to solve it? Is there any additional information that would help track down the cause? I'll be refreshing every few minutes to check for new posts in this thread, so I'll try to be quick in getting you any additional information that's needed. Thanks in advance for any help/guidance you can offer.


How do I pass a comand-line program a list of files from a directory?

I am trying to upload documents to my `Microsoft OneDrive` account using `python-onedrive`. The command I am using is this:               onedrive-cli put Long\ Filename\ 1.jpg     onedrive-cli put Long\ Filename\ 2.jpg      The problem is that there are a lot of these files, and I want to upload all of them (There is no option to upload an entire directory). I have using the asterisk but that doesn't work either:               user@office-debian:~/Desktop/docs$ onedrive-cli put *     usage: onedrive-cli [-h] [-c path] [-p] [-i] [-e enc] [--debug]                              {auth,quota,recent,info,info_set,link,ls,mkdir,get,put,cp,mv,rm,comments,comment_add,comment_delete,tree}                         ...     onedrive-cli: error: unrecognized arguments: Long Filename 1.jpg Long Filename 2.jpg      I presume this is because the program expects the spaces to be escaped, but the asterisk doesn't expand them that way. I have tried "piping" the arguments to no avail:               user@office-debian:~/Desktop/docs$ ls | onedrive-cli put     usage: onedrive-cli put [-h] [-n] file [folder]     onedrive-cli put: error: too few arguments      Evidently `onedrive-cli` doesn't recognise `STDIN`. Are there any other simple options left? I realise I could probably write a script but I was really hoping to avoid that! The following seems to work, but it's not really what I had in mind:               for files in * ; do       onedrive-cli put "$files"     done


Testprintenv:error while loading shared libraries:libodbc.so.1: cannot open shared object file

I am trying to invoke a C-Program which returns the value for a given keyword from a configuration file While trying to invoke program it's displaying below error:               **Testprintenv: error while loading shared libraries: libodbc.so.1: cannot open shared object file: No such file or directory**      We have installed EasySoft previously and uninstalled back (Removed all directories). Below dependencies are showing up on Linux machine               -bash-4.1$ ldd Testprintenv             linux-vdso.so.1 =>  (0x00007fffc0bdb000)             libodbc.so.1 => not found             libodbcinst.so.1 => not found             libc.so.6 => /lib64/libc.so.6 (0x000000397b200000)             /lib64/ld-linux-x86-64.so.2 (0x000000397ae00000)      When we try the same program on Solaris machine dependencies are showing up differently and executing without any error:               [Testuser]$ ldd Testprintenv             libsocket.so.1 =>        /lib/libsocket.so.1             libnsl.so.1 =>   /lib/libnsl.so.1             libc.so.1 =>     /lib/libc.so.1             libmp.so.2 =>    /lib/libmp.so.2             libmd.so.1 =>    /lib/libmd.so.1             libscf.so.1 =>   /lib/libscf.so.1             libdoor.so.1 =>  /lib/libdoor.so.1             libuutil.so.1 =>         /lib/libuutil.so.1             libgen.so.1 =>   /lib/libgen.so.1             libm.so.2 =>     /lib/libm.so.2             /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1      Any insight why the dependency (libodbc.so.1) is only showing up on Linux and how to resolve?


LFS-7.5 chapter 6.9 `make check` fails

I am building and installing **glibc-2.19** in chapter 6.9 and I encountered this error while executing `TIMEOUTFACTOR=16 make -k check | tee glibc-check- log`: > mv -f /sources/glibc-build/nptl/libpthread.so.jmprelT /sources/glibc- > build/nptl/libpthread.so.jmprel   >  LC_ALL=C gawk -f ../scripts/localplt.awk /sources/glibc- > build/libc.so.jmprel /sources/glibc-build/math/libm.so.jmprel > /sources/glibc-build/rt/librt.so.jmprel /sources/glibc- > build/dlfcn/libdl.so.jmprel /sources/glibc-build/resolv/libresolv.so.jmprel > /sources/glibc-build/crypt/libcrypt.so.jmprel /sources/glibc- > build/nptl/libpthread.so.jmprel | \   >  LC_ALL=C gawk -f ../scripts/check-localplt.awk > ../sysdeps/generic/localplt.data - \   >  /sources/glibc-build/elf/check-localplt.out   >  env \   >  LD_TRACE_LOADED_OBJECTS=1 \   >  LD_DEBUG=unused \   >  LD_PRELOAD= \   >  /sources/glibc-build/elf/ld-linux-x86-64.so.2 \   >  \--library-path /sources/glibc-build:/sources/glibc- > build/math:/sources/glibc-build/elf:/sources/glibc- > build/dlfcn:/sources/glibc-build/nss:/sources/glibc- > build/nis:/sources/glibc-build/rt:/sources/glibc- > build/resolv:/sources/glibc-build/crypt:/sources/glibc-build/nptl \   >  /sources/glibc-build/elf/testobj1.so > /sources/glibc-build/elf/tst-unused- > dep.out   >  cmp /sources/glibc-build/elf/tst-unused-dep.out /dev/null > /dev/null   >  rm /sources/glibc-build/libc.dynsym   >  make[2]: Leaving directory '/sources/glibc-2.19/elf'   >  make[1]: Target 'check' not remade because of errors.   >  make[1]: Leaving directory '/sources/glibc-2.19'   >  Makefile:9: recipe for target 'check' failed   >  make: *** [check] Error 2 I understand that `make -k check` tells **make** to not stop if errors or warnings are encountered, implying that `make -k check` encountered something serious and hence exited with an error. Should I be bothered with this error or is this because of the errors and warnings which were ignored. My worry is that it says that `Target 'check' not remade because of errors`. Output of `grep Error glibc-check-log`: > make[2]: *** [/sources/glibc-build/libio/tst-ftell-partial-wide.out] Error 1   >  make[1]: *** [libio/tests] Error 2   >  make[2]: *** [/sources/glibc-build/posix/tst-getaddrinfo4.out] Error 1   >  make[1]: *** [posix/tests] Error 2   >  make[2]: *** [/sources/glibc-build/rt/tst-cpuclock2.out] Error 1   >  make[1]: *** [rt/tests] Error 2   >  make: *** [check] Error 2 Similar questions have been asked in this question_1, this question_2 , here and lfs-mailing-lists. My problem is not with the output of `grep Error glibc- error-log`, but with `make check` failing. Do I continue my build ignoring this? Please help.


Udev (197) last_rule not working

I am using udev version 197. I write a rule `/etc/udev/rules.d/00-test.rules` It's content is : > SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="e0", > ATTRS{bInterfaceSubClass}=="01", OPTIONS+="last_rule" > > SUBSYSTEMS=="usb", ATTRS{bDeviceClass}=="e0", ATTRS{bDeviceSubClass}=="01", > OPTIONS+="last_rule" According to udev manual, `last_rule` means no other rule will execute for the underlying subsystem or device But problem here is that, later rule is getting executed. How am I supposed to debug it ? But the problem here is that,


unable to mount NTFS as readonly

I'm using a PuppyLinux build with the Ubuntu Precise kernel. NTFS partitions are always mounted as "rw" but i'd like to avoid this if it is not really necessary to prevent filesystem corruption. When mounting manually i get this output:               # mount -t ntfs-3g /dev/sda1 /mnt/sda1 -o remount,ro     dolphin: Unknown option 'R'.     dolphin: Use --help to get a list of available command line options.     # mount     rootfs on / type rootfs (rw,relatime)     /dev/sdb1 on /initrd/mnt/dev_save type vfat     (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,quiet,errors=remount-ro)     /dev/loop1 on /initrd/pup_ro1 type ext2     (rw,noatime,errors=continue,user_xattr,acl)     tmpfs on /initrd/pup_rw type tmpfs (rw,relatime,size=1553964k)     tmpfs on /initrd/mnt/tmpfs type tmpfs (rw,relatime,size=165352k)     /dev/loop0 on /initrd/pup_ro2 type squashfs (ro,noatime)     /dev/loop4 on /initrd/pup_ro4 type squashfs (ro,noatime)     /dev/loop5 on /initrd/pup_ro5 type squashfs (ro,noatime)     /dev/loop6 on /initrd/pup_ro6 type squashfs (ro,noatime)     /dev/loop7 on /initrd/pup_ro7 type squashfs (ro,noatime)     /dev/loop8 on /initrd/pup_ro8 type squashfs (ro,noatime)     /dev/loop9 on /initrd/pup_ro9 type squashfs (ro,noatime)     unionfs on / type aufs (rw,relatime,si=3ac8a13a)     none on /proc type proc (rw,relatime)     none on /dev/pts type devpts (rw,relatime,gid=2,mode=620)     none on /sys type sysfs (rw,relatime)     shmfs on /dev/shm type tmpfs (rw,relatime,size=688636k)     /dev/loop2 on /initrd/pup_ro10 type squashfs (ro,noatime)     /dev/sda1 on /mnt/sda1 type fuseblk     (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,blksize=4096)      How can i mount NTFS partitions as readonly?


How can I get bash to exit on backtick failure in a similar way to pipefail?

So I like to harden my bash scripts wherever I can (and when not able to delegate to a language like Python/Ruby) to ensure errors do not go uncaught. In that vein I have a strict.sh, which contains things like:               set -e     set -u     set -o pipefail      And source it in other scripts. However, while pipefail would pick up: `false | echo it kept going | true` It will not pick up:               echo The output is '`false; echo something else`'       The output would be The output is '' False returns non-zero status, and no-stdout. In a pipe it would have failed, but here the error isn't caught. When this is actually a calculation stored in a variable for later, and the value is set to blank, this may then cause later problems. So - is there a way to get bash to treat a non-zero returncode inside a backtick as reason enough to exit?


Julian calendar for a UK locale in ncal

On my machine, ncal identifies my country code as GB, and use that to find the date for the shift to the gregorian calendar, and I think cal uses the same date by default: cal:               $ cal 09 1752             September 1752          Su Mo Tu We Th Fr Sa              1  2 14 15 16       17 18 19 20 21 22 23       24 25 26 27 28 29 30        ncal:               $ ncal 09 1752              September 1752         Mo    18 25              Tu  1 19 26              We  2 20 27              Th 14 21 28              Fr 15 22 29              Sa 16 23 30              Su 17 24                  However, when I switch ncal to old, cal-style output, this disappears:               ncal -b 09 1752             September 1752          Mo Tu We Th Fr Sa Su                    1  2  3        4  5  6  7  8  9 10       11 12 13 14 15 16 17       18 19 20 21 22 23 24       25 26 27 28 29 30           Is this intended? The same happens when specifying different country codes in ncal.. [edit] added command lines used.


How to write bash script to configure my displays when HDMI is plugged in or unplugged

I have a notebook running Kubuntu Precise (12.04) which I occasionally use for watching videos. When I do, I plug in an HDMI cable connected to an A/V receiver with an HDMI monitor attached to it. When I watch videos this way, I still need to use the notebook display when I'm interacting with the system to control playback, etc. The text on the HDMI monitor is hard to read from where I sit. When I plug in the HDMI cable, Kubuntu detects it, but I have to go through a weird dance sequence (that works, but is convoluted) to get it setup correctly every time for both video and audio. To fix this, I'm trying to write a bash script with `xrandr` to do it right the first time. I got the basic idea from Peoro's answer to this U&L Q&A titled: A tool for automatically applying RandR configuration when external display is plugged in. ### About my script My script (included below) works, but needs improvement. It sets the video mode correctly for the HDMI monitor, but the LVDS1 monitor (on the notebook) changes to display only the upper left portion of the desktop - which is a problem because it cuts off window scroll bars on the right and the taskbar on the bottom. I tried fixing this with `--scale`, but my first attempt messed things up sufficiently that I had to reboot to get a working display back. Is there a way to make both displays show the same content, but with each one using it's own separate preferred resolution? Or, at least, a way to set the notebook display so that the whole desktop is still accessible when the HDMI display is in use? Since I'm debugging the script, it isn't cleaned up yet. I may want to make it do more later. ### My script               #!/bin/bash     ## hdmi_set     ## Copyleft 11/13/2013 JPmicrosystems     ## Adapted from     ## http://unix.stackexchange.com/questions/4489/a-tool-for-automatically-applying-randr-configuration-when-external-display-is-p     ## Answer by peoro          # setting up new mode for my VGA     ##xrandr --newmode "1920x1080" 148.5 1920 2008 2052 2200 1080 1089 1095 1125 +hsync +vsync     ##xrandr --addmode VGA1 1920x1080          ##source $HOME/bin/bash_trace     # default monitor is LVDS1     MONITOR=LVDS1          # functions to switch from LVDS1 to HDMI and vice versa     function ActivateHDMI {         echo "Switching to HDMI"         ##xrandr --output HDMI1 --mode 1920x1080 --dpi 160 --output LVDS1 --off         ##xrandr --output HDMI1 --same-as LVDS1         xrandr --output HDMI1 --mode 1920x1080         xrandr --output LVDS1 --mode 1366x768         MONITOR=HDMI1     }     function DeactivateHDMI {         echo "Switching to LVDS1"         xrandr --output HDMI1 --off --output LVDS1 --auto         MONITOR=LVDS1     }          # functions to check if VGA is connected and in use     function HDMIActive {         [ $MONITOR = "HDMI1" ]     }     function HDMIConnected {         ! xrandr | grep "^HDMI1" | grep disconnected     }          ## MONITOR doesn't do anything because it's not preserved between script executions     # actual script     ##while true     ##do         if HDMIConnected         then             ActivateHDMI         fi              if ! HDMIConnected         then             DeactivateHDMI         fi              ##sleep 1s     ##done      ### Output from xrandr Here's what xrandr sees:               bigbird@ramdass:~$ xrandr     Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192     LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm        1366x768       60.0*+        1360x768       59.8     60.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 connected (normal left inverted right x axis y axis)        1920x1080      60.0 +        1680x1050      60.0          1280x1024      60.0          1440x900       59.9          1280x720       60.0          1024x768       60.0          800x600        60.3          720x480        59.9          640x480        60.0          720x400        70.1       DP1 disconnected (normal left inverted right x axis y axis)


RHEL- mysql installation error

I am trying to install mysql in my RHEL 5.6 machine. I use the command `yum install mysql`. However, I receive the below error message.               Transaction Check Error:       file /usr/lib/mysql/libmysqlclient.so.15.0.0 from install of mysql-5.0.95-5.el5_9.i386 conflicts with file from package mysqlclient15-5.0.67-1.el5.remi.i386       file /usr/lib/mysql/libmysqlclient_r.so.15.0.0 from install of mysql-5.0.95-5.el5_9.i386 conflicts with file from package mysqlclient15-5.0.67-1.el5.remi.i386      I did the commands `yum remove mysql` and removed `/usr/lib/mysql` folder itself. However, I receive the above mentioned error.


realpath command not found

I have debian squeeze amd64. My current shell is bash. If I write the following in my terminal, it works:               $ uname -a     Linux core 2.6.32-5-amd64 #1 SMP Fri May 10 08:43:19 UTC 2013 x86_64 GNU/Linux     $ echo $SHELL     /bin/bash                                                                                $ echo $(realpath test.sh)                                                                                /home/ffortier/test.sh      My test.sh file looks like this:               #!/bin/bash     echo $(realpath "$1")      If I try to execute the following, I get an error               $ ./test.sh test.sh      ./test.sh: line 2: realpath: command not found      How can I use the realpath command within a bash file? **Additional Information**               $ type -a realpath     realpath is a function                                                                                realpath ()                                                                                {                                                                                f=$@;                                                                                if [ -d "$f" ]; then                                                                                base="";                                                                                dir="$f";                                                                                else                                                                                base="/$(basename "$f")";                                                                                dir=$(dirname "$f");                                                                                fi;                                                                                dir=$(cd "$dir" && /bin/pwd);                                                                                echo "$dir$base"                                                                                }


Linux bizarre memory report

I took the following meminfo captures. I don't figure out how the free memory went from 8GB to almost 25GB, when only about 4GB of slab was freed. There was no change of the proccess memory consumption on time the meminfo output was taken. First meminfo with 8GB free memory:               MemTotal:       66054256 kB     MemFree:         8344960 kB     Buffers:            1120 kB     Cached:         30172312 kB     SwapCached:            0 kB     Active:         10795428 kB     Inactive:        1914512 kB     Active(anon):   10193124 kB     Inactive(anon):  1441288 kB     Active(file):     602304 kB     Inactive(file):   473224 kB     Unevictable:    26348912 kB     Mlocked:        26348960 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:                 0 kB     Writeback:             0 kB     AnonPages:       8886304 kB     Mapped:         26383052 kB     Shmem:          29097904 kB     Slab:            6006384 kB     SReclaimable:    3512404 kB     SUnreclaim:      2493980 kB     KernelStack:       15240 kB     PageTables:        78724 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:    33027128 kB     Committed_AS:   44446908 kB     VmallocTotal:   34359738367 kB     VmallocUsed:      426656 kB     VmallocChunk:   34325375716 kB     HardwareCorrupted:     0 kB     AnonHugePages:   7696384 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:        6144 kB     DirectMap2M:     2058240 kB     DirectMap1G:    65011712 kB      Second memory capture with almost 25GB free memory:               MemTotal:       66054256 kB     MemFree:        24949116 kB     Buffers:            1120 kB     Cached:         29085016 kB     SwapCached:            0 kB     Active:         10168904 kB     Inactive:        1461156 kB     Active(anon):   10168216 kB     Inactive(anon):  1441956 kB     Active(file):        688 kB     Inactive(file):    19200 kB     Unevictable:    26317328 kB     Mlocked:        26317376 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:                 0 kB     Writeback:             0 kB     AnonPages:       8861224 kB     Mapped:         26351488 kB     Shmem:          29066248 kB     Slab:            1503440 kB     SReclaimable:     232880 kB     SUnreclaim:      1270560 kB     KernelStack:       15256 kB     PageTables:        79664 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:    33027128 kB     Committed_AS:   44418280 kB     VmallocTotal:   34359738367 kB     VmallocUsed:      426656 kB     VmallocChunk:   34325375716 kB     HardwareCorrupted:     0 kB     AnonHugePages:   7665664 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:        6144 kB     DirectMap2M:     2058240 kB     DirectMap1G:    65011712 kB


dhclient cannot get address from home router

I have a home router providing internet access to my desktop and laptop. Both computers are running Ubuntu GNU/Linux version 12.04, and have been configured to use DHCP upon installation. So the router and DHCP are working correctly for these two computers. I also have an older desktop computer with Ubuntu 10.04. This older desktop is normally not attached to the network, and was not configured to use DHCP. I have now connected a network cable to it and I wanted to activate a network connection using DHCP. From the command line, I use               sudo dhclient eth0      The result is that the following is printed:               Listening on LPF/eth0/...     Sending on   LPF/eth0/...     Sending on   Socket/fallback     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7     DHCPOFFER of 192.168.2.106 from 192.168.2.1     DHCPREQUEST of 192.168.2.106 on eth0 to 255.255.255.255 port 67     DHCPNAK from 192.168.2.1     DHCPREQUEST of 192.168.2.106 on eth0 to 255.255.255.255 port 67     DHCPNAK from 192.168.2.1     DHCPREQUEST of 192.168.2.106 on eth0 to 255.255.255.255 port 67     DHCPNAK from 192.168.2.1     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6     DHCPOFFER of 192.168.2.106 from 192.168.2.1     DHCPREQUEST of 192.168.2.106 on eth0 to 255.255.255.255 port 67     DHCPNAK from 192.168.2.1     DHCPREQUEST of 192.168.2.106 on eth0 to 255.255.255.255 port 67     DHCPNAK from 192.168.2.1     DHCPREQUEST of 192.168.2.106 on eth0 to 255.255.255.255 port 67     DHCPNAK from 192.168.2.1      I do not know much about DHCP but it seems to me that the router (192.168.2.1) keeps offering address 192.168.2.106, and then refuses to acknowledge it. At least, this is what I have understood from rfc2131. Do I have to change the configuration of my router, or of my desktop, or both? **EDIT** Following the indications of the comments I have added the following block to the file `/etc/dhcp3/dhclient.conf`:               interface "eth0"     {       request subnet-mask;     }      but I still have the same errors as above. In particular, I still see               DHCPREQUEST of 192.168.2.106 on eth0 to 255.255.255.255 port 67      which means that the `subnet-mask` in my configuration file is ignored. **EDIT 2** Problem solved: apparently `dhclient` was not reading the default file `/etc/dhcp3/dhclient.conf`. I solved the problem by:   * Calling `dhclient` with the `-cf` option (specifying the configuration file explicitly).   * Specifying the option `require subnet-mask` instead of `request`: in this way I am sure (AFAIU) that the client is using a subnet mask it got from the router. Thanks a lot for the hints that pointed me in the right direction.


what device name should I have to give in snd_pcm_open other than "default"

I want to record sound from 2 devices simultaneously:   * internal mic   * external usb webcam mic Using `pulseaudio` sound controller, I set either of these devices as default and could record sound with `snd_pcm_open(&handle, "default", SND_PCM_STREAM_CAPTURE, 0)`. But now I want to record sound from both devices simultaneously, so i have to opt for naming scheme mentioned here. However I have no success with couple of them. I thought this would solve my problem, but `front:CARD=U0x46d0x825,DEV=0` didn't help as the name of device. I get these errors:               ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM     ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card      `arecord -l` gives me:               # arecord -l     **** List of CAPTURE Hardware Devices ****     Home directory not accessible: Permission denied     card 0: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 2: ALC662 rev1 Alt Analog [ALC662 rev1 Alt Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: U0x46d0x825 [USB Device 0x46d:0x825], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0      and `# arecord -L` gives:               # arecord -L     null         Discard all samples (playback) or generate zero samples (capture)     pulse         PulseAudio Sound Server     default:CARD=PCH         HDA Intel PCH, ALC662 rev1 Analog         Default Audio Device     sysdefault:CARD=PCH         HDA Intel PCH, ALC662 rev1 Analog         Default Audio Device     front:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         Front speakers     surround40:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         4.0 Surround output to Front and Rear speakers     surround41:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers     dmix:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         Direct sample mixing device     dmix:CARD=PCH,DEV=2         HDA Intel PCH, ALC662 rev1 Alt Analog         Direct sample mixing device     dsnoop:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         Direct sample snooping device     dsnoop:CARD=PCH,DEV=2         HDA Intel PCH, ALC662 rev1 Alt Analog         Direct sample snooping device     hw:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         Direct hardware device without any conversions     hw:CARD=PCH,DEV=2         HDA Intel PCH, ALC662 rev1 Alt Analog         Direct hardware device without any conversions     plughw:CARD=PCH,DEV=0         HDA Intel PCH, ALC662 rev1 Analog         Hardware device with all software conversions     plughw:CARD=PCH,DEV=2         HDA Intel PCH, ALC662 rev1 Alt Analog         Hardware device with all software conversions     default:CARD=U0x46d0x825         USB Device 0x46d:0x825, USB Audio         Default Audio Device     sysdefault:CARD=U0x46d0x825         USB Device 0x46d:0x825, USB Audio         Default Audio Device     front:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         Front speakers     surround40:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         4.0 Surround output to Front and Rear speakers     surround41:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers     iec958:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         IEC958 (S/PDIF) Digital Audio Output     dmix:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         Direct sample mixing device     dsnoop:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         Direct sample snooping device     hw:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         Direct hardware device without any conversions     plughw:CARD=U0x46d0x825,DEV=0         USB Device 0x46d:0x825, USB Audio         Hardware device with all software conversions      So what are the correct names I should give in to the above devices to record them simultaneously as per the ALSA specification? I **don't** want to use `pulseaudio` API.


How to append multiple lines to a file with bash

I am writing a bash script to look for a file if it doesn't exist then create it and append this to it:               Host localhost         ForwardAgent yes      So `"line then new line 'tab' then text"` I think its a sensitive format. I know you can do this:               cat temp.txt >> data.txt      But it seems weird since its two lines. Is there a way to append that in this format:               echo "hello" >> greetings.txt


How to redirect tun SSL VPN through HTTP CONNECT proxy, using iptables?

I use a VPN under SSL solution (Firepass) on Android. VPN opens an SSL connection on port `443` of remote VPN server. My mobile carrier doesn't allow direct connections on port `443` but allow SSL connections through its HTTP CONNECT proxy. I want to implement this scenario.   * `tun0` outgoing traffic on VPN server TCP port `443` should be redirected, via `iptables`, on another port on `lo`.   * `redsocks` listening on this port, configured in order to **redirect** connection on HTTP CONNECT proxy. Also IP address of HTTP proxy server should be routed on `rmnet0` network interface and other traffic on `tun0`.


MATE: Tile 2 windows next to each other

I would be interested in a keyboard short-cut that would tile windows next to each other. I would be OK with the minimal functionality: If there are exactly 2 windows in the current desktop, tile them. Of course, a script doing it is enough since it can be easily mapped to a keyboard short-cut. I checked e.g. BlueTile, but it doesn't seem to aim at this minimal requirement (it is too heavy artillery and seems not to speak with MATE at all. Ideas how to detect all windows on current desktop, and how to resize windows from scripts would be enough for me, I can then code the final script myself.


Wireless Networks showing "device not managed" in Network Manager

I am using Kali Linux 1.0.6. Recently I have disabled NetworkManager and configured my system to connect to wireless network through Terminal by editing `/etc/network/interfaces` and running `wpa_supplicant`. Now, I want to switch back to NetworkManager UI but I am unable to see any wireless networks. It is saying "device not managed" under Wireless Networks. I tried many solutions which said editing `/etc/NetworkManager/NetworkManager.conf` and changing `Managed=true` will solve the issue. But it didn't solve. I reinstalled NetworkManager even reinstalled wireless modules with no use. How to get back wireless networks in my NetworkManager UI?


Is there any substitute for `lspci`?

`lspci` is not implemented in petalinux. So is there any alternative for this? Any file where I can read `lspci` output?


What does net.ipv4.tcp_app_win do?

I can't figure out why do these variables coexist in Linux. The information from man tcp says (Ubuntu 12.04): For tcp_adv_win_scale: > tcp_adv_win_scale (integer; default: 2; since Linux 2.4) >   >   >               Count   buffering   overhead  as  bytes/2^tcp_adv_win_scale, > if >               tcp_adv_win_scale    is    greater    than    0;    or > bytes- >               bytes/2^(-tcp_adv_win_scale),  if tcp_adv_win_scale is less > than >               or equal to zero. >   >               The socket receive buffer space is shared between  the > applica‐ >               tion  and  kernel.   TCP maintains part of the buffer as the > TCP >               window, this is the size of the receive window advertised to > the >               other  end.   The rest of the space is used as the > "application" >               buffer, used to isolate the network from scheduling and > applica‐ >               tion  latencies.   The  tcp_adv_win_scale  default  value  of > 2 >               implies that the space used for the application  buffer  is > one >               fourth that of the total. >   And for tcp_app_win:               tcp_app_win (integer; default: 31; since Linux 2.4)                   This  variable  defines  how  many  bytes  of the TCP window are                   reserved for buffering overhead.                        A maximum of (window/2^tcp_app_win, mss) bytes in the window are                   reserved  for the application buffer.  A value of 0 implies that                   no amount is reserved.      So I'm not sure of understanding what does tcp_app_win exactly change. It seems to me that both variables can be used to tweak the TCP application buffer, therefore there is no need of changing them toghether. I am correct?


How to find the true disk usage on my Linux box?

I have a linux box on my school's server. When I was trying to install `Protocol Buffers`, disk usage is reported as exceeded. So I checked my disk usage by two command on my home directory:               du -h      535M    .          df -ha     home.XXX:/export/home/XXX                      9.7T  1.5T  8.3T  15% /home/XXX      Are they supposed to be same number? Which one is the real usage of my disk on Linux box?


Muting and unmuting sound with mutebutton

I'm running the testing branch of debian with codename `Jessie` and xfce as desktop environment on a Lenovo ThinkPad T410. When I press the mute-button, it mutes pulse-audio and alsa, but when I press the mute-button again it unmutes pulse-audio but not alsa. I can happily mute and unmute in the terminal by               amixer set Master toggle      Now I'd like to set this command to be executed when pressing the mute button. xfce has a setting for that, it works for other buttons, but not the mute button. In `.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard- shortcuts.xml` I have the line               <property name="XF86AudioMute" type="string" value="amixer set Master toggle"/>      but to no avail. Does anyone know how I can either turn off the mute button or overwrite what happens when I press it?


Script to loop through folders with numeric names

I am working on a bash script to compress the images in my Wordpress folders. The wordpress folder structure is as follows:               > wp-content/uploads/2014/01/filename.jpg     > wp-content/uploads/2014/02/filename.jpg     > wp-content/uploads/2014/03/filename.jpg     > wp-content/uploads/2014/04/filename.jpg     >      > i.e. wp-content/uploads/YEAR/MONTH/filename.jpg      In the uploads folder I have a number of other folders (which were created when plugins were installed), so I'm trying to loop through the folders with numeric names only and then compress the images. Here is what I have so far:               DIR_UPLOADS=/home/html/wp-content/uploads/     cd ${DIR_UPLOADS}         for d in *; do                 # First level i.e. 2014, 2013 folders.          regx='^[0-9]+$'           # Regular Expression to check for numerics.          if [[$d =~ $regx]]; then  # Check if folder name is numeric.            #echo "error: Not a number" >&2; exit 1            cd $d            for z in *; do          # Second level i.e. the months folders 01, 02 etc.             cd $z             for x in *; do         # Third level the actual file.                             echo 'Compress Image'             done           done          fi         done      I'm trying to use reg ex to detect the numeric folders, this isn't quite right, but I think I'm close.


MPlayer plays video in a new window instead of running in terminal

I am using the "-vo caca" option in order to be able to play a video in the terminal. However, mplayer is opening up a window in which the video runs. Is there any way to make it play in the console window (to have it filled)? I am using Linux Mint 16.


What is the need of the struct thread_info in locating struct task_struct?

While reading through the Linux Device Drivers, I could understand that the Process Descriptor (of type `struct task_struct`) has all the info regarding a particular task. The process descriptors are allocated dynamically by the slab allocator. What I would like to know is about the need to introduce a new structure called `thread_info` which is stored at the bottom of the stack (assuming x86). Why was this done? Why was it not possible to place the address of the current executing task address (`struct task_struct`) to the kernel stack?


FATAL: Module p80211 not found. RTL8192CUS WLAN regression under antiX 13.1 (Debian Wheezy)

The problem concerns a driver support regression for the RTL8192CUS WLAN chip under antiX 13.1, a Debian Wheezy (stable) based distribution. The chip actually resides in a Edimax EW-7811Un 802.11n wireless adapter. First, here is some general system information.               $ inxi -F     System:    Host: 4000cdt Kernel: 3.7.10-antix.3-486-smp i686 (32 bit)                 Desktop: IceWM 1.3.7 Distro: antiX-13.1_386-full Luddite 19 June 2013     Machine:   No /sys/class/dmi, using dmidecode: you must be root to run dmidecode     CPU:       Single core Pentium II (Deschutes) (-UP-) cache: 512 KB flags: (pae) clocked at 233.275 MHz      Graphics:  Card: Chips and F65555 HiQVPro X.Org: 1.12.4 drivers: chips (unloaded: fbdev,vesa) Resolution: 800x600@60.0hz                 GLX Renderer: Gallium 0.4 on softpipe GLX Version: 2.1 Mesa 8.0.5     Network:   Card: Edimax EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]                 IF: N/A state: N/A mac: N/A     Drives:    HDD Total Size: 40.0GB (8.7% used) 1: id: /dev/sda model: TOSHIBA_MK4032GA size: 40.0GB      Partition: ID: / size: 9.9G used: 3.0G (32%) fs: ext4 ID: /home size: 25G used: 284M (2%) fs: ext4                 ID: swap-1 size: 2.15GB used: 0.00GB (0%) fs: swap      Sensors:   System Temperatures: cpu: 71.0C mobo: N/A                 Fan Speeds (in rpm): cpu: N/A      Info:      Processes: 88 Uptime: 2:57 Memory: 72.4/151.4MB Client: Shell (bash) inxi: 1.9.9       During booting, the following errors appear on the screen, caused while executing the `/etc/network/if-pre-up.d/linux-wlan-ng-pre-up` script:               FATAL: Module p80211 not found.          /etc/network/if-pre-up.d/linux-wlan-ng-pre-up     Failed to load p80211.ko.          Listening on LPF/wlan0/00:1f:1f:bf:45:7a     Sending on   LPF/wlan0/00:1f:1f:bf:45:7a     Sending on   Socket/fallback     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13     No DHCPOFFERS received.     No working leases in persistent database - sleeping.      The error messages can be reproduced by issuing respectively the `sudo modprobe p80211` and `sudo dhclient -v wlan0` commands. The following modules are loaded:               $ lsmod     Module                  Size  Used by     mperf                    870  0      cpufreq_stats           2600  0      cpufreq_powersave        575  0      cpufreq_conservative     3562  0      ppdev                   4124  0      lp                      6127  0      uinput                  5093  1      nfsd                  156046  2      auth_rpcgss            19755  1 nfsd     nfs_acl                 1576  1 nfsd     nfs                    88586  0      lockd                  42731  2 nfs,nfsd     fscache                21695  1 nfs     sunrpc                122417  6 nfs,nfsd,auth_rpcgss,lockd,nfs_acl     af_packet              19031  6      dm_crypt               10846  0      arc4                    1400  2      rtl8192cu              45534  0      rtlwifi                43564  1 rtl8192cu     rtl8192c_common        23999  1 rtl8192cu     mac80211              192647  3 rtlwifi,rtl8192c_common,rtl8192cu     cfg80211              123731  2 mac80211,rtlwifi     microcode               8484  0      evdev                   6815  10      mac_hid                 2214  0      psmouse                52159  0      pcspkr                  1273  0      serio_raw               3177  0      i2c_piix4               6769  0      toshiba_acpi           10065  0      sparse_keymap           1937  1 toshiba_acpi     parport_pc             23969  1      rfkill                 10599  3 cfg80211,toshiba_acpi     parport                21942  3 lp,ppdev,parport_pc     wmi                     6240  1 toshiba_acpi     pcmcia                 24870  0      battery                 5391  0      yenta_socket           15802  0      ac                      1753  0      pcmcia_rsrc             5995  1 yenta_socket     pcmcia_core             8446  3 pcmcia,pcmcia_rsrc,yenta_socket     processor              23837  1      button                  3513  0      btrfs                 555574  0      zlib_deflate           15207  1 btrfs     dm_mod                 51354  1 dm_crypt     floppy                 41663  0      fan                     1818  0      thermal                 6606  0      thermal_sys            10423  3 fan,thermal,processor      Proof that this is not an authentication issue:               $ sudo cat /var/log/dmesg |grep wlan0     [   36.321107] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready     [   38.921480] wlan0: authenticate with 00:xx:xx:xx:xx:xx     [   38.971473] wlan0: send auth to 00:xx:xx:xx:xx:xx (try 1/3)     [   38.996892] wlan0: authenticated     [   39.000218] wlan0: associate with 00:xx:xx:xx:xx:xx (try 1/3)     [   39.055578] wlan0: RX AssocResp from 00:xx:xx:xx:xx:xx (capab=0x411 status=0 aid=2)     [   39.056549] wlan0: associated     [   39.056781] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready     [   49.062856] wlan0: disassociating from 00:xx:xx:xx:xx:xx by local choice (reason=3)     [   49.086100] wlan0: deauthenticating from 00:xx:xx:xx:xx:xx by local choice (reason=3)     [   50.431396] wlan0: authenticate with 00:xx:xx:xx:xx:xx     [   50.481575] wlan0: send auth to 00:xx:xx:xx:xx:xx (try 1/3)     [   50.684150] wlan0: send auth to 00:xx:xx:xx:xx:xx (try 2/3)     [   50.888146] wlan0: send auth to 00:xx:xx:xx:xx:xx (try 3/3)     [   51.092212] wlan0: authentication with 00:xx:xx:xx:xx:xx timed out          $ sudo iwconfig     wlan0     IEEE 802.11bgn  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm                  Retry  long limit:7   RTS thr=2347 B   Fragment thr:off               Encryption key:off               Power Management:off          lo        no wireless extensions.      I already tried:   * Installing the Linux driver from the Realtek site whilst uninstalling the `linux-wlan-ng` package and blacklisting the kernel's `rtl8192cu` module (what worked before with antiX 12M), and   * Giving `ipv6.disable=1` as a `grub` boot parameter to the kernel. ## Questions Why can the `p80211` module not be found in a distribution that is supposed to be based on Debian Wheezy _stable_? How do I get DHCP working for this wireless adapter?


Can't install XBMCBuntu properly

I tried several Times to install multiple Versions of XBMCbuntu but it's always booting into Terminal without GUI. When I try to start XBMC I get a long list of Graphics errors. I'm installing it on the HP Probook 4530s without monitor(its crashed) I connected an Acer(1600x900) Monitor. I think the cause of the problems is because there is an Intel GPU and an AMD GPU installed. How can I get the GUI to start?


Ho to bridge wlan0 in AP mode and eth0 so that eth0 is static and wlan0 uses DHCP?

I have a router that provides internet access. Connected to this router is a desktop PC that has working `eth0` (static IP address) and `wlan0`. Also connected to the router is a laptop which I use to access the desktop over `eth0` via SSH:               Desktop(wlan0,eth0) ---- Router(internet) ---- Laptop(ssh to Dekstop via eth0)     // wlan0 should get internet access through eth0 and act as DHCP AP      How do I have to configure (in `/etc/network/interfaces`) the bridge on the desktop PC, so that I can keep `eth0` static (same IP address for SSH), but have `wlan0` act as an internet-providing DHCP access point (an access point that dynamically hands out IP addresses to connected devices)? I know how to configure `hostapd` and have `bridge-utils` installed. But I did not fully understand how a bridge works. Does the bridge "replace" all bridged interfaces (as seen from "the outside")? If I bridge, what does my router "see" (`eth0` or the bridge)?


How to install phpmyadmin 4.0 on Debian

Is there a way to install an up-to-date `phpmyadin` on Debian via `apt-get`? I only found a PPA for Ubuntu on the that you can install with               sudo add-apt-repository ppa:nijel/phpmyadmin     apt-get update; sudo apt-get upgrade phpmyadmin


What are potential consequences of going nuts with sparse file based vdevs for a LVM to ZFS migration?

I've been playing around with ZFS having finally accepted that it's mature enough I shouldn't get burned. Now to migrate the home NAS box which is currently an LVM JBOD set up that's quite full, but I have quite a bit of space unallocated on just one drive. I've been experimenting with zfs using zpools created on sparse files. Replacing the file based vdevs with physical partitions seems like a very flexible way forward. I'm wondering what could happen if I were to take this idea to the extreme, and create sparse file vdevs of the same size as the existing hardware, within this already very full filesystem, and move contents out of the LVM into the ZFS array. In theory as long as the free space on the LVM filesystem stays enough to accomodate the growing ZFS, as the files are removed from it then it should keep going. Then eventually the LVM filesystem would be empty, apart from the actual ZFS images, which could be replaced with physical partitions. I expect that there would be a serious performance impact due to fragmentation at the very least. This sounds totally nuts on the surface, why copy files into another container on the same filesystem. So I believe this data set would benefit from switching on deduplication and compression so could potentially end up with a lot more free space. The main goal though is gaining the flexibility of having the data in a ZFS pool which can have it's 'drives' upgraded, ie replaced with physical hardware This crazy question was inspired by this blog post on converting the raid level of an array using a loopback device as an interim hard drive replacement.


Ignore blank keys in coreutils sort

How do you ignore or is there a way to change the sort order of empty keys when using sort -k?               # cat afile     a  b     11 20     93 45     55     26     09 31      How can I sort the empty column b values at the bottom so it looks like this:               a  b     11 20     09 31     93 45     26     55      Here's what I get instead:               sort -k 2b tmp/file     26     55     11 20     09 31     93 45


How do I mount an `img` created with /bin/dd of a hard drive?

I used `dd` to backup a **80GB** drive               dd if=/dev/sdb of=~/sdb.img      Now I need to access some files on that drive, but I don't want to copy the ".img" back over the drive. `mount ~/sdb.img /mnt/sdb` doesn't work either. It returns :               mount: you must specify the filesystem type      I tried to find the filesystem type with `file -s`               fox@shoebox $ file -s sdb.img     sdb.img: x86 boot sector; partition 1: ID=0x12, starthead 1, startsector 63, 10233342 sectors; partition 2: ID=0xc, active, starthead 0, startsector 10233405, 72517410 sectors; partition 3: ID=0xc, starthead 0, startsector 82750815, 73545570 sectors, code offset 0xc0      Is it possible to mount `sdb.img`, or must I use `dd` to restore the drive?


find: missing argument to -exec

I'm trying to run the following command:               find a/folder b/folder -name *.c -o -name *.h -exec grep -I foobar '{}' +      This is returning an error:               find: missing argument to -exec      I can't see what's wrong with this command, as it seems to match the man page: > -exec command {} + > > This variant of the -exec option runs the specified command on the selected > files, but the command line is built by appending each selected file name at > the end; the total number of invoca- tions of the command will be much less > than the number of matched files. The command line is built in much the same > way that xargs builds its command lines. Only one instance of '{}' is > allowed within the command. The command is executed in the starting > directory. I also tried:               find a/folder b/folder -name *.c -o -name *.h -exec grep -I foobar {} +     find a/folder b/folder -name *.c -o -name *.h -exec 'grep -I foobar' {} +     find a/folder b/folder -name *.c -o -name *.h -exec 'grep -I foobar' '{}' +     find a/folder b/folder -name "*.c" -o -name "*.h" -exec grep -I foobar '{}' +     find a/folder b/folder \( -name *.c -o -name *.h \) -exec grep -I foobar '{}' +     find a/folder b/folder -name *.c -o -name *.h -exec grep -I foobar '{}' \+


PowerMizer thinks my laptop is running on battery, but it is not

Im trying to use Debian 64-bit on my old IBM t61p laptop. There is Nvidia Quadro NVS 140M GPU, it is supported by driver v173, everything works but... I'm running some OpenGL stuff and I have low performance. I just realized that my "Nvidia X Server Settings" tool shows that my graphics card is running in "battery saving mode" (memory 100MHz instead of 600MHz, gpu 167MHz instead of 400MHz). I think GNOME recognizes my power state correctly (charging, discharging, battery is full etc.). I have tried this: `nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1` but there is no such attribute in 173 driver. I have "Current perf mode" attribute but it is readonly. **How can I control my graphics card performance level manually or fix this other way?**


Test -n gives unexpected result

I understand `test -n <expression>` to return false if the expression evaluates to a string length of greater than 0. Why then does the following happen?               Macbook:~ echo ${#undeclared_variable}     0     Macbook:~ test -n $undeclared_variable && echo Foo     Foo      Bash 4.x My expectation is that since `test -n $undeclared_variable` should evaluate false, that Foo should not be echoed. If I use `[[ ]]` instead of test, it works as expected.


ssmtp package missing in debian jessie - alternatives?

I'm missing the **ssmtp** package in debian jessie alpha 1 ( _extremely simple MTA to get mail off the system to a mail hub_ ). It's available in wheezy and sid. Has this package been discontinued? What are the alternatives? Please advise.


Dovecot ignores settings for mailboxes

I have set up `Dovecot` on my `Postfix` mailserver. My mailserver is using `Maildir` format:               home_mailbox = Mail/inbox/      A user's Mail directory looks like this:               $HOME/Mail/inbox     $HOME/Mail/drafts     $HOME/Mail/sent     $HOME/Mail/trash      I have set up mailboxes in `Dovecot` accordingly               mail_location = maildir:~/Mail          namespace inbox {       mailbox drafts {         special_use = \Drafts       }       mailbox sent {         special_use = \Sent       }       mailbox trash {         special_use = \Trash       }     }      Now, the problem is, `Dovecot` does not use the mailboxes as defined, but creates its own mailboxes named with a `.` in front and with first letter capital:               $HOME/Mail/.Drafts     $HOME/Mail/.Sent     $HOME/Mail/.Trash      Further, instead of using `$HOME/Mail/inbox` as `inbox`, it uses `$HOME/Mail` as inbox. i.e. it created the `cur/new/tmp` directories directly in `$HOME/Mail/`, rather than using the existing `$HOME/Mail/inbox`:               $HOME/Mail/cur     $HOME/Mail/new     $HOME/Mail/tmp      # SUMMARY: explained briefly, what I need is the following: I have an existing `Maildir` folder structure where `Postfix` delivers mail, plus the usual folders (`drafts`, `sent`, ...):               $HOME/Mail/inbox/{cur,new,tmp}     $HOME/Mail/drafts/{cur,new,tmp}     $HOME/Mail/sent/{cur,new,tmp}     $HOME/Mail/trash/{cur,new,tmp}      How can I tell `Dovecot` to use the correct directories?


How can I keep user acccounts consistent accross multiple machines?

I now have a Raspberry Pi which runs Debian Wheezy. I have a couple machines (4 physical, 2 virtual) sitting here and I would like to unify the user accounts on those machines. The machines I run have the following Debian derivatives installed on them:   * Debian Wheezy (armhf)   * Debian Stable (amd64)   * Debian Unstable (amd64)   * Ubuntu 14.04 (amd64) How could I get the user accounts set up on all machines equally? I want that the name, the long name, password and the UID are consistent. In the future, I would like to unify other parts of the configuration, maybe   * HTCondor   * Mountpoints (Samba)   * `/etc/apt/sources.list`   * Unattended Updates Since I use different Ubuntu and Debian variants, the `sources.list` will differ a bit, but it will be the same on each distribution. What would be a good approach to this?


How to not install GRUB when installing Elementary OS Luna?

I'd like to install eOS Luna, but I already have Debian 7.5 installed, so don't want to install GRUB again, as the last time I did this it broke the bootloader... Is this possible? I haven't seen any option in the Ubuntu installer, and as far as I know they are the same.


Is the maximinm value of network.http.pipelining.maxrequests still 8?

I've detected some slowness in Firefox 17 under Fedora 18, so I decided to modify some configuration options. So, the question is: Does someone know if the maximum value of **network.http.pipelining.maxrequests** is still 8? I find people saying that if I put more than 8, it will be ignored. It seems weird to me that the default value of Fedora and also Centos is 32.


Shell script to Capture the file name and size in csv file and add header on that file

I have a number of zip files in a certain folder. I want to capture file name and the size of the files in a CSV format in day wise and put it in crontab so I can report on a daily basis, and then mail it in each report. Files are in `/somedirectory/archive/test`:               -rw-rw-r--+ 1 AAAA AAAA 9.3M May  30 17:09 XXXXX_20140530_0401_28.txt.gz     -rw-rw-r--+ 1 AAAA AAAA 9.3M May  30 17:09 XXXXX_20140530_0401_29.txt.gz     -rw-rw-r--+ 1 AAAA AAAA 9.3M May  31 17:09 XXXXX_20140531_0401_01.txt.gz      Now I want to crate a cronjob to run everyday and capture the same CSV which we prepared in day wise. example `test30052014.csv`:               "File Name","size","date"     "XXXXX_20140530_0401_28.txt.gz", "9.3","May 30"     "XXXXX_20140530_0401_29.txt.gz", "9.3","May 30"      `test31052014.csv`:               "File Name","size","date"     "XXXXX_20140531_0401_01.txt.gz", "9.3","May 31"


Use output from head to copy files with spaces

I have 11 files with spaces in its name in a folder and I want to copy the newest 10. I used `ls -t | head -n 10` to get only the newest 10 files. When I want to use the expression in a cp statement I get an error that the files could not be found because of the space in the name. E.g.: `cp: cannot stat ‘10’: No such file or directory` for a file named `10 abc.pdf` The cp statement: `cp $(ls -t | head -n 10) ~/...` How do I get this working?


Creating an email server on CentOS 6

I'm looking into creating my first email server on CentOS Linux. I know it can be a challenge when it comes to managing one, but i'm up for the challenge. So if i have my domain name pointed directly to my email servers IP Address would i still have to add MX Records to my DNS? As far as i know, the email server should work with Apple mail that is built in to my computer that should connect with IMAP on the SMTP server port. I'm considering using IRedMail for my email server since it looks like it could make setup allot easier for me. So any suggestions on what i should first know before creating my own email server would be appreciated!


When is swap triggered or how to calculate swap_tendency?

I'm trying to use Redis for production services and trying to avoiding swapping, which is bad for performance. I had learn that swap is triggered by swap_tendency which is depending on > swap_tendency = mapped_ratio/2 + swappiness + distress How can I get mapped_ratio/distress from `/proc/meminfo` for my monitor script? Or anything parameter that can info me that system is going to swap pages?


Debian + Linux kernel 3.12.22: “Kernel module loader” option is not available

The Debian guide for compiling a kernel says: _Do not forget to select “Kernel module loader” in “Loadable module support” (it is not selected by default). If not included, your Debian installation will experience problems._ However, I have downloaded the 3.12.22 kernel, run _make xconfig_ and searched for the “Kernel module loader” option without finding it. Has such option been discontinued, included by default, or not needed anymore? Thank you.


What does the period indicate when an environmental variable is set like "VARIABLE_NAME=."

What does the period indicate when an environmental variable is set like `VARIABLE_NAME=.`


How to select block of text in xterm

In some terminal emulators like _gnome-terminal_ or _terminator_ , I am able to select a block of text by pressing `Ctrl` and then clicking the mouse and dragging. This is useful, let's say, to select an indented block of code without all the surroundings, see figure. ![Difference between pressing Ctrl while clicking and dragging the mouse](http://i.stack.imgur.com/s3P4h.png) Is it possible to do something similar in _xterm_?


32-bit vs 64-bit vs ARM in regards to programs and OSes

So when I run Raspbian (basically a ARM Debian derivative with LXDE), I can install any normal package using aptitude. But if, for example, I wanted to download a .deb file, I would have to choose 32-bit or 64-bit and download that, and try to run it on Raspbian (it wouldn't work). Why does installing packages from the official repositories work on ARM systems? Why is it not incompatible? I'm also a little confused about the difference between hardware and software bits. ARM is hardware, right?


java plugin does not work in chromium-browser (all possible attempts exhausted)

I was using google chrome browser on Ubuntu 12.04 machine, recently I needed to switch to chromium-browser. I am using the version that is available on the Ubuntu software centre. The problem is that I can't make java applets to load any more. Here is my situation --   1. I am using vanilla jdk (jdk 1.7.0_51) from the oracle.   2. Previously in chrome, I have created a symlink of `libnpjp2.so` to the `/opt/google/chrome/plugins` folder, java applets were working fine.   3. After uninstalling chrome and installing chromium-browser, I made a symlink of `libnpjp2.so` to `/usr/lib/chromium-browser/plugins` folder, but java applets do not fire up any more (even from this site: http://www.java.com/en/download/installed.jsp)   4. Even `libnpjp2.so` appears in `about:plugins` in chromium-browser and showing it's enabled. What I have tried so far --   1. After uninstalling chrome, the `/opt/google/chrome` was still there, I removed it   2. Made the symlink as the point 3 above to `/usr/lib/chromium-browser/plugins`, but no luck.   3. So I installed `icedtea-7-plugins` from the Ubuntu repo and made a symlink of `IcedTeaPlugin.so` to `/usr/lib/chromium-browser/plugins`, but no luck, so I removed it.   4. Added the java applet test page to the exclusion list in the java control panel.   5. Cleared temporary internet files from the java control panel.   6. Did multiple cycles of "enable/disable" java plugins in chromium-browser.   7. Firing up the chromium-browser with `-enable-plugins` switch did not work. When I go to the java applet test page, what I can only see is a grey rectangle, nothing else. Please note, everything was working fine on chrome browser and also in firefox. Please also note I do not want to install openjdk stuffs. any idea ?


Redirecting Request on Device in Access Point Mode

I have a Raspberry Pi with a wifi dongle that is configured for Access Point mode (wifi hotspot). When a user is connected, I want to redirect any url they enter to a specified IP (the devices setup/configuration page). I'm looking for behavior similar to what happens when you connect to a public hotspot at the airport and you have to enter an email or accept "terms & conditions" before you can browse other pages. Can this be done on the pi's distribution?


Grep search returning a different line

This is my grep search                grep 'Invoker_Slark*' true_pairscore.txt      But it returns the line `Invoker_Slardar`. Even though the file contains `Invoker_Slark`. Why is that?


grep for multiple strings in files, and then list the files in the order of size

I am in a folder with lots of `.txt` file, I would like to find all the files which contain both `stringA` and `stringB` (not necessarily on the same line), then list these files in the order of the size (from small to big) I have tried the follows, but it doesn't work:               ls -lS | for f in *; do grep -q stringA $f && grep -l stringB $f; done      Does anyone have a good idea?


Setting default username and group for files in directory

Using this helpful post I am able to set a default group and file permissions in a folder. I'm having trouble setting a default owner (teamlead uid 1234).               setfacl -d -m g::rwx /my/test/folder     setfacl -d -m o::rx /my/test/folder          getfacl /my/test/folder          # file: /my/test/folder     # owner: teamlead     # group: web_prod     # flags: -s-     user::rwx     group::r-x     other::r-x     default:user::rwx     default:group::rwx     default:other::r-x      With that:               [mary@boxen]# touch /my/test/folder/somefile     [mary@boxen]# ll /my/test/folder/somefile     -rw-rw-r--. 1 mary web_prod 0 Nov  6 08:58 somefile      So the right group is assigned, but the new file has ownership of the user creating the file. I'd like newly created files to have teamlead:web_prod owner/group. It appears that `setfacl` can be used to set a default user, too. With the existing folder acl config (above):               [mary@boxen]# setfacl -d -m u:1234:rwx /my/test/folder      Now to create a file as a different user. I'm expecting it to have teamlead:web_prod ownership.               [mary@boxen]# touch /my/test/folder/anotherfile     [mary@boxen]# ll /my/test/folder/anotherfile     -rw-rw-r--+ 1 mary web_prod 0 Nov  6 08:58 somefile      New file still has ownership of the owner creating the file, not uid 1234(teamlead). Is what I'm after even possible, or is the way I'm going about this wrong?


How do I set up NFS to respect user and group permissions?

After creating an NFS share between two servers, **lb1** (nfs-client) and **data-server1** (nfs-kernel-server), users with permission on the NFS server do not have access on the NFS client. ## data-server1 configuration:               $ cat /etc/exports     /data  10.132.246.167(rw,no_subtree_check)     $ ls -la / | grep data     drwx--x--x  3 u1   users    4.0K Sep  6 03:55 data/     $ ls -la /data     drwxr-xr-x 3 u1       users    4.0K Sep  6 02:31 prod/     drwxrwsr-x 2 www-data www-data 4.0K Sep  6 02:31 keys/     $ awk -F: '$0=$1 " uid="$3 " gid="$4' /etc/passwd | grep 'root\|u1\|ftp\|www-data'     root uid=0 gid=0     www-data uid=33 gid=33     u1 uid=115 gid=100     ftp uid=999 gid=100      ## lb1 configuration:               $ mount 10.132.245.223:/data /data     $ mount     10.132.245.223:/data on /data type nfs4 (rw,relatime,vers=4,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.132.246.167,minorversion=0,local_lock=none,addr=10.132.245.223)     $ sudo -u u1 ls -la / | grep data     drwx--x--x  3 u1   users    4.0K Sep  6 03:55 data/     $ sudo -u u1 ls -la /data     drwxr-xr-x 3 u1       users    4.0K Sep  6 02:31 prod/     drwxrwsr-x 2 www-data www-data 4.0K Sep  6 02:31 keys/         $ awk -F: '$0=$1 " uid="$3 " gid="$4' /etc/passwd | grep 'root\|u1\|ftp\|www-data'     root uid=0 gid=0     www-data uid=33 gid=33     u1 uid=115 gid=100     ftp uid=999 gid=100          On the NFS server (ie, data-server1), root, u1, and ftp users have proper rwx permissions for the subdirectories of /data and can access the filesystem without any problems. However, on the NFS client (ie, lb1), root and ftp get `permission denied` errors when trying to simply list directory contents of `/data` within the NFS share. User u1 on the other hand, works perfect. This is one of my first usages of NFS


Apache 2.4 won't reload, any problem with my configuration?

I'm trying to get a `VirtualHost` file which was written in Apache 2.2 to work in Apache 2.4 and while I've done some changes to it, it doesn't pass the Apache `configtest`. The idea is to locally test the site. Here is the original file which apparently works in Apache 2.2:               <VirtualHost local.in2014.mini.debconf.org:80>             ServerAdmin webmaster@localhost                  DocumentRoot /var/www/in2014.mini/website/             <Directory />                     Options +FollowSymLinks +Includes                      AllowOverride None             </Directory>             <Directory /var/www/in2014.mini/website/>                     Options +Indexes +FollowSymLinks +MultiViews +Includes                      AllowOverride None                     Order allow,deny                     allow from all             </Directory>     </VirtualHost>      These are the changes I did to change to Apache 2.4:               $ cat /etc/apache2/sites-enabled/minidebconfindia.conf      <VirtualHost mini:80>     ServerAdmin webmaster@localhost          DocumentRoot /var/www/html/in2014.mini/website     <Directory />     Options FollowSymLinks +Includes     Require all granted     </Directory>     <Directory /var/www/html/in2014.mini/website/>     Options Indexes FollowSymLinks MultiViews +Includes     Require all granted     </Directory>     </VirtualHost>      Now I know that I changed the hostname from a big name to a small name. I changed/edited the name there in `/etc/hosts` as well.               $ cat /etc/hosts     127.0.0.1   localhost     127.0.1.1   debian mini      My system's hostname:               $ hostname     debian      I ran the `configtest` to figure out where exactly I'm going wrong:               $ sudo apachectl configtest     AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/minidebconfindia.conf:     Either all Options must start with + or -, or no Option may.     Action 'configtest' failed.     The Apache error log may have more information.      Now line 6 is:               Options FollowSymLinks +Includes      so from the comment it seems I need to do:               Options +FollowSymLinks +Includes      If I do that then it tells/asks the same to do at line 10 as well:               Options +Indexes +FollowSymLinks +MultiViews +Includes      Am I going the right way? ### UPDATE #1 From @garethTheRed's advice, I revised it to the following:               $ cat minidebconfindia.conf     <VirtualHost mini:80>     ServerAdmin webmaster@localhost          DocumentRoot /var/www/html/in2014.mini/website     <Directory />     Options +FollowSymLinks +Includes     Require all granted     </Directory>     <Directory /var/www/html/in2014.mini/website/>     Options +Indexes +FollowSymLinks +MultiViews +Includes     Require all granted     </Directory>     </VirtualHost>      and redid the `apache2 configtest` to get this:               $ sudo apachectl configtest     [sudo] password for shirish:      AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message     Syntax OK      The last line tells that the config file is good now. It's only the servername/IP address which seems to be an issue. I have already shared the output of `/etc/hosts`. I looked at the error via searching on the internet and it seems there is an `httpd.conf` which needs to be in `/etc/hosts` which is/was not available. I created the file and tried both things:               $ cat /etc/apache2/httpd.conf     ServerName localhost      as well as:               $ cat /etc/apache2/httpd.conf     ServerName mini      but neither of these worked, as I'm getting the same error as shared above. Can somebody help?


Installing Arch Linux on empty eee pc's hard drive

I have a problem with the installation of Arch Linux on an Asus 1000HD eee pc. The fact is, it had a Windows XP home basic installation, and it was still very very slow with that. So I formatted the hard drive and erased all partitions with Windows 7 Disk Manager (I used an old Toshiba external hard dtive case to connect my HD plug n play). Than, i tried ISO to USB to install Arch Linux on that drive. I also installed it to my usb pen drive with unetbootin. Finally, I plugged the hard drive back to its place. Nothing happened. I tried to boot the system via USB pen drive, still nothing happens (it didn't even power it). I am pretty sure that I made some mistakes, and I read tutorials all over the internet, no one worked. Could you help me? Thank you!


WAN interface using his own queues for QoS different that the provided by Linux

My Linux embedded system have a WAN interface with the default `pfifo_fast qdisc` attached to it. The web interface for configuring the system let the user configure three Queues for the WAN interface with different precedence, and then you can configure in which queue each kind of traffic will be put. I see that when i apply QoS settings the system is marking via `ebtables` some traffic with `mark-or xxx` depending of the queue configured for that traffic, but i dont see any rule mangling the mark in `iptables` so Im guessing how the mark is used to apply QoS in the wan interface, its possible that there are some queues used internally by the WAN device and that this queues are independent of the `pfifo_fast qdisc`? Any ideas for investigating deeper how QoS is working in this system?