title: How to unset range of array in Bash

text: I'm trying to delete range of array element but it's fail.. My array               root@ubuntu:~/work# echo ${a[@]}     cocacola.com airtel.com pepsi.com      Print 0-1 array looks ok               root@ubuntu:~/work# echo ${a[@]::2}     cocacola.com airtel.com      Now I'm trying to delete only these element using :               root@ubuntu:~/work# unset a[@]::2     root@ubuntu:~/work# echo ${a[@]}      It's delete whole array.. What I'm doing wrong ? I found other way of deleting range of array but why above things is not working ?               for ((i=0; i<2; i++)); do unset a[$i]; done      EDIT I had also tried but no luck               unset -v 'a[@]::2'


title: Change remote host IP address without losing control (Linux)

text: How can I change a remote host _primary_ IP address without getting disconnected **at all** (without being in a "no IP addr" state). The matter is poorly discussed on Internet (according to my research). The best resource I found is a little bit tricky. EXAMPLE : change 10.0.0.11/24 to 10.0.0.15/24               1. ssh root@10.0.0.11     2. ip addr add 10.0.0.15/24 dev eth0      3. logout          4. ssh root@10.0.0.15     5. ip addr del 10.0.0.11/24 dev eth0       _Problem:_ The last command removes both IP addresses and the connection is lost because 10.0.0.11 is primary, and it removes its secondary addresses (to which 10.0.0.15 belongs) when deleted. I know I could "cheat" by adding 10.0.0.11/ **25** (instead of **24** ). However, I think it is theoretically possible to do this properly. What do you think?


title: Timestamp ts not working with thinkfan

text: I wanted the output of `thinkfan -n` output with a timestamp next to it so I can later analyse the patterns, and found this question: Prepending a timestamp to each line of output from a command, which had a seemingly good answer to this problem, namely using: `thinkfan -n | ts` Except it doesn't work. `ts` works fine with all other programs I tried, just not with `thinkfan`. Why doesn't it work with `thinkfan`? Is there some way to get this to work?


title: Failure loading kernel module

text: I've followed the steps at Build Your Own Kernel Modules (CentOS) but when I modprobe it fails:               [root@centos7 ~]# modprobe pcnet32     modprobe: ERROR: could not insert 'pcnet32': Exec format error          [root@centos7 ~]# file /lib/modules/3.10.0-123.6.3.el7.x86_64/extra/pcnet32.ko     /lib/modules/3.10.0-123.6.3.el7.x86_64/extra/pcnet32.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]=0xd7399934aef6f736c96175d7b91e570c49a86eda, not stripped      System info:               Linux centos7.testing 3.10.0-123.6.3.el7.x86_64 #1 SMP Wed Aug 6 21:12:36 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux      I don't know what could be wrong :( Could you help me?


title: Does RHEL 6 enforce software constraints on the number of SATA drvices that can exist on a system?

text: I came across the following blurb in some RHEL 6 training documentation: > The number of drives that can be installed on modern computers has > increased. With port multipliers, it's relatively easy to configure 16 > Serial Advanced Technology Attachment (SATA) drives on a system (assuming > you can fit all of those drives). Does this mean that RHEL 6 won't allow more than 16 SATA drives from a software perspective? Or just that practical hardware constraints usually don't allow for more than 16 but it's technically possible?


title: What tool to edit the /usr/share/mime/packages/freedesktop.org.xml file

text: I edited my /usr/share/mime/packages/freedesktop.org.xml (with a text editor) to modify the file icon of application/x-7z-compressed mime type :               <mime-type type="application/x-7z-compressed">       <generic-icon name="package-x-generic"/>      I would like to know if there is a tool to edit this file (or to change the icon of a mime type) instead of using a text editor ? **EDIT:** My aim is to script my modifications of the freedesktop.org.xml file, so that an text editor is not appropriate.   I would like a command-line tool to edit the `name` attribut of the `generic- icon` tag of a chosen MIME type. **EDIT:** As @Gilles pointed it to me, it should be better to modify the `$XDG_DATA_HOME/mime/packages/Override.xml` file instead of `/usr/share/mime/packages/freedesktop.org.xml` file. But this does not really change my question.


title: Neither crontab nor anacron is running, how to debug?

text: I'm running Arch ARM on a PogoPlug and want to execute a file every hour, the file when call directly runs fine (it is executable), for testing the file               /etc/cron.hourly/crontest      contains               #!/bin/bash     date >> /root/log      First I copied it to /etc/cron.daily but it wouldn't run, run-parts --test lists it as valid but nothing shows in the log file, then I created a crontab:               */5 * * * * /etc/cron.hourly/crontest      To run it every 5 minutes while monitoring the logfile, it doesn't fire. This is /etc/cron.d/0hourly               # Run the hourly jobs     SHELL=/bin/bash     PATH=/sbin:/bin:/usr/sbin:/usr/bin     MAILTO=root     01 * * * * root run-parts /etc/cron.hourly      and               journalctl -u cronie      just returns               -- Logs begin at Wed 1969-12-31 17:00:03 MST, end at Tue 2014-01-28 10:14:12 MST. --      So even though the PogoPlug doesn't have a rtc it has the correct time via ntp. What else can I do to debug cron / get it to run? I'm tempted to just write a bash script that loops and sleeps x amount of seconds, but I'd rather figure this one out :-)


title: Atom 230 + 2GB RAM datastore for small server = 64 bit or 32 bit debian

text: would you recommend me for small debian linux with small apache, small mysql and primary datastore with SW RAID 5 just 32bit debian or rather 64bit and why? I have only 2 GB of RAM, so could that be enough. (it will be only CLI debian without Xserver, GUI and so on!) Thank you


title: Linux on a Dell Inspiron 630m

text: I have an old Dell Inspiron 630m with Windows XP and I want to put some Linux distro on it. I have tried Ubuntu 12 but it did not work (nothing happend). Downloading older versions is slow. I am not a nerd (only wanabe) so I'm afraid of installations that are more complicated than Ubuntu. But the old laptop is a great tool for messing up so I ask you, which distro should I try and how can I get it. EDIT: I went for Debian (Crunchbag looked nice but too big step for me from Ubuntu). I deleted Windows in GPARTED but now I'm missing firmware, `ipw2200-bss.fw`. How do I add it to my dead laptop?


title: bash: test if $WORD is in set

text: I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:               if "$WORD" in dog cat horse ; then          echo yes     else         echo no     fi      does bash have such construct? If not, what would be the closest?


title: Replace matched file path with contents of file at the path with sed

text: I want to write a short deployment script which enters the contents of javascript-files into the single html file. These js files are currently declared as:                 <script src="js/jquery-1.8.2.js"></script>       <script src="js/jquery.rotate-2.2.js"></script>       <script src="js/underscore.js"></script>       <script src="js/backbone.js"></script>       <script src="js/backbone.dualstorage.js"></script>       <script src="js/favourites.js"></script>       <script src="js/menuItem.js"></script>       <script src="js/companies.js"></script>       <script src="js/lectures.js"></script>       <script src="js/banquette.js"></script>       <script src="js/menu.js"></script>       <script src="js/application.js"></script>       <script src="js/main.js"></script>      I got the fallowing sed script which almost does what I want:               sed -r -e '/<script src="(.*)">/r \1' -e '/<script src="(.*)">/d' index.html      The result of running this sed command with the above input is empty string. I'm uncertine what part of \1 is failing. Is it because references don't work outside of s commands? Running:               sed -r -e 's/<script src="(.*)">/\1/'      Results in:               js/jquery-1.8.2.js</script>     js/jquery.rotate-2.2.js</script>     js/underscore.js</script>     And so on ...      So obviously the regexp matches the right thing. Is there any way to debug what \1 holds in the first command to perhaps see if the path is incorrect?


title: Help With MultiCD

text: This is where I'm stuck at. If you know what to do now will you let me know?               TAPITSFIMM-maya multicd # chmod +x multicd.sh     TAPITSFIMM-maya multicd # ./multicd.sh     multicd.sh 7.1     Extracting ISO images with mount; will build multicd.iso; UID 0.          AntiX     Austrumi     Caine     Feather     Finnix     Fusion Linux     GParted Live     Parted Magic     emtest86+          Continuing in 2 seconds - press Ctrl+C to cancel     Copying files for each plugin...     Copying AntiX...     cp: reading `/home/jahaic/multicd/temporary-mountpoints/antix/antiX/linuxfs': Input/output error     cp: failed to extend `/home/jahaic/multicd/multicd-working/antiX/linuxfs': Input/output error     cp: reading `/home/jahaic/multicd/temporary-mountpoints/antix/antiX/linuxfs.md5': Input/output error     cp: failed to extend `/home/jahaic/multicd/multicd-working/antiX/linuxfs.md5': Input/output error     cp: reading `/home/jahaic/multicd/temporary-mountpoints/antix/antiX/vmlinuz': Input/output error     cp: failed to extend `/home/jahaic/multicd/multicd-working/antiX/vmlinuz': Input/output error     TAPITSFIMM-maya multicd #


title: Can anyone tell me why I need to click twice in VLC just so that a little plus button would appear?

text: Basically what happens is this:   I open VLC and go to my playlist and there are tons of folders there. I double-click on one and its icon changes to a folder icon and a plus sign appears next to it, but it stays closed. Then I need to double-click again to see what songs are in it. Is this normal? On Ubuntu 11.10 I didn't have this problem, but now on my Linux Mint 14 Mate...I do.


title: What is the difference between virbr# and vnet#?

text: I am running KVM on RHEL6, and I have created several virtual machines in it. Issuing `ifconfig` command to the host system command line shows a list of virbr0, virbr1... and vnet0, vnet2... Are they the IP addresses of the the guest OS? What are the differences between virbr# and vnet#?


title: What is a generic way of finding out whether the kernel has ext4 (or other) bugs?

text: From /. found this worrisome post by Theodore Ts'o. Turns out ext4 has some journalling problems. How can I quickly find out version numbers of susceptible kernels for this **and other** bugs?


title: Creating a single output stream out of three other streams produced in parallel

