decreasing "reserved block count" does not show up in df output

By default my ext3 file system had 122060 blocks(5%) reserved. I decreased this to 24412(1%), but there were no changes in `df` output:               root@t60:~# df -P     Filesystem         1024-blocks      Used Available Capacity Mounted on     /dev/sda1              9611492   9611492         0     100% /     tmpfs                  1032740         0   1032740       0% /lib/init/rw     udev                   1028300       212   1028088       1% /dev     tmpfs                  1032740       272   1032468       1% /dev/shm     /dev/sda6            294079488  84665932 194475140      31% /home     root@t60:~# tune2fs -m 1 /dev/sda1     tune2fs 1.41.12 (17-May-2010)     Setting reserved blocks percentage to 1% (24412 blocks)     root@t60:~# df -P     Filesystem         1024-blocks      Used Available Capacity Mounted on     /dev/sda1              9611492   9611492         0     100% /     tmpfs                  1032740         0   1032740       0% /lib/init/rw     udev                   1028300       212   1028088       1% /dev     tmpfs                  1032740       272   1032468       1% /dev/shm     /dev/sda6            294079488  84665932 194475140      31% /home     root@t60:~#       Any ideas why is this so?


I can't install Mono because something's wrong with the kernel (I think)

$ sudo apt-get install mono-runtime     Reading package lists... Done     Building dependency tree            Reading state information... Done     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      linux-image-generic-pae : Depends: linux-image-3.2.0-38-generic-pae but it is not going to be installed      mono-runtime : Depends: mono-gac (= 2.10.8.1-1ubuntu2.2) but it is not going to be installed                     Recommends: binfmt-support (>= 1.1.2) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      I'm trying to install McMyAdmin on Ubuntu 12.04, but I can't install `mono`. What's the problem? Should I backup the server files and reinstall? Edit: Here's `sources.list`; `sources.list.d` is empty.


Opening lid results in black screen (Dell Laptop with ATI Graphics, Ubuntu 12.04, 3.2 kernel, GNOME 3)

For the past few weeks, when opening the lid my laptop often fails to recover from suspension leaving me with a blank screen. Further, when this bug occurs, the laptop fans continue to run while the lid is closed, causing my laptop to quickly overheat in my bag. I have read various different questions on here that had similar symptoms but none of the solutions worked in my case. Disabling suspension on gnome seemed to reduce the frequency of this issue, but it still occurs with some frequency. It only seems to occur if I do not lock the computer before closing the lid or I am in a different desktop manager (such as dwm). I currently have the ATI graphics drivers enabled (not sure on the specific driver, but it is whatever driver that Jockey installed).


How can we know who's at the other end of a pseudo-terminal device?

If I do a:               echo foo > /dev/pts/12      Some process will read that `foo\n` from its file descriptor to the master side. Is there a way to find out what that(those) process(es) is(are)? Or in other words, how could I find out which xterm/sshd/script/screen/tmux/expect/socat... is at the other end of `/dev/pts/12`? `lsof /dev/ptmx` will tell me the processes that have file descriptors on the master side of any pty. A process itself can use `ptsname()` (`TIOCGPTN` ioctl) to find out the slave device based on its own fd to the master side, so I could use:               gdb --batch --pid "$the_pid" -ex "print ptsname($the_fd)"      for each of the pid/fd returned by `lsof` to build up that mapping, but is there a more direct, reliable and less intrusive way to get that information?


How to Calculate the Total size of file searched using Find command

Actually there are tow questions. First I have to search the files using FIND command that will show only the files for December 2012 And Secondly I need to see the Total size of files searched I used this command               find /storage/backup/rman/ -mtime +90 -mtime -120 -exec ls -lrth {} \;      But it also gave me the Files of November which I dont want               -rw-r--r-- 1 oraprod dba 8.7K Dec  1 22:40 /storage/backup/rman/full_011212.log     -rw-r----- 1 oraprod dba 3.3G Dec 11 22:34 /storage/backup/rman/BKPPROD_aknskgvb.F_bkp     -rw-r----- 1 oraprod dba 34M Dec  1 22:40 /storage/backup/rman/ctrl_011223     -rw-r----- 1 oraprod dba 1.3M Dec  1 22:33 /storage/backup/rman/BKPPROD_8lnrq765.F_bkp     -rw-r--r-- 1 oraprod dba 8.0K Dec 20 22:45 /storage/backup/rman/full_201212.log     -rw-r----- 1 oraprod dba 34M Dec  2 22:42 /storage/backup/rman/ctrl_021223     -rw-r----- 1 oraprod dba 2.5G Dec 11 22:38 /storage/backup/rman/BKPPROD_ajnskgvb.F_bkp     -rw-r----- 1 oraprod dba 34M Dec 13 22:46 /storage/backup/rman/ctrl_131223     -rw-r--r-- 1 oraprod dba 8.0K Dec 17 22:44 /storage/backup/rman/full_171212.log     -rw-r--r-- 1 oraprod dba 8.0K Dec 10 22:38 /storage/backup/rman/full_101212.log     -rw-r--r-- 1 oraprod dba 8.0K Dec 13 22:46 /storage/backup/rman/full_131212.log     -rw-r--r-- 1 oraprod dba 1.4K Nov 30 22:00 /storage/backup/rman/full_301112.log     -rw-r----- 1 oraprod dba 34M Dec  8 22:46 /storage/backup/rman/ctrl_081223     -rw-r--r-- 1 oraprod dba 9.2K Dec 12 22:43 /storage/backup/rman/full_121212.log      when i pass the du -ch at the end of command this is the result               8.0K    ./.gnome/gnome-vfs     12K     ./.gnome     24K     ./lsat-0.9.7.1/changelog     920K    ./lsat-0.9.7.1     8.0K    ./.gconf/desktop/gnome/accessibility/keyboard     12K     ./.gconf/desktop/gnome/accessibility     8.0K    ./.gconf/desktop/gnome/peripherals/keyboard/host-mdfr-prod/0     12K     ./.gconf/desktop/gnome/peripherals/keyboard/host-mdfr-prod     16K     ./.gconf/desktop/gnome/peripherals/keyboard     20K     ./.gconf/desktop/gnome/peripherals     36K     ./.gconf/desktop/gnome     40K     ./.gconf/desktop     8.0K    ./.gconf/apps/panel/applets/clock/prefs     12K     ./.gconf/apps/panel/applets/clock     8.0K    ./.gconf/apps/panel/applets/workspace_switcher/prefs     12K     ./.gconf/apps/panel/applets/workspace_switcher     8.0K    ./.gconf/apps/panel/applets/window_list/prefs     12K     ./.gconf/apps/panel/applets/window_list     40K     ./.gconf/apps/panel/applets     44K     ./.gconf/apps/panel     8.0K    ./.gconf/apps/puplet     56K     ./.gconf/apps     100K    ./.gconf     8.0K    ./.nautilus/metafiles     12K     ./.nautilus     4.0K    ./.eggcups     196K    ./.gstreamer-0.10     4.0K    ./.redhat/esc     8.0K    ./.redhat     8.0K    ./.gnome2/share/cursor-fonts     8.0K    ./.gnome2/share/fonts     20K     ./.gnome2/share     4.0K    ./.gnome2/keyrings     4.0K    ./.gnome2/accels     4.0K    ./.gnome2/nautilus-scripts     36K     ./.gnome2     12K     ./.metacity/sessions     16K     ./.metacity     4.0K    ./.Trash     4.0K    ./.gnome2_private     68K     ./.gconfd     4.0K    ./.mozilla/extensions     4.0K    ./.mozilla/plugins     12K     ./.mozilla     4.0K    ./Desktop     2.5M    .     2.5M    total


Apache server: permission and symbolic link problem

I am using CentOS(Linux 2.6.32-431.11.2.el6.x86_64). I am trying to create an Apache2.2.15 web server. Every thing configured very well. My DocumentRoot is the default location i.e. `/var/www/html`. I am able to create symbolic link which works perfectly. for example I can create a link for the configuration directory i.e. `ln -s /etc/httpd/conf/ /var/www/html/conf`, and it work perfectly fine. I also made a symbolic link to the home directory but it is not working. When I test my web-server it gave me the following error(403)               Forbidden          You don't have permission to access /test1/home/ on this server.          Apache/2.2.15 (CentOS) Server at my-PC Port 80      the web-server is running as an abc user (abc is a regular user and has home directory access). The permission of the home directory is               drwxr-xr-x.   6 abc abc  4096 May 29 14:47 home      The concerning part of httpd.conf is given below               <Directory "/">     Options Indexes FollowSymLinks Includes ExecCGI     AllowOverride All     Allow from all     </Directory>     <Directory "/var/www/html/">      Options Indexes FollowSymLinks Includes ExecCGI      AllowOverride All      Allow from all     </Directory>      SELINUX is disabled. The error_log tell me the following thing                [client ########] (13)Permission denied: Can't open directory for index: /var/www/html/test1/home/, referer: http://YYYYYYYYYY/test1/      Can any body suggest me how can I create a symbolic link for the home directory or for the `/home/abc/Download` directory?


Remote Desktop with a twist

I am looking for a remote desktop client with the following properties :   1. Preferrablly QT based, than GTK, but not a must.   2. I should be able to do all usual remote desktop as Teamviewer for example   3. However, I want to specifically let the remote user access the executables in a particualr folder (or symbolic links to other executables created in the same aprticular folder - this time the executables may reside somewhere else) and read write permission to the same folder. Does there exist any such software?


Spamassassin blacklist_subject not translating UTF8 characters

I am using spamassassin version 3.3.1 in conjunction with amavisd on Centos 6.5 64bit. It appears that when I use the whitelist subject plugin (actually using it to blacklist subjects, ie "blacklist_subject spammy subject") it does not translate UTF8 encoded subject lines and is allowing spam through that contain blacklisted subjects. Does anyone know how to handle this problem?


Disk full on a server with a large /home partition

I've just got this CentOS Server but I think I've set it up wrong as I can only upload a few GB then I start getting errors, It should have ~1TB. this is the results of lsblk               [root@ns4005990 ~]# lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 931.5G  0 disk     ├─sda1   8:1    0  19.5G  0 part /     ├─sda2   8:2    0 911.5G  0 part /home     └─sda3   8:3    0   511M  0 part [SWAP]      I'm guessing its using sda1 as the main storage but should be using sda 2? I know very little about linux, Any ideas how i can fix it so its using sda2?               [root@ns4005990 ~]# df -h /home     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda2       905G  200M  859G   1% /home


Shell script to wait for a packet from a certain port

