title: Virtualizing a Low End Virtual Server

text: I have started to teach the lesser fortunate children in my area about technology and computers in general. Some of them show some real promise and I'm planning to introduce them to Linux and Open Source. Now for practice's sake, I have dedicated my personal desktop and virtualized it (it's been built with standard commodity hardware). My question is, I had this idea to probably buy the $5 server from Digital Ocean or check out some good deals on Low End Box and probably purchase one such server and virtualize it. I would like to know the merits of this as I know they are already virtualized and running something like KVM on top of it sounds ludicrous but it was a thought I had. That way, the kids can access the machines from their school's lab whenever they want. May I know the community's thoughts on this? Or is there a better way to go about this?


title: can linux be configured to blink an LED (GPIO) on disk activity?

text: I'm hoping to blink an LED that is wired up to a GPIO line whenever the USB connected disk has activity is there an easy way to pull this off?


title: Port 80 refused by Linux (Ubunt 12.04)

text: I am having an issue I cannot seem to resolve. I am being refused only on port 80. However port 8080, and 22 (Tomcat and ssh) are available. I am pretty sure this is not an Apache thing, however I cannot be 100%. Temporarily I have disabled firewall to eliminate that via `sudo ufw disable`. Here are some of my outputs: **sudo iptables -L -n**               Chain INPUT (policy ACCEPT)     target     prot opt source               destination                   Chain FORWARD (policy ACCEPT)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination       **netstat -nao | grep 80**               tcp6       0      0 :::8080                 :::*                    LISTEN      off (0.00/0/0)     tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      off (0.00/0/0)     unix  3      [ ]         STREAM     CONNECTED     8180           **netstat | less**               Active Internet connections (w/o servers)     Proto Recv-Q Send-Q Local Address           Foreign Address         State           tcp        0     48 xx.xxx.xxx.102:ssh      67.xxx.xxx.4.ptr.:40726 ESTABLISHED     Active UNIX domain sockets (w/o servers)     Proto RefCnt Flags       Type       State         I-Node   Path     unix  5      [ ]         DGRAM                    7416     /dev/log     unix  3      [ ]         STREAM     CONNECTED     8181          unix  3      [ ]         STREAM     CONNECTED     8180          unix  2      [ ]         DGRAM                    10399         unix  2      [ ]         DGRAM                    6992          unix  3      [ ]         STREAM     CONNECTED     6959     /var/run/dbus/system_bus_socket     unix  3      [ ]         STREAM     CONNECTED     6958          unix  2      [ ]         DGRAM                    8942          unix  3      [ ]         STREAM     CONNECTED     6870     @/com/ubuntu/upstart     unix  3      [ ]         STREAM     CONNECTED     9273          unix  3      [ ]         STREAM     CONNECTED     8603     /var/run/dbus/system_bus_socket     unix  3      [ ]         STREAM     CONNECTED     8602          unix  3      [ ]         STREAM     CONNECTED     6754          unix  3      [ ]         STREAM     CONNECTED     6753          unix  3      [ ]         DGRAM                    8452          unix  3      [ ]         DGRAM                    8451          unix  3      [ ]         STREAM     CONNECTED     8418     @/com/ubuntu/upstart     unix  3      [ ]         STREAM     CONNECTED     8415       I even went so far as to purge and remove apache2 ... In hopes it would reset the listening on port 80. I really have no idea where else to go .. Does anyone have any suggestions where to look next? # EDIT OK .. So Apache is not starting .. Now to figure out why .. `/var/log/apach2/error.log` shows no errors since last server reboot, and here is the result of `configtest` **sudo apachectl configtest**               Syntax OK


title: ssh into a server using .ssh/config alias & run an alias on the server in the same time

text: ### On my laptop Inside `~/.ssh/config` file I have this:               Host <serverAlias>         HostName 127.0.0.1 #Server IP         User <username>         PreferredAuthentications publickey         IdentityFile ~/.ssh/id_rsa      ### On the server Inside `~/.bashrc` I have this alias:               alias runcomman="ls -al"      ### What I want to do is In my terminal I want to type `ssh <serverAlias> <something>` to ssh into the server & run the alias on the server. How can I do this?


title: How do I process the output of obexpushd?

text: I am using `obexpushd` to accept files from paired bluetooth devices. I need to extract the MAC addresses from the output of `obexpushd` to find out which file has been sent by which device. This information is available in the only verbose option `-n` which attaches the daemon to a terminal. Now, I have two questions:   * How do I process this output directly? (grep, sed)    * If possible, how do I redirect this to a file? I tried I/O redirection and pipes, but neither work. The output keeps being sent to the terminal. A solution **not utilising external tools** (that is, tools not present in default configuration) would be preferred. The OS is Raspbian Wheezy.


title: Caveats with Stdout/Stderr Redirection to Files?

text: I was thinking about having the programs that start on login output their stdout/stderr to files, so I can check the stdout/stderr for any of them if necessary. I also plan to overwrite the last log file instead of appending. Are there any negative side effects to doing this? My specific concern is unnecessary hard drive activity.


title: Fan control on Levono Thinkpad Edge S430 and Ubuntu 13.04

text: I'm trying to make my thinkpad's fan run on higher speeds because of overheating. I've enabled `fan_control` in `thinkpad-acpi` module, at least I think so:               $ cat /sys/module/thinkpad_acpi/parameters/fan_control      Y      However, it does not seem to respond to changes:               $ echo 'level 7' > /proc/acpi/ibm/fan      No error, but no reaction either. Any advice on how to proceed? Does it mean my thinkpad does not support fan control? Note that this question is NOT the same as that one - my `fan_control` is apparently on, and I do not get any `invalid argument` error when I'm trying to `echo` new level.


title: Which Linux distributions have highest install-base as of mid-2010?

text: Which Linux distributions have the most installed machines? What is the distribution in terms of distro, architecture, and version? e.g. Ubuntu vs. RHEL vs. SUSE vs. Fedora vs. CentOS vs. Arch vs. …   Ubuntu 8.04 vs. Ubuntu 9.04 vs. Ubuntu 10.04 vs. RHEL 3 vs. RHEL 4 vs. RHEL 5 vs. …   amd64 vs. i386 vs. ppc vs. ppc64 vs. ARM vs. …


title: What installer types should commercial software use to support Linux?

text: The source code in not open or free, so compilation at installation is not an option. So far I have seen developers that:   * provide a tar.gz file and it is up to user to uncompress in suitable location.    * provide a .tar.gz with an install.sh script to run a basic installer, possibly even prompting user for install options.    * provide RPM and/or deb files, allowing user to continue using the native package management tools they are familiar with to install/upgrade/uninstall.  Would like to support the most number of Linux distributions, make users' lives as easy as possible, and yet maintain as little build/packaging/installer infrastructure as possible too. Looking for recommendations on how to package my software.


title: How does the Linux kernel handle shared IRQs?

text: According to what I've read so far, "when the kernel receives an interrupt, all the registered handlers are invoked." I understand that the registered handlers for each IRQ can be viewed via `/proc/interrupts`, and I also understand that the registered handlers come from the drivers that have invoked request_irq passing in a callback roughly of the form:               irqreturn_t (*handler)(int, void *)      Based on what I know, each of these interrupt handler callbacks associated with the particular IRQ should be invoked, and it is up to the handler to determine whether the interrupt should be handled by it. If the handler should not handle the particular interrupt it must return the kernel macro `IRQ_NONE`. What I am having trouble understanding is how each driver is expected to determine whether it should handle the interrupt or not. I suppose they can keep track internally if they're supposed to be expecting an interrupt. If so, I don't know how they'd be able to deal with the situation in which multiple drivers behind the same IRQ are expecting an interrupt. The reason I'm trying to understand these details is because I'm messing with the kexec mechanism to re-execute the kernel in the middle of system operation while playing with the reset pins and various registers on a PCIe bridge as well as a downstream PCI device. And in doing so, after a reboot I'm either getting kernel panics, or other drivers complaining that they're receiving interrupts even though no operation was taking place. How the handler decided that the interrupt should be handled by it is the mystery. Edit: In case it's relevant, the CPU architecture in question is x86.


title: CentOS: Install packages listed in a text file?

text: I have an existing CentOS installation which I'd like to install extra packages to. The packages to be installed were supplied to me in a list, one package per line, which looks like:               ....     Cluster_Administration-en-US.noarch     ElectricFence.x86_64     GConf2.i386     GConf2.x86_64     GConf2-devel.i386     GConf2-devel.x86_64     Global_File_System-en-US.noarch     ImageMagick.i386     ...      Using this text file, is there a way to install every package listed? I suspect the list is actually a list of 'all' packages which could have been installed when the operating system was originally set up.


title: What other rules should I use to allow PPTP outbound connection?

text: I already allowed outbound connection to TCP/UDP port number 1723, but PPTP connection still fail to establish, If I allow all outbound connection, the tunnel will just go fine.


title: I am trying to parse data on two delimiters

text: So what I'm trying to do is for this: looking at the example CSV:               1,3917,3917,BGP=694|Ethernet=1610|LAG=3,Y      After the script is run, the output should look similar to:               1,3917,3917,BGP=694,Y     1,3917,3917,Ethernet=1610,Y     1,3917,3917,LAG=3,Y      One line of original CSV file that contained additional delimiters is now converted into 3 lines because there were three additional fields within the 4th column. I've been working on it all day and this is what I've come up with. Will it work? Code:                #!/usr/bin/ksh        if [ $# -ne 1 ];          then echo "Usage: read.sh filename";          exit 1;         fi        file="$1"        while read line          do            IFS='|'            set x $line            while [ a -le #$]              do                a=a+1                echo "`$1`,`$a`"              done          done < $1


title: Atomic repo to just update Ossec and not the rest is that possible for Centos 6.4?

text: I followed this link http://www.ossec.net/?page_id=19 and enable both epel and atomic repo to install ossec. My problem is I just want a local installation of ossec so I ran this yum install osssec-hids. Is this correct? Secondly now each time I do yum update I get a whole list of updates from atomic too which I am not dare to update but I just want it to update ossec only is that possible?


title: Attempt to test corruption of ZFS filesystem using dd fails

text: I'm trying to test error detection and recovery on a system with recently installed ZFS. I deliberately overwrite the start of one of the disks with dd but can't force any errors to be detected. Can I not use dd to do this? Or am I just not hitting any data? I've created mirrored zfs pool and copied some data to it:               $ zpool status       pool: zfspool      state: ONLINE       scan: scrub repaired 0 in 0h6m with 0 errors on Sun Dec  1 11:53:12 2013     config:              NAME                                          STATE     READ WRITE CKSUM         zfspool                                       ONLINE       0     0     0           mirror-0                                    ONLINE       0     0     0             ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4257356  ONLINE       0     0     0             ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4299344  ONLINE       0     0     0          errors: No known data errors      I then attempt to corrupt one of the the disks:               $ dd of=/dev/sdb if=/dev/zero bs=512 count=10000     10000+0 records in     10000+0 records out     5120000 bytes (5.1 MB) copied, 0.103375 s, 49.5 MB/s      and force a read of all data:               $ diff -qr /home/archive/ /zfspool/archive/      I would have thought this should have found the corruption on one of the drives, flag it as invalid and set the pool status to degraded but:               $ zpool status       pool: zfspool      state: ONLINE       scan: scrub repaired 0 in 0h6m with 0 errors on Sun Dec  1 11:53:12 2013     config:              NAME                                          STATE     READ WRITE CKSUM         zfspool                                       ONLINE       0     0     0           mirror-0                                    ONLINE       0     0     0             ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4257356  ONLINE       0     0     0             ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4299344  ONLINE       0     0     0          errors: No known data errors      Ok, let's scrub test it:               $ zpool scrub zfspool     $ zpool status           pool: zfspool          state: ONLINE           scan: scrub repaired 0 in 0h6m with 0 errors on Sun Dec  1 12:46:34 2013         config:                  NAME                                          STATE     READ WRITE CKSUM             zfspool                                       ONLINE       0     0     0               mirror-0                                    ONLINE       0     0     0                 ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4257356  ONLINE       0     0     0                 ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4299344  ONLINE       0     0     0              errors: No known data errors      Additional information requested by @rickhg12hs:               $ fdisk -l /dev/sda          WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     256 heads, 63 sectors/track, 121126 cylinders     Units = cylinders of 16128 * 512 = 8257536 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1      121127   976762583+  ee  GPT     Partition 1 does not start on physical sector boundary.     [17:37:26][root@zserver2:~]$ fdisk -l /dev/sdb          WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          [17:38:11][root@zserver2:~]$ mount     ...     zfspool on /zfspool type zfs (rw,xattr)     zfspool/archive on /zfspool/archive type zfs (rw,xattr)


title: Selectively build packages with dpkg-buildpackage

text: When you download source codes with `apt-get source` command, it usually consists of multiple packages, e.g the `eglibc` source package contains glibc- doc, libc-bin, etc. Now with `dpkg-buildpackage` command it builds all packages at once. So, can I selectively build the package I want, it's just slow building them all. Any ideas? I didn't find relevant stuff in the manual of dpkg-buildpackage


title: UTF-8 Characters in Byobu Screen Status Line

text: I'm running Byobu with Screen backend. I have a custom status script that wget's an RSS feed and shows the latest headline in it. If there are non-ASCII characters, they are not printed correctly. I've tried everything I could find Googling for properly enabling UTF-8 in Screen - all to no avail. I put together the sample script below that will demonstrate the problem. Does anyone know what I need to do to get Byobu/Screen displaying this correctly in the status line?               #!/bin/bash     SAMPLE=$(wget -q -O- "http://cnnespanol.cnn.com" | grep '<title>' | sed 's|.*<title>\(.*\)</title>|\1|' | head -n 1)     COLOR="= kr"     printf "\005{-}\005{$COLOR}$SAMPLE\005{-}\005{bw}"     echo      That script displays this text:               CNN en EspaÃ±ol: Ultimas Noticias de Estados Unidos, LatinoamÃ©rica y el Mundo, OpiniÃ³n y      Versions I am running:   * Linux: Mint 14.1 w/ Cinnamon   * byobu version 5.21   * Screen version 4.00.03jw4 (FAU) 2-May-06


title: Get return value of process by PID

text: If I have the PID of a process that was killed, how might I get the return status of the process? I am particularly interested to know if the return status was 143 (`kill`) or 137 (`kill -9`) as I don't know what is killing the process. It is a Python script being run from a PHP script on a server that I don't have root access for. The Python script runs for a few minutes, but PHP is limited to running for 30 seconds. PHP has facility to get the return status with `exec()` however that won't work if the PHP script has timed out!


title: red5 recorder set up on linux

text: Does anyone know how to set up this Red5 Recorder application on Red5 1 RC2 for Linux CentOS 6.4? NB: http://www.red5-recorder.com/ NOT CREATED BY RED5 server developers I followed set up of WEB-INF folder from this document http://fms.denniehoopingarner.com/newapp.html I can get to the swf mysite.net:5080/red5recorder/bin-debug but it is getting error because stuck in local rtmp url and looking in red5recorder.html there doesn't seem to be anywhere to input my url for rtmp. The installer just flashes and disappears. I don't see how even if I can edit URL, how I can get directory structure correct so it opens in red5recorder folder like the other apps in webapps folder. I need to use the installer provided but it just, as I said before, flashes and then goes.


title: Passwords for newly created users?

text: I am fairly new to Linux and I have question regarding users. When I use the `useradd` command I don't specify a password. I must use the `passwd` command afterwards. Does this mean that the user is disabled until it is done? I installed Postgresql with the `apt-get` command. Do I have to create a postgres-user and change ownership of the installed postgresql files? Or is this taken care of by the `apt-get`? I see that the owner of some of the files is already `postgres`. However, how do I run the server as `postgres`? I don't know the password. Trying to do `su postgres` fails because of authentication failure.


title: live dd over a mounted read-only root partiton

text: I'm trying to conceive a firmware update mechanism for a Linux-based embedded system without an additional initrd/initramfs/whatever. From within the running system which has a read-only mounted root I use dd to copy the new root image (residing on a secondary data partition). The problem is that half of the times I end up with a corrupted root filesystem. I don't get why this is happening, knowing that the partition is read-only and that I do a sync right before rebooting (I reboot by writing 'b' to /proc/sysrq-trigger). Someone please enlighten me.


title: gedit preferences grayed out

text: I'm using `gedit 2.28.4`, on `Centos 6.4`. When I click on `Edit > Preferences`, I can't modify anything, as everything is grayed out. Also, I could not re-size the preferences window to locate the 'Edit' button as suggested on other forums.


title: ifconfig command not found

text: I've just installed CentOS7 as a virtual machine on my mac (osx10.9.3 + virtualbox) .Running `ifconfig` returns command not found. Also running `sudo /sbin/ifconfig` returns commmand not found. I am root. The output of `echo $PATH` is as below.               /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/robbert/.local/bin:/home/robbert/bin      Is my path normal? If not, how can I change it? Also, I don't have an internet connection on virtual machine yet, maybe that's a factor.


title: Sed script inserting and appending in wrong place only in one particular place

text: I am trying to convert man pages to tex, and I keep getting               \item[      in the beginning of the file and               ] \hfill \\      After the part of the man pages where it shows ENV(1L). Everything else seems to be working. This is my tex.sed:               /^\<[A-Z]*[A-Z]/i \     \\item[          /^\<[A-Z]*[A-Z]/a \     ] \\hfill \\\\          1i\     \\documentstyle[11pt]{article} \     \\begin{document}               1i\     \\begin{center} {\\bf           1a\     \} \\end{center}               2i\     \\begin{description}          $a\     \\end{description}          $a\     \\end{document}               s/\\/\\verb\+\\\+/g     s/%/\\%/g     s/\^/\\\^/g     s/--/-\\hspace\{.01cm\}-/g          s/^+/ \\\\/     s/^-/ \\\\/      Here is env.ascii:               ENV(1L)               NAME           env - run a program in a modified environment          SYNOPSIS           env    [-]    [-i]    [-u   name]   [--ignore-environment]           [--unset=name] [name=value]... [command [args...]]          DESCRIPTION           This manual page documents the GNU version  of  env.   env           runs  a  command with an environment modified as specified           by the command line  arguments.   Arguments  of  the  form           `variable=value'  set the environment variablevariable to           valuevalue.  value may be empty (`variable=').  Setting a           variable to an empty value is different from unsetting it.                The  first  remaining  argument  specifies  a  program  to           invoke;  it is searched for according to the specification           of the PATH environment variable.  Any arguments following           that are passed as arguments to that program.                If  no command name is specified following the environment           specifications,  the  resulting  environment  is  printed.           This is like specifying a command name of `printenv'.          OPTIONS          -u, --unset name                  Remove  variable name  from the environment, if it                  was in the environment.               -, -i, --ignore-environment                  Start  with  an  empty  environment,  ignoring  the                  inherited environment.                The  long-named options can be introduced with `+' as well           as `--', for compatibility with previous releases.              Eventually  support  for  `+'  will  be removed, because it            is incompatible with the POSIX.2 standard.      And this is how I am compiling:               sed -f tex.sed env.ascii > env.tex      This is what my env.tex looks like:               \documentstyle[11pt]{article}      \begin{document}     \begin{center} {\bf      \item[     ENV(1L)     ] \hfill \\     } \end{center}     \begin{description}               \item[     NAME     ] \hfill \\           env - run a program in a modified environment          \item[     SYNOPSIS     ] \hfill \\           env    [-]    [-i]    [-u   name]   [-\hspace{.01cm}-ignore-environment]           [-\hspace{.01cm}-unset=name] [name=value]... [command [args...]]          \item[     DESCRIPTION     ] \hfill \\           This manual page documents the GNU version  of  env.   env           runs  a  command with an environment modified as specified           by the command line  arguments.   Arguments  of  the  form           `variable=value'  set the environment variablevariable to           valuevalue.  value may be empty (`variable=').  Setting a           variable to an empty value is different from unsetting it.                The  first  remaining  argument  specifies  a  program  to           invoke;  it is searched for according to the specification           of the PATH environment variable.  Any arguments following           that are passed as arguments to that program.                If  no command name is specified following the environment           specifications,  the  resulting  environment  is  printed.           This is like specifying a command name of `printenv'.          \item[     OPTIONS     ] \hfill \\          -u, --unset name                  Remove  variable name  from the environment, if it                  was in the environment.               -, -i, --ignore-environment                  Start  with  an  empty  environment,  ignoring  the                  inherited environment.                The  long-named options can be introduced with `+' as well           as `-\hspace{.01cm}-', for compatibility with previous releases.              Eventually  support  for  `+'  will  be removed, because it            is incompatible with the POSIX.2 standard.     \end{description}     \end{document}      **Note** The end result must be a `sed` script that correctly converts the man page to a `.tex` file. Please don't suggest answers with a different approach to the problem.


title: In UNIX, how to find the most commonly used commands in history of unix?

text: In UNIX, how to find the most commonly used commands in history?


title: Replace all files with identical hash

text: I want to replace all files in a target path with the same name as original.file AND the same hash as orignal.file with new.file. What's the command to do this? Say I have updated the contents of a file, and now I want all other copies of that file in a certain path to be updated as well. In most cases the following code would work:               find /target_path/ -iname "original.file" -exec cp new.file '{}'       However if **original.file** is readme.txt for example, many unrelated files would be overwritten.


title: What's the sudo equivalent for FreeBSD?

text: In pretty much any GNU/Linux distribution you use `sudo` or `su`, What's the right choice for FreeBSD 10 ?


title: Issues with ardour and jackd

text: I'm trying to play with ardour. When I started it up, it complained that jackd isn't running, so I ran `jackd -d alsa`, which displayed:               jackdmp 1.9.6     Copyright 2001-2005 Paul Davis and others.     Copyright 2004-2010 Grame.     jackdmp comes with ABSOLUTELY NO WARRANTY     This is free software, and you are welcome to redistribute it     under certain conditions; see the file COPYING for details     no message buffer overruns     no message buffer overruns     JACK server starting in realtime mode with priority 10     audio_reservation_init     Acquire audio card Audio0     creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit     Using ALSA driver HDA-Intel running on card 0 - HDA Intel at 0xfc320000 irq 44     configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods     ALSA: final selected sample format for capture: 32bit integer little-endian     ALSA: use 2 periods for capture     ALSA: final selected sample format for playback: 32bit integer little-endian     ALSA: use 2 periods for playback      It seems this didn't help much because running `ardour2` displayed the following:               WARNING: Your system has a limit for maximum amount of locked memory!              This might cause Ardour to run out of memory before your system runs              out of memory. You can view the memory limit with 'ulimit -l', and it              is normally controlled by /etc/security/limits.conf          Ardour 2.8.11        (built using 7387 and GCC version 4.4.5)     Copyright (C) 1999-2008 Paul Davis     Some portions Copyright (C) Steve Harris, Ari Johnson, Brett Viren, Joel Baker          Ardour comes with ABSOLUTELY NO WARRANTY     not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     This is free software, and you are welcome to redistribute it      under certain conditions; see the source for copying conditions.     loading default ui configuration file /etc/ardour2/ardour2_ui_default.conf     loading user ui configuration file /home/wena/.ardour2/ardour2_ui.conf     Loading ui configuration file /etc/ardour2/ardour2_ui_dark.rc     theme_init() called from internal clearlooks engine     ardour: [INFO]: Ardour will be limited to 1024 open files     loading system configuration file /etc/ardour2/ardour_system.rc     ardour: [INFO]: No H/W specific optimizations in use     librdf warning - Model does not support contexts     librdf warning - Model does not support contexts     librdf warning - Model does not support contexts     ardour: [INFO]: looking for control protocols in /home/wena/.ardour2/surfaces/:/usr/lib/ardour2/surfaces/     ardour: [INFO]: Control protocol Tranzport not usable     ardour: [INFO]: Control surface protocol discovered: "Mackie"     ardour: [INFO]: Control surface protocol discovered: "Generic MIDI"     powermate: Opening of powermate failed - No such file or directory     ardour: [INFO]: Control protocol powermate not usable     Cannot connect to server socket err = Connection refused     Cannot connect to server socket     jack server is not running or cannot be started      [ **note** ] These are native Debian packages.


title: umount: device is busy. Why?

text: When running `umount /path` I get:               umount: /path: device is busy.      The filesystem is huge, so `lsof +D /path` is not a realistic option. `lsof /path`, `lsof +f -- /path`, and `fuser /path` all return nothing. `fuser -v /path` gives:                                 USER        PID ACCESS COMMAND     /path:            root     kernel mount /path      which is normal for all unused mounted file systems. `umount -l` and `umount -f` is not good enough for my situation. How do I figure out why the kernel thinks this filesystem is busy? Edit: I have made a page with examples of all solutions so far here: http://oletange.blogspot.com/2012/04/umount-device-is-busy-why.html


title: Filtering invalid utf8

text: I have a text file in an unknown or mixed encoding. I want to see the lines that contain a byte sequence that is not valid UTF-8 (by piping the text file into some program). Equivalently, I want to filter out the lines that are valid UTF-8. In other words, I'm looking for `grep [ _notutf8_ ]`. An ideal solution would be portable, short and generalizable to other encodings, but if you feel the best way is to bake in the definition of UTF-8, go ahead.


title: How to specify printer paper size in mm instead of inches?

text: In eog (Eye of Gnome) 2.30.2, I found no way to specify size unit in mm in `Print...` and `Page Setup` dialogs: ![custom size dialog](http://i48.tinypic.com/2w4judz.png) So I have to convert these sizes in inches to sizes in mm. I'm using CUPS as the print backend. Should I configure CUPS to switch to use mm as the default size unit? The same problem occurred in Google Chrome 17.0 and many other applications, when I want to custom paper sizes in the system print dialog: ![system](http://i48.tinypic.com/drccd1.png)


title: How do I convert a TTA file and its CUE sheet into several FLAC files?

text: I have a sound file encoded in TTA format and a CUE sheet with its metadata. Which tools and commands do I need to convert it and split it into several FLAC files? I tried using ffmpeg to convert the TTA file into a FLAC but it shows a "CRC error" and the resulting file has the wrong duration. The TTA file itself plays fine in VLC.


title: Automatic Update Script using Cron, Exit Codes, and Logging

text: I'm managing multiple machines running Debian, Raspian, and Mint. On some of the machines I want to have updating and upgrading automatically. I've drafted a script that I want to do this and log if the update are successful or not.               #!/bin/bash          captains_log=/home/jason/mission_control/captains.log          apt-get update;     if [ $? == 0 ]; then         apt-get upgrade -y;         if [ $? == 1 ]; then             echo `date`": Daily update failed" >> $captains_log         else             echo `date`": Daily update successful" >> $captains_log         fi     else         echo `date`": Daily update failed" >> $captains_log     fi      I've set the script to run `@daily` in a root `crontab`. I run the command manually and it executes as desired. When `cron` runs the script, I get success in the log but my software is not getting updated. Can someone tell me where I'm going wrong?


title: Test if a file is on NFS?

text: Is there a simple test to determine if a file is on an NFS mount? (Or maybe more generally, what type of filesystem a file lives on?) I am imagining some ugly prefix matching against fstab...


title: Hard drive making strange sound

text: It sounds like the HDD is put into a power saving/sleep mode, spun down, but immediately started up again, and then this repeated 3-4 times, very quickly.   How could I find out what this exactly is, and what causes it?


title: New user with root access in Linux Debian

text: I've created a new user by using "User Accounts" in "System Settings". How do I grant rights so that this new user can have the same level of access as root?


title: see all commands/logs of screen in linux

text: Let us say I run               screen -R myscreen.      Then, I run commands on `myscreen` that are bigger than my monitor size so I end up loosing the visibility of the first commands I run. Then, I do `Ctrl`+`d` to leave the screen. Now I want to see all the commands I ran in `myscreen`. How would I do that? How would I see all the history in `myscreen`? If I do `screen -R myscreen` I am attaching `myscreen` but I can only see the latest commands but they are truncated by the size of my actual monitor and I don't know how to navigate up...


title: Recursive umount after rbind mount

text: When entering a chroot is sometimes necessary to mount /sys and /dev using -rbind instead of -bind in order to insure everything is in it's right place when somebody goes looking. The problem comes when unmounting. A simple umount always fails; with the children being mounted as well it appears to be in use:               $ umount /mnt/chroot/sys     umount: /mnt/chroot/sys: device is busy.         (In some cases useful info about processes that use          the device is found by lsof(8) or fuser(1))      Another possible solution is to list the mounts from proc, and umount each of those like so:               $ grep /mnt/chroot/sys /proc/mounts | cut -f2 -d" " | sort -r | xargs umount      However this fails as well because the recursive mounts are not actually registered in the mtab:               /mnt/chroot/sys/kernel/security is not mounted (according to mtab)      Perhaps the solution is to perform a lazy umount, but this seems pretty dangerous to me. Is there a better way to do this that I've missed?


title: Launch Picasa under CrunchBang Waldorf

text: I succesfully installed Picasa 3.9 under Crunchbang following this webupd8-tutorial. I also installed `libwine-cms:i386`. Everything works well and Picasa launches after installation. The problem: once I close it, I cannot get it to relaunch. I tried the following and neiither works:   * `picasa`   * `Picasa`   * `Picasa39`   * `wine picasa`   * `wine Picasa39` On the wine-commands I get `wine: cannot find L"C:\\\windows\\\system32\\\picasa.exe"`, so I tried copying the .exe from "Program Files" to 'system32' but that also does not work.


title: case sensitive substitution; same target ids

text: I am struggled myself to make a case sensitive replacement in a text file. Please find below a segment of my sed file that I am running as sed -f file.sed < input.txt > output.txt                s/\<code_229633_13\>/R77_08349T0/      s/\<code_229633_138\>/R77_09738T0/      s/\<code_230519_10\>/R77_04813T0/      s/\<code_230519_1\>/R77_13591T0/      s/\<code_230519_13\>/R77_05463T0/      up to line 14521....      The code is working great **but** I have also cases where I have 2 or more TARGET ids (code_010512_23 and code_299097_0) ovelapping the same REPLACEMENT id (R77_14520T0) and I would like to have as output something like R77_14520T0.a and R77_14520T0.b (lines 1 and 2 below)               s/code_010512_23/R77_14520T0/ --> R77_14520T0.a     s/code_299097_0/R77_14520T0/ --> R77_14520T0.b      **Furthermore, a more complex but similar case is when i have the following input file (input2.txt file)** :                 ID=gene09464;Name=code_229633_13;isoforms=1                  ID=mRNA10661;Parent=gene09464;Name=code_229633_13                ID=exon26192;Parent=mRNA10661;Name=code_229633_13;Target=R77_08349T0  1   1093    +       ID=exon26193;Parent=mRNA10661;Name=code_229633_13;Target=R77_08349T0  1094    1873    +            ID=gene09491;Name=code_229633_138;isoforms=1                 ID=mRNA10690;Parent=gene09491;Name=code_229633_138                   ID=exon26252;Parent=mRNA10690;Name=code_229633_138;Target=R77_09738T0 1   411 +            ID=gene09513;Name=code_230519_10;isoforms=1                  ID=mRNA10715;Parent=gene09513;Name=code_230519_10                ID=exon26311;Parent=mRNA10715;Name=code_230519_10;Target=R77_04813T0  1   59  +       ID=exon26312;Parent=mRNA10715;Name=code_230519_10;Target=R77_04813T0  60  186 +            ID=gene09511;Name=code_230519_1;isoforms=1                   ID=mRNA10713;Parent=gene09511;Name=code_230519_1                 ID=exon26308;Parent=mRNA10713;Name=code_230519_1;Target=R77_13591T0   1   1075    +       ID=exon26309;Parent=mRNA10713;Name=code_230519_1;Target=R77_13591T0   1076    1128    +            ID=gene09514;Name=code_230519_13;isoforms=1                  ID=mRNA10716;Parent=gene09514;Name=code_230519_13                ID=exon26316;Parent=mRNA10716;Name=code_230519_13;Target=R77_05463T0  1   219 +            ID=gene00865;Name=code_010512_23;isoforms=1                  ID=mRNA00979;Parent=gene00865;Name=code_010512_23                ID=exon02477;Parent=mRNA00979;Name=code_010512_23;Target=R77_14520T0  1   143 +            ID=gene14561;Name=code_299097_0;isoforms=2                   ID=mRNA16419;Parent=gene14561;Name=code_299097_0                 ID=exon39828;Parent=mRNA16419;Name=code_299097_0;Target=R77_14520T0   144 193 +       ID=mRNA16420;Parent=gene14561;Name=code_299097_0                 ID=exon39828;Parent=mRNA16420;Name=code_299097_0;Target=R77_15554T0   408 457 +      and I need **to apply the replacements with the same as the previous way only on the lines which contain the word "isoforms", in other words in lines 1,6,10, 15,20, 24 and 28 and nowhere else in the text.** The format of this input file would be exactly as depicted with blank lines among the "isoforms" lines. My desired output                ID=gene09464;Name=R77_08349T0;isoforms=1                 ID=mRNA10661;Parent=gene09464;Name=code_229633_13                ID=exon26192;Parent=mRNA10661;Name=code_229633_13;Target=R77_08349T0   1   1093    +      ID=exon26193;Parent=mRNA10661;Name=code_229633_13;Target=R77_08349T0   1094    1873    +      ID=exon26194;Parent=mRNA10661;Name=code_229633_13;Target=R77_08349T0   1874    4065    +           ID=gene09491;Name=R77_09738T0;isoforms=1                 ID=mRNA10690;Parent=gene09491;Name=code_229633_138               ID=exon26252;Parent=mRNA10690;Name=code_229633_138;Target=R77_09738T0  1   411 +           ID=gene09513;Name=Target=R77_04813T0;isoforms=1                  ID=mRNA10715;Parent=gene09513;Name=code_230519_10                ID=exon26311;Parent=mRNA10715;Name=code_230519_10;Target=R77_04813T0   1   59  +      ID=exon26312;Parent=mRNA10715;Name=code_230519_10;Target=R77_04813T0   60  186 +      ID=exon26313;Parent=mRNA10715;Name=code_230519_10;Target=R77_04813T0   187 678 +      ID=exon26314;Parent=mRNA10715;Name=code_230519_10;Target=R77_04813T0   679 1399    +      ID=exon26315;Parent=mRNA10715;Name=code_230519_10;Target=R77_04813T0   1400    1402    +           ID=gene09511;Name=R77_13591T0;isoforms=1                 ID=mRNA10713;Parent=gene09511;Name=code_230519_1                 ID=exon26308;Parent=mRNA10713;Name=code_230519_1;Target=R77_13591T0    1   1075    +      ID=exon26309;Parent=mRNA10713;Name=code_230519_1;Target=R77_13591T0    1076    1128    +           ID=gene09514;Name=R77_05463T0;isoforms=1                 ID=mRNA10716;Parent=gene09514;Name=code_230519_13                ID=exon26316;Parent=mRNA10716;Name=code_230519_13;Target=R77_05463T0   1   219 +           ID=gene00865;Name=R77_14520T0.a;isoforms=1               ID=mRNA00979;Parent=gene00865;Name=code_010512_23                ID=exon02477;Parent=mRNA00979;Name=code_010512_23;Target=R77_14520T0   1   143 +           ID=gene14561;Name=R77_14520T0.b;isoforms=2               ID=mRNA16419;Parent=gene14561;Name=code_299097_0                 ID=exon39828;Parent=mRNA16419;Name=code_299097_0;Target=R77_14520T0    144 193 +      ID=mRNA16420;Parent=gene14561;Name=code_299097_0                 ID=exon39828;Parent=mRNA16420;Name=code_299097_0;Target=R77_15554T0    408 457 +


title: "Tuning" tr and sed expression

text: I have MD5 file which lists filename and MD5 sum in the following way:               MD5 (file14n0001.xml.gz) = 04eb2524d271077ec8f1a0021779b171     MD5 (file14n0002.xml.gz) = 07e2b29645e9211cce9daf1ae27e7b99     MD5 (file14n0003.xml.gz) = c31cca187a32743441868822b02d83aa      I need to parse out only filename and MD5 sum; for example, the desired output is:               file14n0001.xml.gz 04eb2524d271077ec8f1a0021779b171     file14n0002.xml.gz 07e2b29645e9211cce9daf1ae27e7b99     file14n0003.xml.gz c31cca187a32743441868822b02d83aa      My tr (augmented with sed) expression is:               tr -d 'MD5() ' | sed 's/=/ /g'      But tr part of the expression also delete all 5s in lines so the output is               file14n0001.xml.gz 04eb224d271077ec8f1a0021779b171     file14n0002.xml.gz 07e2b2964e9211cce9daf1ae27e7b99     file14n0003.xml.gz c31cca187a32743441868822b02d83aa      I kindly ask for a pointer how to proceed.


title: Vagrant-lxc container not starting

text: Firstly I'd like to say that I'm new to LXC and I may have some problems getting the right idea of how the things should work. The thing is I'm trying to start a previously download vagrant-lxc box that holds an Ubuntu 12.04 x32. My development PC is running Ubuntu 13.10 x64 and lxc 1.0.0.alpha1 installed from the Ubuntu official repositories. When I run vagrant up --provider=lxc I'm always getting               There was an error executing ["sudo", "lxc-create", "--template", "vagrant-tmp-lxc-test_default-1393431786", "--name", "lxc-test_default-1393431786", "-f", "/home/ccvera/.vagrant.d/boxes/lxc-ubuntu-12.04/lxc/lxc.conf", "--", "--tarball", "/home/ccvera/.vagrant.d/boxes/lxc-ubuntu-12.04/lxc/rootfs.tar.gz", "--auth-key", "/opt/vagrant/embedded/gems/gems/vagrant-1.3.5/keys/vagrant.pub"]      I might be making a dumb error here so my questions are: 1- Is there any problem running a box of x32 container inside a x64 host using LXC? 2- Is there any problem running a box with a different Ubuntu version (Kernel version) that the host machine does? In may case (Ubuntu 12.04 (kernel 2.6) vs Ubuntu 13.10 (kernel 3.11)) 3- In the case that 1, 2 do not apply, then, how can I figure out what's the problem? prep-ending VAGRANT_LOG=DEBUG didn't make the trick, it just shows the above errors many times. 4- In the case that 1 or 2 do apply, then, how can I overcome the situation?, I need fast and well performance on test virtual machines, (so I think I need containers), but it is no feasible to me that the developers should have the same OS as the testing VMs


title: How to make tab insert spaces in pico?

text: Most text editors have a setting for converting tabs to spaces. How would this be done in pico?


title: Start/stop program from website

text: I have some users on my machine that I allow to run small Mumble voice servers. I would like for them to be able to start/stop their voice server from a website (being ran by Apache). With the current set up, I have each server being run as a different user (the person's specific user account). What I can't figure out is the best way to start/stop the server without delay. Currently, I have the website make an entry into a database whenever they want to start/stop their service. Then, I have a cron script that runs every minute look in the database for these starts/stops. That cron script will switch to the users account and run the server as that user. My issue with this is that it can take up to around 1 minute for the action to happen. Is there a more responsive way to accomplish this?


title: Removing non-printable characters using POSIX sed

text: Files created with `roff` and other "old-school" tools (for example man pages on many Unix systems) generate bold and underlined text in minimalistic terminals using tricks involving non-printable ASCII characters like "half- backspace" `^H` to obtain bold and underlined text, for example:               b^Hbo^Hol^Hld^Hd and _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^He_^Hd      If I wish to convert this into the human readable plain text `bold and underline` (ignoring the formatting), I can easily achieve this in `vim` using something like `:%s:\\(.\\)\b\1:\1:ge | %s:_\b\\(.\\):\1:ge`. I can also pipe the text through `tr -dc` and use some of perl's regex magic to look for words that are built entirely of pairs of repeated characters. However, this looks like something that plain `sed` should be able to handle, which would make it much cleaner to use in scripts. > **Question:** Is it possible to do this translation _only_ using POSIX > `sed`, i.e. without using GNU or BSD extensions? What's giving me trouble here is only the non-printable character `^H` (ASCII #8). There's a trick mentioned in Bruce Barnett's Sed - An Introduction, but somehow I was unable to get it to work.


title: How to restart Alsa/PulseAudio after using Jack

text: After I use Jack, the PulseAudio outputs and inputs are replaced by a dummy device. I've tried to kill PulseAudio and reload Alsa, but the only way I can use an Alsa-based application again is to reboot. I know that there must be a way to fix the problem without rebooting. I have had this problem in multiple Linux distros, including Ubuntu and currently Fedora 19. Output of `service alsa-utils restart`:               Redirecting to /bin/systemctl restart  alsa-utils.service     Failed to issue method call: Unit alsa-utils.service failed to load:     No such file or directory. See system logs and 'systemctl status     alsa-utils.service' for details.      And `systemctl status alsa-utils.service`:               alsa-utils.service        Loaded: error (Reason: No such file or directory)        Active: inactive (dead)      `alsactl kill quit` and `alsactl init` proceed with no errors.


title: Stacked filesystems with write-back

text: I need to setup a system where a laptop and a desktop computers coexist.   The idea is, I bring the laptop into the network and the laptop syncs the /home directory( with some exceptions) with the desktop computer, then the desktop computer mounts a stack with his copy of /home on top and the laptop copy(nfs) in the bottom. So, obviously I don't need a write-through strategy, a write-back with a quite big cache solution would suit me way better. I've been reading on unionfs and aufs and others but I either don't understand how or I can't do this with those fs. Any ideas?


title: varnish configtest

text: Is there a way to check varnish configuration syntax without actually using the new version? I'm searching for a native varnish equivalent of `apache2ctl configtest`


title: Find files starting with ~$ (MicroSoft Word Temp files)

text: For some reason my machine is full of M$ Word temporary files such as:               ~$Filename.docx       ~$AnotherFile.docx      Can someone suggest a find/regex command to search $HOME and delete them?


title: What happened to my desktop?

text: I have Linux Mint 12 Gnome desktop, everything was normal yesterday. I shut my PC down yesterday and went to sleep, I turned it on today, and see what happened ![enter image description here](http://i.stack.imgur.com/7ejt8.png) You see how everything is messed up? The desktop normally should look like this. I tried to switch between the Gnome classic and the Gnome classic (no effects), but it make no difference, there are the only themes that i have. When I press restart, it logs me out, it does not restart. I shut it down and turned it on again but there's no difference. **EDIT** I have been told that this is Gnome Fallback mode, which is forced on you when your graphics card driver doesn't have the needed 3D acceleration support. This happens mostly with discrete graphics cards with proprietary drivers. the output of `inxi -Gxc 0` is               Graphics: Card: nVidia G86 [GeForce 8500 GT] bus-ID: 01:00.0      X.Org 1.10.4 drivers nouveau unloaded: fbdev,vesa Resolution 1024x768@60.0hz      GLX Renderer Gallium 0.4 on NV86 GLX Version 2.1 Mesa 7.11 Direct Rendering Yes      **Update** i updated nvidia, now the output is this               Graphics: Card: nVidia G86 [GeForce 8500 GT] bus-ID: 01:00.0      X.Org 1.10.4 drivers nvidia unloaded: fbdev,vesa,nouveau Resolution 1024x768@50.0hz      GLX Renderer GeForce 8500 GT/PCIe/SSE2 GLX Version 3.3.0 NVIDIA 295.33 Direct Rendering Yes      the error is not fixed


title: Removing a long string from php files - using grep and sed?

text: I have encountered some malware on my Linux server, and am trying to remove it from many php files. I've tried endlessly with grep | sed and grep | tr and couldn't even erase a simple text string, getting different errors. When trying:               grep -l '@error' * | xargs -0 sed -i 's/error/nothing/g'         I receive an error message: > can't read _filename_.php Using Terminal on Mac - maybe it's an OSX syntax problem? My final task is to delete a long string of code from all the files - one that includes some $,!,?,<,>,\," symbols - will I need to backslash them?


title: #!/bin/bash - no such file or directory

text: I've created a bash script but when I try to execute it, I get               #!/bin/bash no such file or directory      I need to run the command: `bash script.sh` for it to work. How can I fix this?


title: Shell Script Output not written to file properly

text: I tried to put the output of my program into a text file. It appends the echo commands to the file properly, but the imagemagick "compare" command is not appended to the file. It just STOUD's the "PSNR value", which is returned by compare method into terminal. Is there a way to append this commands output to the textfile too? Also if I call my script just with "./script.sh > test.txt" it doesn't print anything more than the echos to file and compare results to terminal. Here's a part of my code:               ls images/toconvert/ > lsout.txt          while read LINE     do         echo ====================== $LINE ==================== >> psnrdiff.txt         echo Jpeg2000 >>  psnrdiff.txt         compare -metric PSNR images/toconvert/$LINE images/converted/$LINE.jp2 images/psnrDiffs/$LINE.jp2.png >> psnrdiff.txt     done < lsout.txt


title: How to find out which file is currently written by a process

text: My situation is that from time to time a specific process (in this case, it's Thunderbird) doesn't react to user input for a minute or so. I found out using `iotop` that during this time, it writes quite a lot to the disk, and now I want to find out which file it writes to, but unfortunately `iotop` gives only stats per process and not per open file(-descriptor). I know that I can use `lsof` to find out which files the process has currently open, but of course Thunderbird has a lot of them open, so this is not that helpful. `iostat` only shows statistics per device. The problem occurs only randomly and it might take quite some time for it to appear, so I hope I don't have to strace Thunderbird and wade through long logs to find out which file has the most writes.


title: Automatically hide Linux Mint notification bar after timeout

text: It seems like the notification bar on the bottom of the desktop in Linux Mint 12 never hides unless I click N+1 times on it first (N being the number of messages). Since it's overlaid over all windows (even fullscreen video) it's a bit annoying. Right- and left-clicking the notification bar does not bring up any settings dialog, so I'm wondering how to either automatically **hide messages after a timeout** , _disable_ the display of _certain messages_ (I don't need to know about external disks which are plugged in at boot time), or (if all else fails) _disable the notification bar altogether_.


When I run git-sh from my terminal it works fine. But I get the following warning.               bash: export: `--wait': not a valid identifier      What is this and how do I get rid of it?


title: perl one liners + print line if match last word but with space

text: The following perl syntax will print the line in case line was ended with "DUPLEX" But Sometimes DUPLEX have one space or more as                  "DUPLEX    "       so in this case line will not printed Please advice what I need to add in my perl syntax in order to print the line that ended with the word - DUPLEX in spite there are some spaces after the word "DUPLEX"               perl -ne "print if /DUPLEX$/" file      .               more file          VAL=18327 FULL DUPLEX     VAL=782      HALF


title: Is there any IP messenger for Linux (CentOS)?

text: Currently am using a Linux (CentOS) machine. Is there any IP messenger for CentOS like iptux and Gnome IP Messenger?


title: Other acl manipulation executables than getfacl/setfacl?

text: I am familiar with setfacl/getfacl. However, I am wondering if there are any other executables/packages that maintain similar functionality with regards to manipulating acl. I am not looking for anything in particular, I am trying to contemplate the entire scope and logic of acl manipulation to get a complete picture of what is happening and what would be useful. Examples of interesting behavior:   1. When a named group has been assigned, subsequent executions of chmod with regards to the owning group (ie chmod g+/-?) manipulate the acl's mask as opposed to the unnamed acl entry for the owning group. Perhaps this is a peculiarity of the setfacl/getfacl implementation and a different API provides different behavior.    2. Assignment of permissions cannot be done by appending permissions, eg: setfacl -m g:1:+rw.    3. Assignment cannot be done for all entities of a type, eg: setfacl -m g:*:perms


How do I can get the size of a file in a bash script? How do I assign this to a bash variable so I can use it later?


title: CIFS VFS: Unexpected SMB signature

text: When I login to server in Text mode the following Message appearing on one of Server CIFS VFS: Unexpected SMB signature We are using Redhat 5.6 64 bit. Is this serious error and how to resolve this.


title: Text files with sections in common with a given file

text: I need to maintain a set of plain text files saved in a directory which all have a section taken from another file. An example follows: Files:               /directory/textfile1 (every other file in the directory needs to "include" the                           full contents of this file, each file can do so at a                           different starting position; this file changes often      )     /directory/textfile2 ("includes" textfile1 after a few lines from the top       )     /directory/textfile3 ("includes" textfile1 as a header                          )     /directory/textfile4 ("includes" textfile1 as a footer                          )      Upon changing textfile1, I would like filesystem reads hitting textfile{2..4} to return updated versions with the new content from textfile1. On web servers, this would be solved with the traditional server side include directives. Now, how would I do that without running a front-end service? Could I create a symlink that, rather than pointing to another inode, runs some custom code and presents stdout as the contents of the file, somehow like defining custom "reparse points"? The hypotetical "symlink" would, for instance, run this for file textfile3:               cat /directory/textfile1 /directory/textfile3_static      and thus simulate the existence of a static file whose content depends on textfile1. I am looking for a solution that uses the least amount of customisation, not writing a custom FUSE module for a special mount point or anything like that. I may be thinking in the wrong direction here, perhaps it would be easier to trigger an update script replacing placeholders at every modification of textfile1? How could one trap that event without polling for it? Here some sample text files: Contents:               /directory/textfile1:     --------------------------------------------------------------------------------     Ferma non stai sei come un ciclone     e non dormi mai     --------------------------------------------------------------------------------          /directory/textfile2:     --------------------------------------------------------------------------------     Juny tu hai un cervellone     quasi tutto sai     Ma quando fai un'invenzione     sono sempre guai     Ferma non stai sei come un ciclone     e non dormi mai     Il centauro Nico ami già     ma lui forse non lo sa     --------------------------------------------------------------------------------          /directory/textfile3:     --------------------------------------------------------------------------------     Ferma non stai sei come un ciclone     e non dormi mai     Il centauro Nico ami già     ma lui forse non lo sa          Come sempre insisterai     allora che pasticci tu di nuovo farai     --------------------------------------------------------------------------------      ... etcetera. :)


title: How to turn microphone jack to headphones jack?

text: I've picked out my headphones jack. Can i change my microphone jack to headphones jack only by soundsystem configuration? My soundcard is Intel82801I (ICH9 Family) HD.


title: How to filter IPv4 and IPv6 addresses?

text: echo "1.1.1.1" | awk '/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/ {print $1}'      How can I filter IPv4 addresses in a script, and how can I filter IPv6 addresses. I mean more precisely then this so the oneliner should only output VALID IPv4 addresses or another script to output only VALID IPv6 addr. In different languages? like: awk, perl? ty!


title: How can I remove a specific string from a file only if there are other lines in the file?

text: How can I remove a specific string from a file ONLY if there are other lines in the file? For example, don't touch this file:               cat file.txt     ASDF      but remove "ASDF" from this file:               cat file.txt     ASDF     TR422      Because it has other characters than "ASDF". I'll welcome a solution in bash, perl or any other common tool.


title: routing based on source IP - a continue

text: Following my previous question routing based on source IP The source IP floating one and assigned to a cluster (consists from 2 servers). Let's say that the physical IP on server1 is 10.0.0.1, on server2 10.0.0.2 and the virtual IP is 10.0.0.3 and this should be the source IP. How can I configure static source IP routing for this?


title: getgrent() never terminates in NIS setup

text: I have an NIS setup on my Linux box (from nsswitch.conf):               group: compat nis      When iterating over the group entries (using the `getgrent()` function), the iteration never terminates. For example:               #include <stdio.h>     #include <grp.h>          int main() {         struct group* gr;         setgrent();         while((gr=getgrent()) != NULL)           printf("%s\n", gr->gr_name);         endgrent();         return 0;     }      It properly lists all the local groups, but then gets into an infinite loop once the first NIS group (`eng` in this example) is encountered:               root     daemon     bin     sys     adm     tty     sambashare     nslcd     guest-afY5kZ     x2gouser     Domain Users     sysops     eng     eng     eng     eng     eng     eng     ^C      Any ideas on how to debug what's wrong with my configuration? Everything else with the NIS setup seems to be functioning properly. This is an Ubuntu 14.04 box. The same program run on an RHEL6 box with a similar `nsswitch.conf` does not demonstrate this problem.


title: Mount via SSHFS in NFS filesystem

text: As a student I have access to a cluster of teaching lab computers, at each of the machines all the home folders (including my) are mounted via NFS. I also have a desktop PC. I want to mount my home folder from the desktop to my home folder at the cluster, so that the freshest version of the source codes was avaiable there. Here is the error I get:                mkdir tmp      sshfs user@desktop-ip: tmp/           fusermount: failed to open mountpoint for reading: Stale file handle      I don't have admin rights and don't much about mounting. Any ideas what I can do? Thanks for any help you can provide.


title: Duplicate specific text in text file, using perl or grep

text: I need to duplicate part of a plain text file as follows: The text file consists of a sequence of "pages", of the form:               <page    [lots of lines of text]       /page>          <page    [lots of lines of text]       /page>          <page    [lots of lines of text]       /page>          <page    [lots of lines of text]       /page>      and I need an automated way to duplicate say the 3rd such "page". Is there an easy way to do this? (and similarly with "3rd" replaced by "23rd" etc) Ideally I would like a bash script that unzipped the file, then did this duplication in the resulting text file, then rezipped it. The aim of this is a hack to get xournal to duplicate pages.


title: How to install VMware Tools on Fedora 15?

text: Where is the best place to find resources on how to install VMware Tools on a Fedora guest? I had some trouble with Fedora 14 in the past and now I'm trying Fedora 15. The host is Windows and I am using VMware Workstation as the hypervisor.


title: How does /usr/bin/env know which program to use?

text: When I use the shebang `#!/usr/bin/env python` to run a script, how does the system know which `python` to use? if I look for a `python` bin path in the environment variables I find nothing.               env | grep -i python


title: Shutdown screen taking too long to pop up in Ubuntu 8.04

text: I am using Ubuntu 8.04, and it was working fine until a few days ago, the pop screen for ShutDown started taking too long to come(about 3 mins) and in the mean time computer freezes. However, after about 3 mins when it appears everything looks normal and when shut down is clicked, it shut downs smoothly.


title: Converting from ascii to utf-8 format - iconv not working

text: I have a requirement to convert from ASCII text format to UTF-8. Below is what I am performing through the `iconv` command:               [root@main tmp]# cat File1     1     5     6     [root@main tmp]# file File1     File1: ASCII text     [root@main tmp]# iconv -f ascii -t utf-8 File1 > File2     [root@main tmp]# file File2     **File2: ASCII text**      (Still ASCII not utf-8) Any suggestions on how to convert it from ascii to utf-8?


title: Loop Mounting in Parallel

text: I am doing a project in which I need to mount 100+ loop devices and merge it into AUFS mountpoint As an observation, for sequentially mounting 90 loop devices, it takes 25 seconds. I am looking for a solution which will minimize time by mounting loop devices in parallel


title: Finding all "essential" packages with apt

text: When I run synaptic, there are certain packages which synaptic treats as "essential". For example, if I select bash for removal, I will be warned that bash is an "essential package". If I then press the apply button I get a list of packages that are going to be acted on. One of those lists is the list of essential packages that I am about to remove. Using the apt toolset, how can I vgenerate a list of all the packages that synaptic considers essential?


title: more command behavior

text: Someone can explain me about the more command? when I use it with `||` or with `&&`, it seems to have an exist status of true, even when the file is not found(Unlike the other commands).               ~/Desktop$ more notExists || echo aaa     notExists: No such file or directory     ~/Desktop$ more notExists && echo aaa     notExists: No such file or directory     aaa


title: What makes a Unix process die with Broken pipe?

text: Here are some options I thought of, not sure which is the right one. a) There was an I/O error reading from the pipe. b) The process writing to the other end of the pipe died with a failure. c) All processes who could write to the pipe have closed it. d) The write buffer of the pipe is full. e) The peer has closed the other direction of the duplex pipe. f) Writing failed because there are no processes which could read from the pipe. g) A system call returned the EPIPE error, and there was no error handler installed.