text: I have three kinds of data that are in different formats; for each data type, there is a Python script that transforms it into a single unified format. This Python script is slow and CPU-bound (to a single core on a multi-core machine), so I want to run three instances of it - one for each data type - and combine their output to pass it into `sort`. Basically, equivalent to this:               { ./handle_1.py; ./handle_2.py; ./handle_3.py } | sort -n      But with the three scripts running in parallel. I found this question where GNU `split`was being used to round-robin some stdout stream between n instances of a script that handles the stream. From the split man page:               -n, --number=CHUNKS               generate CHUNKS output files.  See below     CHUNKS  may be:      N       split into N files based on size of input      K/N     output Kth of N to stdout      l/N     split into N files without splitting lines      l/K/N   output Kth of N to stdout without splitting lines      r/N     like 'l'  but  use  round  robin  distributio      So the `r/N` command implies " _without splitting lines_ ". Based on this, it seems like the following solution should be feasible:               split -n r/3 -u --filter="./choose_script" << EOF     > 1     > 2     > 3     > EOF      Where `choose_script` does this:               #!/bin/bash     { read x; ./handle_$x.py; }      Unfortunately, I see some intermingling of lines - and lots of newlines that shouldn't be there. For example, if I replace my Python scripts with some simple bash scripts that do this:               #!/bin/bash     # ./handle_1.sh     while true; echo "1-$RANDOM"; done;      .               #!/bin/bash     # ./handle_2.sh     while true; echo "2-$RANDOM"; done;      .               #!/bin/bash     # ./handle_3.sh     while true; echo "3-$RANDOM"; done;      I see this output:               1-8394          2-11238     2-22757     1-723     2-6669     3-3690     2-892     2-312511-24152     2-9317     3-5981      This is annoying - based on the man page extract I pasted above, it should maintain line integrity. Obviously it works if I remove the `-u` argument, but then it's buffered and I'll run out of memory as it buffers the output of all but one of the scripts. If anyone has some insight here it'd be greatly appreciated. I'm out of my depth here.


title: How to Block SSH Brute Force via Iptables and How does it work?

text: I'm planning to add the following rules to `iptables` to stop ssh brute force attack which are common these days.               -A INPUT -i eth0.103 -p tcp -m tcp --dport 4522 -m state --state NEW -m recent --set --name SSH --rsource         -A INPUT -i eth0.103 -p tcp -m tcp --dport 4522 -m recent --rcheck --seconds 30 --hitcount 4 --rttl --name SSH --rsource -j REJECT --reject-with tcp-reset         -A INPUT -i eth0.103 -p tcp -m tcp --dport 4522 -m recent --rcheck --seconds 30 --hitcount 3 --rttl --name SSH --rsource -j LOG --log-prefix "SSH brute force "         -A INPUT -i eth0.103 -p tcp -m tcp --dport 4522 -m recent --update --seconds 30 --hitcount 3 --rttl --name SSH --rsource -j REJECT --reject-with tcp-reset         -A INPUT -i eth0.103 -p tcp -m tcp --dport 4522 -j ACCEPT      I understand that second, third, and forth rules are responsible from logging and blocking the attack coming from the same IP within 30 sec. interval. ### Questions   1. When the documentation says "log it to the system log once, then immediately reject it and forget about it" what do they mean by forget about it?    2. Forget about it forever?    3. Is there a blacklist that iptables check?    4. If an IP is rejected but then tried another connection an hour later, will there be another 3 attempts from that IP?    5. If it is the case then this is not blocking but slowing down the attacks as long as `iptables` doesn't have some blacklist count?


title: Arch-Linux: Chrome first start takes about 15 seconds

text: First start of Google-Chrome after boot takes about 10-15 Seconds, after that chrome starts immediately. On my previous Fedora installation, this was not the case. So I thought this must be something with my arch-linux installation/configuration. But I really don't have a clue how to track this problem down... when I start chrome via terminal I get these error-messages: > [1212:1212:0122/194748:ERROR:profile_sync_service.cc(1200)] History Delete > Directives datatype error was encountered: Delete directives not supported > with encryption. [1212:1212:0122/194751:ERROR:CONSOLE(1)] "Uncaught > ReferenceError: ntp is not defined", source: (1) any suggestions?


title: How can I resume/save work in a to-be-killed VNC session

text: I run VNC server at CentOS 6.4 and VNC client at windows machine. For some reason, VNC is not working properly today; there is no response of normal key presses, some mouse clicks work (changing workspaces, select terminal), but closing applications using the mouse do not work. The only solution I know is to start another VNC server, but the problem is, I have quite a bit of some GUI windows open and they are not saved yet. If I start another VNC session, my work in the previous session is lost. Is there a way the new VNC session can inherit/clone another VNC session?


title: Installing the kernel EFI stub loader in kernel 3.2?

text: Kernel EFI stub loader support was added in kernel 3.3, but I'm stuck on 3.2 running an Ubuntu 12.04 64bit distribution. Is there a way for me to somehow bring that stub loader support into my kernel?


title: Wine/PoL giving numerous errors in Fedora 17

text: I've been trying to run a handful of indy games for Windows on my laptop through Wine, but got a bunch of errors along the lines of:               wine: created the configuration directory '/home/jude/.wine'     fixme:storage:create_storagefile Storage share mode not implemented.     err:mscoree:LoadLibraryShim error reading registry key for installroot     err:mscoree:LoadLibraryShim error reading registry key for installroot     err:mscoree:LoadLibraryShim error reading registry key for installroot     err:mscoree:LoadLibraryShim error reading registry key for installroot     fixme:storage:create_storagefile Storage share mode not implemented.     err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.     fixme:iphlpapi:NotifyAddrChange (Handle 0xefe2c8, overlapped 0xefe2e0): stub     p11-kit: couldn't load module: /usr/lib/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory     fixme:storage:create_storagefile Storage share mode not implemented.     err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.     fixme:iphlpapi:NotifyAddrChange (Handle 0xece8d0, overlapped 0xece8dc): stub     wine: configuration in '/home/jude/.wine' has been updated.     wine: cannot find L"C:\\windows\\system32\\potatomanseeksdatroof.exe"      Play on Linux gives me errors about 32bit OpenGL (I run 64bit) I've been wrestling with this all day... help?


title: bash autocompletion not working for filenames (Debian wheezy 64bit)

text: Bash auto completion seems to work normally except on files. ie, if I am in / and there is some directory structure               /      folder1/       folder2/        fileName        nameOfFile       other2/      otherfolder/      I can type cd f(tab)f(tab) to get "cd folder1/folder2/" but when in folder2/ typing fi(tab) does nothing. what gives?


title: Trouble with postfix install (timing out from client)

text: I have just outfitted a basic server (Ubuntu 12.04 LTS /Precise Pangolin) and have installed Postfix and Dovecot, based on the Ubuntu manuals. https://help.ubuntu.com/community/Dovecot https://help.ubuntu.com/community/Postfix Postfix gets mail out of the box to my gmail account, e.g.:               sendmail [redacted]@gmail.com < /etc/motd      Testing remote access with the open source client for Eudora, I can successfully download email, so Dovecot/POP3 seems to be functioning. However, I cannot seem to get Eudora to successfully get mail from the client to the box or beyond. Depending on the security/port config I use, it generally times out. I seem to be able to get access via the local terminal, and remote shells, such as (from a remote server):               $ telnet lists.teachers.net 25     Trying 50.56.184.186...     Connected to lists.teachers.net.     Escape character is '^]'.     220 lists.teachers.net ESMTP Postfix (Ubuntu)     ehlo lists.teachers.net     250-lists.teachers.net     250-PIPELINING     250-SIZE 10240000     250-VRFY     250-ETRN     250-STARTTLS     250-AUTH PLAIN LOGIN     250-AUTH=PLAIN LOGIN     250-ENHANCEDSTATUSCODES     250-8BITMIME     250 DSN     quit     221 2.0.0 Bye     Connection closed by foreign host.      I tried setting Eudora to use STARTTLS, SSL/TLS, and none, but they all time- out. When Eudora tries to connect, i don't see any activity in the /var/log/mail/log or /var/log/mail.err , which I guess means those aren't the relevant logs or there is no activity to report. I haven't set up any firewall rules:               $ sudo iptables -L     Chain INPUT (policy ACCEPT)     target     prot opt source               destination          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination      netstat output:               $ sudo netstat -tap     Active Internet connections (servers and established)     Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     tcp        0      0 *:submission            *:*                     LISTEN      4112/master     tcp        0      0 *:pop3                  *:*                     LISTEN      3210/dovecot     tcp        0      0 *:imap2                 *:*                     LISTEN      3210/dovecot     tcp        0      0 *:ssh                   *:*                     LISTEN      564/sshd     tcp        0      0 *:smtp                  *:*                     LISTEN      4112/master     tcp        0      0 *:imaps                 *:*                     LISTEN      3210/dovecot     tcp        0      0 *:pop3s                 *:*                     LISTEN      3210/dovecot     tcp        0    300 lists.teachers.net:ssh  99-95-169-159.lig:55464 ESTABLISHED 1433/sshd: listman     tcp6       0      0 [::]:submission         [::]:*                  LISTEN      4112/master     tcp6       0      0 [::]:pop3               [::]:*                  LISTEN      3210/dovecot     tcp6       0      0 [::]:imap2              [::]:*                  LISTEN      3210/dovecot     tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      564/sshd     tcp6       0      0 [::]:smtp               [::]:*                  LISTEN      4112/master     tcp6       0      0 [::]:imaps              [::]:*                  LISTEN      3210/dovecot     tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN      3210/dovecot      MX record:               $ dig mx lists.teachers.net          ; <<>> DiG 9.8.1-P1 <<>> mx lists.teachers.net     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22244     ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3          ;; QUESTION SECTION:     ;lists.teachers.net.            IN      MX          ;; ANSWER SECTION:     lists.teachers.net.     300     IN      MX      100 lists.teachers.net.          ;; AUTHORITY SECTION:     teachers.net.           2057    IN      NS      dns1.stabletransit.com.     teachers.net.           2057    IN      NS      dns2.stabletransit.com.          ;; ADDITIONAL SECTION:     lists.teachers.net.     300     IN      A       50.56.184.186     dns1.stabletransit.com. 77665   IN      A       69.20.95.4     dns2.stabletransit.com. 77741   IN      A       65.61.188.4          ;; Query time: 830 msec     ;; SERVER: 72.3.128.241#53(72.3.128.241)     ;; WHEN: Thu Jan 10 14:08:34 2013     ;; MSG SIZE  rcvd: 155      How can I troubleshoot this, maybe from a remote machine? What logs might shed light? What other info would be helpful here? Thanks! **RESOLVED: SBC apparently blocks port 25 traffic on u-verse. I enabled port 587 in /etc/postfix/main.cf and immediately got the mail out to the server. D'oh!**