I want to start my minecraft server when someone tries to connect to it on port 25565. I have a plugin for the server which shuts it down after x amount of minutes without players online. With a shell script I created a loop that starts the server when it shuts down:               #!/bin/bash     while true     do         # run server         java -Xms2048M -Xmx2048M -Djava.awt.headless=true -jar "craftbukkit.jar"         # server shut down              # run MCSignOnDoor         java -jar MCSignOnDoor.jar --sentrymode -m "Gone Fishin' Back in Five Minutes!"         # McSignOnDoor shut down              # stop loop if error code is not 12         # so only restart the server when the program ended because of a packet         if [ "$?" -ne "12" ]; then             break         fi     done      McSignOnDoor was a java program someone made that emulates an active server, and exits as soon as someone pings it on port 25565 with exit code 12. Sadly, this does not work since a protocol update, so I'm looking for an alternative. Is there a way to wait until it receives a packet on port 25565 (or any other port) and then continue the script?


How to configure DHCP so that hostname is not sent?

A simialr question Host name on terminal changes when I connect internet : why? But since it was not resolved in my case so I am putting it here and asking in a different way. The answer given here by chaos did not help me as I could not find the file mentioned in RHEL 6.0 64 bit `/etc/dhcp/dhclient.conf` The content of the file:               /etc/sysconfig/network-scripts/ifcfg-eth0      is               DEVICE="eth0"     HWADDR=70:54:D2:22:FA:A6     NM_CONTROLLED="yes"     ONBOOT="no"      . I can see there is no `DHCP_HOSTNAME`. But Still I am seeing a strange issue here. And the issue is that when I am not connected to internet:               [acme@localhost ~]$      But when I connect to internet:                [acme@dhcppc9 ~]$      Why it is happening?


How can I paste something to the VIM from the clipboard? In Windows "*p works as expected but in Debian both "*p and "+p doesn't work with both clipboard=unnamed and clipboard=unnamedplus.


Strange fcitx-mozc behavior with ArchLinux