title: How Wine is not an emulator?

text: As I understand emulators (in a simple way), they do translate or substitute the function calls of a program using functions of system X into functions used by system Y in which the program is being run onto. Wine project claims that Wine Is Not an Emulator, because: > Instead of simulating internal Windows logic like a virtual machine or > emulator, Wine translates Windows API calls into POSIX calls on-the-fly, > eliminating the performance and memory penalties of other methods and > allowing you to cleanly integrate Windows applications into your desktop. Well, how emulators and virtual machines simulate internal Windows logic on host non-Windows systems? Isn't that by translating Windows system calls into the host's own respective calls? Is the difference between emulators and non- emulators (like Wine) is that emulators emulate a whole operating system then the application uses that system APIs without knowing that it is talking to an emulator, while non-emulators directly translates application's calls into the host's (and the application also may not know it)? Is the extra level of indirection is the only different between emulators and Wine?


title: Count of several keywords on a site

text: I currently have the following command               wget -O - -q http_url_goes_here |         grep -Eci '(cart|shop|buy|order|store|shipping|products|price)'      It gives me a count of ALL occurences of each of the following keywords on the site `(cart|shop|buy|order|store|shipping|products|price)`. The problem I have is that I get counts as high as 200 if some of the words occur multiple times. I would like to get a count of between 0 and 8, which would indicate how many of the keywords were found on the site. As in the count should be incremented by a maximum of 1 for each keyword. I appreciate your help.