title: Force less to display a file as text

text: Sometimes less wrongly recognize file as binary and tries to show hexdump on LHS (usually ones with non-alphanumeric characters but still containing printable ASCII characters). How to force it to recognize it as text?


title: RVM + TMUX—Duplicate entries in $PATH

text: My Linux terminal config files (.bash_profile, .profile, .bashrc) expand $PATH by prepending some custom directories. This only happens once (and I've also included some ENV vairiable based guards to enforce that it can only ever happen once). My `.bash_profile` also sources the .rvm script (`~/.rvm/scripts/rvm`) which prepends its own custom dirs. These RVM dirs must be first. Everything's OK as long as I'm in a clean bash session. If I run `tmux`, however, the directory entries from my config files get prepended to PATH doubly (regardless of my ENV variable guards). It seems that tmux has two environments for ENV variables which it then merges. This is a problem, since entries prepended by the .rvm script get only prepended once, and in the tmux scenario they don't end up first. How can I prevent this from happening? **Edit—additional info:** All my PATH additions get prepended in `.profile`, which I include from `.bash_profile` (`. ~/.profile`). All my GUI terminals are run "as a login shell". In each config file, I use guards of the following form to prevent double inclusion:                   if [ "$PROFILE_SOURCED" != "true" ]; then              export PROFILE_SOURCED=true         ...         fi      By prepending an entry to PATH, I mean `export PATH=entry:$PATH`.


title: how can I give a normal user write access to a network interface?

text: I have a program that reads and writes packets to/from network interfaces, and normally I would add myself in the sudoers file and run the program like this:               sudo ./bridge      But now I need multiple users to run this program, but without giving them sudo rights, such that they could run the program like this:               ./bridge      Does anyone know how can I accomplish this? I am running Scientific Linux 6.1 on a 64bit platform, if it helps. Thanks, Claudiu


title: How do I restore Mint?

text: I recently tried to install a package in Mint 16 and the next thing I knew it uninstalled cinnamon and mint. Now, when I boot I am taken to a Ubuntu startup page. (Which fails to load because of an error "stopping startpar bridge for notification of upstart job start/stop") and it just freezes there. I then got the live cd out and booted from there and mounted my old drive (eg chroot). All my files are there but when I try to `"sudo apt-get update"` I get:               "Could not resolve security.ubuntu.com" and "Could not resolve archive.ubuntu.com".      How do I restore Mint? EDIT: I was trying to install AceStream and then it told me that the following packages are not necessary and it gave me a big list of packages and I hit "Enter" not even thinking. Now, when I boot I get Ubuntu 13.10 and an error message `kvm: disabled by bios`. If I press Esc, I see an error message on the command line `stopping startpar bridge for notification of upstart job start/stop`. Thus, Ubuntu is loading, not Mint (even though Mint is the only OS I have on this machine). I then have to use the Live CD to then chroot into my files. EDIT#2: I was able to `cp /etc/resolv.conf /mnt/etc/resolv.conf` once I was chrooted and that solved the networking issues. I was then able to `apt-get update` and then `apt-get dist-upgrade`. I then tried to boot without the Live CD but I'm still being thrown to the Ubuntu splash screen with the same error `kvm: disabled by bios`


title: When you ssh into a server, do you use server settings or your own settings?

text: So say I'm running a Linux server that is running irssi in a tmux session.(Detached) My question is, when I ssh into the server and reattach the session, will my shortcuts that I use on the 2nd PC take effect? So will irssi and tmux the session follow the settings I have in the pc that is doing the accessing, or will it follow the server settings? I am asking for the settings for tmux and irssi.


title: how to pdfjoin landscape and portrait oriented JPEG images to one PDF file?

text: I have some JPEG files. Most of them are landscape oriented, but some are portrait oriented. I want to combine them into one big PDF file. I tried `pdfjoin` but this results in all images beeing landscape oriented. Strange thing is: When I do the joining only on the portrait oriented images, then all images are portrait oriented. Same with all images that are landscape oriented. But if I do `pdfjoin` on all images at a time, then the result is always landscape oriented, which means, that if you watch the PDF file you have to turn your head by 90 degrees to watch the images that were portrait oriented originally. I would like to have an easy command line solution for this.


title: Compare two files

text: I have two files in UNIX. 1st file is Entity and Second File is References. 1st File has only one column named Entity ID and 2nd file has two columns Entity ID | Person ID. I want to produce a output file where entity id's are matching in both the files. Entity File               624197     624252     624264     624276     624280     624309     624317      Reference File               624252|624346     624264|1070122     624264|624346     624276|624588     624280|624346     624280|624582     624298|624588     624319|333008     624330|624588      Output File               624252|624346     624264|1070122     624264|624346     624276|624588     624280|624346     624280|624582      Entity Files has 90K Records and Reference file has 200K Records. Is there an efficient way to produce the third file ? Any solution is appreciated.


title: LinuxMint, unable to set swap partitions to equal priority

text: I only recently realised that you can specify multiple swap partition, spreading them across drives. Well that's great for me as my desktop system often uses swap space and I have three different drives spread across two controllers. One of which is a dedicated raid5.If your curious, it's a retired server. :) If you set them to the same priority it will "round-robin" them, or spread the workload between them. At least as I understand it. Nonetheless, I can't seem to get both swap partitions to the same priority. Here is my fstab:               # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     /dev/sda1       /               ext4    errors=remount-ro,user_xattr 0       1     /dev/sdb1       none            swap    sw pri=1        0       0     /dev/sda3       none            swap    sw pri=1        0       0     /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0      I'm using `swapoff -a` and `swapon -a` to turn off then back on the swap files. When I use `swapon -s` I get:               Filename                Type        Size    Used    Priority     /dev/sdb1               partition   5855656 1408        -1     /dev/sda3               partition   2093052 0           -2      Any ideas why it's not setting the priority the same? Thanks for any help.


title: How do I find a files directory?

text: I am looking for a specific file in OS/X. I can see the file by using:               ls -alR | grep "mkmf.*"      This shows my that the file exists. How do I find what directory the file is located. Many thanks


title: Bash script that can test for a particular lib

text: I'm writing a bash script that needs to test if certain libs are installed on a VPS, and if they're not, the script will install them. My problem is being able to have the script determine if they exist or not. My primary idea was to use this:               ldd /usr/lib/libgd.so > /tmp/lddcheck 2>/dev/null      To output the ldd results to a file, which I could then search with grep or something for the libs I'm looking for. If they're not there, I'll install them, otherwise the script will continue. Not sure exactly how to do that. Any help would be appreciated (pretty new to bash scripting).


title: Why did a new user inherit files from a deleted user?

text: So I had to do an exercise in a book as homework. First you had to create a user like:               useradd -c "Steven Baxter" -s "/bin/sh" sbaxter      Then you had to add some files to the `/home/sbaxter` directory:               touch /home/sbaxter/ some.txt new.txt files.txt      Then you had to remove the `sbaxter` user and create a new user named `mjane`. To my suprise when I ran `find /home/ -user mjane`, the new user `mjane` now owned all of sbaxter's old files, what happened?


title: What happens when I close() a file descriptor?

text: I am trying to get the whole picture with file descriptors. Say I have process1 which initially has these file descriptors:                _process1_     |          |     | 0 stdin  |     | 1 stdout |     | 2 stderr |     |__________|      Then I close file descriptor 1:               close(1);      The file descriptor 1 translates(points) to the stdout _FILE structure_ in the kernel's _Open Files Table_. With the code above the file descriptor 1 gets deleted from the process's table which becomes:                _process1_     |          |     | 0 stdin  |     | 2 stderr |     |__________|      But what happens in the kernel? Does the `stdout` FILE structure get deallocated? How is that possible if stdout is a special file (the monitor) and probably being used by other processes? What about FILE structures that are just normal files (.txt for example)? What if such a file is being used by an other process?


title: LVM2 can not wake up suspended logical volume

text: Read my story below. I'm using LVM2 with following information: Scan for VG:               # vgs       VG   #PV #LV #SN Attr   VSize   VFree        unix   1   1   0 wz--n- 115.00g 45.00g      Scan for LV               # lvs       LV   VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert       work unix -wi-s- 70.00g      Attempt to activate VG, LV               # vgchange -ay       device-mapper: resume ioctl failed: Invalid argument       Unable to resume unix-work (254:1)       1 logical volume(s) in volume group "unix" now active      Check LV activated or not               # lvdisplay        /dev/mapper/unix-work: open failed: No such file or directory       --- Logical volume ---       LV Name                /dev/unix/work       VG Name                unix       LV UUID                HzzTTr-rX2d-w1dP-NEQL-QksJ-rmHW-jMTxO7       LV Write Access        read/write       LV Status              NOT available       LV Size                70.00 GiB       Current LE             17920       Segments               2       Allocation             inherit       Read ahead sectors     auto      Because of last command end with error: "/dev/mapper/unix-work: open failed: No such file or directory" Then I have to run vgmknodes to manual create /dev/ nodes as below               # vgmknodes        The link /dev/unix/work should had been created by udev but it was not found. Falling back to direct link creation.      Now it look like better with status "suspended"               # lvdisplay        --- Logical volume ---       LV Name                /dev/unix/work       VG Name                unix       LV UUID                HzzTTr-rX2d-w1dP-NEQL-QksJ-rmHW-jMTxO7       LV Write Access        read/write       LV Status              suspended       # open                 0       LV Size                70.00 GiB       Current LE             17920       Segments               2       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           254:1      Attempt to mount LV:               # mount /dev/unix/work /mnt/     mount: /dev/mapper/unix-work already mounted or /mnt/ busy      Message from dmesg:               [ 1527.566964] device-mapper: table: 254:1: sda3 too small for target: start=94372224, len=136306688, dev_size=224606491      So, my question is: how can I wake up LV to mount it or use `dd` command to get data from LVM partition? Thanks in advanced!


title: Disabling hibernation in debian testing (lxde)