I use ArchLinux and I have problem with Japanese IME. When I write by Japanese IME, a character can't be in text area with Skype, Android Studio etc.(Maybe those aren't gtk and qt apps) ![enter image description here](http://i.stack.imgur.com/evkBk.png) It works for Chromium, gnome-terminal. Do you have solution of this problem?


Make error while installing wifi driver offline

I need to install Kali Linux updates without Internet access on my laptop. I think I need to do this because I'm trying to install the wifi driver but I get an error when I try to make:               make ARCH=x86_64 CROSS COMPILTE= -C /lib/modules/3.7-trunk-amd64/build M=/root/Desktop/rtl8723A_WiFi_linux_v4.1.3_6044.20121224      modules make: *** /lib/modules/3.7-trunk-amd64/build: No such file or directory. Stop.      make: *** [modules] Error 2      Trying to install the Realtek rtl8723au wireless driver wifi driver: github.com/lwfinger/rtl8723au (from http://askubuntu.com/questions/318608/…) It's for the Yoga13, I can cd /root/blah/driver, but when I make it just spits out the aforementioned error message, that was the entire error message. When using "dpkg -l | grep linux-" command, it yields this: ii firmware-linux-free 3.2 all Binary firmware for various drivers in the Linux kernel ii firmware-linux-nonfree 0.37 all Binary firmware for various drivers in the Linux kernel ii kali-linux-full 1.35 amd64 Penetration testing and security auditing distribution, full system ii kali-linux-sdr 1.35 amd64 Penetration testing and security auditing distribution, SDR tools ii linux- base 3.5 all Linux image base package ii linux-image-3.7-trunk-amd64 3.7.2-0+kali8 amd64 Linux 3.7 for 64-bit PCs ii linux-image-amd64 3.7+46+kali1 amd64 Linux for 64-bit PCs (meta-package) ii linux-libc-dev:amd64 3.7.2-0+kali8 amd64 Linux support headers for userspace development The OS is a fresh install.


Problem creating a bootable USB stick

I have tried to make a bootable USB stick on my netbook using Universal USB Installer for Fedora Desktop. But it can't find my pendrive. I thought the problem is my pendrive, so I change it. Unfortunately,the problem still the same. Whats wrong exactly?   I am using Zorin 8 OS on my netbook.


Show in folder does not select file

In various applications when I do "show file in folder" it simply open the file-manager (nemo) but does not select the actual file. How can I make show in folder also select the file?


nmcli freedesktop DBus warnings and errors

As soon as I do `nmcli con up id <ESSID>`, I experience some warnings/errors: > ** (process:4841): WARNING **: async_got_type: could not read properties for > /org/freedesktop/NetworkManager/ActiveConnection/5: Method "Get" with > signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist > > ** (process:4841): WARNING **: async_got_type: could not read properties for > /org/freedesktop/NetworkManager/ActiveConnection/5: Method "Get" with > signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist > > ** (process:4841): WARNING **: async_got_type: could not read properties for > /org/freedesktop/NetworkManager/ActiveConnection/5: Method "Get" with > signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist > > Error: Connection activation failed: Creating object for path > '/org/freedesktop/NetworkManager/ActiveConnection/5' failed in libnm-glib.   * How can I fix this error?   * What causes this? I have (X)Ubuntu 13.10. This might have to do something with some `freedesktop` related issues, I have with recently. Please have a look at it, too: Gnome programs (eog/gnome- terminal) have a slow start and produce a DBus.Error.NoReply Warning.


Multiple root options in Linux command line

My kernel command line looks like this:               root=31:0 ro noinitrd console=ttyS0,115200 root=/dev/mtdblock2 rootfstype=squashfs      I think the first `root` entry identifies a disk by its major and minor device number and the second entry identifies it by its name. I can confirm that the `rootfs` is indeed on `/dev/mtdblock2` but I don't know how to interpret `31:0`.


Prelink warning in output of rpm -Va

I have run the following as root on a RHEL 4 box to get a list of the modified files:               rpm -Va      The output includes lines such as:               prelink: /tmp/#prelink#.60m2Jq: Recorded 2 dependencies, now seeing -1          S.?.....    /usr/bin/gencat     prelink: /tmp/#prelink#.2izAsr: Recorded 2 dependencies, now seeing -1          S.?.....    /usr/bin/getconf     prelink: /tmp/#prelink#.QIPLxn: Recorded 2 dependencies, now seeing -1          S.?.....    /usr/bin/getent      Are the prelink warnings anything to worry about? Secondly, the question mark in the MD5 sum column means that the value could not be calculated. Any theories as to why? I can do `md5sum filename` without any problem.


bash function to find a directory recursively

How can I write a bash-function that finds a specific parent directory. Here's my setup:               /home/user/dev/project1/branch1/deeply/nested/module/structure      The app-server used for devs is located at:               /home/user/dev/project1/branch1/apps/someappserver      I'd like to have a bash function that goes up recursively to the branch's root to quickly copy compiled modules to the appserver, run/stop the appserver, call specific maven goals etc. Any ideas? Each branch has a maven pom.xml which contains exact information about the version


some shared libs in /usr/local/lib aren't found but they are in /usr/lib

I can successfully run an executable using a symlink'd shared library in /usr/lib like so - `sudo ln -s /lib/i386-linux-gnu/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.4` In the interest of making this easier to maintain I'd like to move this to /usr/local/lib - `sudo ln -s /lib/i386-linux-gnu/libcrypto.so.0.9.8 /usr/local/lib/libcrypto.so.4` But my system seems to ignore this specific sym link. /usr/local/lib is in relevant ld.so.conf settings and indeed is included in the output of `ldconfig -v`.               /usr/local/lib:             libcrypto.so.0.9.8 -> libcrypto.so.4      My only clue so far is that ldconfig creates an additional sym link back to the actual file name...               /usr/local/lib $ ls -l *so*     lrwxrwxrwx 1 root root 14 Aug 26 22:53 libcrypto.so.0.9.8 -> libcrypto.so.4     lrwxrwxrwx 1 root root 38 Aug 26 22:36 libcrypto.so.4 -> /lib/i386-linux-gnu/libcrypto.so.0.9.8     lrwxrwxrwx 1 root root 49 Aug 26 22:36 libiniparser.so.0 -> /usr/lib/x86_64-linux-gnu/samba/libiniparser.so.0      In the output above, for example, the lib and link to libiniparser.so.0 works perfectly fine whether included in /usr/lib or /usr/local/lib. The simplest explanation would be that ldconfig specifically avoids entries that switch the file name of the library, but that theory doesn't explain why this works from /usr/lib. Any insight would be appreciated, thanks.


How to enable an federated storage engine in the Debian MySQL package?

How would I enable an extra (in this case `FEDERATED`) storage engine in the `mysql-server-5.1` package from Debian? I've installed `mysql-server-5.1` via apt-get. But the `SHOW ENGINES` shows that federated is not enabled.               mysql> show engines;     +------------+---------+----------------------------------------------------------------+--------------+------+------------+     | Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |     +------------+---------+----------------------------------------------------------------+--------------+------+------------+     | InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |     | MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |     | BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |     | CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |     | MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |     | FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |     | ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |     | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |     +------------+---------+----------------------------------------------------------------+--------------+------+------------+     8 rows in set (0.00 sec)


Cobbler+Kickstart $basearch problems

I'm using CentOS 6.5 with Cobbler 2.4 (from EPEL). I'm trying to use a heredoc comment to create a repo file (which works) without the `$basearch` being interpreted. What happens is the file is created except `$basearch` is replaced with nothing (e.g. it's removed). What I have:               %post     #raw     cat > /etc/yum.repos.d/blah.repo <<REPO     [repo]     name=repo     baseurl=http://repo.local/repo/$basearch     enabled=1     priority=99     gpgcheck=0     REPO     #end raw     %end      What actually gets put in `/etc/yum.repos.d/blah.repo` (`$basearch` is missing):               [repo]     name=repo     baseurl=http://repo.local/repo/     enabled=1     priority=99     gpgcheck=0      Things I have have verified:   * I know it's not Cobbler or Cheetah because `cobbler validateks` and `cobbler profile getks ...` reports back to me the kickstart script unmodified (when using `#raw` and `#end raw`.   * I created a sample of the template within Cheetah and it properly showed the un-escaped string. I was doing some further research and found this, from the first bullet it looks like `$basearch` is a special variable within kickstart. Are there any suggestions on how to get around this without using `curl` to get the file or explicitly defining the architecture? I want to keep this within the kickstart file for simplicity sake.


ttyO ports do not have the good port address on QEMU 1.4.0 running image for beagleboard-xm

I'm running an Linux Image (kernel 3.2.8) for beagleboard-xm on QEMU's 1.4.0 emulator Ubuntu distribution for 13.04. My image is created using Buildroot beagle_defconfig. I added some pkgs to be able to debug a little. QEMU call cmd:               `$ sudo qemu-system-arm -M beaglexm -m 1024 -sd ./test.img -clock unix -serial stdio -device usb-mouse -device usb-kbd -serial pty -serial pty`     [sudo] password for emperador:           char device redirected to /dev/pts/3 (label serial1)     char device redirected to /dev/pts/4 (label serial2)      What I want to do is to have a communication between guest and host across serial the 4 differents ttyO present on the guest. QEMU offer facilities to redirect the trafic to some device in the host side. My problem goes like this: At the guest kernel boot Im able to see that my UART where enabled               [    2.682040] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled     [    2.777947] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0     [    2.794967] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1     [    2.814942] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2     [    2.966825] console [ttyO2] enabled     [    2.984777] omap_uart.3: ttyO3 at MMIO 0x49042000 (irq = 80) is a OMAP UART3      In fact when I go see in to `/proc/tty/driver` and I do a cat on OMAP-SERIAL Im able to see this serinfo:1.0 driver revision:               0: uart:OMAP UART0 mmio:0x4806A000 irq:72 tx:0 rx:0 CTS|DSR|CD     1: uart:OMAP UART1 mmio:0x4806C000 irq:73 tx:0 rx:0 CTS|DSR|CD     2: uart:OMAP UART2 mmio:0x49020000 irq:74 tx:268 rx:37 RTS|CTS|DTR|DSR|CD     3: uart:OMAP UART3 mmio:0x49042000 irq:80 tx:0 rx:0 CTS|DSR|CD      I know that ttyO2 is working because my console is been redirected to it. The thing is that doing a set serial on any of the ttyO I get the following message:                [root@enu driver]# setserial -a /dev/ttyO0     /dev/ttyO0, Line 0, UART: undefined, Port: 0x0000, IRQ: 72         Baud_base: 3000000, close_delay: 50, divisor: 0         closing_wait: 3000         Flags: spd_normal      The same goes with ttyO2. I tried to set some settings to any of the ttyO with `setserial` but I always get the same message:               [root@enu ~]# setserial /dev/ttyO0 uart 8250                                   setserial: can't set serial info: Invalid argument     [root@enu ~]# setserial /dev/ttyO0 port 0x4806a000     setserial: can't set serial info: Invalid argument      While looking at guest `/proc/tty/drives` this is what we see               /dev/tty             /dev/tty        5       0 system:/dev/tty     /dev/console         /dev/console    5       1 system:console     /dev/ptmx            /dev/ptmx       5       2 system     /dev/vc/0            /dev/vc/0       4       0 system:vtmaster     sdio_uart            /dev/ttySDIO  249 0-7 serial     acm                  /dev/ttyACM   166 0-31 serial     ttyprintk            /dev/ttyprintk   5       3 console     OMAP-SERIAL          /dev/ttyO     253 0-3 serial     serial               /dev/ttyS       4 64-95 serial     pty_slave            /dev/pts      136 0-1048575 pty:slave     pty_master           /dev/ptm      128 0-1048575 pty:master     unknown              /dev/tty        4 1-63 console      Basically I want to establish a serial communication between a guest and a host, but the serial ports on the guest side aren't well configured. `/sys/class/tty` show that tty drivers had been linked to a serial device. has I showed up before, only omap uarts have been initialized and attached to ttyO*. notice that the console is been redirected ttyO2 by kernel configs. but because I added `-serial stdio`, console is been redirected to the terminal that invoked QEMU. If I redirect the console using at first `-serial pty` instead of `-serial stdio` , I'm able to prompt the console in minicom by opening the pty created on the host side. Still nothing happen on the others pty created on the host side to communicate across other ports. On host side I open `/dev/pts/3` and `/dev/pts/4` with minicom or by doing `cat` on them On guest side: Whent I do `echo "test" > /dev/ttyO0` or 1 or 3 nothing. but when I do it on ttyO2, "test" prompt on the console terminal (which is normal). now when using any of the ttyS:               echo "test" > /dev/ttyS0      I get               -bash: echo: write error: Input/output error      I made some research about this error and what I found is that is could be many things. But one thing that I noticed was that no device beside serial has been assigned to ttyS. and looking at /proc/tty/driver/serial we see this :               serinfo:1.0 driver revision:     0: uart:unknown port:00000000 irq:0     1: uart:unknown port:00000000 irq:0     2: uart:unknown port:00000000 irq:0     3: uart:unknown port:00000000 irq:0      also `setserial -a /dev/ttyS0` confrim this:               /dev/ttyS0, Line 0, UART: unknown, Port: 0x0000, IRQ: 0         Baud_base: 0, close_delay: 50, divisor: 0         closing_wait: 3000         Flags: spd_normal      I managed to do serial communication with muliples ports usig grml image on a x86 architecture. So its seems the host side is fine. If anyone have ever made something like this work before on QEMU -M beaglexm or any other ARM architecture, I would gladly take any details on the VM used, QEMU's version and distribution as well as the kernel details and image configs used.


Bash scripting - loop until return value is 0

I need to umount something in my script, but sometimes it unmount's before all of the data has finished being copied and causes the umount to fail. I looked for a way to do a "blocking" umount, but I didn't find anything. So, I tried to write a script to loop until it could be unmounted, but it doesn't work.               while [ `sudo umount mount` ]     do         sleep 0.1     done     rmdir mount      When run outputs:               umount: /home/evantandersen/mount: device is busy.             (In some cases useful info about processes that use              the device is found by lsof(8) or fuser(1))     rmdir: failed to remove `mount': Device or resource busy      Shouldn't it loop until the return value of `sudo umount mount` is 0, meaning it was successfully umounted?


Grub2 adding a new Linux distro

I installed Arch Linux on my computer, but I also installed Slackware on another partition (`/dev/sda5`). I would like to configure Grub2 from the Arch Linux installation through the `/etc/grub.d/40_custom` file to add Slackware to the menu list at boot. I searched for quite some time on the Internet but failed to find an answer to whether I need to install Grub in Slackware too and what exactly to write in the config file. Reading the full documentation of grub is too long. I tried the following but during loading of Slackware, I have a kernel panic event saying something like "unable to find block":               menuentry "Slackware 14.0" {             set root='hd0,msdos5'             echo 'Loading Linux Slackware 14.0 ...'             linux /boot/vmlinuz root=UUID=xxxXXxx-xx-XXX... ro acpi=off     }


How can I be notified about state changes to a VPN adapter

On Ubuntu 12.04 - actually Kubuntu, but I am using NetworkManager, so the configuration should be the same - I have configured a few VPN connections. Now, if I have a long-running up- or download, how can I ensure that all network traffic is stopped immediately and unconditionally if the VPN connection breaks off? What I am looking for is some method of getting notified (I don't want to poll!) of the change. The rest (e.g. inserting netfilter rules) I can handle myself. I just need to find out how to get notified about a change to an established connection. In case it matters, the configuration I am using is based on `tun0`. If other details are required, let me know in a comment and I'll add them to the question. * * * What I have tried so far:   * configure the main LAN connection (this is inside a VM, so there is only a LAN connection) to be manual   * configure the VPN to be automatic then I figured that this isn't the route I want to take anyway, because I want to start my script/program to get notified only whenever I activate the VPN. I am not running on VPN all the time, but most of the time. So basically I need to register for some notification as soon as a particular VPN connection is established and then get notified if something happens to it in order to tear down the main connection automatically in response.


how to stop Clementine playback on suspend using systemd

As the title says, I'm trying to stop Clementine playback using DBus before entering suspend mode. Here is my service file right now:               [Unit]     Description=Stop Clementine playback before suspend     Requires=dbus.service     Before=sleep.target     Before=dbus.service          [Service]     User=jo     Type=oneshot     ExecStart=-/bin/sh -c 'qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Stop'          [Install]     WantedBy=sleep.target      Now, this works, i.e. playback is stopped. However, systemd then proceeds to take a long time to actually enter suspend mode. Looking at the logs in journalctl, I see:               Jun 05 23:43:53 localhost.localdomain systemd[1]: Starting Suspend...     Jun 05 23:44:18 localhost.localdomain systemd-sleep[7052]: Error: org.freedesktop.DBus.Error.NoReply     Jun 05 23:44:18 localhost.localdomain systemd-sleep[7052]: Did not receive a reply. Possible causes include: the remote application did not send a reply, the      Jun 05 23:44:18 localhost.localdomain systemd-sleep[7052]: Suspending system...      My first thought is that the DBus system, or maybe Clementine itself is suspended before it has time to reply, thus causing a hang. This is why I tried adding a dependency to the dbus service in my service file above. However, that does not do the trick. Any ideas?


Common, accessible filesystem with very high filename size limit?

I need to extract an archive that contains files whose names are longer than 256 characters. Every common filesystem I have tried (ntfs, ext3, ext4) has a limitation on filename size at 255 or 256 bytes. Is there a filesystem I can easily use in a Debian system (mkfs, mount, etc) that helps me get around this limitation?


Postfix error: not yet authorized to deliver mail

I am running a private postfix server for my domain `mydomain.com`, on server `111.111.111.111` (IP and domain sanitized for privacy reasons) I have sent an email to `info@example.com` which is on server `222.222.222.222`. The message was deferred, and in my postfix logs, I could see following error:               postfix/smtp  9D055EA: host mail1.example.com[222.222.222.222] said:      451-111.111.111.111 is not yet authorized to deliver mail from 451      <martin@mydomain.com> to <info@example.com>. Please try later. (in      reply to RCPT TO command)      My domain has reverse DNS record set up, and I am using SPF record. Both are configured correctly, I can send emails all right, this is the first case when I have seen these errors. This leads me to believe, that this error is caused by misconfiguration on the destination server. But since I am not sure what these errors mean, I would like if somebody could explain it.


Splitting display among computers

If i have 17 system units (computers with monitors) that connected using network, is it possible to display image or video splitted into those computers without having split it manually?               1 2 3 4 --> slave PCs     5 6 7 8      9 A B C     D E F G     | | | |     [switch]      |     0 --> master PC      what is the software to display images and videos into those monitors?


Mark packets between machines (client and router)?

Can I mark a packet on the client's `OUTPUT` chain and add an iproute policy on the router to route them via a specific gateway? This what I tried to do, but it isn't working. My client's mangle table dump:               Chain OUTPUT (policy ACCEPT 13884 packets, 2327K bytes)      pkts bytes target     prot opt in     out     source               destination              13917 2330K MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            MARK set 0x2          Chain POSTROUTING (policy ACCEPT 13889 packets, 2328K bytes)      pkts bytes target     prot opt in     out     source               destination              13889 2328K LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x2 LOG flags 0 level 4      `iptables` mangle table's INPUT chain dump on the router:               Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x2 LOG flags 0 level 4      2074  196K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED        88 14890 ACCEPT     all  --  ethint *       0.0.0.0/0            0.0.0.0/0                    0     0 ACCEPT     all  --  eth0   *       0.0.0.0/0            0.0.0.0/0                 After some moments and sending test packets (pings from a client connected to the router via wifi, sent to a host outside the intranet), the LOG counter on the router remains equal to zero. ### Questions   * What's happened to my packets?   * Where my packets lose their marks?


What scripting language can I use to automate a concatenation & zipping process?

For a project I'm doing I need to concatenate and compress (with zip) many (midi) files and compare their sizes. I've thought there must be some language that allows me to do something like this:   1. create all pairwise concatenations (i.e. I need to merge files 01.mid and 02.mid and create file 0102.*, I don't care if it's a valid midi file or not, I just want it to have the information of both of them. Is .tar a good option?)   2. compress all files independently (original and concatenated)   3. check all file sizes and write them in some table which I can then import with Matlab or something Should I use bash scripting?


Command substitution - single quotes and spaces

How can I make command substitution pass a list of single-quoted POSIX paths separated by spaces?               command1 $(command2)     command1 '/path/to/file 1' '/path/to/file 2' '/path/to/file 3'      How can I trace the expansion?


Why does monitor stay on when DPMS is enabled?

I am running Mint 13 connected to a Dell U2711 monitor via displayport. When the GDM logon screen is displayed, DPMS does not ever shut down the monitor. If I logon and run               $ xset -q      I get               ...      Screen Saver:       prefer blanking:  yes    allow exposures:  yes       timeout:  0    cycle:  0     ...     DPMS (Energy Star):       Standby: 600    Suspend: 600    Off: 600       DPMS is Enabled       Monitor is On      If I run               $ xset dpms force off      The monitor blanks for about two seconds, and then it comes back on again. I have tried disabling my mouse as this post suggests with               $ xinput --set-prop [id] "Device Enabled" "0"      but no luck. The symptoms are a little different than this post's, and I am not running gnome-power-manager. Could someone please tell me what I am doing wrong? Here is my video card and driver information:               $ lspci -v | grep VGA     05:00.0 VGA compatible controller: NVIDIA Corporation GF106GL      [Quadro 2000] (rev a1) (prog-if 00 [VGA controller])     $ egrep -i " connected" /var/log/Xorg.0.log     [1743798.098] (II) NOUVEAU(0): Output DP-2 connected     $ egrep -i "drivers" /var/log/Xorg.0.log     [1743797.880] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so     [1743797.882] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so     [1743797.882] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so     ...      I also have:               $ grep DPMS /var/log/Xorg.0.log     [2246008.870] (II) Loading extension DPMS     [2246009.091] (II) NOUVEAU(0): DPMS capabilities: Off     [2246009.113] (==) NOUVEAU(0): DPMS enabled


Any tips for surviving Terminal.app?

I've recently switched to using a Mac full-time, and am having trouble getting used to Terminal.app after years of loving gnome-terminal. I miss having URLs show up underlined, using alt+arrow to move between words, and having screen+ssh behave the way I'm used to it. I'm trying to get used to the following key combinations to survive in Terminal.app:   * `Alt``B` to go back a word   * `Alt``F` to go forward a word   * `Alt``A` to go to the beginning of a line   * `Alt``E` to go to the end of a line   * you can still right-click on a URL to open it, it just doesn't look pretty like in gnome-terminal Does anyone have any other good tips or alternative terminal suggestions to retain command line efficiency on a Mac?


The 'less' command-line equivalent of 'tail -f'

I would like to open up a file using less, and have it automatically scroll the file similar to `tail -f`. I know that I can do `less file`, and then hit `Shift-F` to forward forever; like `tail -f`. I need `less` because it provides the `\--raw-control-chars` flag, which is necessary because my input is colorful.


How to trigger error using Trap command

I am using Ubuntu 12.04.2. I am trying to use "trap" command to capture abnormal or error in my shell script but I am also trying to manually trigger "Error" exit. I have tried exit 1, but it won't trigger "Error" signal.               #!/bin/bash          func()     {         exit 1     }          trap "echo hi" INT TERM ERR     func      Not sure how to manually trigger "Error" exit signal?


How to create strong passwords in Linux?

I wonder how I can create strong passwords on Linux (for both normal and admin users) and if there are specific programs to do that.


Fedora 20 on Macbook Pro Retina 11.1 (Late 2013)

I've got myself a new Macbook last week but I just can't get used to OSX and would like to use a Ubuntu, Debian or Fedora installation as Main OS. I have installed Fedora without a bootloader as the guide I followed required me to build my own grub2 bootloader. The SSD in the macbook looks is partitioned like this:   * /dev/sda1 - Apple EFI   * /dev/sda2 - Apple Data   * /dev/sda3 - Apple Boot   * /dev/sda4 - Fedora /boot/efi   * /dev/sda5 - Fedora /boot   * /dev/sda6 - Fedora LVM   * /dev/mapper/fedora-home - Fedora Home   * /dev/mapper/fedora-root - Fedora Root   * /dev/mapper/fedora-swap - Fedora Swap I've used the tool "boot-repair" in a ubuntu live disk to get debian to boot once before, however it didn't work for Fedora(I guess it's because of the LVM). A few questions regarding booting into Fedora on a Macbook Pro Retina (Late 2013):   1. Do I need to use REFInd?   2. Where do I need to place my `grub.cfg`?   3. Do I need to configure a .efi file from my `grub.cfg`?   4. Where do I need to place this EFI file? Could someone please help me out here, I've tried so many tutorials and solutions which were written so poorly I gave up halfway.


How to install ruby-devel and python-devel in SuSE Enterprise?

I've been trying to install some software in SuSE Enterprise (SLES 11 SP 2 64 bits), and keep getting errors about missing dependencies. In the past, I could work around them (in an Ubuntu system) by installing **python-devel** , but I couldn't find it in SLES repository. Now I need to install Ruby Gems, and also can't find either **ruby-devel** or **rubygems** using zypper. I should be able to install Gems manually, but I'm clueless about those two "devel" packages. When googling them, I keep getting OpenSuse results (which are pointless, since AFAIK OpenSuse comes with these packages already included in its repositories) regardless of searching for "suse", "suse enterprise" or "sles". Most searches for binaries also show only files targeting OpenSuse. How can I install these two packages? I'm fairly new to SuSE Enterprise (or SuSE in general), and not very familiar to its installation procedures. I've had no problems using zypper or YaST to install things which came included in the default repositories, but - while I could look up how to include other repos - I'm having trouble even _finding_ the right ones to include. P.S. I just found this thread about [the lack of] devel RPMs for SuSE Enterprise. I haven't tried following those instructions yet (will do later, if a more direct and/or simpler approach doesn't show up).


xkb - Keymaps at `/usr/share/X11/kbd/symbols` 2 values vs 4 values being specified

I am a noob when it comes to `linux` and `xkb`. Sorry if the question seems very obvious and stupid. I was checking the keymap found at `/usr/share/x11/kbd/symbols` and in particular, I was browsing the `us` keymap and I didn't understand how this works: > key `<TLDE>` { [dead_grave, dead_tilde, grave, asciitilde ] }; I understood that: > key `<TLDE>` { [ grave, asciitilde ] }; meant that for regular keypress of ```, I would get `grave` on the screen and pressing `Shift`+``` would result in `asciitilde (~)`. So, how can 4 values be represented?


Parse lines of output from bash loop

I'm trying to parse the output of commands run in a bash loop. Here is an example:               $ for i in `git log --format='%H'`; do echo $i ; git branch --contains $i; done | head -n 8     5f11ce7da2f9a4c4899dc2e47b02c2d936d0468e     * foobar     e1c3f6fabd45715b527a083bc797e9723c57ac89       dev1     * foobar     7053e08775d2c1da7480a988a235e445799cbca5       dev1     * foobar      The command `git log --format='%H'` prints out only the commit ID for each Git commit. The command `git branch --contains $i` prints out which Git branches contain the commit. I'm trying to find the latest git commit that is not on branch 'foobar'. I would like to echo `$i` for the first branch whose output of `git branch --contains $i` contains a line that does not start with the `*` character, which specifies "current branch". What Bash documentation should I be reading? Note that I am aware of other solutions to this problem. However, I plan on making additions that the other answers do not account for. Furthermore, this is how I improve my Bash scripting abilities.


LDAP: view DIT structure from terminal

Can I get list of existing entries using any console utilities? For example - I can get a tree of my filesystem with `tree`:               $ tree     .     ├── Catalina     │   └── localhost     │       ├── host-manager.xml     │       └── manager.xml     ├── catalina.policy     ├── catalina.properties      Can I get a similar view with `shelldap`, `ldapsctritps` or builded **OpenLDAP** utils?


Adding shortcuts to docky on Gnome 3

So I have been using `docky` on Linux for a while and really enjoy it. However, with the introduction of Gnome 3 I can still run docky but the ability to be able to drag shortcuts from the menu to the bar is now gone. Is there another way to add shortcuts to the docky bar to get this functionality?


postfix queue file write error only when sending emails from smartphone

This might sound weird, but the thing is, that I cannot send emails from my smartphone even though it works from my desktop email client. I double-checked that the smtp settings are correct. This is the status log I am getting as error messages:               Transcript of session follows.           Out: 220 ****.tld ESMTP Postfix (Debian/GNU)      In:  EHLO [IP ADDRESS]      Out: 250-****.tld      Out: 250-PIPELINING      Out: 250-SIZE 26214400      Out: 250-VRFY      Out: 250-ETRN      Out: 250-AUTH PLAIN LOGIN      Out: 250-ENHANCEDSTATUSCODES      Out: 250-8BITMIME      Out: 250 DSN      In:  AUTH PLAIN SOME_LONG_CODE      Out: 235 2.7.0 Authentication successful      In:  MAIL FROM:<xxx@***.tld>      Out: 250 2.1.0 Ok      In:  RCPT TO:<a@b.tld>      Out: 451 4.3.0 Error: queue file write error      In:  QUIT      Out: 221 2.0.0 Bye      What is this? Authentication seems to work fine, and I am not sending attachments. (That is mainly what I get when I google that error, that attachments are too big). As I said: It works from thunderbird but doesn't from my smartphone. (Android with K-9 Mail). What could be the problem here?


Generate a list of files from a file containing a series of globbing patterns

I am looking for a way to build a list of files by parsing a file that contains a sequence of `zsh` globbing patterns. The final goal is to pass this list of files to `hg add` in mercurial. For those interested in this specific part, my question is motived by this other question that I asked in StackOverflow:   * Mercurial “hginclude”? (globbing syntax to specify which files to track) A sample file (let's call it `.hginclude`) would look as follows:               .zshrc                                                                                .zprofile                                                                                .less*                                                                                .emacs*/**                                                                                src*/**                                                                                .hg*                                                                                .bash*                                                                                .inputrc                                                                                .ssh      and the output from the script should be a list of **files** obtained by collecting the output of `print globbing_pattern` on every line, where `globbing_pattern` refers to each line in the file `.hginclude` above. Ultimately, the list of files should be a list that I can pass to `hg add` to track those files in mercurial. The assumption for this part is that I have an `.hgignore` with the following:               syntax: glob     *      which means: don't track anything unless explicitly added via an `hg add` command.


Bash script to get ASCII values for alphabet

How do I get the ASCII value of the alphabet? For example, `97` for `a`?


Can't control brightness on HP Pav dv6t running Fedora 16

I installed FC 16 on my HP Pavilion dv6 with a 9-cell battery. I get approximately 7-8 hours on Windows 7, but at best 3 hours on Fedora. I cannot adjust the screen brightness using the fn keys, nor can I adjust it through software. `lspci | grep VGA` gives me: > 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core > Processor Family Integrated Graphics Controller (rev 09)   >  01:00.0 VGA compatible controller: ATI Technologies Inc NI Seymour [AMD > Radeon HD 6470M] My kernel version is 3.1.5-1.fc16.x86_64


bash script check if variable is is [A-Z]

How do I check if a variable is in [A-Z] I want something like this:               read var          while [ $var in [A-Z] ]     do      #code here     done      How to achieve this?


Interesting numbers when apache benchmarking

[root@NOTEBOOK ~] time for i in 128 321; do sleep 302; ab -n $i -c $i https://EXAMPLE.COM/ 2>/dev/null | egrep '^Complete requests:|^Failed requests:|^Requests per second:|^Time taken for tests:'; echo '______________________'; done     Time taken for tests:   87.538 seconds     Complete requests:      128     Failed requests:        0     Requests per second:    1.46 [#/sec] (mean)     ______________________     Time taken for tests:   58.507 seconds     Complete requests:      321     Failed requests:        490     Requests per second:    5.49 [#/sec] (mean)     ______________________      **Q:** how could the Failed requests > Complete requests? p.s.: The "sleep 302" is needed, because somehow if I do too many ab's then the outputs will be 100% fails..


how to investigate Firewall blocked outbound TCP

CentOS webserver with CSF (Config Server Firewall) running. Blocking all outbound / Inbound traffic except listed ports 80 81 22 21 etc. for web, mail & FTP services etc. I'm use to seeing heaps of Inbound blocks from hackers etc. but seeing the below outbound block & appreciate suggestions on where to look to try & discover what is causing this traffic. > Sep 26 12:40:28 thor kernel: Firewall: *TCP_OUT Blocked* IN= OUT=eth0 > SRC=xx.xx.xx.xx DST=54.241.137.2 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=54974 > DF PROTO=TCP SPT=49907 DPT=31000 WINDOW=14600 RES=0x00 SYN URGP=0 UID=509 > GID=509 My server XX is the SRC source IP & destination IP seems to belong to Amazon web services.   The UID GID listed in log is that of user with hosted website but cant see anything obvious in site. I presume there must be some kind of script trying to contact AWS.


What's the difference between .local, .home, and .lan?

How can I reliably address different machines on my network? I've always used the `.local` suffix to talk to computers on my local network before. With a new router, though, `.local` rarely (though sometimes) works. I've found that `.home` and `.lan` both _usually_ work, but not always.               .-------.   .--------.                 .-----.     | modem |---| router |))))))(wifi))))))| foo |     .-------.   .--------.         v       .-----.        ||            |             v      /_^_^_\         |             \))))))).-----.     / cloud \        |                     | bar |      \-_-_-/      .-----.                  .-----.                   | baz |                   .-----.      So, from a terminal on `foo`, I can try:               ssh bar.local     ssh bar.home     ssh bar.lan          ssh baz.local     ssh baz.home     ssh baz.lan      and sometimes some of those suffixes work and some don't, but I don't know how to predict which or when. `foo`, `bar`, and `baz` are all modern Linux or Android systems and the Linux boxes all have (or can have) avahi-daemon, or other reasonably-available packages, installed (I don't want to set up static IP addresses: I'd like to keep using DHCP (from the router) for each machine, and even if I was okay with static addresses I'd want to be able to enter hostnames in the unrooted Android machines, where I can't edit the hosts file to map a chosen hostname to an IP address.)


