title: Regaining usage of volume control media keys after removing pulseaudio

text: I am running a GNOME 3 fallback desktop in Debian testing, and I removed some `pulseaudio` packages, for I don't need the advanced functionality. That resulted in my multimedia keys that control speaker volume to work no more. This forces me to use a mouse on the classic volume control applet to control the volume, which isn't always convenient. Here's what I get:               $ acpi_listen     button/volumedown VOLDN 00000080 00000000 K     button/volumeup VOLUP 00000080 00000000 K      **note** : the other Fn keys (brightness, suspend, ...) work okay


title: How to do alphanumeric validation for a particular column (say $2) of a file using awk?

text: How do I perform alphanumeric validation for a particular column (say `$2`) of a file using awk? For example I've tried:               awk -F, '{if ($10==(/[0-9a-zA-Z]/)) count+=1;} END {print count}' final.csv      I don't get any errors or a result.


title: How to install LibreOffice on Scientific Linux 6.1?

text: How can I install (from a repository?*) a fresh but still stable version of LibreOffice under Scientific Linux 6.1 64bit?      * = this means I need updates too, so if there will be a newer stable version of LibreOffice, then I it should update it self (of course with the package manager set to auto update). Because if I just install a .rpm file then it wouldn't be updated if there are newer releases..


title: Default preference of executable over built-ins with the same name

text: I was playing around a bit with the names of some executables, putting them in a folder, `~/bin`, which is in my `$PATH`. Now I'm wondering how I can set the preferences of a `bash-3.2` terminal so that it picks up these executables instead of the builtins or aliases to execute. For example, if I put a script named `cd` in a directory in `$PATH`, the builtin for `cd` is still executed. However, if I create an `alias` for `cd`, then this alias will be executed, overriding the builtin.               $ type cd     cd is a shell builtin      ### My questions   1. Is there a way to make an executable file in `$PATH` have, by default, preference over a shell builtin, by executing only, e.g. `cd` without having to resort to using the commands `builtin` or `command`?   2. I'm also interested in any official reference which discusses this preference (not the reasoning, that I do understand). **Note:** This question is purely for personal educational purposes, I am wondering why it works the way it works.


title: Unable to use scp on Solaris

text: I'm trying to use `scp` from one Solaris machine to another, but I get this message and the copy fails:               root@ark123 # scp -r emcgrab_SunOS_v4.4.4a.tar 192.163.119.21:/tmp     Password:     Sourcing /root/.profile-EIS.....     root@ark123      What does this mean? How do I fix it so `scp` will work?


title: Setting nice and ionice for rsync via xinetd

text: I am attempting to set nice and ionice for rsync via xinetd. I am running Fedora 16. The reason I would like to use these values is to reduce the rsync process to an idle state so other processes run unaffected. I have tried to use `/etc/default/rsync` to set nice and ionice values, but it looks like these are not working for me. The rsync process is always started with a nice value of 0, even when I set it to 19. Do these settings work in xinetd? Is there another way to nice rsync via xinetd? Here are my config files: /etc/rsync.conf:               log file = /var/log/rsyncd.log     pid file = /var/run/rsyncd.pid     lock file = /var/run/rsync.lock     [share]     <shares go here>      /etc/xinetd.d/rsync:               service rsync     {         disable = no         flags           = IPv6         socket_type     = stream         wait            = no         user            = root         server          = /usr/bin/rsync         server_args     = --daemon         log_on_failure  += USERID     }      /etc/default/rsync:               RSYNC_ENABLE=inetd     RSYNC_OPTS=''     RSYNC_NICE='19'     RSYNC_IONICE='-c3'


title: How to install drivers on Linux

text: How can I install a driver on any Linux? I have XG-762 Sagem adapter on USB with the ZyDAS 1211B chipset, and I don't have drivers for it. What should I do? PS: Despite it should be in my file system. It isn't...


title: Ubuntu - USB device not discovered after system restart

text: I have an USB device that after pluging in is visible as /dev/ttyACM0. Unfortunately, after system restart, it is not beeing discovered and I have to plug it out and in again to work. I have found a piece of code: http://www.clearchain.com/blog/posts/resetting-the-usb-bus-under-linux but it's result is similar to the system restart. If device is present and working, program sees it, claims that it is beeing reset and then device dissapear from /dev. Otherwise nothing is happenig. My question is: How to force the system to discover my device without pluging it of and on again? I'm Using Ubuntu Server 12.04.2 LTS. I will appreciate any tips.


title: Best parameters for ext4 filesystem to handle virtualbox disk images