text: I have a dell inspiron 6000 laptop running debian testing lxde. I can't figure out how to disable hibernation once the lid is closed. Do I modify the systmd files or the `lib/systemd/systemd-sleep <hybrid-sleep/hibernate>` command?


title: Arch ntpd/ntpdate not synchronizng clock

text: My raspi running Arch isnt updating time with NTPD. Im running                [root@fatpi ~]# cat /proc/version      Linux version 3.10.28-1-ARCH (nobody@root-armv6-copy) (gcc version 4.8.2 20131219 (prerelease) (GCC) ) #1 PREEMPT Tue Jan 28 15:46:05 MST 2014      So I stop the service and try to update with ntpdate, but "ntpdate -sb" wont work , weird thing is "ntpdate -qd" will output the correct date & offset:               [root@fatpi ~]# ntpdate -dq time.nist.gov     31 Dec 18:09:13 ntpdate[299]: ntpdate 4.2.6p5@1.2349-o Sat Jan 11 17:42:10 UTC 2014 (1)     Looking for host time.nist.gov and service ntp     host found : nist1-chi.ustiming.org     transmit(216.171.120.36)     receive(216.171.120.36)     transmit(216.171.120.36)     receive(216.171.120.36)     transmit(216.171.120.36)     receive(216.171.120.36)     transmit(216.171.120.36)     receive(216.171.120.36)     server 216.171.120.36, port 123     stratum 1, precision -29, leap 00, trust 000     refid [ACTS], delay 0.07671, dispersion 0.00000     transmitted 4, in filter 4     reference time:    d69d8005.439fdedc  Wed, Feb  5 2014 21:29:09.264     originate timestamp: d69d800c.753a297e  Wed, Feb  5 2014 21:29:16.457     transmit timestamp:  83aa80af.2239d5e4  Wed, Dec 31 1969 18:09:19.133     filter delay:  0.07681  0.07671  0.07689  0.07681              0.00000  0.00000  0.00000  0.00000     filter offset: 13916567 13916567 13916567 13916567              0.000000 0.000000 0.000000 0.000000     delay 0.07671, dispersion 0.00000     offset 1391656797.298671          31 Dec 18:09:19 ntpdate[299]: step time server 216.171.120.36 offset 1391656797.298671 sec      When my ntpd service is runing this is "ntpq" output, refid doesnt change from INIT status, and reach is always 0 ... :(               ntpq> peers          remote           refid      st t when poll reach   delay   offset  jitter     ==============================================================================      nist1.ny.certic .INIT.          16 u    -   64    0    0.000    0.000   0.000      elara.mysnip.de .INIT.          16 u    -   64    0    0.000    0.000   0.000      dsl-201-120-53- .INIT.          16 u    -   64    0    0.000    0.000   0.000      golem.canonical .INIT.          16 u    -   64    0    0.000    0.000   0.000     ntpq> as          ind assid status  conf reach auth condition  last_event cnt     ===========================================================       1 22183  8011   yes    no  none    reject    mobilize  1       2 22184  8011   yes    no  none    reject    mobilize  1       3 22185  8011   yes    no  none    reject    mobilize  1       4 22186  8011   yes    no  none    reject    mobilize  1     ntpq>           my /var/log/ntp.log reads:(nothing intresting)               31 Dec 18:00:18 ntpd[124]: Deferring DNS for time.nist.gov 1     31 Dec 18:00:18 ntpd[124]: Deferring DNS for 0.pool.ntp.org 1     31 Dec 18:00:18 ntpd[124]: Deferring DNS for 1.pool.ntp.org 1     31 Dec 18:00:18 ntpd[124]: Deferring DNS for 2.pool.ntp.org 1     31 Dec 18:00:18 ntpd[124]: Deferring DNS for ntp.ubuntu.com 1     31 Dec 18:00:18 ntpd[132]: signal_no_reset: signal 17 had flags 4000000     31 Dec 18:00:20 ntpd[132]: host name not found: time.nist.gov     31 Dec 18:00:20 ntpd[132]: host name not found: 0.pool.ntp.org     31 Dec 18:00:20 ntpd[132]: host name not found: 1.pool.ntp.org     31 Dec 18:00:20 ntpd[132]: host name not found: 2.pool.ntp.org     31 Dec 18:00:20 ntpd[132]: host name not found: ntp.ubuntu.com     31 Dec 18:00:30 ntpd[124]: Listen normally on 2 eth0 192.168.0.104 UDP 123     31 Dec 18:00:30 ntpd[124]: peers refreshed     31 Dec 18:00:30 ntpd[124]: new interface(s) found: waking up resolver     31 Dec 18:00:32 ntpd[132]: DNS time.nist.gov -> 216.171.120.36     31 Dec 18:00:32 ntpd[132]: DNS 0.pool.ntp.org -> 201.120.27.5     31 Dec 18:00:32 ntpd[132]: DNS 1.pool.ntp.org -> 201.120.27.5     31 Dec 18:00:32 ntpd[132]: DNS 2.pool.ntp.org -> 201.120.27.5     31 Dec 18:00:32 ntpd[132]: DNS ntp.ubuntu.com -> 91.189.94.4           ive changed my ntp.conf file a gazillion times, currently:               server time.nist.gov iburst     server 0.pool.ntp.org iburst     server 1.pool.ntp.org iburst     server 2.pool.ntp.org iburst     server ntp.ubuntu.com iburst                              restrict default noquery nopeer     restrict 127.0.0.1     restrict ::1                              driftfile /var/lib/ntp/ntp.drift     logfile /var/log/ntp.log      ` my ntpd.service file reads:               [Unit]     Description=Network Time Service     After=network.target nss-lookup.target          [Service]     Type=forking     PrivateTmp=true     PIDFile=/var/run/ntpd.pid     ExecStart=/usr/bin/ntpd -g -u ntp:ntp -p /var/run/ntpd.pid     Restart=always          [Install]     WantedBy=multi-user.target      I also installed fake-hwclock but didnt help(shouldnt matter as my ntpd runs with -g) Any help is appreciated... im about to smash my rpi "#$"#$"#!!@@!!! * * * UPDATE: ntpd -q outputs:               [root@fatpi ~]# ntpd -qd     ntpd 4.2.6p5@1.2349-o Sat Jan 11 17:42:09 UTC 2014 (1)     31 Dec 18:02:42 ntpd[296]: proto: precision = 1.000 usec     event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled     Finished Parsing!!     31 Dec 18:02:42 ntpd[296]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16     31 Dec 18:02:42 ntpd[296]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123     31 Dec 18:02:42 ntpd[296]: Listen normally on 1 lo 127.0.0.1 UDP 123     restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00003000 flags 00000001     31 Dec 18:02:42 ntpd[296]: Listen normally on 2 eth0 192.168.0.104 UDP 123     restrict: op 1 addr 192.168.0.104 mask 255.255.255.255 mflags 00003000 flags 00000001     31 Dec 18:02:42 ntpd[296]: peers refreshed     31 Dec 18:02:42 ntpd[296]: Listening on routing socket on fd #19 for interface updates     restrict: op 1 addr 0.0.0.0 mask 0.0.0.0 mflags 00000000 flags 00000050     restrict: op 1 addr :: mask 0.0.0.0 mflags 00000000 flags 00000050     restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00000000 flags 00000000     31 Dec 18:02:42 ntpd[296]: restrict: error in address '::1' on line 12. Ignoring...     key_expire: at 0 associd 21204     peer_clear: at 0 next 1 associd 21204 refid INIT     event at 0 64.250.229.100 8011 81 mobilize assoc 21204     newpeer: 192.168.0.104->64.250.229.100 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000     key_expire: at 0 associd 21205     peer_clear: at 0 next 2 associd 21205 refid INIT     event at 0 132.248.81.123 8011 81 mobilize assoc 21205     newpeer: 192.168.0.104->132.248.81.123 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000     key_expire: at 0 associd 21206     peer_clear: at 0 next 3 associd 21206 refid INIT     event at 0 91.189.94.4 8011 81 mobilize assoc 21206     newpeer: 192.168.0.104->91.189.94.4 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000     event at 0 0.0.0.0 c016 06 restart     event at 0 0.0.0.0 c012 02 freq_set kernel 0.000 PPM     event at 0 0.0.0.0 c011 01 freq_not_set     transmit: at 1 192.168.0.104->64.250.229.100 mode 3 len 48     auth_agekeys: at 1 keys 1 expired 0     transmit: at 2 192.168.0.104->132.248.81.123 mode 3 len 48     transmit: at 3 192.168.0.104->91.189.94.4 mode 3 len 48     transmit: at 66 192.168.0.104->64.250.229.100 mode 3 len 48     transmit: at 68 192.168.0.104->132.248.81.123 mode 3 len 48     transmit: at 69 192.168.0.104->91.189.94.4 mode 3 len 48     transmit: at 131 192.168.0.104->64.250.229.100 mode 3 len 48     transmit: at 133 192.168.0.104->91.189.94.4 mode 3 len 48     transmit: at 135 192.168.0.104->132.248.81.123 mode 3 len 48     transmit: at 197 192.168.0.104->91.189.94.4 mode 3 len 48     transmit: at 197 192.168.0.104->64.250.229.100 mode 3 len 48     transmit: at 202 192.168.0.104->132.248.81.123 mode 3 len 48     transmit: at 262 192.168.0.104->91.189.94.4 mode 3 len 48     transmit: at 263 192.168.0.104->64.250.229.100 mode 3 len 48     transmit: at 267 192.168.0.104->132.248.81.123 mode 3 len 48     transmit: at 327 192.168.0.104->91.189.94.4 mode 3 len 48     transmit: at 327 192.168.0.104->64.250.229.100 mode 3 len 48     transmit: at 331 192.168.0.104->132.248.81.123 mode 3 len 48     ^C31 Dec 18:09:12 ntpd[296]: ntpd exiting on signal 2     [root@fatpi ~]#           BUTTT ntpdate -buv... WORKS!!!!               [root@fatpi ~]# ntpdate -bv ntp.ubuntu.com     31 Dec 18:11:18 ntpdate[299]: ntpdate 4.2.6p5@1.2349-o Sat Jan 11 17:42:10 UTC 2014 (1)     31 Dec 18:11:27 ntpdate[299]: no server suitable for synchronization found     [root@fatpi ~]# date     Wed Dec 31 18:11:52 CST 1969     [root@fatpi ~]# ntpdate -buv ntp.ubuntu.com     31 Dec 18:11:54 ntpdate[303]: ntpdate 4.2.6p5@1.2349-o Sat Jan 11 17:42:10 UTC 2014 (1)      6 Feb 14:31:00 ntpdate[303]: step time server 91.189.94.4 offset 1391717938.800589 sec     [root@fatpi ~]# date     Thu Feb  6 14:31:02 CST 2014      I guess the thing making it work is ntpdate's -u, which uses unprivileged ports. I read the man page for ntpdate's -u option it states that -d always uses this option, so thats why I saw transmit/receive/transmit/receive on my ntpdate -dq command ... well big NOPE! I guess port udp 123 forwarding is what I should check now?... will update later!