Running MySQL in a Docker container

So my ultimate end goal is to run a MySQL Docker container (say `tutum/mysql` from the public registry) and then link a Gitlab Docker container (say `sameersbn/gitlab`) to it, where both containers use persistent storage. However, I am stuck on the MySQL part. Every time I try and run a pre-made MySQL Docker container (`mysql`, `tutum/mysql` and `sameersbn/mysql`) as outlined below, I get the below output. _Steps_ This is just one way of getting to the error message below.   1. `docker.io pull tutum/mysql:latest`   2. `docker.io run -it tutum/mysql bash`   3. Once attached to the new container run `/run.sh` (as per `tutum/mysql` Dockerfile)   4. At this point a `Waiting for confirmation of MySQL service startup` message constantly repeats.   5. At this point if I cancel the `/run.sh` command and start MySQL myself I get the error message below. _Output:_               root@1bbeb34f3491:/# mysqld     140730  4:49:04 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.     140730  4:49:04 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.      140730  4:49:04 [Note] Plugin 'FEDERATED' is disabled.     mysqld: Table 'mysql.plugin' doesn't exist     140730  4:49:04 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.     140730  4:49:04 InnoDB: The InnoDB memory heap is disabled     140730  4:49:04 InnoDB: Mutexes and rw_locks use GCC atomic builtins     140730  4:49:04 InnoDB: Compressed tables use zlib 1.2.8     140730  4:49:04 InnoDB: Using Linux native AIO     140730  4:49:04 InnoDB: Initializing buffer pool, size = 128.0M     140730 4:49:04 InnoDB: Completed initialization of buffer pool     140730 4:49:04 InnoDB: highest supported file format is Barracuda.     140730 4:49:04  InnoDB: Waiting for the background threads to start     140730 4:49:05 InnoDB: 5.5.37 started; log sequence number 1595675     140730 4:49:05 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306     140730  4:49:05 [Note]   - '0.0.0.0' resolves to '0.0.0.0';     140730  4:49:05 [Note] Server socket created on IP: '0.0.0.0'.     140730  4:49:05 [ERROR] Can't start server : Bind on unix socket: Permission denied     140730  4:49:05 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?     140730  4:49:05 [ERROR] Aborting     140730  4:49:05  InnoDB: Starting shutdown...     140730  4:49:06  InnoDB: Shutdown completed; log sequence number 1595675     140730  4:49:06 [Note] mysqld: Shutdown complete      _Addressing the errors_   * "Please run mysql_upgrade to create it" => run `mysql_upgrade` command which outputs:              root@1bbeb34f3491:/# mysql_upgrade     Looking for 'mysql' as: mysql     Looking for 'mysqlcheck' as: mysqlcheck     FATAL ERROR: Upgrade failed        * "Do you already have another mysqld server running on socket" => Nope. Running `service mysql stop` does nothing and running `ps` doesn't show `mysqld`. Running `ls -a /var/run/mysqld/` suggests that the socket file doesn't exist. No matter which MySQL container I try, eventually when I start MySQL the same error message came up. This almost certainly means there is something wrong with my setup which confuses me because I thought a Docker container, with no exposed ports or persistent storage, would be isolated from the system Docker is installed on? I have also tried running a MySQL container with the `-d` flag then running a fresh Ubuntu 14.04 container (`docker.io run -it --link mysql:mysql ubuntu:14.04 bash`) linked to it. On the Ubuntu container I installed mysql- client through `apt-get` and tried to connect to the MySQL container on the IP address in `MYSQL_PORT_3306_TCP_ADDR` but that doesn't work either. Equally the problem might be that I do not understand how Docker works. If this is the case, can someone create a set of steps that uses one of the MySQL containers on the Docker index and then link a container to it that can connect. This will also help to see whether there is something wrong with my Docker installation (or some other unknown problem that is causing this issue). My host system is running Ubuntu 14.04 and Docker was installed through `apt- get` and is version 0.9.1. I wasn't quite sure what to put in this explanation because the problem seems quite weird to me. If there is anything I have missed please ask and I will add it for you. **Edit** I have since upgraded Docker from 0.9.1 to 1.1.2 by these instructions: http://askubuntu.com/a/473720/89270. It has not fixed the problem.