text: I have ext4 partition, which holds disk image files VirtualBox works with. They all are fixed-size images (i.e. files never change their size). They are defragmented as much as possible (with e4defrag). I assume that a lot of filesystem features are redundant in this case. I.e. as files are never created, never deleted, never change their size, only reading and "in-place" writing happens, and file contents are aligned on the hard- drive continuously, thus much simpler filesystem could be used in this case (no need for file attributes, directories, journal, etc). Theoretically, I could even use logical volumes instead of files in this case (I am just not sure that I want). So, questions:   1. How to tune ext4 filesystem, to get best performance in this case?   2. May be another filesystem is more suitable? (Some filesystem that don't support directories, and only continuous fixed-size files?) Or may be Linux has a possibility to mount _part_ of existing partition as a file? I.e. that I create unformatted partition /dev/sda2 and then     * mount K-th to L-th bytes of it as /somepath1/somefile1.vdi,     * mount M-th to N-th bytes of it as /somepath2/file2.vdi,     * and so on.


title: What NOT to put on an SSD?

text: I bought an SSD and I am going to set up my desktop system with a completely fresh Linux installation. SSDs are known to be fast, but they have a disadvantage: The number of writes (per block?) is limited. So I am thinking about which data should be located at the SSD and which at the HDD drive. Generally I thought that data that changes frequently should be placed on the HDD and data that doesn't change frequently can be put on the SSD.   * Now I read this question, with a similar scenario. In the answers there is written: "SSD drives are ideally suited for swap space..." Why are SSDs ideally suited for swap space? OK, I see high potential for raising the system's performance, but doesn't swap data change frequently and hence there would be many writes on the SSD resulting in a short SSD lifetime?   * And what about the /var directory? Doesn't its contents change frequently, too? Wouldn't it be a good idea to put it on the HDD?   * Is there any other data that should not be located on an SSD?


title: how to Connect to Mysql only once?

text: I have created a shell script to connect to a DB and INSERT IPs and MACs from dhcpd.log file   the scripts worked properly:               #/!bin/bash     #Defining Variables     dhcpLogFile="/var/log/dhcpd.log"          #Begin Code     # extrcting the Information of IPs and MACs from log file     # and eleminating the duplicate Entry     NumberOfLines=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++'|awk 'BEGIN{i=0}{i++;}END{print i}')     j=1     while [ $NumberOfLines -gt 0 ]     do     ip=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\n')     mac=$(awk '/DHCPACK/ { print $10} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\n')     echo $ip     echo $mac        let "j +=1"     let "NumberOfLines -=1"     mysql -u root --password='pw' MatchingDB <<- _END_      INSERT INTO IP_MACTable (IP_Address, MAC) VALUES ('$ip','$mac');     _END_     done      The code is correct but as you can see it connects to the DB every insert query inside the while, my question is how can I connect to the DB only once then do multiple queries then exit without connecting to it every insertion operation


title: What can go wrong if /var/tmp is on a temporary filesystem?

text: I have read that I should not mount /var/tmp as a temporary filesystem (e.g., as tmpfs), because files in /var/tmp must not be deleted on reboot. Is that correct? Suppose I did mount /var/tmp as a tmpfs, so its contents are deleted on every reboot. Would that be bad? If yes, what could go wrong? How bad would it be?


title: Use a custom colourscheme in Vim

text: I have customized a color profile for Vim (toto.vim) in the colors folder at : `/usr/share/vim/vim74/colors` Now, to use it, I am obliged to call it each time I start vim, using the command :               :colorscheme toto      Is there any way to load it by default instead of the default color scheme?


title: How does one properly use the nautilus & command in a graphical SSH into debian 6.0.4?

text: Last login: Wed Mar 21 20:10:33 2012 from astrolab17.astro.washington.edu      1 td% nautilus &     [1] 9847      2 td% Initializing nautilus-gdu extension      And then I quit nautilus. The thing is, though, that putting the & operator at the end of nautilus, I'm supposed to be able to enter new commands after I close (or 'X' out of) the nautilus window. This happens with most other programs like Matlab. Except that this doesn't happen with Debian. The distribution involved is Debian 6.0.4.


title: compiling PHP fails cause of libpcre

text: I'm trying to compile PHP myself as I want to use PHPBrew to switch between multiple versions of PHP. I already solved a ton of problems in the process, but with this particular one I can't get any further. I'm getting this error message in the `make` process:               /usr/bin/ld: /usr/libpcre.a(pcre_exec.o): relocation R_X86_64_32S against `_pcre_ucd_stage1' can not be used when making a shared object; recompile with -fPIC     /usr/libpcre.a: error adding symbols: Bad value     collect2: error: ld returned 1 exit status     make: *** [libphp5.5.5.la] Fehler 1     Error      I needed to add a symlink from `/usr/libpcre.a -> /usr/lib/x86_64-linux- gnu/libpcre.a` before, as otherwise he would complain about not beeing able to find `libpcre.a`. I also tried to add `"EXTRACFLAGS=-fPIC"` to `make`, but it wouldn't change anything. It's the first time I'm compiling something, so I'm not even sure if I get the basics right. This is under Ubuntu 13.10 (not seeing the same problems on 12.04). This is my PHPBrew command:               phpbrew install 5.5.5 +default+mysql+pdo+apxs2      Wich results in the following configure options being generated: > ./configure '--prefix=/home/malte/.phpbrew/php/php-5.5.5' '--with-config- > file-path=/home/malte/.phpbrew/php/php-5.5.5/etc' '--with-config-file-scan- > dir=/home/malte/.phpbrew/php/php-5.5.5/var/db' '--with- > pear=/home/malte/.phpbrew/php/php-5.5.5/lib/php' '--disable-all' '--enable- > phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with- > pcre-regex' '--with-zlib=/usr' '--with-libdir=lib/i386-linux-gnu' '--with- > mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable- > pdo' '--with-apxs2=/usr/bin/apxs2' '--enable-dom' '--enable-libxml' '-- > enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' ' > --with-xsl' '--with-libxml-dir=/usr' '--enable-bcmath' '--with-bz2=/usr' '-- > enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable- > fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable- > sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable- > mbstring' '--with-mhash' '--with-mcrypt=/usr' '--enable-pcntl' '--with-pcre- > regex=/usr' '--with-pcre-dir=/usr' '--enable-phar' '--enable-posix' '--with- > readline=/usr' '--enable-sockets' '--enable-tokenizer' '--enable-zip' 2>&1 > > /home/malte/.phpbrew/build/php-5.5.5/build.log I think I have all relevant packages installed:               dpkg --get-selections | grep pcre     libpcre++0:amd64                install     libpcre3:amd64                  install     libpcre3:i386                   install     libpcre3-dev:amd64              install     libpcrecpp0:amd64               install      Any help is really appreciated!


title: Qemu terminating on signal x from pid xxxx

text: I've been all over google and back and I cannot locate any information on this particular error. **qemu: terminating on signal 15 from pid 3111** I'm using Virtualizor to launch new **KVM** VPS on my machines. I am getting this error in my vps startup logs that's preventing the system from working.               2012-01-05 18:38:14.927: starting up     LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 1024 -smp 4,sockets=4,cores=1,threa     ds=1 -name 1001 -uuid 81658116-8f37-4939-829a-c679c3576b00 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/1001.monit     or,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/dev/vg_hv2/vs1001,if=none,id=drive-ide0-0-0,fo     rmat=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev     =hostnet0,id=net0,mac=00:16:3e:46:da:e1,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 198.1     45.30.132:1,password -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4     char device redirected to /dev/pts/0     qemu: terminating on signal 15 from pid 3111     2012-01-06 04:06:20.875: shutting down     2012-01-06 05:07:21.782: starting up      This is an example of my startup logs for the vps that I just tried to create. Notice the qemu terminating error, then the system restarts and tries this same sequence three more times until finally failing.


title: recover lvm after loosing partition table

text: On one of my hard drives had a few physical volumes/partitions and lvm on them. And then I lost partition table. I still have files from /etc/lvm/* how can I recover my data?


title: How can I add invisible watermark to images on commandline?

text: Similar question here but for Tex -document. Imagemagick shows ways of watermarking here but not how to do it as invisible as possible. I currently just obfuscate some functional elements into photos so extremely hard to remove, without distorting the image itself. Is there some commandline tool to add invisible watermark to images, something like to check with microscope perhaps but still readable? I have a massive tree of images (of very different variety so watermark should adopt to env etc) -- some commandline tool to add watermarks fast invisibly on every photo?


title: Is there a file search engine like "Everything" in Linux?

text: On Windows there a nice file search engine called Everything, which is (unlike `find`) very fast and (unlike `locate`) always returns up to date results. AFAIK it works by filling a database from the NTFS journal (it doesn't work with other filesystems). I wonder if there's something similar (I don't care about the GUI; my point is the speed and the up-to-date guarantee) for Linux (ext3 or ext4); I have googled but found nothing. Can something like this be done or is even somebody working on it?


title: remove Cinnamon Desktop replace with MATE

text: I'm guessing this is something simple I'm missing because nobody else seems to have this problem I just installed fedora 20 which installs cinnamon desktop (I believe) and want to use MATE because that's what I'm familiar - this installed OK But how do I uninstall cinnamon? When I do yum groupremove "Cinnamon Desktop" I get "No environment named Cinnamon Desktop" exists


title: zsh: Is it worth the switch from bash? Is it the time?

text: I have been a **bash** user for years now. However, I find that **zsh** is increasingly gaining momentum. I came up with the following questions:   1. Is **zsh** really becoming that popular? Will it compete with **bash** on becoming the standard shell sometime?   2. Is it time to start writing **zsh** scripts instead of **bash** ones?   3. Is it really worth to switch from **bash** to **zsh**?   4. What is the best tutorial/starter guide to consult for **zsh**?


title: Guake is not opening

text: Whenever I try to open guake it shows the following error               Traceback (most recent call last):       File "/usr/bin/guake", line 24, in          import pygtk     ImportError: No module named pygtk      How to remove this error and make guake run properly ?


title: How do I set key binding for set mark in emacs?

text: _I'm new to emacs and newer to lisp_ I'm trying to set Meta + spacebar to set the mark for highlighting text (at current cursor position). searching around online and experimenting I've ended up with the command `(global-set-key (kbd "M-SPC") 'push-mark nil nil 1)` The above command isn't working for me though, I'm getting an "incorrect number of arguments error". Got the function definition, push-mark &optional; position nomsg activate from elisp manual here **Position:** nil for position should default to current cursor position **nomsg:** I don't care about (I think) **activate:** apparently isn't true by default so I need to set it to...something. How would I format the command to pass in three values? _The error is definitely due to the push-mark function call as other functions such as backward-char (which I'm not passing inputs to) work correctly_


title: What's the difference between SFTP, SCP and FISH protocols?

text: I used to think SCP is a tool to copy files over SSH, and copying files over SSH is called SFTP, which is itself a synonym to FISH. But now as I was looking for a Total Commander plugin to do this in Windows, I've noticed that on its page it says "Allows access to remote servers via secure FTP (FTP via SSH). Requires SSH2. This is NOT the same as SCP!". If it's not the same then what am I misunderstanding?


title: policy routing problem with load balanced ppp connections

text: This my setup using **Debian 6.0.6**. It's role is a proxy server and a load balancer using eight 3G modems. First and foremost: Whenever a ppp connection dials it takes over the default gateway which is ok but it also cuts me out.The reason it's ok is that in Ubuntu I noticed that it does not do that by default. By default it will leave the ethX gateway untouched.I could have added in the ppp options file `replacedefaultroute` but problems with iptables in Ubuntu made me switch to Debian. But now I cannot ping other hosts on the LAN but other hosts can ping me. I also lose connectivity from the outside and the only way I can get access is through another computer from inside the LAN.Also all the hosts in the LAN can use the proxy. What I found out is that if I add a separate routing table called **e1** and copy               192.168.2.0/24 dev eth0  proto kernel  scope link  src 192.168.2.126     default via 192.168.2.3 dev eth0      from the main table into table e1 and then do:               ip rule add table e1      it works, but this is not what I want since all the connections now flow through the eth0 interface. What can I try to restore the connections comming from outside, and to communicate with the local computers. However all traffic comming from the LAN must still be made through the ppp links.               root@proxy:~# iptables -L OUTPUT -t mangle -v     Chain OUTPUT (policy ACCEPT 433K packets, 217M bytes)     pkts bytes target     prot opt in     out     source               destination     433K  217M CONNMARK   all  --  any    any     anywhere             anywhere            CONNMARK restore      929 61011 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 MARK set 0x1      929 61721 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 packet 1 MARK set 0x2      929 61461 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 packet 2 MARK set 0x3      929 61438 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 packet 3 MARK set 0x4      929 61530 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 packet 4 MARK set 0x5      929 61022 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 packet 5 MARK set 0x6      929 61738 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 packet 6 MARK set 0x7      928 61224 MARK       all  --  any    any     anywhere             anywhere            state NEW statistic mode nth every 8 packet 7 MARK set 0x8     433K  217M CONNMARK   all  --  any    any     anywhere             anywhere            CONNMARK save               root@proxy:~# iptables -L POSTROUTING -t nat -v     Chain POSTROUTING (policy ACCEPT 285 packets, 18881 bytes)      pkts bytes target     prot opt in     out     source               destination       743 49005 MASQUERADE  all  --  any    ppp0    anywhere             anywhere       705 47291 MASQUERADE  all  --  any    ppp1    anywhere             anywhere       679 45581 MASQUERADE  all  --  any    ppp2    anywhere             anywhere       679 45598 MASQUERADE  all  --  any    ppp3    anywhere             anywhere       670 45177 MASQUERADE  all  --  any    ppp4    anywhere             anywhere       638 42447 MASQUERADE  all  --  any    ppp5    anywhere             anywhere       724 48671 MASQUERADE  all  --  any    ppp6    anywhere             anywhere       679 45182 MASQUERADE  all  --  any    ppp7    anywhere             anywhere     root@proxy:~#          root@proxy:~# ip rule     0:      from all lookup local     32758:  from all fwmark 0x8 lookup d8     32759:  from all fwmark 0x7 lookup d7     32760:  from all fwmark 0x6 lookup d6     32761:  from all fwmark 0x5 lookup d5     32762:  from all fwmark 0x4 lookup d4     32763:  from all fwmark 0x3 lookup d3     32764:  from all fwmark 0x2 lookup d2     32765:  from all fwmark 0x1 lookup d1     32766:  from all lookup main     32767:  from all lookup default          root@proxy:~# ip ro sh t d1     default via 10.64.64.64 dev ppp0     root@proxy:~# ip ro sh t d2     default via 10.64.64.65 dev ppp1     root@proxy:~# ip ro sh t d3     default via 10.64.64.66 dev ppp2     root@proxy:~# ip ro sh t d4     default via 10.64.64.67 dev ppp3     root@proxy:~# ip ro sh t d5     default via 10.64.64.68 dev ppp4     root@proxy:~# ip ro sh t d6     default via 10.64.64.69 dev ppp5     root@proxy:~# ip ro sh t d7     default via 10.64.64.70 dev ppp6     root@proxy:~# ip ro sh t d8     default via 10.64.64.71 dev ppp7               root@proxy:~# ip ro     10.64.64.67 dev ppp3  proto kernel  scope link  src 10.90.33.221     10.64.64.66 dev ppp2  proto kernel  scope link  src 10.18.11.90     10.64.64.65 dev ppp1  proto kernel  scope link  src 10.90.14.235     10.64.64.64 dev ppp0  proto kernel  scope link  src 10.18.27.226     10.64.64.71 dev ppp7  proto kernel  scope link  src 172.22.201.81     10.64.64.70 dev ppp6  proto kernel  scope link  src 10.80.131.6     10.64.64.69 dev ppp5  proto kernel  scope link  src 172.20.17.183     10.64.64.68 dev ppp4  proto kernel  scope link  src 10.80.61.34     192.168.2.0/24 dev eth0  proto kernel  scope link  src 192.168.2.126     default via 192.168.2.3 dev eth0     root@proxy:~#      If you can give me some ideas I would appreciate it. Thanks!.


title: Viewing shared segments created by shmget

text: I'm trying to "visualize" shared memory between two processes. I've created a little server-client example where the client writes some data to a shared memory location and the server reads from it. I'm using the usual code for this:               (shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0      Now, I need to know that while the server and client are running, how do I actually see in some memory map or something that both have the same memory shared between them i.e. is there something in `/proc/<pid>/` file that I can read and interpret? I tried reading from `smaps` but that doesn't really look like what I need.


title: Acpid and Startup Brightness

text: On Arch Linux on my laptop, I have acpid control the brightness level based on AC plug events. Plugging in gives me max brightness and running on battery sets it at the minimum. My problem is that when I start the laptop, the brightness is always at the highest. That is, there isn't anything to trigger the brightness change, so it runs with the highest brightness. How can I make it so that the brightness will set correctly on startup? I was thinking of creating a systemd service as a potential solution, but I have never written one before and I wanted to hold out for any alternative (potentially better) methods before I start. UPDATE: I ended up using a udev rule, I was unaware of its ability to control things like brightness. I still have to keep acpid, however, since udev is apparently unable to pick up my laptop close event. Anyway, here is the link to the rule I found: https://github.com/Unia/powersave/blob/master/rules/50-powersave.rules


title: Update not working properly

text: Whenever I write sudo apt-get update it does not work properly and shows following :               tusharmakkar08@tusharmakkar08-Satellite-C660 ~ $ sudo apt-get update     Ign http://archive.ubuntu.com nadia Release.gpg                                     Ign http://packages.medibuntu.org nadia Release.gpg                                 Ign http://archive.canonical.com nadia Release.gpg                                  Get:1 http://packages.linuxmint.com nadia Release.gpg [197 B]                       Ign http://security.ubuntu.com nadia-security Release.gpg                           Hit http://dl.google.com stable Release.gpg                                         Hit http://ppa.launchpad.net quantal Release.gpg                                    Ign http://archive.ubuntu.com nadia-updates Release.gpg                             Hit http://archive.canonical.com quantal Release.gpg                                Get:2 http://packages.linuxmint.com nadia Release [17.6 kB]                         Get:3 http://security.ubuntu.com quantal-security Release.gpg [933 B]               Hit http://dl.google.com stable Release.gpg                                         Hit http://ppa.launchpad.net quantal Release                                        Hit http://packages.medibuntu.org quantal Release.gpg                               Hit http://archive.ubuntu.com quantal Release.gpg                                   Ign http://archive.canonical.com nadia Release                                      Ign http://security.ubuntu.com nadia-security Release                               Hit http://dl.google.com stable Release                                             Hit http://ppa.launchpad.net quantal/main Sources                                   Hit http://archive.canonical.com quantal Release                                    Get:4 http://security.ubuntu.com quantal-security Release [49.6 kB]                 Hit http://dl.google.com stable Release                                             Get:5 http://archive.ubuntu.com quantal-updates Release.gpg [933 B]                 Hit http://ppa.launchpad.net quantal/main i386 Packages                             Ign http://packages.medibuntu.org nadia Release                                     Get:6 http://packages.linuxmint.com nadia/main i386 Packages [22.6 kB]              Hit http://dl.google.com stable/main i386 Packages                                  Hit http://packages.medibuntu.org quantal Release                                   Get:7 http://packages.linuxmint.com nadia/upstream i386 Packages [11.3 kB]          Hit http://archive.canonical.com quantal/partner i386 Packages                      Get:8 http://packages.linuxmint.com nadia/import i386 Packages [44.0 kB]            Hit http://dl.google.com stable/main i386 Packages                                  Ign http://archive.ubuntu.com nadia Release                                         Ign http://archive.ubuntu.com nadia-updates Release                                 Hit http://archive.ubuntu.com quantal Release                                       Get:9 http://archive.ubuntu.com quantal-updates Release [49.6 kB]                   Ign http://ppa.launchpad.net quantal/main Translation-en_IN                         Ign http://ppa.launchpad.net quantal/main Translation-en                            Get:10 http://security.ubuntu.com quantal-security/main i386 Packages [104 kB]      Hit http://packages.medibuntu.org quantal/free i386 Packages                        Hit http://packages.medibuntu.org quantal/non-free i386 Packages                    Ign http://dl.google.com stable/main Translation-en_IN                              Err http://archive.canonical.com nadia/partner i386 Packages                          404  Not Found [IP: 91.189.92.191 80]     Ign http://dl.google.com stable/main Translation-en                                 Ign http://archive.canonical.com nadia/partner Translation-en_IN                    Ign http://dl.google.com stable/main Translation-en_IN                              Ign http://archive.canonical.com nadia/partner Translation-en                       Ign http://dl.google.com stable/main Translation-en                                 Ign http://archive.canonical.com quantal/partner Translation-en_IN                  Get:11 http://security.ubuntu.com quantal-security/restricted i386 Packages [3,531 B]     Ign http://archive.canonical.com quantal/partner Translation-en                     Get:12 http://security.ubuntu.com quantal-security/universe i386 Packages [45.8 kB]     Get:13 http://security.ubuntu.com quantal-security/multiverse i386 Packages [1,402 B]     Hit http://security.ubuntu.com quantal-security/main Translation-en                 Hit http://security.ubuntu.com quantal-security/multiverse Translation-en           Hit http://archive.ubuntu.com quantal/main i386 Packages                            Ign http://packages.linuxmint.com nadia/import Translation-en_IN                    Hit http://archive.ubuntu.com quantal/restricted i386 Packages                      Hit http://security.ubuntu.com quantal-security/restricted Translation-en           Hit http://archive.ubuntu.com quantal/universe i386 Packages                        Hit http://archive.ubuntu.com quantal/multiverse i386 Packages                      Ign http://packages.linuxmint.com nadia/import Translation-en                       Hit http://security.ubuntu.com quantal-security/universe Translation-en             Ign http://packages.linuxmint.com nadia/main Translation-en_IN                      Hit http://archive.ubuntu.com quantal/main Translation-en                           Ign http://packages.linuxmint.com nadia/main Translation-en                         Ign http://packages.linuxmint.com nadia/upstream Translation-en_IN                  Hit http://archive.ubuntu.com quantal/multiverse Translation-en                     Ign http://packages.linuxmint.com nadia/upstream Translation-en                     Hit http://archive.ubuntu.com quantal/restricted Translation-en                     Hit http://archive.ubuntu.com quantal/universe Translation-en                       Get:14 http://archive.ubuntu.com quantal-updates/main i386 Packages [225 kB]        Get:15 http://archive.ubuntu.com quantal-updates/restricted i386 Packages [4,841 B]     Get:16 http://archive.ubuntu.com quantal-updates/universe i386 Packages [179 kB]     Get:17 http://archive.ubuntu.com quantal-updates/multiverse i386 Packages [10.8 kB]     Hit http://archive.ubuntu.com quantal-updates/main Translation-en                   Hit http://archive.ubuntu.com quantal-updates/multiverse Translation-en             Hit http://archive.ubuntu.com quantal-updates/restricted Translation-en             Hit http://archive.ubuntu.com quantal-updates/universe Translation-en               Err http://packages.medibuntu.org nadia/free i386 Packages                            404  Not Found     Err http://packages.medibuntu.org nadia/non-free i386 Packages                        404  Not Found     Err http://security.ubuntu.com nadia-security/main i386 Packages                      404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.medibuntu.org nadia/free Translation-en_IN                      Err http://security.ubuntu.com nadia-security/restricted i386 Packages                404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com nadia-security/universe i386 Packages                  404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.medibuntu.org nadia/free Translation-en                         Err http://security.ubuntu.com nadia-security/multiverse i386 Packages                404  Not Found [IP: 91.189.92.200 80]     Ign http://security.ubuntu.com nadia-security/main Translation-en_IN                Ign http://packages.medibuntu.org nadia/non-free Translation-en_IN                  Ign http://security.ubuntu.com nadia-security/main Translation-en     Ign http://security.ubuntu.com nadia-security/multiverse Translation-en_IN          Ign http://packages.medibuntu.org nadia/non-free Translation-en                     Ign http://security.ubuntu.com nadia-security/multiverse Translation-en     Ign http://security.ubuntu.com nadia-security/restricted Translation-en_IN          Ign http://packages.medibuntu.org quantal/free Translation-en_IN                    Ign http://security.ubuntu.com nadia-security/restricted Translation-en     Ign http://security.ubuntu.com nadia-security/universe Translation-en_IN            Ign http://security.ubuntu.com nadia-security/universe Translation-en               Ign http://security.ubuntu.com quantal-security/main Translation-en_IN              Ign http://security.ubuntu.com quantal-security/multiverse Translation-en_IN        Ign http://security.ubuntu.com quantal-security/restricted Translation-en_IN        Ign http://security.ubuntu.com quantal-security/universe Translation-en_IN          Ign http://packages.medibuntu.org quantal/free Translation-en                       Ign http://packages.medibuntu.org quantal/non-free Translation-en_IN                Ign http://packages.medibuntu.org quantal/non-free Translation-en                   Err http://archive.ubuntu.com nadia/main i386 Packages        404  Not Found [IP: 91.189.92.202 80]     Err http://archive.ubuntu.com nadia/restricted i386 Packages       404  Not Found [IP: 91.189.92.202 80]     Err http://archive.ubuntu.com nadia/universe i386 Packages       404  Not Found [IP: 91.189.92.202 80]     Err http://archive.ubuntu.com nadia/multiverse i386 Packages       404  Not Found [IP: 91.189.92.202 80]     Ign http://archive.ubuntu.com nadia/main Translation-en_IN     Ign http://archive.ubuntu.com nadia/main Translation-en     Ign http://archive.ubuntu.com nadia/multiverse Translation-en_IN     Ign http://archive.ubuntu.com nadia/multiverse Translation-en     Ign http://archive.ubuntu.com nadia/restricted Translation-en_IN     Ign http://archive.ubuntu.com nadia/restricted Translation-en     Ign http://archive.ubuntu.com nadia/universe Translation-en_IN     Ign http://archive.ubuntu.com nadia/universe Translation-en     Err http://archive.ubuntu.com nadia-updates/main i386 Packages       404  Not Found [IP: 91.189.92.202 80]     Err http://archive.ubuntu.com nadia-updates/restricted i386 Packages       404  Not Found [IP: 91.189.92.202 80]     Err http://archive.ubuntu.com nadia-updates/universe i386 Packages       404  Not Found [IP: 91.189.92.202 80]     Err http://archive.ubuntu.com nadia-updates/multiverse i386 Packages       404  Not Found [IP: 91.189.92.202 80]     Ign http://archive.ubuntu.com nadia-updates/main Translation-en_IN     Ign http://archive.ubuntu.com nadia-updates/main Translation-en     Ign http://archive.ubuntu.com nadia-updates/multiverse Translation-en_IN     Ign http://archive.ubuntu.com nadia-updates/multiverse Translation-en     Ign http://archive.ubuntu.com nadia-updates/restricted Translation-en_IN     Ign http://archive.ubuntu.com nadia-updates/restricted Translation-en     Ign http://archive.ubuntu.com nadia-updates/universe Translation-en_IN     Ign http://archive.ubuntu.com nadia-updates/universe Translation-en     Ign http://archive.ubuntu.com quantal/main Translation-en_IN     Ign http://archive.ubuntu.com quantal/multiverse Translation-en_IN     Ign http://archive.ubuntu.com quantal/restricted Translation-en_IN     Ign http://archive.ubuntu.com quantal/universe Translation-en_IN     Ign http://archive.ubuntu.com quantal-updates/main Translation-en_IN     Ign http://archive.ubuntu.com quantal-updates/multiverse Translation-en_IN     Ign http://archive.ubuntu.com quantal-updates/restricted Translation-en_IN     Ign http://archive.ubuntu.com quantal-updates/universe Translation-en_IN     Fetched 771 kB in 1min 19s (9,715 B/s)     W: Failed to fetch http://archive.canonical.com/ubuntu/dists/nadia/partner/binary-i386/Packages  404  Not Found [IP: 91.189.92.191 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/nadia-security/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/nadia-security/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/nadia-security/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/nadia-security/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://packages.medibuntu.org/dists/nadia/free/binary-i386/Packages  404  Not Found          W: Failed to fetch http://packages.medibuntu.org/dists/nadia/non-free/binary-i386/Packages  404  Not Found          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia-updates/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia-updates/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia-updates/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/nadia-updates/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]          E: Some index files failed to download. They have been ignored, or old ones used instead.           My Sources.list looks like :               deb http://packages.linuxmint.com/ nadia main upstream import     deb http://archive.ubuntu.com/ubuntu/ nadia main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu/ nadia-updates main restricted universe multiverse     deb http://security.ubuntu.com/ubuntu/ nadia-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ nadia partner     deb http://packages.medibuntu.org/ nadia free non-free          # deb http://archive.getdeb.net/ubuntu quantal-getdeb apps     # deb http://archive.getdeb.net/ubuntu quantal-getdeb games     deb http://archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse     deb http://security.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ quantal partner     deb http://packages.medibuntu.org/ quantal free non-free          # deb http://archive.getdeb.net/ubuntu quantal-getdeb apps     # deb http://archive.getdeb.net/ubuntu quantal-getdeb games


title: SCO Unix run interactive script when sending a print job

text: I'm working with (read, "around") a proprietary ERP system on top of SCO Unix. It has several "query at print time" reports where you can assign a printer to send your job to. You usually input something like "%lp5", which spools your job to printer lp5. If I want to create a pseudo-printer that will interact with the user and then return control to the ERP how would I go about it? I have manipulated the LP interfaces scripts in the vein of this article, to include dynamic data into the reports and flow control to a print server. But now I want to do actual interaction with the user to connect print jobs with a separate HylaFax server that I've built, so I need a way of triggering a shell script and asking the user for fax coversheet information. Our system has a built in fax system using VsiFax (which I'm trying to subvert), but I don't see how it is performing the same function I'm trying to do. You usually send your job to the VsiFax system by printing to "@fax" which I don't know if it's a hardcoded printer on the ERP side or if there is some Unix convention that is being used to call a shell script. I guess what I'm looking for is a resource or some help on what the SCO Unix printer assignment conventions might be related to syntax of printer names (what does "@" and "%" mean and are there other special characters, and how I could call a shell script when sending that print job?


title: What format does man use?

text: A piece of software wants to know for its configuration whether my man uses nroff or vt100 "catman" pages. How do I determine this?


title: xfdesktop (xfce4) broken? (can't set wallpaper)

text: On start-up, xfce4 loads lots of desktop pictures (I have the settings set to 'image list') one after another (about 10, but I have the feeling it gets more and more). That by itself would be no problem, but then it decides to show no background image, just an awful shade of brown. Plus, it shows files (icons) on the desktop, which I don't want. Where could I start to look to fix it?


title: Building custom glibc and compiling program against it

text: I've been scouring the internet for a couple of days now to get some information on how to (cross)compile glibc and then compile a program against it. So far, I've managed to compile glibc using the following commands   `../configure arm-none-linux-gnueabi --host=arm-none-linux-gnueabi --target=arm-linux-gnueabi --prefix=`pwd` --build=i686-pc-linux-gnu` make -j4 ` As for the program itself, I followed this post and it all seemed to work..Until I realized that none of the changes that I made to glibc were reflecting. To come up with a test to verify whether the library was infact being linked against, I made the following changes:   I modified `include/signal.h` and added `extern int my_test_fn(void);`   I then modified `signal/signal.c` first and then `sysdeps/posix/signal.c` and went on to add the function definition as follows:               int my_test_fn() {         errno=13; //EACCESS     }      When I tried compiling my program, it threw up   `In function `tuning_library_init': /home/guru/workspace/tuning- library/tuning_library.c:1076: undefined reference to `my_test_fn' collect2: error: ld returned 1 exit status make: *** [host] Error 1 `


title: Change default DNS on openvpn connect

text: I am using Network Manager on Ubuntu 12.10 to connect to an openvpn server. The connection works without problems. However, when I connect, I would like to change my default DNS server to a server on the vpn network. That way I can use domain names that are only defined on the vpn network. Is there a way I can make this automatic with Network Manager? I can also change settings on the openvpn server if that is the way I need to go. Thanks!


title: Installing RPMS on Centos

text: Is generally installing standalone rpms considered 'dangerous'? Are these affected by any system upgrades, package upgrades etc.? How about dependencies and libraries?


title: setuid and setgid confusion

text: I'm trying to fully grasp the concept of setuid and setgid, and I'm not quite sure in what way permissions are actually elevated. Let me provide an example: **Users**               userA (groups: userA groupA)     userB (groups: userB groupB GroupC)      **Executable**               Permission owner group  filename     -rws-----x userA groupD file     -rwsrws--x userA groupD file2      If userB executes `file` and `file2`, what group permission will the executables have? What I'm not completely sure about, is whether the executable gains user/group permissions of _both_ the caller and the file owner, or if permissions are "replaced". I know this is a silly example, as setuid and setgid will normally be used to envoke "all-powerful" applications, but I hope this example will be better at actually conceptualizing how setuid and setgid works.


title: Have I been hacked?

text: I run a dedicated server, where I noticed a high CPU usage recently, and checked the processes. It appears someone (mick account) was mining on my server. How is this possible? The process is below. I have suspended the account. What else would I need to do?               25516 mick  30  10  778m 6728 1132 S 740.5  0.2   8463:59 /tmp/sh64 -o stratum+tcp://multi1.wemineall.com:80 -u weedee.1 -p x --algo scrypt -B


title: find files without extension

text: Let say I have:               foo.txt     bar     baz.ooo      If I use `ls -1 !(*.*)` then I'll get only `bar` on the output. Great, now I wish to have same results with find - some `find -regex` that will do the job. **NOTE:** `find -name !(*.*)` is not the answer as `!(*.*)` in it is still Bash's glob which I can NOT use.


title: Deduplication on partition level

text: What are available solutions for block level or more detailed deduplication ? There are file-based ones - with "Copy-On-Write" approach. I'm looking for block level "copy-on-write", so I could periodically look for common blocks, or - preferably - parts of files, merge them and flag for CoW use manner. Is there sth like this available, or does it still need to be created ? I am not sure if Btrfs deduplication is block/file/subpart level ? There is LessFS, but I'am not sure what level of deduplication does it provide ? Maybe other solution?


title: is it possible to send the remote connector ip via netcat?

text: Actually I want to make something like ifconfig.me functionality but only for my internal network. I see it the way smth on server listens some port and send ip of connected remote machine. Seems `nc` is a great utility for my issue (also I haven't any php/python/whatever on server. just only shell and standard unix tools). I can see remote ip and dns name if I launch `nc -vv` and connect to it from remote system, but I can't find the way to send them to remote host. Or maybe I chose too strange path and there is another simpler solution?


title: CIFS vs SAMBA, What are the differences

text: What are the differences between CIFS and SAMBA? When would you use one over the other? Are there any performance differences between the two?


title: Parameter substitution and error messages: suppressing line numbers etc

text: Here is my example file:               !/bin/bash     # argument-one          # Is first argument missing?          # First method     [[ "$1" == "" ]] && echo "Usage: $(basename $0) filename"; exit 1          # Second method     # filename=${1?"Usage: $(basename $0) filename"}      In the above script, I get a "clean" message `Usage: argument-one filename` when I run the above script with no arguments; and it exits cleanly. However, if I comment out line 7 and uncomment line 10, I get this error message when the program exits: `./argument-one: line 10: 5: Usage: argument-one filename` This message suggests that there is something wrong with the program that triggered it to exit, when in fact, it was actually an invocation with no arguments, which is a usage issue. But line 10 is preferable because it is more terse and also assigns a variable if available. My question is: "How might I retain only the message part and filter out or disable the `./argument-one: line 10: 5:` part of the usage message? Thanks.


title: Partitioning for Web Servers

text: I was curious what some general best practices are in relation to partitioning for a new Linux VM that will be used as a web server? Are there certain guides that should be consulted or followed? What partitions should be created? What are the common sizes for the various partitions that should be created? Should I worry about LVMs, and if so, what do I need to know about them? I am working on building a template for many new web server builds and I wanted to make sure that I have something that will be able to be used now and for a little while into the future to turn up new servers with. Also, this will likely be used on CentOS 6.x or RHEL 6.x.


title: TFTP server not listening on port defined

text: I started a tftp server with `atftpd -v --port 69 --bind-address 10.10.10.2 --daemon /srv/tftp/` command, but for some reason I do not see TFTP server listening on port 69 in ss/netstat output. However, if I connect to a TFTP server with TFTP client, I'm able to transfer files and automatically another instance of TFTP server starts(PID 5191):               # ss -l -4 -u     Recv-Q Send-Q                                 Local Address:Port                                     Peer Address:Port        # ss -l -6 -u     Recv-Q Send-Q                                 Local Address:Port                                     Peer Address:Port        # pgrep -lf tftp     4316 /usr/sbin/atftpd -v --port 69 --bind-address 10.10.10.2 --daemon /srv/tftp/     5191 in.tftpd --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /srv/tftp     #       `in.tftpd` is a symbolic link to `/usr/sbin/atftpd`. How are clients able to connect to TFTP server if the TFTP server is not listening on UDP port 69? Are there other servers which work in a same manner?


Can't start X window because reporting can't find a valid framebuffer device. Here is the error output below:               "X Window System Version 7.1.1     Release Date: 12 May 2006     X Protocol Version 11, Revision 0, Release 7.1.1     Build Operating System: Linux 2.6.18-164.11.1.el5 ppc Red Hat, Inc.     Current Operating System: Linux scenarioa12.scenario.netfinity.com 2.6.18-194.el5 #1 SMP Tue Mar 16 22:03:12 EDT 2010 ppc64     Build Date: 06 March 2010     Build ID: xorg-x11-server 1.1.1-48.76.el5     Before reporting problems, check http://wiki.x.org to make sure that you have the latest version.     Module Loader present     Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational,(WW) warning, (EE) error, (NI) not implemented, (??)unknown.     (==) Log file: "/var/log/Xorg.0.log", Time: Thu Mar 29 09:13:43 2012     (==) Using config file: "/root/xorg.conf"     (WW) ****INVALID IO ALLOCATION**** b: 0xf400fc00 e: 0xf400fcff correcting     (EE) end of block range 0xf3ffffff < begin 0xf4000000     (**) RADEON(0): RADEONPreInit     (EE) Unable to find a valid framebuffer device     (EE) RADEON(0): Failed to open framebuffer device, consult warnings and/or errors above for possible reasons     (you may have to look at the server log to see warnings)     Backtrace:     0: X(xf86SigHandler+0x98) [0x100a89d8]     1: [0x100344]     2: /usr/lib/xorg/modules/drivers/radeon_drv.so(RADEONPreInit+0xcb8) [0xf46fe18]     3: X(InitOutput+0xadc) [0x10066f4c]     4: X(main+0x274) [0x10027864]     5: /lib/libc.so.6 [0xfe2dde0]     6: /lib/libc.so.6 [0xfe2e020]     Fatal server error:     Caught signal 7.  Server aborting     XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"       after 0 requests (0 known processed) with 0 events remaining."     And some other info may help:      Here is the configuration of `xorg.conf`:               console# cat /etc/X11/xorg.conf          # Xorg configuration created by pyxf86config           Section "ServerLayout"         Identifier     "Default Layout"         Screen      0  "Screen0" 0 0         InputDevice    "Keyboard0" "CoreKeyboard"      EndSection           Section "InputDevice"         Identifier  "Keyboard0"         Driver      "kbd"         Option      "XkbModel" "pc105"         Option      "XkbLayout" "us"      EndSection           Section "Device"         Identifier  "Videocard0"         Driver      "vesa"         Option      "UseFBDev" "true"      EndSection           Section "Screen"         Identifier "Screen0"         Device     "Videocard0"         DefaultDepth     24         SubSection "Display"                 Viewport   0 0                 Depth     24         EndSubSection      EndSection


title: Use AWK add new line if match exists

text: I have a file with the following format:               aaa@ bbb     bbb@ ccc& ddddd@ aaaf     ccc@ ddd& eee: abcd& dassda      The output should be:               aaaa@ bbb     bbb@ ccc&     ddddd@ aaaf     ccc@ ddd&     eee@ abcd& dassda      How would I be able to achieve this using AWK? I've tried sed and awk but I can only print a new line after the delimeter, I don't know how to print the whole thing on the next line.


title: Java on FreeBSD

text: Is it possible to get the latest Java (Java 7u3 or Java 6u31) on FreeBSD? Everything i found on the internet is outdated. I currently have 6u24 from the packagemanager which works for now but may get problematic really soon.


title: QEMU-KVM and internal DHCP server

text: I have set up a few soon-to-be production VMs running on QEMU-KVM on Ubuntu 10.04 LTS. As for networking, I chose the "NAT" option in Virt-Manager and each VM now gets an IP address 192.168.122.x from QEMU's internal DHCP server. I've restarted the VMs several times and the IP addresses are always the same. I've given each VM a network adapter with a unique MAC address. So can I rely on that QEMU's internal DHCP server will give out the same IP addresses? Or is the safest option to set static IP addresses from within each VM?


title: Quickly find which file(s) belongs to a specific inode number

text: I know of this command:               find /path/to/mountpoint -inum <inode number>      but it is a very slow search, I feel like there has to be a faster way to do this. Does anybody know a faster method?


title: Is the Minix 3 license GPL compatible?

text: Does anyone know if Minix 3's license is GPL compatible? It's a BSD-style license, but I'm not entirely sure if it's compatible with the GPL. Here is a link to the license: http://www.minix3.org/other/license.html


title: Windows in Gnome on Ubuntu 10.10 are frozen

text: I saw a question in SuperUser titled How do I restart a frozen screen in Ubuntu without losing any open windows? and I think it would be helpful, but the problem is I can't switch to any of the TTYs. I'm trying to switch to tty 1 with `Ctrl`+`Alt`+`F1` and it doesn't work, and honestly I even can't say if it has ever been worked before. The problem already occured one time about one month ago and fixed after 3 hours of waiting but this time the difference is that the cursor is moving and the clock is working right. Moreover all system monitor indicators show current state of hardware so it seems that the processor, disc, RAM and swap are also working. It happened during moving a terminal window to another part of workspace which is displayed on second monitor. And, what is strange, I can see mini dialog box with the resolution of the window that I have never seen before. Trying to unplug the second monitor didn't help. What can I do to unfreeze it and to not lose unsaved data? Shortcut `Super`+`D` made GNOMEs windows unfrozen so in similar cases this should be helpful.


title: Are nautilus and command-line commands the same?

text: When I copy, move, or delete a file in Nautilus or using the corresponding commands (cp, mv, or rm) does the same tool perform the action behind the wraps? I ask because nautilus tends to hang on big files or too many files. I have the impression that it's not that efficient.


title: configuring hubot to connect to a local openfire server

text: I'm running Ubuntu and I am trying to get a hubot to connect to my local openfire server. I followed the tutorial here, and everything went pretty smooth till toward the end, after editing the dependencies, I run `npm install` and receive two warnings:               npm WARN package.json node-xmpp@0.3.2 'repositories' (plural) Not supported.     npm WARN package.json Please pick one as the 'repository' field          > node-stringprep@0.1.11 install /opt/hubot/my-bot/node_modules/node-stringprep     > node-gyp rebuild      Since they are warnings and not errors I went ahead and started hubot to see if it would connect but it doesn't. I don't get any errors from it but it doesn't connect. The output when I run the bot:               jake@jake-Lenovo-G580:/opt/hubot/my-bot$ ./bin/hubot --adapter xmpp     npm WARN package.json node-xmpp@0.3.2 'repositories' (plural) Not supported.     npm WARN package.json Please pick one as the 'repository' field          > node-stringprep@0.1.11 install /opt/hubot/my-bot/node_modules/node-stringprep     > node-gyp rebuild          make: Entering directory `/opt/hubot/my-bot/node_modules/node-stringprep/build'       CXX(target) Release/obj.target/node_stringprep/node-stringprep.o       SOLINK_MODULE(target) Release/obj.target/node_stringprep.node       SOLINK_MODULE(target) Release/obj.target/node_stringprep.node: Finished       COPY Release/node_stringprep.node     make: Leaving directory `/opt/hubot/my-bot/node_modules/node-stringprep/build'     [Mon Dec 30 2013 13:39:23 GMT-0700 (MST)] INFO { username: 'hubot',       password: 'asdf',       host: '127.0.0.1',       port: '9090',       rooms: [ { jid: 'hubot-test', password: false } ],       keepaliveInterval: 30000 }      And nothing happens. I double checked all the hubot xmpp fields several times to make sure they are correct, and although this particular output does not have it, I tried several variations of usernames -> `hubot@jake-lenovo-g580` and `hubot@jake- Lenovo-G580`. Any help much appreciated.


title: How to write a script that will open up multiple tabs in the terminal?

text: I am on OSX and using iTerm I have this so far               #!/bin/sh          open /Applications/iTerm.app &          exit 0      So after opening, I need two windows and one of those windows will need to open 6 tabs. two of those tabs will need to enter into a certain directory, one of those needs to run an app like               cd ~/Desktop/projects/myNodeApp     node app.js


title: iptables redirect traffic from VPN interface to next interface

text: Can you help me with this problem please? I need redirect all traffic from tun0 interface (OpenVPN tunnel) to eth1 interface. eth1 is internal network behind this system which works as special firewall... If I use this rule (now only for testing purposes - destination port 80):               iptables -t nat -A PREROUTING -i tun0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.199.115.146      traffic from VPN pass correctly. I see it in iptables statistic (iptables -L -v), but reverse traffic does not pass. iptables shows this error:               99689.703349 x_tables: ip_tables: tcp match: only valid for protocol 6        I need redirect all traffic from machine behind firewall only via tun0 interface. I use this rule too:               iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE         I have enabled `ip_forward`. If I use rule only with `-p tcp` without `-m tcp` I see in iptables statistic activity in the rule `iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE` **interfaces** _VPN Server (A):_               eth0      Link encap:Ethernet  HWaddr 00:...               inet addr:MY_PUBLIC_IP  Bcast:MY_PUBLIC_IP.255  Mask:255.255.255.0               inet6 addr: .../64 Scope:Global               inet6 addr: .../64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:41909528 errors:0 dropped:0 overruns:0 frame:0               TX packets:373639 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:2150448064 (2.1 GB)  TX bytes:185713075 (185.7 MB)               Interrupt:10          tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00               inet addr:10.1.1.1  P-t-P:10.1.1.2  Mask:255.255.255.255               UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1               RX packets:82014 errors:0 dropped:0 overruns:0 frame:0               TX packets:164251 errors:0 dropped:24 overruns:0 carrier:0               collisions:0 txqueuelen:100               RX bytes:5945388 (5.9 MB)  TX bytes:147587733 (147.5 MB)      **on firewall machine:**               eth0      Link encap:Ethernet  HWaddr 08:...               inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:189399 errors:0 dropped:0 overruns:0 frame:0               TX packets:103528 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:180399131 (180.3 MB)  TX bytes:14844868 (14.8 MB)               tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00               inet addr:10.1.1.2  P-t-P:10.1.1.1  Mask:255.255.255.255               UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1               RX packets:153314 errors:0 dropped:0 overruns:0 frame:0               TX packets:80986 errors:0 dropped:8 overruns:0 carrier:0               collisions:0 txqueuelen:100               RX bytes:145341797 (145.3 MB)  TX bytes:5818996 (5.8 MB)          eth1      Link encap:Ethernet  HWaddr 08:...               inet addr:10.199.115.1  Bcast:10.199.115.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:6890 errors:0 dropped:0 overruns:0 frame:0               TX packets:23022 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:710721 (710.7 KB)  TX bytes:43966879 (43.9 MB)      _machine B:_               eth0      Link encap:Ethernet  HWaddr 08:...               inet addr:10.199.115.146  Bcast:10.199.155.255  Mask:255.255.255.0               inet6 addr: .../64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:24185 errors:0 dropped:0 overruns:0 frame:0               TX packets:8044 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:29645960 (28.2 MiB)  TX bytes:842414 (822.6 KiB)      **Schema:** `VPN server (A) /eth0 - public IP, tun0 VPN/ <-> Firewall (F) /tun0 VPN, eth1 - internal network/ <-> Server (B) (eth0 - internal network)` Communication which is initialized from machine behind the firewall works ok. Thank you very much for your help. **Routing tables:** VPN server A: - is VPS server               10.1.1.2 dev tun0  proto kernel  scope link  src 10.1.1.1     MY_PUBLIC_IP.0/24 dev eth0  proto kernel  scope link  src MY_PUBLIC_IP     10.199.115.0/24 via 10.1.1.2 dev tun0     default via MY_PUBLIC_IP.1 dev eth0  metric 100      _///one physical server_ Firewall F: is virtual machine VirtualBox Ubuntu - eth0 is VirtualBox NAT, but I need use tun0 and eth1 is local network for B               0.0.0.0/1 via 10.1.1.1 dev tun0     default via 10.0.2.2 dev eth0  metric 100     10.0.2.0/24 dev eth0  proto kernel  scope link  src 10.0.2.15     10.1.1.1 dev tun0  proto kernel  scope link  src 10.1.1.2     10.199.115.0/24 dev eth1  proto kernel  scope link  src 10.199.115.1     MY_PUBLIC_IP via 10.0.2.2 dev eth0     128.0.0.0/1 via 10.1.1.1 dev tun0      B machine on eth1 side (no eth0) is virtual machine Debian 7               default via 10.199.115.1 dev eth0 proto static     10.199.115.0/24 dev eth0 proto kernel scope link src 10.199.115.146      Route for packets should be as much as possible transparent even invisible... **iptables rules:** **_on VPN Server (A):_** only table NAT:               -P PREROUTING ACCEPT     -P POSTROUTING ACCEPT     -P OUTPUT ACCEPT     -A PREROUTING -i eth0 -p tcp -m tcp --dport 0:1192 -j DNAT --to-destination 10.1.1.2     -A PREROUTING -i eth0 -p tcp -m tcp --dport 1195:65535 -j DNAT --to-destination 10.1.1.2     -A PREROUTING -i eth0 -p udp -m udp --dport 0:1192 -j DNAT --to-destination 10.1.1.2     -A PREROUTING -i eth0 -p udp -m udp --dport 1195:65535 -j DNAT --to-destination 10.1.1.2     -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE      _FILTER table_               is empty       _MANGLE table_               is empty      **_on firewall (F):_** currently after last modification _NAT table:_               none      _FILTER table_               contains many specific rules for mitigation etc...        _MANGLE table_               is empty      **_on machine B_**               without iptables rules


title: How do I do a ls and then sort the results by date created?

text: In what order are the dated ordered by? Certainly not alphanumeric order. `ls -lt` sorts by modification time. But I need creation time.


title: Deleted header file /bits/types.h

text: On compiling a program using `gcc`, I was getting syntax errors in `/sys/types.h`. While investigating the problem, I ended up mixing up the `/bits/types.h` and `/sys/types.h` and I mistakenly deleted `/sys/types.h` as well created some problems in `/sys/types.h` How do I fix this ? Are they a part of the `linux-headers` package ? I am using Ubuntu 12.04 x86 with Kernel 3.2.0-36-generic


title: How to get rid of `mosh` spamming `last -f /var/log/wtmp`?

text: Ever since I've started using mosh, I'm getting way too many entries in my `/var/log/wtmp` file of last(1) on a Linux box.               cnst     pts/8        172.56.2x.yz via Mon May 19 08:19   still logged in     cnst     pts/8        mosh [50892]     Mon May 19 08:19 - 08:19  (00:00)     cnst     pts/8        172.56.2x.yz via Mon May 19 08:18 - 08:19  (00:01)     cnst     pts/8        mosh [50892]     Mon May 19 08:18 - 08:18  (00:00)     cnst     pts/8        172.56.2x.yz via Mon May 19 08:18 - 08:18  (00:00)     cnst     pts/8        mosh [50892]     Mon May 19 08:18 - 08:18  (00:00)     cnst     pts/8        172.56.2x.yz via Sun May 18 20:11 - 08:18  (12:06)     cnst     pts/8        mosh [50892]     Sun May 18 20:11 - 20:11  (00:00)     cnst     pts/8        172.56.2x.yz via Sun May 18 20:11 - 20:11  (00:00)     cnst     pts/8        mosh [50892]     Sun May 18 20:10 - 20:11  (00:00)     cnst     pts/8        172.56.2x.yz via Sun May 18 19:55 - 20:10  (00:15)     cnst     pts/8        mosh [50892]     Sun May 18 19:55 - 19:55  (00:00)     cnst     pts/8        172.56.2x.yz via Sun May 18 19:55 - 19:55  (00:00)     cnst     pts/8        mosh [50892]     Sun May 18 19:55 - 19:55  (00:00)     cnst     pts/8        172.56.2x.yz via Sun May 18 19:24 - 19:55  (00:30)     cnst     pts/8        mosh [50892]     Sun May 18 19:24 - 19:24  (00:00)     cnst     pts/8        172.56.2x.yz via Sun May 18 19:24 - 19:24  (00:00)     cnst     pts/8        mosh [50892]     Sun May 18 19:23 - 19:24  (00:00)      What's up with those 00 hours, 00 minutes, login entries? Any way to adjust the parameters of mosh to not be so strict about reporting the very brief periods in the loss of connectivity? Not really interested in having a couple of seconds of connectivity issues reported so loudly.


title: Changing user while scp

text: I need to copy file between Linux machines. The problem that the user I use to login (`myuser`), is different from the user that can access the file. If I just `ssh` to the machine, I can switch the user using `sudo su someuser`, can I do it somehow while `scp`? While using WinSCP I managed to do it, by configuring the SCP/Shell, so I believe there must be a similar way to do it via pure shell.


title: Fedora installation problem on virtualbox

text: I try to install Fedora as a guest operating system on VirtualBox in Windows7 64-bit.I download Fedora-17-x86_64-Live-Desktop.iso first and when I begin to install everything fine until I see "Congratulations,you succesfully install fedora" page.When I reboot fedora virtualbox stopped.I search on google but could not find anything to solve my problem.


title: Unpacking kernel-source rpm off-system (OpenSuse)?

text: I'm using OpenSuse 11.2 from a LiveUSB USB flash/stick, which arguably has not much place on it. I need to get the Linux sources for this version of OpenSuse, as they are needed to build a driver for an application I'm using. I have plenty of disk space on an attached hard-drive, so I'd like to "install" the sources there ( _note that on 11.2,`zypper --download-only` will by default download to /var/cache/zypp/packages, which crashes my LiveUSB setup_). So, I do the following:               > cd /media/myhdrive/     > wget http://download.opensuse.org/update/11.2/rpm/src/kernel-source-2.6.31.14-0.8.1.src.rpm          > mkdir kernel-source-2.6.31.14     > cd kernel-source-2.6.31.14/     > rpm2cpio ../kernel-source-2.6.31.14-0.8.1.src.rpm | cpio -idmv --no-absolute-filenames          > ls     arch-symbols              kernel-source.rpmlintrc   patches.kabi.tar.bz2     built-in-where            kernel-source.spec        patches.kernel.org.tar.bz2     check-for-config-changes  kernel-source.spec.in     patches.rpmify.tar.bz2     check-supported-list      kernel-spec-macros        patches.rt.tar.bz2     compute-PATCHVERSION.sh   kernel-syms.spec.in       patches.staging.tar.bz2     ....      ... and there is a bunch of `*.tar.gz` files (patches) - and not anything resembling C source files. I'm guessing there is a script/command I should apply now to unpack the source tree, but I have no idea what it - I've seen `rpmbuild -bb ...` here, but I guess that will build yet another `.rpm` - while I want the actual sources unpacked (and that at a location I specify - not in `/usr/src` or anywhere on root filesystem). Any ideas what I should do now? Many thanks in advance for any answers,   Cheers! EDIT: via Building a custom kernel - FedoraProject, trying `rpmbuild -bp`, but it fails:               # man rpmbuild:     # -bp    Executes the "%prep" stage from the spec file.  Normally  this  involves     unpacking the sources and applying any patches.          > mkdir src     > rpmbuild --buildroot=$(pwd)/src/ -bp --target=$(uname -m) kernel-source.spec     Building target platforms: i686     Building for target i686     error: Unable to open /usr/src/packages/SOURCES/kernel-spec-macros: No such file or directory


title: How to mask passwords in 'watch' command?

text: I am using `watch` to monitor the progress of a MySQL replication slave. The way I have it set up now, the password shows up in the header of the `watch` output. I am not exceedingly worried that someone will steal the password, but on principle I would prefer not to be showing a naked password to anyone who happens to wander up and look over my shoulder. The command line I am currently using with `watch` is:               watch -n1 -d mysql -pmypass -e "'show slave status\G'"      Should I just bury the `mysql` command in a tiny little shell script?


title: Symbolic link to a socket

text: From a security point of view, is it safe to create a symbolic link to a socket file? The following bits of context refer to the deployment of a web application on a shared hosting service.               $ ls -al ~/runtime/supervisor     srwx------ 1 myuser myuser 0 Oct  6 20:02 supervisord.sock          $ pwd     ~/runtime/deployment_1     $ ln -s ../supervisor/supervisor.sock     $ ls -al     lrwxrwxrwx 1 myuser myuser 47 Oct  6 21:20 supervisord.sock -> ../runtime/supervisor/supervisord.sock=      Should I set any special permissions on the symlink or something else?


title: Systemd/agetty: halt machine when session ends

text: Using LXC running a systemd based container, one automatically gets dropped into a console session on the container. By creating and modifying `/etc/systemd/system/console-getty.service` to have an `ExecStart` line such as the following:               ExecStart=-/sbin/agetty --noclear -a <username> -s console 115200,38400,9600      It's possible to skip the login session and directly drop in to a session running as a particular user. What I would like is for the machine to be automatically halted when this session ends. Is there a way to configure this, either in systemd or agetty? For reference, the host is Ubuntu 12.04 and the container is running a pretty recent Arch basis.


title: Linux and Android apps on ARM vs x86

text: There are a plethora of low-cost ARM-based mini-devices coming out (Cotton Candy, etc). Some of these are Android-only, some Linux-only, and some allow both operating systems to run. The only issue is: all of these are ARM-based devices. While Android apps can run on Android on both x86 and ARM, I'm having a hard time finding useful apps that run on Linux on ARM - in fact, even Ubuntu on ARM is still not that well supported. I have two related questions:   1. Is it hard to make low-cost x86 devices that can run Ubuntu/Linux and relevant x86 applications?   2. How is it that Android apps can run seamlessly on x86 and ARM, while Linux applications have to be recompiled for ARM?


title: Is the chromebook Linux based at its core?

text: Just wondering if the Chromebook uses Linux in some way? If so, would there be a way to run Linux commands (e.g. Ssh) from a command line on it?


title: logrotate won't truncate original file

text: I have this conf for my logrotate:               /tmp/snmp.log {         daily         rotate 12         missingok         notifempty         copytruncate         dateext      } but it won't truncate the original file. it logrotates but keeps on appending to the original file.


title: Remote executing Magic Sys Rq

text: Is it possible to execute Magic SysRq keys on remote machine, using SSH? For example I'm trying to run like this:               xdotool key Alt+Sys_Req+H      But I do not see any help in console, also in /var/log/syslog. Please assume that I do not have root access, and I can't write to /proc/sysrq-trigger.


title: Removing control chars (including console codes / colours) from script output

text: I can use the "script" command to record an interactive session at the command line. However, this includes all control characters _and_ colour codes. I can remove control characters (like backspace) with "col -b", but I can't find a simple way to remove the colour codes. Note that I want to use the command line in the normal way, so don't want to disable colours there - I just want to remove them from the script output. Also, I know can play around and try find a regexp to fix things up, but I am hoping there is a simpler (and more reliable - what if there's a code I don't know about when I develop the regexp?) solution. To show the problem:               spl62 tmp: script     Script started, file is typescript     spl62 lepl: ls     add-licence.sed  build-example.sh  commit-test         push-docs.sh     add-licence.sh   build.sh          delete-licence.sed  setup.py     asn              build-test.sh     delete-licence.sh   src     build-doc.sh     clean             doc-src             test.ini     spl62 lepl: exit     Script done, file is typescript     spl62 tmp: cat -v typescript     Script started on Thu 09 Jun 2011 09:47:27 AM CLT     spl62 lepl: ls^M     ^[[0m^[[00madd-licence.sed^[[0m  ^[[00;32mbuild-example.sh^[[0m  ^[[00mcommit-test^[[0m         ^[[00;32mpush-docs.sh^[[0m^M     ^[[00;32madd-licence.sh^[[0m   ^[[00;32mbuild.sh^[[0m          ^[[00mdelete-licence.sed^[[0m  ^[[00msetup.py^[[0m^M     ^[[01;34masn^[[0m              ^[[00;32mbuild-test.sh^[[0m     ^[[00;32mdelete-licence.sh^[[0m   ^[[01;34msrc^[[0m^M     ^[[00;32mbuild-doc.sh^[[0m     ^[[00;32mclean^[[0m             ^[[01;34mdoc-src^[[0m             ^[[00mtest.ini^[[0m^M     spl62 lepl: exit^M          Script done on Thu 09 Jun 2011 09:47:29 AM CLT     spl62 tmp: col -b < typescript      Script started on Thu 09 Jun 2011 09:47:27 AM CLT     spl62 lepl: ls     0m00madd-licence.sed0m  00;32mbuild-example.sh0m  00mcommit-test0m         00;32mpush-docs.sh0m     00;32madd-licence.sh0m   00;32mbuild.sh0m          00mdelete-licence.sed0m  00msetup.py0m     01;34masn0m              00;32mbuild-test.sh0m     00;32mdelete-licence.sh0m   01;34msrc0m     00;32mbuild-doc.sh0m     00;32mclean0m             01;34mdoc-src0m             00mtest.ini0m     spl62 lepl: exit          Script done on Thu 09 Jun 2011 09:47:29 AM CLT


title: Redirecting without color

text: > **Possible Duplicate:**   >  Removing control chars (including console codes / colours) from script > output How do I disable all color codes when redirecting to file? I previously asked how to redirect everything to file, now I want to know how to redirect without colors. So instead of:               ^[(B^[[m^[[1m^[[31m:: ^[(B^[[m^[[1mDaemon script ^[(B^[[m^[[1m^[[31mntpd^[(B^[[m^[[1m does not exist or is not executable.^[(B^[[m      I'm looking forward to achieve plain: `:: Daemon script ntpd does not exist or is not executable.` ### Update: Looking at jw013 provided link, I tried the `sed` approach: `rc.d restart ntpd | sed -r "s/\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" &> progress.txt` But it didn't even redirect, and simply displayed the colored output to the console. ### Update 2: After user1146332 comment, in order to pipe STDERR, I have to pipe with `|&`. `rc.d restart ntpd | sed -r "s/\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" &> progress.txt` Resulted in: `^[(B:: ^[(BDaemon script ^[(Bntpd^[(B does not exist or is not executable.^[(B` It's tidier, but still some codes remain. But that `sed` RegExp is too hard for me to decypher.


title: Is it possible to uncolor STDIN before writing it to file?

text: > **Possible Duplicate:**   >  Removing control chars (including console codes / colours) from script > output Is there a utility which uncolors colored output? Something like the `uncolor` utility in the example below:               $ ./colored_output | uncolor > plain.txt      The aim is to remove characters like "`[0m[32m`" and "`[0m[1m`" which get additionally output.


title: How can i redirect the output to a file when the program is build with ncurses library

text: > **Possible Duplicate:**   >  Removing control chars (including console codes / colours) from script > output If we redirect output to file in this pattern `top >> somefile.txt`, we get lot of garbage value in the output. But for `top` there is batch (`top -b -n1 >> somefile.txt`) option where the file output is as desired. In case of programs like `nethogs` there is no such options. Is there is good way to output in such case.


title: USB keypad (HID) not responding in linux but in grub

text: An external USB keypad I'd like to use gets recognised as a USB HID device, but it is not functional when Linux is booted. It does work when plugged into a Windows desktop and it does work while in grub, but not when the system has booted. The device is visible on the USB port (05a4:8003):               $ lsusb     Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 002: ID 046d:c078 Logitech, Inc.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 001 Device 004: ID 05a4:8003 Ortek Technology, Inc.      And `dmesg` shows no error when the device gets connected:               [  466.932272] usb 1-1.2: new full-speed USB device number 4 using ehci_hcd     [  467.026740] usb 1-1.2: New USB device found, idVendor=05a4, idProduct=8003     [  467.026745] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [  467.026756] usb 1-1.2: Product: USB Keypad          [  467.026758] usb 1-1.2: Manufacturer: Keypad     [  467.027939] input: Keypad USB Keypad      as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input13     [  467.028099] hid-generic 0003:05A4:8003.0004: input,hidraw1: USB HID v1.10 Keyboard [Keypad USB Keypad     ] on usb-0000:00:1a.0-1.2/input0     [  467.029600] input: Keypad USB Keypad      as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1/input/input14     [  467.029726] hid-generic 0003:05A4:8003.0005: input,hidraw2: USB HID v1.10 Mouse [Keypad USB Keypad     ] on usb-0000:00:1a.0-1.2/input1      The input/event devices are created, but not responding. I wonder whether it is problematic that the device gets registered twice, as Keyboard input and as Mouse input. I'm testing on a Ubuntu 13.04 system. The intended target system is a Raspberry Pi with Rasbian. Since the problem appears on Rasbian in the same way I'm thinking it is Linux related. How can I debug this further? Any idea what could cause this unresponsive behaviour?


title: Measure disk IO latencies of a running process

text: I'm trying to measure the disk IO latencies of a running process to make a histogram. I could do this with DTrace in operating systems that provide it (e.g. as in this Joyent paper), but my application is running in Linux. My first thought was to try `perf`, and I can get counters but I can't find any way to get time deltas. I can get time deltas with `strace` (e.g. `strace -e read -T`), but I'm not sure if I can restrict the trace to disk IO (this system has a busy network interface as well). Is there any way to do this in Linux?


title: extract value between two search patterns on same line

text: I have the following in a file Output.dat. I need to extract the value between **dn: uid=** and **,ou=**                dn: uid=user1,ou=Active,ou=Member,dc=domain,dc=org      dn: uid=user2@abc.com,ou=Active,ou=Member,dc=domain,dc=org      dn: uid=usertest,ou=Active,ou=Member,dc=domain,dc=org      dn: uid=abc1,ou=Active,ou=Member,dc=domain,dc=org      I tried using `sed -e '/dn: uid=/,/,ou=/p' output.dat but it returns complete line instead of value. when tried to use `sed -e '/dn: uid=/,/,ou=/\1/p' output.dat` then got the following error:                   sed: -e expression #1, char 18: unknown command: `\'


title: Unix vs Mac OS X, Notable Difference

text: I was searching Unix vs OS X. I found a notable difference at From http://www.unix.com/unix-dummies-questions-answers/919-mac-osx-vs-unix.html > OS X is a evolutionary kernel from the MACH and BSD linage. Can anyone help me understand this? * * * What are the notable differences between Unix and Mac OS X.


title: How do I get rid of unnecessary mp3 tags in my music library?

text: I have a massive bunch of music. Some of the tracks have unnecessary MP3 flags. How can I get rid of them?


title: How to enable auto login in TTY while getting softwares like tmux work?

text: Currently i'm using flow redirect to enable auto login mode , but when i launch `tmux` in tty1 , it stuck. `c1:12345:respawn:/bin/login -f USERNAME</dev/tty1 > /dev/tty1 2>&1` Is there any better solution for this ?


title: Will VMX cpu flags increase the speed of virtual machine software , like VirtualBox?

text: On some CPUs, if I run `grep vmx /proc/cpuinfo`, I can see a `vmx` flag under the `features` entry. Will this feature speed up virtual machine software like VirtualBox?


title: Debian server doesn't show in DHCP list on router

text: I have a Raspberry Pi running Raspbian which is connected over ethernet to my router. The router has been running both with DCHP and Static IP addresses and over the local LAN I can connect fine over ssh, for example. However, the device never shows in the list of connected devices on the router so I cannot configure port forwarding for external access. I would have said that this was a problem with the router but I have now tried with two different routers (BT Home Hub 2 and Edimax BR-6428) with the same results so I am thinking that it must be the OS. Is there some setting that I need to make the device appear to the router?


title: Success/fail tests for cURL (don't execute second line if first line fails)

text: According to Using "&&" is not effective for cURL submit form (don't execute second line if first line fails) In below code; first line is curl submit; second line is for queuing:               curl -b cookies.txt \         -d title="$(sed '1,/sblmtitle/d;/slpstitle/,$d' sedut.html)" \         -d taxonomy%5Btags%5D%5B1%5D="$(             sed '1,/sblmkategori/d;/slpskategori/,$d' sedut.html         )" \         -d teaser_include=1 \         -d body="$(sed '1,/sblmkonten/d;/slpskonten/,$d' sedut.html)" \         -d field_source%5B0%5D%5Burl%5D="$(             sed '1,/sblmurl/d;/slpsurl/,$d' sedut.html         )" \         -d changed= \         -d form_build_id=form-424f851ad50bd4781c8c25ab7efd5c4c \         -d form_token=0e7cc7437faf816f1ecd96087286bda9 \         -d form_id=post_node_form \         -d op=Save http://www.web.org/submit/post &&     for file in $(ls *.html | sort -r | tail -1); do         mv $file sedut.html     done      If `cURL` fails to submit, it will print out `sedut.html` contents. If `cURL` success submitting, it will print nothing. But `cURL` always giving `0` no matter if it success or failed in submitting. I think the best workflow is "If `cURL` print nothing, run second line" and "If `cURL` print something, don't run second line" I've just looked linux `if` command but still have no idea how to implement this because the example have different case.


title: HP-UX SZ limit for ps?

text: Right so I have a fun little thing that I'm deathly confuzzled about. I have a program that is running and I am getting the following: using top:                SIZE    RES     1639M   359M      using ps:               SZ     20171      Now this seems deathly wrong for me. I checked and a page does qualify as 4kb so it is not a problem with paging. Can anyone help me figure out why this is occuring? Thanks!


title: How to watch rss feed for new entries from bash script?

text: I need to watch a RSS feed from our hudson ci server. Each time a new entry is available i want to play a sound by calling `#>play sound.wav`. Does anyone know a tool which can watch a rss-feed and fire a command each time a new entry appears? I had a look at `rsstail` but it gets all entries from the feed and not the latest or only the ones that are new since the last lookup.


title: Emacs indentation using Tabs

text: Is there a way to make Emacs indent code using only tabs globally and not spaces. I know of tabify command. I would prefer the automated indentation to use tabs rather than a mixture of tabs and spaces as the default configuration does.


title: Self-contained password manager with CLI

text: I'm looking for a password manager that has the following properties:   1. The manager is entirely self-contained. I take and install a directory on a thumbdrive and execute from that drive. It should also be self-contained.   2. The database should easily identifiable and moveable by hand. So for example,I could copy it to another thumbdrive, without copying the executable.   3. There should a commandline interface. A gui is fine and probably better then a curses based one, but I also want the ability to type on the commandline:  > _retrieve_password_ for_this_app_or_site for_this_user. >   4. There should be at least a manager on Android which uses the same > database. A Windows version whould be a plus too but not mandatory. >


title: ngircd / xchat SSL issues

text: I'm trying to setup a ngircd IRC server on Fedora 18 (which was installed using yum), but I'm having some SSL issues. I can connect to the server locally and remotely if I choose to "accept invalid SSL certificates", but get an error otherwise. Here is the XChat output when I try to connect to the IRC server locally:               * Connecting to {domain_name} ({ip_address}) port 6697...     * * Subject: /OU=Domain Control Validated/OU=PositiveSSL/CN={domain_name}     * * Issuer: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2     * * Subject: /OU=Domain Control Validated/OU=PositiveSSL/CN={domain_name}     * * Issuer: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2     * * Subject: /OU=Domain Control Validated/OU=PositiveSSL/CN={domain_name}     * * Issuer: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2     * * Certification info:     *   Subject:     *     OU=Domain Control Validated     *     OU=PositiveSSL     *     CN={domain_name}     *   Issuer:     *     C=GB     *     ST=Greater Manchester     *     L=Salford     *     O=COMODO CA Limited     *     CN=PositiveSSL CA 2     *   Public key algorithm: rsaEncryption (2048 bits)     *   Sign algorithm sha1WithRSAEncryption     *   Valid since Nov  7 00:00:00 2012 GMT to Nov  7 23:59:59 2015 GMT     * * Cipher info:     *   Version: TLSv1/SSLv3, cipher DHE-RSA-AES256-SHA (256 bits)     * Connection failed. Error: unable to verify the first certificate.? (21)      Here is the SSL portion of my `ngircd.conf` file. I ran `ngircd --configtest` to test the config file, but it just printed the contents of the file to my terminal.               [SSL]       CertFile = /etc/pki/tls/certs/{domain_name}.crt       DHFile = /etc/pki/tls/private/dhparams.pem       KeyFile = /etc/pki/tls/private/{domain_name}.pem       KeyFilePassword = {key_file_password}       Ports = 6697      I've also tried to connect to the server remotely from a Windows 7 x64 machine using mIRC, but had issues there also. I can't confirm it, but I think Fedora compiles ngircd with GnuTLS and I think my keys were created with OpenSSL. If this were so, would the keys be in a different format? How could I check and convert them? Is it possible that this is a CA trust issue on both of my machines? If so, how/where can I add the CA root certificates in Fedora 18 and Windows 7 so I don't have this problem? Are there any other possible causes? Is there's any other information that I should be providing?


title: simulate the read only environment without the users realizing it in VirtualBox

text: I have configured the Virtual Box in my machine. Now, I have the original Virtual Box images available under the folder `/home/original_vbox_images`. Now, the Virtual Box, as per the configuration, uses the images from the location `/root/VirtualBox VMs/`. I am planning on providing root access to the users in the guest OS installed in Virtual Box. So basically, the users can do anything with root access in the guest OS machine. (I expect the users to even execute **rm -rf /** ). Now, during reboot, I want the initial Virtual Box image that I have with me to be available again. So, I thought of doing something like this.               vi /root/Desktop/newscript.sh     cp -R /home/original_vbox_images/ /root/VirtualBox VMs/      Now, after giving execute permission on the script, I will add it to `/etc/rc.local` as below.               vi /etc/rc.local     sh /root/Desktop/newscript.sh      As of now, I have 10 GB HDD. However, I plan on increasing the capacity of the Virtual HDD. The problem is, the copy might take longer time and won't be efficient. I am looking for some other elegant solution.


title: Free all function keys ( F1-F12 ) for gnome-terminal

text: I'm using `gnome-terminal` and I need to free all the F keys because I need to remap them to something else inside `vim`, how I can do that? I'm running Ubuntu 13.04.


title: Taking a sparse snapshot

text: I would like to take a dm snapshot of a drive. I do not want to take the snapshot of the unused and deallocated blocks. Is there any way of determining the used blocks and sectors of a hard drive without being file system aware. I would like to take a snapshot without having the empty parts of my disk backed up.


title: How to run john parallel on several CPU's?

text: If I use:               john --incremental UNSHADOWEDFILE      then I can see it uses only 1 CPU. How can I set john to use several CPU's for finding the weak passwords? (need to find weak ones faster because of an audit)


title: gnome-open execute shell script

text: Is there a way to execute shell scripts automatically using gnome-open? If I call `gnome-open script.sh` in the terminal, the script opens in the default text editor. However the shell-script is executed directly by double-click from Nautilus.


title: How can I check what signals a process is listening to?

text: How can I verify whether a running process will catch a signal, or ignore it, or block it? Ideally I'd like to see a list of signals, or at least not have to actually send the signal to check.


title: How can I overlay lines in a transparent, inactive layer over my screen?

text: I'm attempting to line up some items on my screen, and it'd be useful to have a mostly-transparent guide as an overlay. Ideally, I would draw a vertical line that persists in the foreground, while not stealing focus from the window beneath. I've tried the built-in mouse marks in KDE, and ardesia, but both draw in freeform, and don't allow creating straight horizontal or vertical lines. (Gromit-MPX appears to be the same.) ## Usage example I've navigating genomes with igv, and sometimes I need to work out which features line up. I'd like to be able to draw temporary vertical lines to see what lines up, for example in the following screenshot. ![enter image description here](http://i.stack.imgur.com/d8B55.png)


title: A script's background process is still alive after closing the terminal

text: This is more of a process management/signal handling question than a Bash question. It just uses Bash to explain the issue. I'm running a Bash script in which I run a background process. This is the script:               #!/bin/bash          # ...          # The background process     {        while :; do         sleep 1 && echo foo >> /path/to/some/file.txt       done     } &          # ...          exit 0      I do NOT run the script itself in the background. Simply `./script`. The "huponexit" shell option is enabled using `shopt -s huponexit`, therefore when the terminal is being closed I expect it to send a HUP signal to Bash, which will propagate it until it reaches the background process. If the background process will not `trap` and ignore the signal, it will be killed too - but this is not happening. The background process acts as if it was `disown`'ed. This is a scheme I draw to illustrate the issue. The scheme, along with the description above, can be wrong as I'm sure I do not understand the subject well enough. Please fix me on that if it is truly the case. ![enter image description here](http://i.stack.imgur.com/avuMP.jpg) I want to know why the background process is not being killed after closing the terminal, as if it was invoked by an interactive shell like that:               rany@~/Desktop$ while :; do sleep 1 && echo foo >> /path/to/some/file.txt; done &      I'm not sure but I guess that the answer to my question lies in the fact that Bash fork()s a non-interactive shell to run the script which might have a different set of rules for job control and signal handling.


title: Manage network connections on Arch Linux

text: I'm setting up an arch linux system(latest version) on my laptop. It already boots and configuration for network it's done via `systemctl`. Following instructions on the wiki I configured the ethernet service, first finding the service name with `ip link`, and then setting it up with `sudo systemctl enable dhcpcd@<servicename>.service`. But on reboot the name of the network device changed to `eth0`, so my configuration doesn't work. Running               $ sudo systemctl disable dhcpcd@<old service>.service      (and all other systemctl commands aside list-units )throws error:               [...] Failed to create mount unit file /run/systemd/generator/-.mount, as it already exists. Duplicate entry in /etc/fstab?      How can I remove/disable the old config and set it up again? Note: oddly my prompt changed to `[<username>@dhcppc0]`


title: Set persistent permissions for /var/log/boot.log

text: Every time I reboot my CentOS 6.5 computer, it writes the boot log to `/var/log/boot.log`. The permissions on this file are always `644` after a reboot. I want the permissions to be `600`. When I change the file permissions manually using `chmod 600 /var/log/boot.log` it reverts to `644` after the reboot. How can I make this change permanent? I would prefer the permissions are set when the file is created, instead of having the permissions applied sometime after the boot process is complete (or nearly complete).


title: failed to stuff "ctrl-a H" to a screen session

text: I need to toggle logging from outside of a detached screen session. Interactively you do this by pressing `ctrl`-`a` `H`. Their octal codes are `\001` and `\110`. (source) What I tried:               $ screen -S test      then from other terminal I tried to push these codes to the screen:               $ screen -S test -X stuff $'\\001\\110\\r'      However instead of the expected `Appending to logfile screenlog.0` I got `bash: h: command not found` Please tell me how to push 'Ctrl-a H' to a detached screen session.


title: Chrome OS: Crosh Window and Hostname

text: I have a couple of questions regarding Chrome OS:   * By default `Ctrl+Alt+T` opens a crosh window within the Chrome browser. I have the Crosh Window extension, which I would like `Ctrl+Alt+T` bound to - how would I go about doing this?   * For various reasons, I need to have a hostname set both for the machine, and for DHCP requests. I've read via a Google site that there is some form of option via Shill Manager - which I cannot find. As such I'm at a loss as to how I can set a hostname.