title: Self-built kernel: failed to mount /dev: No such device

text: I am trying to install a Linux kernel (3.8.1) from source in a Fedora distribution. The kernel is a vanilla one. I follow the kernel's build instructions closely that is:               make menuconfig     make     sudo make modules_install install     sudo grub2-mkconfig -o /boot/grub2/grub.cfg      Everything in `/boot` seems fine. I can see `System.map`, `initramfs`, and `vmlinuz` for the newly compiled kernel. The `vmlinuz` link points to `vmlinuz-3.8.1`. There are multiple other kernels installed including an Ubuntu one. grub2 recognises all of them and I can boot to each one of them. When I reboot I see all kernels as menu entries and choose 3.8.1. Then I see this message:               early console in decompress_kernel     decompressing Linux... parsing ELF ... done     Booting the kernel.     [1.687084] systemd [1]:failed to mount /dev:no such device     [1.687524] systemd [1]:failed to mount /dev:no such device      Solution: All three posted responses provide the solution. CONFIG_DEVTMPFS was in fact causing the issue. I copied a working kernel's /boot/config-… into the root of the source tree as .config and executed the standard commands for building the kernel also shown above.


title: Where should I keep the source files of the compiled applications?

text: I use Slackware Linux and I install most applications from the source. I would like to know how to manage the source files, specially the header files, so they are available to other applications.


title: Remove comma between the quotes only in a comma delimited file

text: I have a input file delimited with commas (`,`). There are some fields enclosed in double quotes that are having a comma in them. Here is the sample row               123,"ABC, DEV 23",345,534.202,NAME      I need to remove all the comma's occuring within inside the double quotes and the double quotes as well. So the above line should get parsed into as shown below               123,ABC DEV 23,345,534.202,NAME      I tried the following using `sed` but not giving expected results.               sed -e 's/\(".*\),\(".*\)/\1 \2/g'      Any quick tricks with `sed`, `awk` or any other unix utility please?


title: gsub command in awk

text: I am trying to replace the field separator from "," to "|" except for the strings which are under double quotes " " . The following command works fine :               awk -F\" '{for(i=1;i<=NF;i+=2) {gsub(",","|",$i)}}1' OFS=\" input.csv > output.csv      Can someone explain me this command ?


title: When I am in VirtualEnv and do apt-get install, is there any difference?

text: If I have a virtualenv activated when I do something like               sudo apt-get install python2.7-dev      should I expect different results than if I did it outside the virtual env? Limited theory says no, but I'm not sure I'm aware of everything I should be.


title: I need help with a cronjob to watch for runaway processes and kill them

text: I have an interesting situation, I have a runaway ruby process - I know exactly how I trigger it. Point is, it got me thinking about runaway processes (CPU usage or memory usage).   * How would one monitor runaway processes with cron? grep / top / ulimit?   * Can one notify the user via the   command line if something like this   happens?   * What alternatives are there to Monit?


title: Monitoring HTTPS traffic using tcpflow

text: I would like to use tcpflow to monitor **https** requests. I have read tutorials on how to monitor http traffic but when I connect to a host using https the output is garbled. I am using tcpflow in the following manner:               sudo tcpflow -s -c -i eth0 src or dst host api.linkedin.com


title: How to turn off permanent highlighting of all braces (not just pairs) in vim

text: I have no idea how I modified vim such that all braces are highlighted, not just matching ones, but I want to turn it off now. How do I do that? The usual highlighting of matching braces works fine.


title: GUI for adding Fedora software source

text: Is there a GUI for adding additional software sources in Fedora (FC 13). I have a software repository that works fine when added manually (as a .repo file in /etc/yum.repos.d/), but I'd like to have a better way of telling end users how to install.


title: Commandline e-mail client that syncs contacts with external server?

text: I am planning to setup a groupware server that's either Citadel or SOGo, which supports the GroupDAV, CardDAV, or SyncML protocols. Is there a commandline e-mail client that supports syncing contacts via such protocols either out of the box or with a plugin/extension?


title: Sync Palm Centro pictures on Linux

text: I have a Palm Centro, and I'd like to copy the pictures to my computer. However, I'm using Ubuntu, and I don't want to switch to Windows or use Palm's horrible sync application (through Wine.) Is there a Linux application I can use to easily copy my pictures from my phone to my computer? I'd prefer a simple command-line script to a monolithic productivity suite.


title: Can't register or update Solaris 11 Express

text: Trying the x86 live CD, installed it on a VirtualBox virtual machine, network connectivity and guest additions are OK. The "Register" link (which they imply is needed to get updates) gets me to an error page. The browser goes to https://inventory.sun.com/RegistrationWeb/register/urn:st:5b620481-ea10-e3c8-f16a-99bfff4e8eac?product=OracleSolaris&version=11&locale=en_US And then to https://inventory.sun.com/RegistrationWeb/OracleSolaris/default/en_US/register- login.jsp Which gives me a "Not Found" page. The update manager says there are no updates. I imagine it'd say otherwise if I was able to register the OS. But I can't. Any clues? (Fun fact: "Add More Software" and "Update Manager", if called, like the proverbial goggles, did nothing... until I tried to run them from the console and saw a message that "root password was expired". Aha. The "root shall never login" ideology was preventing them from running. OK, I gave root a password and was able to install much-needed software like gcc.)


title: Vim command for inserting a character

text: I'm looking for the opposite of `x`. I want to insert just one character and stay in command mode.


title: Removing "[crap-like-this]" from strings using bash parameter expansion?

text: If I have the following `$STRING`               aaa.bbb.ccc.[ddd].eee.fff.[ggg].hhh      is there any way, using bash parameter expansion, to echo the following               aaa.bbb..ccc.eee.fff..hhh      That is, remove all occurrences of square brackets and everything inside those brackets? Everything I've tried ends up either removing everything in the string after the first left bracket or removing the brackets but leaving behind everything inside the brackets.


title: Are there any comic book authoring programs?

text: Is there any software designed to assist with creating comic books? The basic features needed are pre-drawn frames around the panels and the ability to easily drag and drop characters into the scene, add speech bubbles, and edit the background. I would prefer software that is specific to these tasks, rather than general graphic-editing software.


title: inline double and single quote escaping

text: I'm having trouble with escaping characters in bash. I'd like to escape single and double quotes while running a command under a different user. For the purposes of this question let's say I want to echo the following on the screen:               'single quote phrase' "double quote phrase"      How can I escape all the special chars, if I also need to switch to a different user:               sudo su USER -c "echo \"'single quote phrase' \"double quote phrase\"\""      Of course, this doesn't produce the right result.


title: How to copy a folder from remote machine to my system using ssh or any other way

text: Hi I need to copy a folder of size 885 MB from a remote machine to my system using ssh and port no is 1500 What is the command I can use to accomplish this path of remote folder is               /u001/app/oracle/product/frmsrv/Nayifat/finnone       and I need to copy the finnone folder to my system


title: Solaris + display file time stamp [year][month][day]

text: I have Solaris 10 machine I need to verify time stamp of some file in my Solaris machine And to get the following format                [year][month][day]      Example of working command on Linux                 ls -l --time-style=+%Y%m%d /etc/hosts | awk '{print $6}'       20121107   <----- ( expected results )                   * remark I can't to install gnu ls on My solaris machine! On my solaris machine I try the following commands but all them not works ( because Solaris flags are different from Linux ) , and stat command not defined in my Solaris               # ls -l -T -D %Y%m%d /etc/hosts     ls: illegal option -- T     ls: illegal option -- D     usage: ls -1RaAdCxmnlhogrtuvVcpFbqisfHLeE@ [files]      #               # stat /etc/hosts | awk '/Access/{print $2}' | tail -n1 | tr -d'' '-'     ksh: stat:  not found      Please advice if there are some other ways to get stamp date of file ( not by ls or stat command ) , maybe with date command ? in order to give me the solution, As the following:                  <solaris>   command /etc/hosts                          [year][month][day]


title: How do you set up the environment for es?

text: I've been playing with es the last couple of days, and it (like rc) has the quirk/feature that it only runs its startup script (`.esrc`) on login. The usual way to run code in each interactive session is to put that code in the `%prompt` function. Of course, there's no `%prompt` function if `es -l` has never been run. So, the question: how do you set the login environment when you come in via gdm or similar, which only source .profile (or .xprofile, .xsession, etc.)? The best I've come up with is:               if [ -f "$HOME/.esrc" ]; then         eval "`es -l <<-x             sh <<<'export -p'         x`"     fi      Which seems... horrifying. Any better approaches?


title: Specifying tmux command-prompt line

text: How can you specify the line where you want tmux's command prompt to appear? I want to see the panes when executing tmux commands that require pane numbers (e.g. join-pane, etc) but as the command prompt is displayed **on top of the pane numbers** , I have to cancel it, memorize the pane number and type the command again.


title: Elementary OS, some settings disappeared

text: I don't know how it is possible but many of my settings has disappeared. Is there anything I can do about it? Some kind of reset? Using: Elementary OS Here is the image: ![enter image description here](http://i.stack.imgur.com/cgAJR.png)


title: What is the maximum allowed number of TTY, is it defined anywhere in kernel headers?

text: What's the maximum allowed number of TTYs? I found pty.max, but is there anything similar for TTYs? Or is it defined as a fixed value in kernel headers, I couldn't find that


title: Changing sound chip with ALSA