Immediately kill MySQL

I have a shared server that someone has compromised Wordpress. Is there an easy way to kill MySQL. I am stopping the service but it is just sitting and waiting.... to stop               Shutting down MySQL (Percona Server)...........................


How can I find out what's seeding in Vuze if it's not listed anywhere in the application?

I use Vuze (formally known as Azuereus) for downloading torrents. But for some time now it's been seeding something that I can't see or find anywhere. It's not listed in any of the lists that are within the application, but the upload is showing 100% upload used(to the limit) but the upload in the lists are only a fraction of that. ![enter image description here](http://i.stack.imgur.com/78XIP.png)


How many lines of code are in this file?

I'm trying to figure out how many lines of code I have for files that end in *.pp                find . -name *.pp -type f  | wc -l       39      I know that I have 39 files, how can I figure out how many lines of code those 39 files contain?


Accounting for /proc/net/dev reported traffic

I noticed that according to /proc/net/dev I am constantly receiving around 6Kb/s on my wireless usb interface. But I can't account for anything even close to that with the individual connections that I get with iptraf, iftop, and nethogs. Investigations with netstat, lsof, and tcpdump didn't help either. So, what else could contribute to /proc/net/dev values? I can speculate that, while only IP based traffic is reported by the applications I mentioned, /proc/net/dev probably accounts for other link-layer/internet-layer stuff too (arp? icmp? wireless management stuff?). Or maybe other transport/application protocols. Can anyone confirm this? How else would you proceed to find out: through what sockets are the 6Kb/s coming through? What processes are receiving the traffic? * * * [EDIT] The 2 consistent results across all the tools:   1. the totals of Rx are around a few Kb/s      * confirmed with /proc/net/dev, dstat, bmw-ng, cbm, iptraf, ifstat, gnome-system-monitor   2. no connection/packet stream justifies that      * confirmed with netstat, tcpdump, iftop, nethogs, iptraf All of this with a Netgear WDNA 4100 wireless usb adapter using a custom driver from some git (the only way I got it to work). I asked the devs about it here. This might be malware, but I suspect the driver is simply reporting wrong totals. Nevertheless, I cannot explain what's going on for sure.


Backup server users creation

I have a RHEL server which acts as the web server for all the users (around 1000 users). Now, I have a backup script which backs up the data (all data inside `/home` folder) into an external HDD. This back up script is also in the `cron.daily` so that the backup will happen on a daily basis. ## Hypothetical situation Let us assume the RHEL web server crashed. I will build a new machine as a RHEL web server. I can paste the users' data that is already backed up in the external HDD into the new machine's `/home` folder. But for the **1000 users'** to access their home directories in this new machine, I need to create the 1000 users again. Is there a way I can save that data too from the existing machine before crash? I know `/etc/passwd` and `/etc/groups` will contain user related information. But if I save them, won't there be password issues?


Do I just need to include a .netrc file to have UNIX pick it up?

I have a .netrc with the following format in a directory using a bash terminal on OSX:               machine m...         login l...         password p...      I have chowned and cmoded the file like this, as suggested in this help file               $ chown myusername .netrc     $ chmod +600 .netrc      When I am in the directory, I issue the following command:               $ftp m...      Based on this tutorial (see section "useage of the .netrc") it seems like unix should automatically detect that there is a .netrc file in the directory when I type `ftp m..`, see that the .netrc gives credentials for machine . and pass them along to ftp. This is not happening. Instead, I see this output               Connected to server.domain.com     220 Microsoft FTP Service     Name (file.server.domain.com:My_OSX_Username): #I would expect it would pull my username off the .netrc file      Am I using the .netrc file incorrectly?