title: Health check of web page using curl

text: I'd like to do a health check of a service by calling a specific url on it. Feels like the simplest solution would be to use cron to do the check every minute or so. In case of errors, cron sends me an email. I tried using cUrl for this but I can't get it to output messages only on errors. If I try to direct output to /dev/null, it prints out progress report.                 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                      Dload  Upload   Total   Spent    Left  Speed     100  5559  100  5559    0     0   100k      0 --:--:-- --:--:-- --:--:--  106k      I tried looking through the curl options but I just can't find anything to suit the situation where you want it to be silent on success but make noise on errors. Is there a way to make curl do what I want or is there some other tool I should be looking at?


title: gnome-terminal scrollbar customization

text: Im trying to customize my gnome-terminal under gnome 3.12.2. Right now Im searching for a way to change the color of the scollbars. What I already tried without success:   * ask google    * Gnome-color-chooser    * replacing the files in /usr/share/themes/Adwaita/gtk-2.0/Scrollbars/ right now Im trying to create a custom css file to modify the scrollbars. The major problem is, that I have no idea which css properties refer to the scrollbar of the gnome-terminal. I tried to figure it out with help of gtkparasite (https://chipx86.github.io/gtkparasite) but I couldn't get it compiled under Fedora 20. So has anybody an idea how to change the color of the gnome-terminal? Am I on the right way with creating a custom css file? And if yes is there a documentation on which properties are available? kind regards niph


title: Will Docky run on gnome 3 with gnome shell?

text: This is not Ubuntu specific (as I no longer use Ubuntu) but will Docky ( http://wiki.go-docky.com/index.php?title=Welcome_to_the_Docky_wiki ) which is in the Ubuntu repos run on gnome shell? I know it requires compositing which is provided by mutter.


title: Memory buffer in a bash script

text: I have recently finished a script that will ask for a hostname and automatically take the argument of the `function` and `ssh` into one of my work servers. Here is a copy of my script:               #!/bin/bash     echo "Provide hostname: "     read host          createSSHFunction()     {         arg1=$1         ssh $host     }     createSSHFunction $host          while((1)); do ~/sshScript.sh; done      What I notice though is say I want to `ssh` into one of the servers and I got disconnected, by instinct I will press the Up arrow key to redisplay the same argument I put in the last time. Here is an example of that:                   Provide hostname:         crf-alpha         support@localhost's password:         Last login: Thu Jul 24 12:16:33 2014 from localhost         [support@crf-alpha ~]$     Connection to localhost closed.     Provide hostname:     ^[[A      Is there such a way to code in my current script where it will buffer anything I type last? So for example i `ssh` into the crf-alpha and I get disconnected. My script will run again prompting me to enter a hostname, I would like it so that if I press the Up arrow key, the last input I entered will re-display, so in this case crf-alpha rather than the weird symbol I always get.


title: Join the executable and all its libraries

text: Lets say I have a `/bin/cat` executable that uses the following shared libraries:               linux-vdso.so.1     libc.so.6     /lib64/ld-linux-x86-64.so.2      Is it possible to somehow "join" that stuff together (executable archive or something like that)? I don't have the code of the program I want to do that to, so I can't just compile it with -static flag.


title: Unable to do paswordless ssh even after following standard procedure

text: I have two systems named Interface(10.1.1.87) and Client-Interface(10.1.1.91). I want to automatically mount an sshfs share from Client-Interface on Interface on boot. I am using the command:               sshfs mc@10.1.1.91:/opt/lampp/ /media/CIDrive/ -o allow_other      But it asks for my password. I tried the following to make it password-less:   1. As root on Interface:              # ssh-keygen -t rsa     # chmod 700 ~/.ssh     # cat ~/.ssh/id_rsa.pub | ssh mc@10.1.1.91 'cat > .ssh/authorized_keys'        2. On Client-Interface I added to the `sshd_config` file:              RSAAuthentication yes     PubkeyAuthentication yes     StrictModes no      and restarted the SSH daemon. Nonetheless, it is still asking for the password:               root@JMGDDS-Interface:~# ssh -v mc@10.1.1.91     OpenSSH_5.1p1 Debian-3ubuntu1, OpenSSL 0.9.8g 19 Oct 2007     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug1: Connecting to 10.1.1.91 [10.1.1.91] port 22.     debug1: Connection established.     debug1: permanently_set_uid: 0/0     debug1: identity file /root/.ssh/identity type -1     debug1: identity file /root/.ssh/id_rsa type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048     debug1: identity file /root/.ssh/id_dsa type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-3ubuntu1     debug1: match: OpenSSH_5.1p1 Debian-3ubuntu1 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-3ubuntu1     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-cbc hmac-md5 none     debug1: kex: client->server aes128-cbc hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Host '10.1.1.91' is known and matches the RSA host key.     debug1: Found key in /root/.ssh/known_hosts:2     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Trying private key: /root/.ssh/identity     debug1: Offering public key: /root/.ssh/id_rsa     debug1: Authentications that can continue: publickey,password     debug1: Trying private key: /root/.ssh/id_dsa     debug1: Next authentication method: password     mc@10.1.1.91's password:      The permission for the `.ssh` folder is 700; `.pub` and `authorized_keys` are 600. What could be the possible cause? How can I fix it?


title: Generic Preprocessor adds extra whitespace

text: Following up on this article I use GPP to empower Markdown parser pandoc with some macros. Unfortunately, `gpp` seems to copy all whitespace into the result. For example, consider file `test.md`               % Title     % Raphael     % 2012          \lorem \ipsum      with `test.gpp`               \define{lorem}{Lorem}     \define{ipsum}{ipsum...}      Now, calling `gpp -T --include test.gpp test.md` yields               <empty line>     % Title     % Raphael     % 2012          Lorem ipsum...      This breaks the metadata extraction of `pandoc`. The extra linebreak is indeed the one between the definitions; if I use               \define{lorem}{Lorem}@@@     \define{ipsum}{ipsum...}      with the extra option `+c "@@@" "\n"`, the empty line is gone. But this workaround is not only ugly, is also has two fatal flaws. First, it treats `@@@` as comment indicator in the source file, too. As `@@@` is not forbidden in Markdown, that can have unintended consequences when `@@@` (or any other chosen delimiter) happens to occur in the source file. Second, it does not cover whitespaces at line beginnings as caused by proper indentation. For example,               \define{lorem}{@@@       \if{a == a}@@@         ![some image](test.png)@@@       \endif@@@     }@@@      will cause all such image tags to be indented by four spaces, causing `pandoc` to typeset it as code (as specified). So, short of writing `gpp` files in one line or introducing ugly line-end comments and not indenting, what can you do to prevent `gpp` from plastering superfluous whitespaces all over the place?


title: How to make changes in nvidia-settings tool persistent

text: I want to disable VSync (it's called "Sync to VBlank" in nvidia-settings) for my nvidia graphics card. But the configuration only takes effect if I start the nvidia-settings tool. After rebooting the system VSync is enabled again and I have to start the program again. I tried exporting the `xorg.conf` and putting it in `/etc/X11/` but with no success. So my question is how can I make changes in the nvidia-settings tool persistent?


title: Problem opening .dvi files

text: I would like to know why my Lubuntu 11.10 does not open my .dvi files created with Latex. Please, can anybody help me solve this problem? * * * When I use `evince L1.dvi`, in the terminal, the `evince` opens but not the file and the messages on the terminal are:                   evince L1.dvi           (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-buttons.css:159:10: Expected valid border          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:102:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:117:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:134:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:153:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:165:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:175:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:186:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:198:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:208:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:218:16: Themeing engine 'adwaita' not found          (evince:3556): Gtk-WARNING **: Theme parsing error: gtk-bars.css:223:16: Themeing engine 'adwaita' not found     warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/share/texmf/web2c:/usr/share/texmf-texlive/web2c:/usr/local/share/texmf/web2c.          kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 cmti10     mktexpk: Permissão negada     kpathsea: Appending font creation commands to missfont.log.     page: Warning: font `cmti10' at 600x600 not found, trying `cmr10' instead          kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 cmr10     mktexpk: Permissão negada     page: Warning: font `cmti10' not found, trying metric files instead          kpathsea: Running mkofm cmti10     mkofm: Permissão negada          kpathsea: Running mktextfm cmti10     mktextfm: Permissão negada     page: Warning: metric file for `cmti10' not found, trying `cmr10' instead          kpathsea: Running mkofm cmr10     mkofm: Permissão negada          kpathsea: Running mktextfm cmr10     mktextfm: Permissão negada     page: Error: could not load font `cmti10'     warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/share/texmf/web2c:/usr/share/texmf-texlive/web2c:/usr/local/share/texmf/web2c.          kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 cmti10     mktexpk: Permissão negada     kpathsea: Appending font creation commands to missfont.log.     page: Warning: font `cmti10' at 600x600 not found, trying `cmr10' instead          kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 cmr10     mktexpk: Permissão negada     page: Warning: font `cmti10' not found, trying metric files instead          kpathsea: Running mkofm cmti10     mkofm: Permissão negada          kpathsea: Running mktextfm cmti10     mktextfm: Permissão negada     page: Warning: metric file for `cmti10' not found, trying `cmr10' instead          kpathsea: Running mkofm cmr10     mkofm: Permissão negada          kpathsea: Running mktextfm cmr10     mktextfm: Permissão negada     page: Error: could not load font `cmti10'          (evince:3556): EvinceView-CRITICAL **: ev_document_model_set_document: assertion `EV_IS_DOCUMENT (document)' failed          (evince:3556): EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion `EV_IS_DOCUMENT (document)' failed          (evince:3556): EvinceDocument-CRITICAL **: ev_document_get_max_page_size: assertion `EV_IS_DOCUMENT (document)' failed


title: FreeBSD 10 with Root-on-ZFS using only a part of the disk

text: I'm having a bit of trouble here. I'll try and be as concise as possible in describing my objective: I'm setting up a storage server for my employer, using two Intel DC S3500 series 120GB solid state drives (and 12 x 2TB SAS drives for storage). I would like to install freebsd10 with root-on-zfs on these drives, but only use a small (12GB) partition to create a zfs mirror for the OS. The remaining space, I want to use for a ZIL/SLOG (24GB), and the rest for a L2ARC (striped, everything that's left, on both drives). I cannot figure out how to tell the freebsd10 installer to only use 'ada0p2' and 'ada1p2' as my mirror for installing the OS onto. I only get the option for using the entire drives. Additionally, I've tried installing as normal and then using zfs send and recv to backup, resize the partition with gpart, and then restore a replica stream of my zroot pool... the system refuses to boot when I do that. How do I go about achieving this goal? Any assistance with this would be much appreciated.


title: Package bash-completion missing from Yum in CentOS 6

text: I am trying to get tab-completion working in Yum in CentOS 6 (so I can do something like `yum install firefo<TAB>` and get back `firefox`), and I have found many tutorials which say to simply do `yum install bash-completion`, but when I do this, I get this back:               Loaded plugins: fastestmirror, refresh-packagekit     Loading mirror speeds from cached hostfile      * base: mirror.anl.gov      * extras: yum.singlehop.com      * updates: mirror.ubiquityservers.com     Setting up Install Process     No package bash-completion available.     Error: Nothing to do      I am new to CentOS/Yum so I am lost- is there some repository I should add?


title: What is the proper way of sharing the /usr subdirectory?

text: What parts of the `/usr` subdirectory are usually shared in common practice without introducing any system instabilities? My intent is to share share-able parts of the `/usr` subdirectory among VM's of the same configuration to conserve virtual HD disk space. Plan A is to:   1. Install OS: I haven't found an option during the installation process to point a `/usr` subdirectory to a remote NFS share so all `/usr` subdirectories will have to be installed for now on the local drive. Will have to resize VM hard drive later.   2. Configure network settings   3. Configure `/etc/fstab` point to individual remote `/usr` shares. Plan B is to:   1. Attach target new VMHD to baseline VM   2. Manually copy `/` subdirectories from a baseline VM to new VMHD and `mkdir /dev /proc`, etc.   3. Install grub 2 on new hard disk, (`grub-install /dev/sdb` in my case)   4. Detach new VMHD from baseline machine and attach it to new VM   5. Boot new VM, do Plan A 3 and 4. Are these methods good? Is there a more proper, better or quicker way? I did Plan B, the new machine booted to grub but keeps trying to find the baseline host's HD which is being referred to by its UUID. I removed all mention of the baseline host's UUID from `/boot/grub/grub.cfg` on the new machine but grub still keeps trying to find it. I don't know of any other configuration files that grub uses at boot time besides the `grub.cfg` file that refer to hard disks.


title: Brother DCP-J315W is active in terminal but not detected in Elementary OS

text: For a couple of days I've been trying to get my "all-in-one" Brother DCP-J315W to work. I managed to make the printer work over Wi-Fi, but the scanner is not detected in GUI even though it is visible in the terminal using `brscan-skey -l`               SCANNER : brother3:net1;dev0 : 192.168.2.101 Active     DCP-J315W_scan : brother3:net1;dev1 : 192.168.2.101 Active     DCP-J315W_skaner : brother3:net1;dev2 : 192.168.1.101 Not responded      The drivers seem to be installed properly:               vielebny@MK-Samsung:~$ brsaneconfig3 -q | grep SCANNER     0 SCANNER "DCP-J315W" I:192.168.2.101          vielebny@MK-Samsung:~$ dpkg -l | grep Brother     ii brscan-skey:i386 0.2.4-1 Brother Linux scanner S-KEY tool      ii brscan3:i386 0.2.11-4 Brother Scanner Driver      ii dcpj315wcupswrapper:i386 1.1.3-1 Brother CUPS Inkjet Printer Definitions      ii dcpj315wlpr:i386 1.1.3-1 Brother lpr Inkjet Printer Definitions      ii printer-driver-ptouch 1.3-3ubuntu0.1 printer driver Brother P-touch label printers      Any ideas on how to resolve this?


title: Test firefox in a loop

text: I would like to simply bash the following: start firefox, test it, kill its process if it does not work and restart it; or stop the script once for all if it works. Actually I need a `awk` sentence to intercept string "ESTA http" from netstat and put $CONDTION to 0.               #!/bin/bash     $CONDITION=1;     while($CONDITION)          firefox & timeout 10s watch -n 1 'netstat -a | grep "http    ESTA"|$CONDITION=0; (<-bad syntax)          if [$CONDITION == 0];          then break     fi          kill $(ps aux | grep 'firefox' | awk '{print $2}');          done;          exit;


title: How to eliminate annoyances when starting a GUI from a terminal?

text: I prefer to launch GUI applications from a terminal window rather than by using a graphical desktop. A frequent annoyance is that often the developers haven't anticipated this type of use, so the app prints lots of useless, cryptic, or uninformative messages to stdout or stderr. Further clutter on the terminal occurs because running the program in the background, with an &, generates reports of the creation and termination of the job. What is a workaround for these problems that will accept command line arguments and handle autocompletion? Related: http://stackoverflow.com/questions/7131670/make-bash-alias-that- takes-parameter


title: What does Linux's "nointremap" option do?

text: Ubuntu 12.10 alpha 2 works perfectly on my new 11" 2012 Macbook Air, but only when I boot with the "nointremap" option. Supposedly this is not good to use as a permanent solution. What exactly does this option do, and why is it "bad"?


title: Why is the available space in my $HOME decreasing?

text: My OS is Ubuntu 12.04. As System Monitor shows, "free" for my $HOME is 1.6GiB, but "Available" is 222.7 MiB and is keeping slowly decreasing from around 750 MiB yesterday. I am not aware that I am adding more data to $HOME. So I would like to know   * how to find out the reason that causes that, e.g.,is there some running application that is using the space of $HOME as temporary storage place and therefore can be freed up?   * how to find out which directory or file is increasing its size? * * * To Ignacio `~/.xsession-errors` is only 21330862 bytes. Some of its last content is               > ** (zeitgeist-datahub:2116): WARNING **: recent-manager-provider.vala:133: Desktop file for     > "file:///windows-d/academic%20discipline/study%20objects/areas/formal%20systems/logic/generalize%20to%20when%20inference%20is%20uncertain/uncertainlize%20deductive%20logic/statistics/general/Kalbfleisch/vol2/all.djvu"     > was not found, exec: plugin-container, mime_type: image/vnd.djvu     >      > ** (zeitgeist-datahub:2116): WARNING **: recent-manager-provider.vala:133: Desktop file for     > "file:///windows-d/academic%20discipline/study%20objects/areas/formal%20systems/logic/generalize%20to%20when%20inference%20is%20uncertain/uncertainlize%20deductive%20logic/statistics/general/Montgomery/prob%20and%20stat%20in%20Eng/4ed.pdf"     > was not found, exec: plugin-container, mime_type: application/pdf      * * * To Karlson               $ df -kh     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda7        21G   15G  4.8G  76% /     udev            949M   12K  949M   1% /dev     tmpfs           383M  988K  382M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            956M  184K  956M   1% /run/shm     /dev/sda2        71G   47G   24G  68% /windows-c     /dev/sda3       110G  101G  9.9G  92% /windows-d     /dev/sda6        27G   26G  223M 100% /home     /dev/sda1       1.2G  658M  543M  55% /media/SYSTEM_DRV


title: AIX and Subversion

text: Very basic question regarding AIX and Apache Subversion: I need to install an Apache Subversion client onto an AIX 4.3 system. (Yes, this is a rather old version of AIX; the story is too long and boring to relate here...) As far as I can tell, there is no Red Hat Package manager installed there, so I assume that I will have to find a compiled binary of the Subversion client for AIX in some form other than an RPM package, or I will have to retrieve an RPM-packaged Subversion client and extract the compiled binaries from it. This is based on the assumption that even a Subversion client compiled for a more recent AIX flavor (say 5.3?) will be usable under this older AIX 4.3 server. How can I install a Subversion client onto an AIX 4.3 system?


title: Is there a better alternative to sudoedit?

text: What I really hate about `sudoedit` is the fact that it always uses a different filename. I'm using `emacsclient` and when editing a file twice I'm left with two useless buffers. Sometimes I even happen to edit the "stale" file. Is there something like `sudoedit` which uses always the same filename, ideally one the user could choose? I'm thinking about writing a script allowing me to edit e.g. `/etc/fstab` by editing `$HOME/global/etc/fstab` instead, but I see some problems with keeping the files in sync and also possible security issues (which aren't that important on my single user machine).


title: What are the different ways that a message can be displayed to a bash shell after a user logs in?

text: I have a CentOS 5.7 VPS using bash as its shell that displays a branded greeting immediately after logging in via SSH. I've been trying to modify it, but can't seem to find where it is in the usual places. So far I've looked in the `motd` file and checked `sshd_config` for banner file settings. A banner file is not set. Where else can I look for where the login message might be?


title: Using mutt and thunderbird together

text: I'd love to use both `thunderbird` and `mutt` together. At times I just want a GUI over CLI or the reverse. I also love `thunderbird`'s search and contact features. I especially love its mail filtering capabilities. Any help would be greatly appreciated.


title: Do procmail recipes have an alternator "or" operator?

text: Given the following procmail recipe:               :0:     * ^Subject:.*viagra.*     * ^From:.*viagra.*     /dev/null      Procmail would only delete emails that were both from viagra, and had viagra in the subject. Is it possible to apply the filter if either of the matches are true? The solution should preferably not make use of the regular expression `(regex1|regex2)` operation, but if that is the only solution, then please say so.


title: How can I apply my procmail filters to my maildir inbox?

text: Last night I subscribed to a mailing list, and discovered this morning that my procmail filter didn't apply to many of the mailing list messages. Now I have loads of less-important mailing list messages interspersed with my more- important work emails sitting in my inbox. Is it possible to rerun all the emails in my inbox through my procmail filters again? Note: I am using the maildir format


title: Lightest weight SMTP server for Linux Single Board Computer (SBC)

text: The other discussions I found did not give a clear answer to my question. Problem description: I am running an embedded Linux server device, such as TuxRail or a DreamPlug which are ARM-based devices with very little of memory and using a micro-SD card as their mass memory device and don't have GUI frontends. They are running Debian Squeeze. I also have IP-cameras from D-Link which can send motion captures via email with SMTP-settings but which have bad limitations (such as that username-field cannot be over 20 characters(!)) and that is why I want to create my own SMTP/eSMTP-server into a separate Linux box which would allow these short usernames and then relay these emails forward to actual ISP's SMTP-server. Question: What would be suitable "real" SMTP-server for such a Linux SBC box? Your answer is only worthwhile, if the server you suggest runs a daemon which acts as a SMTP server in TCP/IP port 25 and/or 465 and can relay those emails to similar ISP servers. (Please don't suggest me something completely different from what I asked, I specifically want "IP-to-IP" kind of SMTP relay server, not commandline MTAs or anything like that since I don't have access to the commandline of that IP- camera product) Thanks in advance!


title: Are there any Linux distros currently using Wayland?

text: I know that Ubuntu is planning to use it in 11.10, and Fedora has announced 'eventual' migration, but I'm curious if there is something using it already that I could load in a VM to help with compatibility testing.


title: cygwin displays rectangles instead of characters

text: I have a bit of a problem in cygwin, When I use make utility in cygwin, it prints rectangles instead of text. Also when text is not english, i.e. polish or russian I see rectangles instead of characters. But when I print those symbols I see them. I'm using mintty, also XTerm, mintty is a bit better. Output of `locale` from Xterm:               $ locale     LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_ALL=      But the thing is while my windows xp is english version, I'm not in US and have Russian time and date settings, maybe it's the problem? I want to see correctly texts in different languages, is there a way? Also mintty and xterm behave a bit different. I have a text file in polish language and `cat` in mintty gives no rectangles for that text, while `cat` in xterm gives me rectangles for some characters. Output for make looks like this in mintty:               $ make     make: ▒▒▒▒ `default' ▒▒ ▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒.      and like this:               $ make     make: �� `default' � ���� ����� ���.      in xterm. I found a way to fix it for sertain languages: http://stackoverflow.com/questions/13094248/how-do-i-get-accented-letters-to- actually-work-on-bash when I set options for mintty like said there and specify character set ISO-8859-2, I can see polish text fine. Only I don't undertand, I saved text in utf-8 format, why do I need set charset, as if my text was in ANSI. And I can only see make results (which is in russian, i don't know why) when I set charset to CP1251.


title: Is there anyway to make vnc viewer function like Xming with allowing linux windows move freely about?

text: I have a vncserver set up on my remote machine and am using vnc viewer to interact with that machine. I am also used to doing the following: 1. Remote connecting to a machine with an ssh client like Putty and using Xming for X11 forward so that I can open linux programs but have them appear on my windows desktop and move about freely. What I don't like about the vnc viewer is that linux programs have to 'stay' within the view viewer window, and there is essentially less screen space to interact programs with. I am wondering if there is a way to get the kind of experience that I am used to with Xming but with vnc somehow? I know I could use screen with a terminal, but I don't wan to do that. I want to use vnc somehow. BTW, my operating system is Windows 7


title: How to edit the file content in vi?

text: I have a text file with following content (Actual filecontains thousands of lines)               abcd     xyas     sasss     jddks     asa     sasa     lkkkss     asasd      I want the output in the folloing format.               abcd xyas sasss jddks     asa sasa lkkkss asasd      How can i acheve this?


title: How do I set a variable as the user id

text: I want to write a start up script in tsch that creates a directory some where named with the current user id. I was hoping the following would work.               Set A = (id -u -n)      But I'm not sure how to handle the output of the command id properly for this kind of variable assignment.


title: Can grep output only specified groupings that match?

text: Say I have a file:               # file: 'test.txt'     foobar bash 1     bash     foobar happy     foobar      I only want to know what words appear after "foobar", so I can use this regex:               "foobar \(\w\+\)"      The parenthesis indicate that I have a special interest in the word right after foobar. But when I do a `grep "foobar \\(\w\\+\\)" test.txt`, I get the entire lines that match the entire regex, rather than just "the word after foobar":               foobar bash 1     foobar happy      I would much prefer that the output of that command looked like this:               bash     happy      Is there a way to tell grep to only output the items that match the grouping (or a specific grouping) in a regular expression?