text: I have a laptop with Intel audio card that `lspci` reports as               00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)      It is responsible for both Analog Audio (speakers, 3.5 mm jack) and HDMI sound (since my laptop has HDMI output) as reported by `aplay --list-devices`                   **** List of PLAYBACK Hardware Devices ****         card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]           Subdevices: 1/1           Subdevice #0: subdevice #0         card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]           Subdevices: 1/1           Subdevice #0: subdevice #0      Obviously the audio card is configured and drivers are loaded. Media players, however, don't produce any sound. `pavucontrol` shows that there is output from the player - under playback tab, the slider which acts as a visual feedback is "bouncing". But under "Output devices" tab, the very same slider doesn't react at all. Under Configuration tab "Profile" is set to "Analog Stereo Duplex", which it should be. If I change the profile to "Digital Stereo (HDMI) Output" the aferomentioned slider suddenly begins to bounce. It is now obvious to me that either ALSA or PulseAdio (I don't know which is to be blamed) recognize the HDMI chip as the default one. `alsamixer` gives me option to change sound card, but not it's chip.![alsamixer interface](http://i.stack.imgur.com/T2omG.png) `pactl list` output               Module #0         Name: module-device-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore the volume/mute state of devices"             module.version = "5.0"          Module #1         Name: module-stream-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore the volume/mute/device state of streams"             module.version = "5.0"          Module #2         Name: module-card-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore profile of cards"             module.version = "5.0"          Module #3         Name: module-augment-properties         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Augment the property sets of streams with additional static information"             module.version = "5.0"          Module #4         Name: module-switch-on-port-available         Argument:          Usage counter: n/a         Properties:               Module #5         Name: module-udev-detect         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Detect available audio hardware and load matching drivers"             module.version = "5.0"          Module #6         Name: module-alsa-card         Argument: device_id="0" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"         Usage counter: 0         Properties:             module.author = "Lennart Poettering"             module.description = "ALSA Card"             module.version = "5.0"          Module #7         Name: module-jackdbus-detect         Argument: channels=2         Usage counter: n/a         Properties:             module.author = "David Henningsson"             module.description = "Adds JACK sink/source ports when JACK is started"             module.version = "5.0"          Module #8         Name: module-bluetooth-policy         Argument:          Usage counter: n/a         Properties:             module.author = "Frédéric Dalleau"             module.description = "When a bluetooth sink or source is added, load module-loopback"             module.version = "5.0"          Module #9         Name: module-bluetooth-discover         Argument:          Usage counter: n/a         Properties:             module.author = "João Paulo Rechi Vita"             module.description = "Detect available Bluetooth daemon and load the corresponding discovery module"             module.version = "5.0"          Module #10         Name: module-bluez5-discover         Argument:          Usage counter: n/a         Properties:             module.author = "João Paulo Rechi Vita"             module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers"             module.version = "5.0"          Module #11         Name: module-esound-protocol-unix         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "ESOUND protocol (UNIX sockets)"             module.version = "5.0"          Module #12         Name: module-native-protocol-unix         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Native protocol (UNIX sockets)"             module.version = "5.0"          Module #13         Name: module-gconf         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "GConf Adapter"             module.version = "5.0"          Module #14         Name: module-default-device-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore the default sink and source"             module.version = "5.0"          Module #15         Name: module-rescue-streams         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "When a sink/source is removed, try to move its streams to the default sink/source"             module.version = "5.0"          Module #16         Name: module-always-sink         Argument:          Usage counter: n/a         Properties:             module.author = "Colin Guthrie"             module.description = "Always keeps at least one sink loaded even if it's a null one"             module.version = "5.0"          Module #17         Name: module-intended-roles         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically set device of streams based on intended roles of devices"             module.version = "5.0"          Module #18         Name: module-suspend-on-idle         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "When a sink/source is idle for too long, suspend it"             module.version = "5.0"          Module #19         Name: module-console-kit         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Create a client for each ConsoleKit session of this user"             module.version = "5.0"          Module #20         Name: module-systemd-login         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Create a client for each login session of this user"             module.version = "5.0"          Module #21         Name: module-position-event-sounds         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Position event sounds between L and R depending on the position on screen of the widget triggering them."             module.version = "5.0"          Module #22         Name: module-role-cork         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Mute & cork streams with certain roles while others exist"             module.version = "5.0"          Module #23         Name: module-filter-heuristics         Argument:          Usage counter: n/a         Properties:             module.author = "Colin Guthrie"             module.description = "Detect when various filters are desirable"             module.version = "5.0"          Module #24         Name: module-filter-apply         Argument:          Usage counter: n/a         Properties:             module.author = "Colin Guthrie"             module.description = "Load filter sinks automatically when needed"             module.version = "5.0"          Module #25         Name: module-x11-publish         Argument: display=:0.0         Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "X11 credential publisher"             module.version = "5.0"          Module #26         Name: module-x11-xsmp         Argument: display=:0.0 session_manager=local/localhost:@/tmp/.ICE-unix/281,unix/localhost:/tmp/.ICE-unix/281         Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "X11 session management"             module.version = "5.0"          Sink #0         State: SUSPENDED         Name: alsa_output.pci-0000_00_1b.0.analog-stereo         Description: Built-in Audio Analog Stereo         Driver: module-alsa-card.c         Sample Specification: s16le 2ch 44100Hz         Channel Map: front-left,front-right         Owner Module: 6         Mute: no         Volume: front-left: 49145 /  75% / -7.50 dB,   front-right: 49145 /  75% / -7.50 dB                 balance 0.00         Base Volume: 65536 / 100% / 0.00 dB         Monitor Source: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor         Latency: 0 usec, configured 0 usec         Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY          Properties:             alsa.resolution_bits = "16"             device.api = "alsa"             device.class = "sound"             alsa.class = "generic"             alsa.subclass = "generic-mix"             alsa.name = "ALC269VB Analog"             alsa.id = "ALC269VB Analog"             alsa.subdevice = "0"             alsa.subdevice_name = "subdevice #0"             alsa.device = "0"             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "front:0"             device.buffering.buffer_size = "352800"             device.buffering.fragment_size = "176400"             device.access_mode = "mmap+timer"             device.profile.name = "analog-stereo"             device.profile.description = "Analog Stereo"             device.description = "Built-in Audio Analog Stereo"             alsa.mixer_name = "Intel CougarPoint HDMI"             alsa.components = "HDA:10ec0269,10250504,00100100 HDA:80862805,80860101,00100000"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Ports:             analog-output: Analog Output (priority: 9900)             analog-output-speaker: Speakers (priority: 10000)             analog-output-headphones: Headphones (priority: 9000, not available)         Active Port: analog-output         Formats:             pcm          Source #0         State: SUSPENDED         Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor         Description: Monitor of Built-in Audio Analog Stereo         Driver: module-alsa-card.c         Sample Specification: s16le 2ch 44100Hz         Channel Map: front-left,front-right         Owner Module: 6         Mute: no         Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB                 balance 0.00         Base Volume: 65536 / 100% / 0.00 dB         Monitor of Sink: alsa_output.pci-0000_00_1b.0.analog-stereo         Latency: 0 usec, configured 0 usec         Flags: DECIBEL_VOLUME LATENCY          Properties:             device.description = "Monitor of Built-in Audio Analog Stereo"             device.class = "monitor"             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "0"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Formats:             pcm          Source #1         State: SUSPENDED         Name: alsa_input.pci-0000_00_1b.0.analog-stereo         Description: Built-in Audio Analog Stereo         Driver: module-alsa-card.c         Sample Specification: s16le 2ch 44100Hz         Channel Map: front-left,front-right         Owner Module: 6         Mute: no         Volume: front-left: 8251 /  13% / -54.00 dB,   front-right: 8251 /  13% / -54.00 dB                 balance 0.00         Base Volume: 5206 /   8% / -66.00 dB         Monitor of Sink: n/a         Latency: 0 usec, configured 0 usec         Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY          Properties:             alsa.resolution_bits = "16"             device.api = "alsa"             device.class = "sound"             alsa.class = "generic"             alsa.subclass = "generic-mix"             alsa.name = "ALC269VB Analog"             alsa.id = "ALC269VB Analog"             alsa.subdevice = "0"             alsa.subdevice_name = "subdevice #0"             alsa.device = "0"             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "front:0"             device.buffering.buffer_size = "352800"             device.buffering.fragment_size = "176400"             device.access_mode = "mmap+timer"             device.profile.name = "analog-stereo"             device.profile.description = "Analog Stereo"             device.description = "Built-in Audio Analog Stereo"             alsa.mixer_name = "Intel CougarPoint HDMI"             alsa.components = "HDA:10ec0269,10250504,00100100 HDA:80862805,80860101,00100000"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Ports:             analog-input-internal-mic: Internal Microphone (priority: 8900)             analog-input-mic: Microphone (priority: 8700, not available)         Active Port: analog-input-internal-mic         Formats:             pcm          Client #0         Driver: module-systemd-login.c         Owner Module: 20         Properties:             application.name = "Login Session c1"             systemd-login.session = "c1"          Client #3         Driver: module-x11-xsmp.c         Owner Module: 26         Properties:             application.name = "XSMP Session on xfce4-session as 2c7bf982c-3f0a-4235-93e5-780d27ff15f0"             xsmp.vendor = "xfce4-session"             xsmp.client.id = "2c7bf982c-3f0a-4235-93e5-780d27ff15f0"          Client #10         Driver: protocol-native.c         Owner Module: 12         Properties:             application.name = "pactl"             native-protocol.peer = "UNIX socket client"             native-protocol.version = "29"             application.process.id = "1707"             application.process.user = "tichomir"             application.process.host = "localhost"             application.process.binary = "pactl"             application.language = "C"             window.x11.display = ":0.0"             application.process.machine_id = "98bf0358e390486598b6233568214778"             application.process.session_id = "c1"          Card #0         Name: alsa_card.pci-0000_00_1b.0         Driver: module-alsa-card.c         Owner Module: 6         Properties:             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "0"             device.description = "Built-in Audio"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Profiles:             input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 60, available: yes)             output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)             output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes)             output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5400, available: yes)             output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5460, available: yes)             output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 300, available: yes)             output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 360, available: yes)             off: Off (sinks: 0, sources: 0, priority: 0, available: yes)         Active Profile: output:analog-stereo+input:analog-stereo         Ports:             analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec)                 Properties:                     device.icon_name = "audio-input-microphone"                 Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo             analog-input-mic: Microphone (priority: 8700, latency offset: 0 usec, not available)                 Properties:                     device.icon_name = "audio-input-microphone"                 Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo             analog-output: Analog Output (priority: 9900, latency offset: 0 usec)                 Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo             analog-output-speaker: Speakers (priority: 10000, latency offset: 0 usec)                 Properties:                     device.icon_name = "audio-speakers"                 Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo             analog-output-headphones: Headphones (priority: 9000, latency offset: 0 usec, not available)                 Properties:                     device.icon_name = "audio-headphones"                 Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo             hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available)                 Properties:                     device.icon_name = "video-display"                 Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround, output:hdmi-surround+input:analog-stereo