Finding all kinds of extensions referenced in a html file

Here is my problem statement : There is a folder with many html and text files. I need to recursively go through each one of them and find all kinds of file extensions referenced in these html/text files like .jpg, .tif, .png etc The problem is I don't have a defined list of the extensions I want to search for. What would be the best way to achieve this using a shell script ? Coming up with a Reg-ex which would essentially search for all occurrences of a dot followed by 3 or 4 letters, and filtering out the ones which end with a space or a comma, or a quote etc ?? Any suggestions would be helpful.


Automating minisat solutions

I'm a unix noob and need a simple (bash) script. I am solving SAT instances using minisat. The syntax is `minisat inputfile outputfile`. However, it only returns one solution. To find all solutions I have to append the negation of the first solution to the original instance and solve again until it is unsolvable. The output file looks like this:               SAT     1 -2 3 -4 5 -6 -7 0       So each natural number from one to whatever is either negated or unnegated followed by a 0. I need to multiply each number by -1 and append that (last) line (including the 0) to the end of `inputfile` and loop it until the first line of `outputfile` is `UNSAT`. Thanks for your help!


Run expect inside a bash script as another user

I am writing a bash script to install some small software I'm developing. That script is run with `sudo` (as root), but some of the commands that are executed by the script need (or should be) run with a regular user whose name I keep in the `$userName` variable. Most of the commands are one liners and `su -c "/what/ever/command" $userName` works good enough. However, one of those commands I don't want to run as `root` is going to ask me things (actually, only one thing, but many times: whether it should overwrite an existing file or not). That command which I may call "`baaad_command`" doesn't have any option to provide a default answer (there's no "`\--assume-no`" or anything like that). The only option I see feasible is using the expect command, and reply "`n\r`" every time the command outputs and string witch starts with "`Overwrite`", I want my script to reply no (meaning "`n\r`") as many times as baaad_command asks `"Overwrite... ? [y/n]"` I've tried many different combinations of su, spawn, expect... without any luck. This is my last try so far:               #!/bin/bash     if [[ -d "$destinationFolder" ]] ; then         if [[ -n "$userName" ]] ; then             spawned=$(su -c expect -c "                 spawn baaad_command --user \"foo\" --passwd \"bar\" \"$destinationFolder\"                  expect {                      Overwrite: { send \"n\r\"; exp_continue }                      eof { exit }                  }             " )         else             echo "Don't have a non-root username to install baaad_command with. Skipping"             exit 3         fi     else             echo "$destinationFolder directory not found in $(pwd). Can't continue"             exit 2     fi      It doesn't have any remarkable thing over the other 200 tries... just happens to be the last. Any hint will be very appreciated. Thank you in advance.


What are good document organization utilities?

I'm a graduate student and I have to deal with reading a lot of academic papers. I was wondering if there were any good utilities for linux for organizing documents (pdfs mostly) for reading. Having utilities that are open-sourced would be a plus.


playing a sound/notification in finch over ssh on my local machine

So I have `finch`, a command line chat client (think pidgin) running on a remote machine that I `ssh` into. `finch` has notification sounds and can run a command when certain events occur, letting you pass the sound file in as `%s`. e.g. `mplayer %s` from the remote machine, when the notification occurs, what kind of command could I run to play whatever `%s` is on my local machine?


To what does the byte sequence in this kerneloops (syslogd@hostname) message refer?