title: noexec on /tmp and /var/tmp directory

text: Our client servers are running old version of jboss (Jboss 4.0) which has lots of known vulnerabilities. Result is that the server is hacked and we are seeing some unknown executables running from `/tmp`, `/var/tmp` and `/dev/shm` directories. The server is being used as a zombie machine from which other machines are targeted. We modified jboss configuration to remove the flaw with Nessus confirming that the vulnerability is no more there. Apart from that, I executed the following               Mounted /tmp with noexec option     Mounted /dev/shm with noexec,nosuid option       I had no issue in executing the above two steps as `/tmp` is on a separate partition for me. I am facing issues with `/var/tmp` location as I cannot use noexec on `/var` partition. So, planning to mount `/var/tmp` on the same partition that I am using for `/tmp` location. I hoped that will help resolve the issue for me but after executing the changes I noticed that files and dirs in `/tmp` are also available in `/var/tmp`.               # ls -l /var/tmp/     total 32     drwx------ 2 ssdg  ssdg   4096 Dec 17 12:10 gconfd-ssdg     drwxr-xr-x 3 root  root   4096 Feb 21  2013 hp_sum     drwxr-xr-x 2 jboss jboss  4096 Dec 18 11:56 hsperfdata_jboss     drwx------ 2 root  root  16384 May 18  2011 lost+found     srwxr-xr-x 1 root  root      0 Aug 29  2011 mapping-root          # ls -l /tmp/     total 32     drwx------ 2 ssdg  ssdg   4096 Dec 17 12:10 gconfd-ssdg     drwxr-xr-x 3 root  root   4096 Feb 21  2013 hp_sum     drwxr-xr-x 2 jboss jboss  4096 Dec 18 11:56 hsperfdata_jboss     drwx------ 2 root  root  16384 May 18  2011 lost+found     srwxr-xr-x 1 root  root      0 Aug 29  2011 mapping-root      So , proably the idea of using the same partition for `/tmp` and `/var/tmp` is not going to work. Need suggestions how can I implement noexec for `/var/tmp` directory.


title: Why does my squid cache never get any hits?

text: I have set up a squid cache on a portable 3G/wifi router I've built. The proxy works, but I only ever see TCP_MISS, with a very rare TCP_MEM_HIT I've never tried this before, and this is the config file I came up with:               acl manager proto cache_object     acl localhost src 127.0.0.1/32 ::1     acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1     acl localnet src 192.168.99.0/24         acl SSL_ports port 443     acl Safe_ports port 80           acl Safe_ports port 21           acl Safe_ports port 443          acl Safe_ports port 70           acl Safe_ports port 210          acl Safe_ports port 1025-65535       acl Safe_ports port 280          acl Safe_ports port 488          acl Safe_ports port 591          acl Safe_ports port 777          acl CONNECT method CONNECT     http_access allow manager     http_access deny !Safe_ports     http_access deny CONNECT !SSL_ports     http_access allow localnet     http_access allow localhost     http_access deny all     http_port 3128     cache_dir aufs /var/spool/squid3 8192 16 256     maximum_object_size 512 MB     coredump_dir /var/spool/squid3     refresh_pattern ^ftp:       1440    20% 10080     refresh_pattern ^gopher:    1440    0%  1440     refresh_pattern -i (/cgi-bin/|\?) 0 0%  0     refresh_pattern .       0   20% 4320     cache_mgr *******@*****.com      Even the files coming from the 3G stick's built in http pages don't cache. Have I made any mistakes in config file?   Is there any special way to set up /var/spool/squid3? I just used sudo mkdir /var/spool/squid3 and it created all the bits inside. Here's the output from cache.log:               2013/09/04 19:13:47| Starting Squid Cache version 3.1.20 for arm-unknown-linux-gnueabihf...     2013/09/04 19:13:47| Process ID 2606     2013/09/04 19:13:47| With 65535 file descriptors available     2013/09/04 19:13:47| Initializing IP Cache...     2013/09/04 19:13:47| DNS Socket created at 0.0.0.0, FD 7     2013/09/04 19:13:47| Adding nameserver 127.0.0.1 from /etc/resolv.conf     2013/09/04 19:13:47| Adding nameserver 192.168.1.1 from /etc/resolv.conf     2013/09/04 19:13:47| Adding nameserver 192.168.1.1 from /etc/resolv.conf     2013/09/04 19:13:47| Unlinkd pipe opened on FD 12     2013/09/04 19:13:47| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec     2013/09/04 19:13:47| Store logging disabled     2013/09/04 19:13:47| Swap maxSize 8388608 + 262144 KB, estimated 665442 objects     2013/09/04 19:13:47| Target number of buckets: 33272     2013/09/04 19:13:47| Using 65536 Store buckets     2013/09/04 19:13:47| Max Mem  size: 262144 KB     2013/09/04 19:13:47| Max Swap size: 8388608 KB     2013/09/04 19:13:47| Version 1 of swap file with LFS support detected...      2013/09/04 19:13:47| Rebuilding storage in /var/spool/squid3 (CLEAN)     2013/09/04 19:13:47| Using Least Load store dir selection     2013/09/04 19:13:47| Set Current Directory to /var/spool/squid3     2013/09/04 19:13:48| Loaded Icons.     2013/09/04 19:13:48| Accepting  HTTP connections at 0.0.0.0:3128, FD 15.     2013/09/04 19:13:48| HTCP Disabled.     2013/09/04 19:13:48| Squid plugin modules loaded: 0     2013/09/04 19:13:48| Adaptation support is off.     2013/09/04 19:13:48| Ready to serve requests.     2013/09/04 19:13:48| Done reading /var/spool/squid3 swaplog (1664 entries)     2013/09/04 19:13:48| Finished rebuilding storage from disk.     2013/09/04 19:13:48|      1664 Entries scanned     2013/09/04 19:13:48|         0 Invalid entries.     2013/09/04 19:13:48|         0 With invalid flags.     2013/09/04 19:13:48|      1664 Objects loaded.     2013/09/04 19:13:48|         0 Objects expired.     2013/09/04 19:13:48|         0 Objects cancelled.     2013/09/04 19:13:48|         0 Duplicate URLs purged.     2013/09/04 19:13:48|         0 Swapfile clashes avoided.     2013/09/04 19:13:48|   Took 0.85 seconds (1953.12 objects/sec).     2013/09/04 19:13:48| Beginning Validation Procedure     2013/09/04 19:13:48|   Completed Validation Procedure     2013/09/04 19:13:48|   Validated 3353 Entries     2013/09/04 19:13:48|   store_swap_size = 19920     2013/09/04 19:13:49| storeLateRelease: released 0 objects     2013/09/04 19:50:17| Preparing for shutdown after 90 requests     2013/09/04 19:50:17| Waiting 30 seconds for active connections to finish     2013/09/04 19:50:17| FD 15 Closing HTTP connection     2013/09/04 19:50:48| Shutting down...     2013/09/04 19:50:48| basic/auth_basic.cc(97) done: Basic authentication Shutdown.     2013/09/04 19:50:48| Closing unlinkd pipe on FD 12     2013/09/04 19:50:48| storeDirWriteCleanLogs: Starting...     2013/09/04 19:50:48|   Finished.  Wrote 1693 entries.     2013/09/04 19:50:48|   Took 0.02 seconds (102861.66 entries/sec).     CPU Usage: 3.420 seconds = 1.690 user + 1.730 sys     Maximum Resident Size: 56784 KB     Page faults with physical i/o: 404     Memory usage for squid via mallinfo():         total space in arena:    4212 KB         Ordinary blocks:         3197 KB     96 blks         Small blocks:               0 KB      1 blks         Holding blocks:         27936 KB     10 blks         Free Small blocks:          0 KB         Free Ordinary blocks:    1014 KB         Total in use:           31133 KB 739%         Total free:              1014 KB 24%     2013/09/04 19:50:48| Open FD READ/WRITE    7 DNS Socket IPv4     2013/09/04 19:50:48| Squid Cache (Version 3.1.20): Exiting normally.      Here's a pair of lines from access.log               pi@junior ~ $ sudo cat /var/log/squid3/access.log | grep 32px-Portal-puzzle     1378324277.327    203 192.168.99.74 TCP_MISS/304 263 GET http://upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/32px-Portal-puzzle.svg.png - DIRECT/91.198.174.234 text/html     1378324296.260     68 192.168.99.74 TCP_MISS/304 263 GET http://upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/32px-Portal-puzzle.svg.png - DIRECT/91.198.174.234 text/html      Two different machines, same file, two misses Two more lines, these are weird:               pi@junior ~ $ sudo cat /var/log/squid3/access.log | grep 16px-Portal-puzzle     1378324276.132    130 192.168.99.74 TCP_MISS/304 263 GET http://1.2.3.9/bmi/upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/16px-Portal-puzzle.svg.png - DIRECT/1.2.3.9 text/html     1378324320.926    290 192.168.99.254 TCP_MISS/200 1373 GET http://1.2.3.9/bmi/upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/16px-Portal-puzzle.svg.png - DIRECT/1.2.3.9 image/png      What is 1.2.3.9? how can upload.wikimedia.org be in the middle of that url? Is that some sort of other cache maintained by T-Mobile in between us and the rest of the 'net?


title: Why am I not able to login directly using SSH

text: Suppose, the server address is **abcd.com**. On my local machine at my workplace, I have to login to that server, using               ssh <my employeeid>@abcd.com      Then, to login to user **myname** , I have to use               su - myname      This way I login, but why can't I directly login to that server using               ssh myname@abcd.com


title: NFS different uig/gid on hosts

text: Scenario: There are different mappings of UIDs and GIDs between hosts that would like to have NFS share. Is there workaround without changing number mapping on hosts ? **Example:** Is there a way to "hardcode" mapping of username/groupname <-> uid/gid. (for example on client side to map local uid 3333 top remote uid 2222 and local gid 999 to remote gid 888 ? ) I know about trick with mapping everyone to "nobody" or making `chown uog+rw -R ...`. I am interested in solution where user UX in group GX creates files and directories as GX and UX and other GY, UY creates as GY UY... maybe some idmapd might be helpful ? If there is no other option, how to securely change number UID and GID on all those hosts to make them consistent ?


title: in bash, read after a pipe is not setting values

text: Edit : original title was "read fails in bash" With ksh I'm using read as a convenient way to separate values:                 $ echo 1 2 3 4 5 | read a b dump       $ echo $b $a        2 1       $      But it fails in bash :                 $ echo 1 2 3 4 5 | read a b dump       $ echo $b $a             $      I didn't find a reason in the man page why it fails, any idea ?


title: Installing Ubuntu/Debian on 16 GB SD Card

text: Is it possible to install Ubuntu/Debian on my 16 GB SD Card ? Do I just during installation process chose my SD Card partition and install it (that doesn't work if we have USB) or do I need to install persistance ISO on my SD Card ? The last question how it's with the speed of such demon as this ? I will use that SD Card in laptop slot where I can insert it so I think it should be faster than using USB Adapter.


title: Unable to connect to wifi on Linux Mint

text: I installed Linux Mint and am trying to connect to wifi, but this does not work. On the system tray it shows the “connecting” icon for a while, then the “not connected” icon. How can I investigate what's going wrong and make the wifi work? Model is Intel(R) WiFi Link 1000BGN on a Dell Inspiron 14r laptop. `dmesg` says:               wlan0: authenticate with 20:4e:7f:13:e1:58 (try 1)     [  152.358450] wlan0: authenticated     [  152.371768] wlan0: associate with 20:4e:7f:13:e1:58 (try 1)     [  152.377936] wlan0: RX AssocResp from 20:4e:7f:13:e1:58 (capab=0x411 status=0 aid=1)     [  152.377939] wlan0: associated     [  152.385284] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready     [  153.041670] wlan0: deauthenticating from 20:4e:7f:13:e1:58 by local choice (reason=3)


title: How do I prevent GNOME suspending while I finish a compilation job

text: I am trying to build a custom kernel for my machine which is taking a long time to build (as expected). Is it possible to stop my GNOME desktop from suspending the machine until the compilation has completed and then have it suspend (assuming I'm away from the machine for the 30 minutes it would normally take). I don't want to permanently disable suspend (which is easy to do via the system settings control panel but wastes power) but rather be able to specify (via PID?) my compile job and have the computer suspend when it finishes.


title: router latency measured by tcpdump increases

text: I am using tcpdump to measure latency on a linux router, i.e. the delay experienced by packets as they pass through the router (made of Ubuntu 10). For this purpose, I captured packets in the IN and Out interfaces and subtracted their log timestamp to know the latency inside the router. I was expecting some sort of flat latency; but, in constrast, the latency increased linearly with time. I used iperf to send about 800,000 packets (of size 1500Byte) through the router (having two Gibabit links). The surprising point is that although the latency on the router was increasing from about 20 microseconds to 7 milliseconds, the average throughput measured every second was almost flat. Would you please let me know why the latency has increased? There might be some problem in properly recording the time of capturing OUT interface packets. Thank you in advance.


title: Why does the read command not take interactive options when run by sh?

text: I want to download a provisioning script that reads some configuration parameters via `read`, and execute it:               curl http://example.com/provisioning.sh | sh      The problem is, that the `read` command in the script is call with the `-i` parameter to provide a default:               read -p "Name: " -i joe name     echo $name      If I download the script, set the `+x` permission and run it, everything's fine. If I run it with `cat provisioning.sh | sh` or `sh provisioning.sh`, it fails with:               read: Illegal option -i      Why wouldn't read support providing a default if it's run via sh? But whatever, I'll remove the `-i`, being left with               read -p "Name: " name     echo $name      Now if I run the script via `cat provisioning.sh | sh`, it won't do anything. Why is that? Ubuntu 14.04.


title: fastest way of doing a tar.gz from a tree of directories?

text: I've got a tree of directories with files like this:               .     |-- 00     |   |-- 00     |   |   |-- 00     |   |   |-- 01     |   |   |-- 02     |   |   |-- 03     |   |   |-- 04     |   |   |-- 05     [..]     |   |   |-- 97     |   |   |-- 98     |   |   `-- 99     |   |-- 01     |   |   |-- 00     |   |   |-- 01     [...]      There is about 200 files at the end of each directory, so a lot of files. What would be the fastest way of making a tar.gz of the whole thing? Can I parallelize the task for many CPUs?


title: Mislocated bootloader is needed removed

text: I used to have Windows XP on my computers smaller partition but it seems the bootloader is located on the bigger one. After replacing my OS with Linux Mint, I kept being asked as to choose whether XP or Mint. I tried deleting `boot.ini`, didn't work. I cannot afford to delete all my backup files. How can I get rid of the Windows bootloader? Especially manually.


title: sed to search for multiple words and remove those lines

text: I have a master file with more than 50000 lines and my requirement is to remove around 20000 lines from actual file, for this I used `grep -vE` command which is showing an error as too many arguments. I'm using `sed` command to remove those using for loop. But it is taking so much time to remove as 20000 `sed` commands are going to initialize. I need help in doing it as fast as possible.               for i in `cat 20000-words.txt`; do          sed -i -e "/$i/ d" 50000-lines.txt     done


title: GRUB on MBR of Windows-only internal drive, with distros on external drive

text: I think what I want to do is long and convoluted; then again, it might be somewhat easy, and I'm just overthinking it. Here's the setup I want to achieve:   * The internal drive (sda) is one giant WinXP partition (sda2), a tiny one for a boot partition (sda1), and the MBR.   * On an external drive (sdb), I will create multiple partitions for several distros. This drive will be either an HDD in an enclosure or something like a WD passport. This will be attached via USB 2.0. I know it is possible to install grub to the MBR of `sda` and boot an `sdb` partition from there. I also know I'll need to edit grub to chainload Windows and list all the distros. However, I have the following questions:   1. If I disconnect sdb and want to select + boot into Windows, is grub going to get upset? In other words, does the grub menu just display what you tell it to, or does it go hunting for those other options immediately and will have problems because some have disappeared?    2. If I disconnect sdb, I'd love for it to still be bootable on another computer. If I have a boot partition on sdb as well as sda, but have my BIOS set to use the internal MBR first, can this be achieved?    3. What if I want to use something pretty like burg or plymouth? How will this change things? I'm sure the answers are out there somewhere, but I'm finding it hard to Google for!


title: IPtables reset on reboot, how do I tell what is causing this

text: Using RHEL, and I have had some "Cyber Security" people work on my server. I'm now using this server in a completely closed environment with no outward network connection, and would like my iptables set to completely off. I have used these commands:               chkconfig iptables off     service iptables save     service iptables stop          chkconfig ip6tables off     service ip6tables save     service ip6tables stop      **The Issue** Every time I restart the server the iptables are back on their incredibly restrictive settings. Am I not doing something correctly, or do they have a script that could be running and resetting the iptables settings. If there is a script, how could I figure out where this is coming from to disable it.


title: Find files that have words in common

text: What would be the best way to create a list of files that have common words with a given file. For example, if I had:               $ ls       mainFile  file1  file2  file file4     $ cat mainFile       exquisite malicious sentient pulsating       perspicacious one       tawdry fumigate Baryshnikov O'connor      and I wanted to list any of the files in the `cwd` that contained any one of the words in `mainFile`. What would be the best way to go about this? Since the number of words per line in `mainFile` is not constant, I was finding solutions using `cut` a little tricky. I was trying to create a string out of the words and then place them separated by `|` in a `grep -l "exquisite|malicious|etc" *` command. I'm open to any method though that might be better.


title: How can I configure postfix smtp per user?

text: I have previously used msmtp as my MDA. msmtp has a configuration file with username and password of the outgoing smtp server (eg gmail) stored in my home directory. I've recently changed distributions to CentOS 6.3 for reasons of support (only supported distribution for third party software). I tried to install msmtp but it wasn't available in any of the repositories. I finally got an rpm from fedora and installed that but it still doesn't work (can't find ca-certificates). So I decided I'd try with Postfix as it's the default on RHEL. What I'm trying to do is set up sendmail (git and mutt) to send mail via my gmail account. I can't find where to set this up using Postfix. Everything I read suggests editing /etc/postfix/main.cf. But I don't want every user of my computer to be able to send email via _my_ gmail account. So my question is: how can I configure postfix per user (or can this not be done)? update: I've got msmtp working now (had to edit the config due to distribution changing), but I'm still curious if this can be done (easily) in postfix


title: How do I get started with linux?

text: I am a programmer but have only used Windows as the development environment till now. I work on Java. I wanted to start developing on Linux and would like to know where to start. More specifically:   * Which Linux to install on my machine?   * What are the basic requirements that I would need to know before I insert the Linux CD in my PC?   * Which packages do I need to install so that I don't have to wait for it to install while first access? I mean like JDK/ MP3 Player/ Open Office/ GCC, etc


title: Is there a way to execute the second-to-last command that started with a given string?

text: In a project with different makefiles:               $ make -f foo1.make     ... ...     $ testing testing     ... ...     $ !ma     make -f foo1.make       Good! But then if I by accident do:               $ make -f foo1.make     ... ...     $ testing testing     ... ...     $ make     make: *** No targets specified and no makefile found.  Stop.      And now I am sad:               $ !!ma     makema     No command 'makema' found, did you mean:       ... ...      Now I have to pick through all my testing commands with the up arrow like an animal. Unacceptable*! Is there any way to re-run that full `make -f foo1.make` command using `!` or some variant thereof? *: I will not even dignify the suggestion that I just retype the entire command with a response!


title: simplest way to get an ubuntu virtual machine w/ ssh server on my network

text: I have an OSX box and I'd like to just get a fresh install of Ubuntu to use remotely over SSH. That's all. But I'd like to get that on the same box without in anyway altering my existing OSX environment (i.e. I want to just run an Ubuntu VM or Docker). What's the simplest (fewest steps) way for me to do this?