Message from syslogd@ROOROO at Mar 22 19:36:12 ...      kernel:[13988.165672] Oops: 0000 [#1] SMP           Message from syslogd@ROOROO at Mar 22 19:36:12 ...      kernel:[13988.169607] Stack:          Message from syslogd@ROOROO at Mar 22 19:36:12 ...      kernel:[13988.169607] Call Trace:          Message from syslogd@ROOROO at Mar 22 19:36:12 ...      kernel:[13988.169607] Code: 55 53 48 81 ec 88 00 00 00 48 8b af 28 03 00 00 65 48 8b 04 25 28 00 00 00 48 89 44 24 78 31 c0 8b 05 00 bb 07 00 48 89 7c 24 48 <4c> 8b 7d 08 c1 e8 15 83 e0 07 83 f8 03 76 43 48 8b 8d 78 02 00           Message from syslogd@ROOROO at Mar 22 19:36:12 ...      kernel:[13988.169607] CR2: 0000000000000008      I've been running my latest Debian testing netbook for about 2 months. This is the first kernel failure that has flooded my always-open terminal emulator. I am asking about the bytes that come after `Code:` and am just curious about what they may mean, and why they have flooded my terminal emulator as a normal user.


Terminal - copy from CLI without using mouse

While firing commands in CLI, **I want to copy the command I just fired** or anything I wrote in terminal and **paste it somewhere else** without using mouse. Like in following picture, I want to copy the update command (completely or partially) without using mouse and paste it somewhere. ![copy from CLI without using mouse](http://i.stack.imgur.com/4y4Q3.png)


Live Distros: UBCD boot Deft, Caine, and Tails from Custom Menu

I'm building my own UBCD and I'm using dual layer to fit 7.5Gigs * * * Useful resources for UBCD customization:   * The SYSLINUX Project   * UBCD Customize   * Casper Man Page   * Live Boot Man Page * * * Here's my `custom.cfg` file.               MENU INCLUDE /ubcd/menus/syslinux/defaults.cfg     UI menu.c32          LABEL -     MENU LABEL ..     CONFIG /ubcd/menus/syslinux/main.cfg          LABEL -     MENU LABEL Caine 5.0 January 17th, 2014     TEXT HELP      Read only system forensics. 64bit system required.     ENDTEXT     LINUX /ubcd/custom/caine/casper/vmlinuz     INITRD /ubcd/custom/caine/casper/initrd.gz     APPEND boot=casper splash          LABEL -     MENU LABEL Deft 8.1 April 10th, 2014     TEXT HELP      Digital Evidence & Forensics Toolkit. 64bit system required.     ENDTEXT     LINUX /ubcd/custom/deft/casper/vmlinuz     INITRD /ubcd/custom/deft/casper/initrd.lz     APPEND file=/ubcd/custom/deft/preseed/lubuntu.seed boot=casper iso-scan/filename=/ubcd/custom/deft.iso splash --          LABEL -     MENU LABEL SpinRite     TEXT HELP      Repair damaged Hard Drives with Steve Gibson's SpinRite.     ENDTEXT     LINUX /boot/syslinux/memdisk     INITRD /ubcd/custom/spinrite.iso     APPEND iso raw           LABEL -     MENU LABEL Tails 1.0.1 June 10th, 2014     TEXT HELP      The Amnesic Incognito Live System. i386     ENDTEXT     LINUX /ubcd/custom/tails/live/vmlinuz     INITRD /ubcd/custom/tails/live/initrd.img     APPEND boot=live config live-media=removable nopersistent noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 splash noautologin module=Tails iso-scan/filename=/ubcd/custom/tails.iso          LABEL -     MENU LABEL Tails (failsafe) 1.0.1 June 10th, 2014     TEXT HELP      The Amnesic Incognito Live System. i386     ENDTEXT     LINUX /ubcd/custom/tails/live/vmlinuz     INITRD /ubcd/custom/tails/live/initrd.img     APPEND boot=live config live-media=removable nopersistent noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 splash noautologin module=Tails noapic noapm nodma nomce nolapic nomodeset nosmp vga=normal iso-scan/filename=/ubcd/custom/tails.iso          LABEL -     MENU LABEL Tails 1.0.1 64bit June 10th, 2014     TEXT HELP      The Amnesic Incognito Live System. amd64     ENDTEXT     LINUX /ubcd/custom/tails/live/vmlinuz2     INITRD /ubcd/custom/tails/live/initrd2.img     APPEND boot=live config live-media=removable nopersistent noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 splash noautologin module=Tails iso-scan/filename=/ubcd/custom/tails.iso          LABEL -     MENU LABEL Tails 1.0.1 64bit (failsafe) June 10th, 2014     TEXT HELP      The Amnesic Incognito Live System. amd64     ENDTEXT     LINUX /ubcd/custom/tails/live/vmlinuz2     INITRD /ubcd/custom/tails/live/initrd2.img     APPEND boot=live config live-media=removable nopersistent noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 splash noautologin module=Tails noapic noapm nodma nomce nolapic nomodeset nosmp vga=normal iso-scan/filename=/ubcd/custom/tails.iso          LABEL -     MENU LABEL Ubuntu Rescue Remix 12.04 April 26th, 2012     TEXT HELP      Ubuntu system rescue utility disc.     ENDTEXT     LINUX /ubcd/custom/urr/casper/vmlinuz     INITRD /ubcd/custom/urr/casper/initrd.gz     APPEND boot=casper iso-scan/filename=/ubcd/custom/urr.iso splash --      SpinRite works and Ubuntu Rescue works with some keyboard recognition error noise (but keyboard entry works fine.) Side note: Ubuntu Rescue also works with the options `APPEND iso raw`, but then it loads the entire iso image into memory before booting. Caine, Deft, and Tails all don't find a live image to boot. Caine gets to some sort of sys mem prompt but keyboard input does nothing. Deft and tails get to a similar prompt initramfs. Both without the live image found, one of them doesn't respond to the keyboard and the other doesn't recognize it. Basically I need help with getting these systems to boot with the live images. Here's a tree of the directory structure under /ubcd/custom (with the Caine windows files cut out)               .     ├── caine     │   ├── autorun.inf     │   ├── boot.catalog     │   ├── casper     │   │   ├── filesystem.squashfs     │   │   ├── initrd.gz     │   │   └── vmlinuz     │   ├── EFI     │   │   └── BOOT     │   │       ├── BOOTx64.EFI     │   │       └── grubx64.efi     │   ├── isolinux     │   │   ├── isolinux.bin     │   │   ├── isolinux.cfg     │   │   ├── splash.png     │   │   └── vesamenu.c32     │   ├── ldlinux.sys     │   ├── syslinux.cfg     │   └── UFO.dat     ├── custom.cfg     ├── custom.lst     ├── deft     │   ├── casper     │   │   ├── initrd.lz     │   │   └── vmlinuz     │   └── preseed     │       ├── cli.seed     │       └── lubuntu.seed     ├── deft.iso     ├── spinrite.iso     ├── tails     │   └── live     │       ├── initrd2.img     │       ├── initrd.img     │       ├── vmlinuz     │       └── vmlinuz2     ├── tails.iso     ├── urr     │   └── casper     │       ├── initrd.gz     │       └── vmlinuz     └── urr.iso      I extracted out the vmlinuz and initrd files from the ISOs but tried to keep and mount the existing ISOs just like the working Ubuntu example. So the lines in the config I need help with are the LINUX/INITRD/APPEND lines for Caine, Deft, and Tails. If I have to repackage the ISOs into something else that's fine. I just need to make them work. If you need more specific error states I can try booting into them again.


Debian Wheezy can not use LDOCE5

I have installed LDOCE5 (Longman Dictionary of Contemporary English Edition 5) on Debian Wheezy 7.6 adm64, and I have installed `libc6` by the following method:               dpkg --add-architecture i386 # enable multi-arch     apt-get update     apt-get install libc6:i386 # install base 32bit libraries      Then I ran the command `./ldoce5` which returned the following error:               ./ldoce5-bin: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory      So, I tried the following:               $ locate libgtk-x11-2.0.so.0     /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0     /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.10      Then I constructed a link by               $ sudo ln -s /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0  .      followed by:               $ ./ldoce5     ./ldoce5-bin: error while loading shared libraries: libgtk-x11-2.0.so.0: wrong ELF class: ELFCLASS64      I guessed that it maybe do the work if I have successed in installing `ia32-libs-gtk-i386:i386` and `ia32-libs-i386:i386`, for I have tried this method successfully on Linuxmint Qiana. But when I tried to install the two packages, the result is of great trouble, for there are many dependence problems:               $ sudo apt-get install ia32-libs-i386:i386 ia32-libs-gtk-i386:i386     The following packages have unmet dependencies:      ia32-libs-gtk-i386:i386 : Depends: gtk2-engines-pixbuf:i386 (>= 2.20.1-2) but it is not going to be installed                            Depends: gtk2-engines:i386 (>= 1:2.20.1-1) but it is not going to be installed                            Depends: libcanberra-gtk-module:i386 (>= 0.24-1) but it is not going to be installed                            Depends: libcanberra-gtk0:i386 (>= 0.24-1) but it is not going to be installed                            Depends: libgail-common:i386 (>= 2.20.1-2) but it is not going to be installed                            Depends: libgail18:i386 (>= 2.20.1-2) but it is not going to be installed                            Depends: libgtk2.0-0:i386 (>= 2.20.1-2) but it is not going to be installed                            Recommends: libbonobo2-0:i386 (>= 2.24.3-1) but it is not going to be installed                            Recommends: libglade2-0:i386 (>= 1:2.6.4-1) but it is not going to be installed                            Recommends: libgnomecanvas2-0:i386 (>= 2.30.1-1) but it is not going to be installed                            Recommends: libidl0:i386 (>= 0.8.14-0.1) but it is not going to be installed                            Recommends: liborbit2:i386 (>= 1:2.14.18-0.1) but it is not going to be installed      ia32-libs-i386:i386 : Depends: libcups2:i386 (>= 1.4.4-7+squeeze1) but it is not going to be installed                        Depends: libcurl3:i386 (>= 7.21.0-2) but it is not going to be installed                        Depends: libgnutls26:i386 (>= 2.8.6-1) but it is not going to be installed                        Depends: libpulse0:i386 (>= 0.9.21-3+squeeze1) but it is not going to be installed                        Depends: libsdl1.2debian:i386 (>= 1.2.15) but it is not going to be installed      libsmbclient : Depends: libtdb1 (>= 1.2.7+git20101214) but it is not going to be installed     E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.      How could I have LDOCE5 work right on Wheezy?


How to uninstall BOOST 1.49 and install BOOST 1.54 in ubuntu?

I have a boost 1.49 in my ubuntu system. And I am trying to uninstall boost 1.49 and completely remove it from my system. And after that install the `Boost 1.54.0` I did like this to uninstall 1.49 from my system -               sudo apt-get --purge remove libboost-dev     sudo apt-get --purge remove libboost-all-dev      And after that when I do below command to see the version, it still says I have 1.49               cat /usr/include/boost/version.hpp | grep "BOOST_LIB_VERSION"     //  BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION     #define BOOST_LIB_VERSION "1_49"      Not sure why? And I tried installing Boost 1.54.0 version like this -               wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz/download     tar -xvzf boost_1_54_0.tar.gz     cd boost_1_54_0/     ./bootstrap.sh --with-libraries=atomic,date_time,exception,filesystem,iostreams,locale,program_options,regex,signals,system,test,thread,timer,log     sudo ./b2 install      But still it is not showing me boost 1.54.0 version installed? Any pointers how to remove BOOST 1.49 from my system and install BOOST 1.54 in my machine?


Script to send mail if there has been no entry in a log file for a certain amount of time

I am new to shell scripting. How would I write a script which can send an alert mail if there is no entry in the log file for more than 3 hours.


`grep -l .. | xargs vim` generates a warning, why?

If I run a command like               grep -rl test . | xargs vim      I get a warning "Vim: Warning: Input is not from a terminal." But I am still able to edit the files. Why the warning?


Midnight Commander, using date in User menu

I would like to use MC (midnight commander) to compress the selected dir with date in its name, e.g: `dirname_20131231.tar.gz` The command in the User menu is :               tar -czf dirname_`date '+%Y%m%d'`.tar.gz %d      The archive is missing because `%m`, and `%d` has another meaning in MC. I made an alias for the date, but it also doesn't work. Does anybody solved this problem ever?


rrdtool 1.4.7 compilation fail : glib-2.0/glib.h

I am trying to compile rrdtool from the source package. I don't use RPM packages, so don't ask me to install packages ;) I compile all the required software before rrdtool according to http://oss.oetiker.ch/rrdtool/doc/rrdbuild.en.html ./configure of rrdtool is OK. But when I do make I got the following error :                     CC     rrdcached-rrd_daemon.o     rrd_daemon.c:108:27: erreur: glib-2.0/glib.h : Aucun fichier ou dossier de ce type     rrd_daemon.c:246: erreur: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token     rrd_daemon.c: In function âadd_response_infoâ:     rrd_daemon.c:540: attention : implicit declaration of function âva_startâ     rrd_daemon.c:540: attention : nested extern declaration of âva_startâ     rrd_daemon.c:546: attention : implicit declaration of function âva_endâ     rrd_daemon.c:546: attention : nested extern declaration of âva_endâ     [...]      glib-2.0/glib.h exist in my system, in /usr/local/glib-2.34.0/glib/glib.h I set up env variable PKG_CONFIG_PATH which contain glib's path. /usr/local/glib-2.34.0/lib/pkgconfig/ I saw some topic about it but nothing for my case. Looking in config.log everything seems Ok!


How to get grub Ubuntu 12.04 to boot from secondary boot partition and use new seperate root

On a remote Ubuntu server I performed a series of upgrades/changes to go from a desktop-install _Ubuntu 10.10 Maverick_ to a server-install of _12.04 LTS Precise_ This all went well except a few hickups I got around, all the while without physical access -so far-. The next goal is to create a XEN server using LVM as backend storage. The system didn't have LVM on it, which I added once I got to 12.04 LTS. I know how to create a XEN machine of it remotely, done it before. But I have an issue trying to boot into the new configuration. The original person that installed this box didn't pay attention to the partitioning, the machine was used as a server but installed as desktop (this I fixed), but left me with this kind of partitioning scheme:               Disk /dev/sda: 500.0 GB, 499999834112 bytes     ...      Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1       58558   470361088   83  Linux     /dev/sda2           58558       60789    17916929    5  Extended     /dev/sda5           58558       60789    17916928   82  Linux swap / Solaris      So I took the huge 17G swap partition and reorganised it a bit into a fresh boot (now /dev/sda2), a small swap partition(/dev/sda3) and a new root (lvs). I got the diskusage down to about 3GB which is small enough and I copied that to a new root, which I created under LVM. Currently we have               Device Boot      Start         End      Blocks   Id  System     /dev/sda1            2048   940724223   470361088   83  Linux     /dev/sda2   *   940724224   941748223      512000   83  Linux     /dev/sda3       941748224   943845375     1048576   82  Linux swap / Solaris     /dev/sda4       943845376   976562175    16358400   8e  Linux LVM      /dev/sda1 is the _old boot partition_ and I want the machine to boot from /dev/sda2. The difference now is that I now want a seperate /boot and / partition. The root partions is know under LVM as :               # lvscan     ACTIVE            '/dev/server20/root' [10.00 GiB] inherit      The ultimate goal is that I want to bring /dev/sda1 under LVM control, but I have to boot the system in a way that it's not used. From there on, LVM will work. In addition to the whole filesystem changes above, I did: created logical volume:               pvcreate /dev/sda4      vgcreate server20 /dev/sda4     lvcreate -L 10G -n root server20     mkfs.ext4 /dev/server20/root      mounted it:               mount /dev/server20/root /mnt/root/     mount /dev/sda2 /mnt/root/boot/     (cd / ; find . -xdev -print0 | rsync -xavz . /mnt/root/)     for i in /dev /run /dev/pts /proc /sys; do sudo mount -B $i /mnt/root$i; done      update grub:               chroot /mnt/root     echo "dm-mod" >> /etc/initramfs-tools/modules     echo "dm-mod" >> /etc/modules     grub-mkconfig (verified config file visually)     update-grub (no errors/warnings)      Reviewed the created /boot/grub/grub.cfg I see most looks correct, especially stuff like:               insmod lvm     ...     set root='(server20-root)'     search --no-floppy --fs-uuid --set=root 0bb92c24-8c02-4fa3-8f75-970076261b2f     ...          menuentry 'Ubuntu, with Linux 3.2.0-38-generic' --class ubuntu --class gnu-linux --class gnu --class os {         recordfail         gfxmode $linux_gfx_mode         insmod gzio         insmod part_msdos         insmod ext2         set root='(hd0,msdos2)'         search --no-floppy --fs-uuid --set=root 891b3eaa-fb43-4a42-9789-a91c2a5ffb13         linux   /vmlinuz-3.2.0-38-generic root=/dev/mapper/server20-root ro quiet         initrd  /initrd.img-3.2.0-38-generic     }     ...      Then, checking blkid's:               /dev/sda2: UUID="891b3eaa-fb43-4a42-9789-a91c2a5ffb13" SEC_TYPE="ext2" TYPE="ext3"     /dev/sda4: UUID="IyDrfU-TOYT-rFXO-JknG-rwEK-Sm2A-mfKcIe" TYPE="LVM2_member"     /dev/mapper/server20-root: UUID="0bb92c24-8c02-4fa3-8f75-970076261b2f" TYPE="ext4"     /dev/sda1: UUID="888c061a-1d51-4516-aced-4bb21042d2f4" TYPE="ext4"     /dev/sda3: UUID="19efc041-eccd-42c9-94aa-5b6c88ffd5bb" TYPE="swap"      So, I understand from this is: my boot partition will be msdos2, that would be /dev/sda2 . Also referenced in the search line by uuid, even though it says root, I compaired it to other installs and that is meant as the boot uuid (correct assumption?) in case of a split root/boot. I really assumed this would work to reboot using the additional disk layout, but it didn't. I set both /dev/sda1 and /dev/sda2 bootable flag active using fdisk. It booted the same old way as before, without a hickup luckily. My deeper questions are probably sparked in misunderstanding using chroot + update-grub. I actually am not sure what I need to do on the root/boot /dev/sda1 . Do I have to copy the grub.cfg from the chrooted version to the /boot subdir or not ? Steps I took after the reboot now               switched off bootable flag on /dev/sda1     remounted everything again and performed all steps again plus an additional     grub-install /dev/sda  (from the chroot)      Will this be enough to disregard /dev/sda1 ? I read about everything on grub I could find but I fail to get answers on how the boot process goes in case of 2 boot partitions on the same disk. (lots of other cases). Can someone visualize the grub flow in regards to using a chroot vs using something alike _grub- install --boot-directory=/mnt/boot_ . How is this internally treated? Feel free to suggest better titles for this question, I'm very bad at that. Additionally , here's the MBR               dd if=/dev/sda of=mbr.bin bs=512 count=1     root@server20:/# file mbr.bin      mbr.bin: x86 boot sector;      partition 1: ID=0x83, starthead 32, startsector 2048, 940722176 sectors;      partition 2: ID=0x83, active, starthead 95, startsector 940724224, 1024000 sectors;      partition 3: ID=0x82, starthead 29, startsector 941748224, 2097152 sectors;      partition 4: ID=0x8e, starthead 167, startsector 943845376, 32716800 sectors, code offset 0x63


is it possible for DHCP to assign different IP addresses to the same machine?

I have install and configure a DHCP server on my centos6.5, it works properly and assign IPs to the clients Machines in my Network, and As I noticed when a client reconnect the dhcp reassign the IP that he already assign to this client my questions is:   1. Is it a possibility for DHCP to assign different IPs to the same machine   2. if it does that, how long he remember that he assigned this IP to this client(MAC)   3. if it doesn't, when the range is fully used, IS it a possibility for DHCP to assign an IP (that he remembered that it assign to a MAC) to another machine.   for example if client1 take 192.168.1.20 as an IP and then it disconnect and another client (client2) connect and the only IP left is 192.168.1.20, does the DHCP assign this IP to the new client(client2) or it keeps it to the old client(client1) and if it keeps it for How long ?


Dual boot Ubuntu with windows 8

I have Windows 8 and need to dual boot Ubuntu. I made a new partition from Windows Manager, but when I boot Ubuntu and select the new partition I get the error: > this partition is not rooted !! I'm trying to use Lucid Lynx. How do I dual boot Ubuntu with Windows 8 in a different partition?


Create a deb package from difference between two images

I am maintaining an Ubuntu server image as a development environment with several deployments. If my base image changes - install a package, modify conf files, etc - I am manually patching the new system, or selectively adding the deb files that I knew I added. It is a little tedious and I've missed some system files a couple times. Is there away to automate this? It seems like a common scenario but I can't find a solution. I was thinking something along the lines of taking the output of a rsync comparison and generating a deb install package based off these differences. I don't have any experience with either of these so I'd like to check to see if there is an 'off-the-shelf' solution first.


Is there a way to pass a variable from an awk statement to a bash function as an argument?

I am trying to look a for some specific values from (such as 1 or 4 and 2 or 3) a text file using an `awk` statement in a bash script. If this value is found in the file (within the `awk` statement), then I want to call a function from outside the `awk` statement and pass it the found value as an argument. My questions: (1) Is this possible? If so then how? (2) If it is not possible or there is a better way, then how? Note that I am skipping the first two lines of the text file when searching the file. I am using GNU AWK. Let me know if further explanation is required. **I apologize in advance for the cross-post but I did not get the answer I am looking for. file.txt               Name  Col1  Col2  Col3       -----------------------     row1  1     4     7             row2  2     5     8              row3  3     6     9       The actual `retrieve` functions are much more complex than in this simplified example. So I need to make a call to this function because I don't want to put this in the `awk` statement.               function retrieve {         if [[ "$1" == "1" ]]; then             echo "one beer on the wall"         elif [[ "$1" == "4" ]]; then             echo "four beers on the wall"         fi     }          function retrieve2 {         if [[ "$1" == "2" ]]; then             echo "two beers on the wall"         elif [[ "$1" == "3" ]]; then             echo "three beers on the wall"         fi     }          awk -F '\t' '         FNR < 2 {next}         FNR == NR {             for (i=2; i <= NF; i++)              {                 if (($i == 1) || ($i == 4))                     printf(%s, "'retrieve "$i" '")    # Here is the problem                      if (($i == 2) || ($i == 2))                     printf(%s, "'retrieve2 "$i" '")    # Here is the problem             }         }          ' file.txt


Linux: $SSH_CONNECTION is set even without SSHing to the server

I have a remote server and I am writing a script in the server and want it to fire only when I SSH. I thought of using the `$SSH_CONNECTION` and `$SSH_TTY` for this purpose. I found out that when I have not used ssh and instead used my VNC client to get into the server ( I have vnc running on my server), the terminals created within VNC still have these two environment variables set and `$SSH_CONNECTION` has same value in both cases. I found a workaround to do further filtering by `ps -o comm= -p $PPID` and see if parent process is sshd but I want to know why the variables are set


Find out if files in a folder exist under other name in other folder

_Possibly a little incorrect English ahead:_ There are at least 2 folders. For this, **A** contains files without extension, usually usernames, and **B** contains similar files, with '.yml' extension or possibly without extension, or even other extension, that's not always the case. How to find out if the files in the **A** folder exist in **B** , possibly under a different extension, without using scripting language such as Python ? It'd not be much of an issue for me to make a Python script, but for portability I'd prefer shell scripting, which I suck at. Not to mention I don't know all the commands. It's only good if this can be done in non-Linux systems too, particularly BSD. _**EDIT 0:_** The difference in name isn't always just the extension, the name could have characters before or after the same text. For example, if **A** had a file called `foobar`, it could be named `location_foobar` in **B**. Otherwise the name wouldn't be more different, like `foo1bar`, that's entirely different thing, so the script wouldn't be looking for such differences.


XMonad not launching xmobar

For some reason, my xmonad config won't launch xmobar, but it doesn't throw any errors, and the command `xmobar` launches it fine. Here is my `xmobar.hs`                import XMonad      import XMonad.Hooks.ManageDocks      import XMonad.Hooks.DynamicLog      import XMonad.Util.Run(spawnPipe)           main = do          xmproc <- spawnPipe "xmobar"          xmonad $ defaultConfig              { terminal    = "terminator"              , layoutHook = avoidStruts $ layoutHook defaultConfig              , manageHook=manageHook defaultConfig <+> manageDocks              , logHook = dynamicLogWithPP $ sjanssenPP { ppOrder = reverse }              , borderWidth = 1              }


Why does mencoder output still images if I try to encode them under 3 FPS, while mencoder outputs dynamic images if I output them at 3 FPS or over?

If I try...               mencoder mf://@NetSWLW12MA.txt -mf w=800:h=600:fps=1.5:type=png -ovc lavc     -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o NetSWLW12MA2.avi      I just get a bunch of still images of the first frame. if I try...               mencoder mf://@NetSWLW12MA.txt -mf w=800:h=600:fps=4:type=png -ovc lavc     -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o NetSWLW12MA2.avi      then I get mencoder to robustly play all the images. (there are 145 separate image frames contained in the txt file). Is there a way to put all 145 images as separate images in the mencoder file when I encode it at 1 FPS?


Changing the UID of files in /proc

In a follow up to this question about changing the `UID` of a user, it is recommended to change the ownership of **all files** on the system (this answer)               find / -uid 1000 -exec chown 5000 '{}' \+      where `1000` is the old `UID` and `5000` is the new one. I just listed all files (outside `/home/seb`) owned by `UID=1000` and found that most are in the `/proc` directory.               find / -uid 1000 \! -wholename '/home/seb/*'      Is it _save_ or _necessary_ to perform the suggested `UID` change? I'm not familiar with the purpose of these `/proc` files, but I assume they would be created as needed when I log in with the new user. Note: There are also some files in `/dev` owned by `UID=1000`, but those are just the terminals open by the user (e.g. `/dev/pts/23`)


How to save email sorted by date?

I seem to remember a patch to mutt that allowed to modify the path of the mailbox in mbox-hook in include the date. For example, you could have this:               mbox-hook Maildir +Archive/%y/%m/maildir      Which would save the emails in Archive/2011/12/maildir if they were send during December 2011. Anyone knows what it was called or if it still is supported? I seem to remember that there was an option in the BSD ports to enable it but cannot find it now. If not, does anyone know how I could achieve the same thing?


Debian 6 Squeeze - installing build-essentials - gcc / g++

The first thing to say is: "I am noob", so please be patient and don't laugh.. too much on me. I need to install c / c++ compiler and I heard that the best thing to do is to install gcc/g++ for that purpose (I think I don't have it on my machine).               maistora@maistora:~$ gcc --version     bash: gcc: command not found      I also read if I install build-essential the c/c++ compiler comes with it. So what I did is:               maistora@maistora:~$ sudo apt-get install build-essential     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      build-essential : Depends: libc6-dev but it is not going to be installed or                                 libc-dev                        Depends: gcc (>= 4:4.4.3) but it is not going to be installed                        Depends: g++ (>= 4:4.4.3) but it is not going to be installed     E: Broken packages      Then, I don't know why but I decided to install the dependencies one by one and started with the `libc6-dev` and this is the output:               maistora@maistora:~$ sudo apt-get install libc6-dev     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      libc6-dev : Depends: libc6 (= 2.11.2-10) but 2.13-21 is to be installed                  Depends: libc-dev-bin (= 2.11.2-10) but it is not going to be installed                  Recommends: gcc but it is not going to be installed or                              c-compiler     E: Broken packages      And the next thing I did is:               maistora@maistora:~$ sudo apt-get install libc6     Reading package lists... Done     Building dependency tree            Reading state information... Done     libc6 is already the newest version.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.      which seem very strange to me. But I'm sure that something basic for you. So, my question is - how can I install build-essentials on my Debian 6 Squeeze or any work-around to install gcc/g++. P.S. If I write `sudo apt-get install gcc` I will get to the beginning of my post and ending with `libc6 is already the newest version.` (hope I make my point clear). Thanks in advance.


Doing nmap on a network

I used nmap to scan all the ports in the hosts in a network by using the command:               $ nmap 172.31.100.0/24      What I found is that it showed the following in the result: > Nmap scan report for 172.31.100.0   >  Host is up (0.0039s latency).   >  Not shown: 998 closed ports   >  PORT STATE SERVICE   >  23/tcp open telnet   >  80/tcp filtered http What does `172.31.100.0` represent? Is it a specific interface or something else?


adjust zfs settings on freebsd 9

What's the proper way on FreeBSD 9 to tune ZFS parameters such as `vfs.zfs.arc_max` and `vfs.zfs.vdev.cache.size`? I've seen references to `/boot/loader.conf`, `/boot/kernel.conf` and `/etc/sysctl.conf` but I have none of those files.


Why does "wc -c" print a value of one more with echo?

When running               echo abcd | wc -c      it returns `5`.   But the word `abcd` is only 4 characters long. Is `echo` printing some special character after the word `abcd`? And can I prevent `echo` from printing that?