title: Extract tomcat parameters from ps output

text: I'm trying to write a little diagnostic tool and one of the functions I want from it is that I want to run is:               ps axu | grep tomcat | grep -v grep | awk '{ print $<list of desired fields> }'        I want to return the userid that started tomcat and the following parameters that were passed when tomcat started:               -javaagent:/usr/share/tomcat7/<someagent> -Dcatalina.base=/var/lib/tomcat7      - Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp      I want those fields passed into an array which I can then use to tell the user something about the tomcat install. The problem is I can't find a way of formatting the command to force the fields to be what I need them to be to make awk work. At this point I'm thinking of just taking the output, writing it to a temp file, then pulling what I want out using regex. I know there's a way to do this in Bash but I have not had any success getting there from here.


title: Using cat to modify ~/.bash_profile seems to remove __git_ps1 compeltely

text: I want my prompt to display the current git-branch when inside of a repo directory. e.g.,               [desktop repo(master)]$      In my terminal I can type:               cat <<EOF >> ~/.bash_profile     PS1='\[\e[0;32m\][\h \W\[\e[m\]$(__git_ps1 "(%s)")\[\e[0;32m\]]\$ \[\e[m\]'     EOF      But the resultant appended text in .bash_profile is:               PS1='\[\e[0;32m\][\h \W\[\e[m\]\[\e[0;32m\]]$ \[\e[m\]'      the __git_ps1 method is not present in the result. If I manually edit the .bash_profile with vim then source ~./bash_profile, the PS1 statement contains the __git_ps1 method and it works fine. This cat statement is part of a larger 'bootstrapping' script, but I've trimmed out all the irrelevant stuff. I have successfully implemented this on Ubuntu. I am trying to get it running on a CentOS VM. Thanks!


title: APF firewall & IPset

text: Due to too many hack attempts from spam countries, today got the server configured with IPset for iptables. I loaded thousands of ip range in IPset & then added it to iptables with this command               iptables -A INPUT -m set --set Cblock src -j DROP      Cblock is the name I gave for the ipset rule containing 20 countries ip range All is good! but the moment I start APF firewall, ipset rules no longer in effect even though it still shows up in the status.               service iptables status      I checked APF config file & there is no mention about IPset. I also tried to start APF first & then load IPset rules. This approach also did not make a difference. Anyone had similar circumstance to tackle? I use APF to deal with spamhouse ip's, port blocking etc. Is there any other firewall wrapper that is compatible with IPset?


title: Wrong mount point for internal SSD

text: I am having a problem with mounting an internal SSD. For some reason The mounting point is chosen as `/media/user/Data` instead of, as specified in `/etc/fstab`, `/mnt/Data`. The according line in `/etc/fstab` goes as follows:               UUID="064ced5e-19c1-43d1-876f-3de0c115b65e"     /mnt/Data       ext4    users,noauto,exec,rw,async,dev  0       0      I am using Ubuntu 14.04 LTS 64bit. (edit:) Here goes the complete fstab file:               # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     # / was on /dev/sdc2 during installation     UUID=9cf86df3-3d02-45d7-8078-d6ff5fc83ea6 /               ext4    errors=remount-ro 0       1     # /boot/efi was on /dev/sda2 during installation     UUID=5AC7-594F  /boot/efi       vfat    defaults        0       1     # swap was on /dev/sdc5 during installation     UUID=5460f609-5245-417a-833a-271c533db97a none            swap    sw              0       0          UUID="064ced5e-19c1-43d1-876f-3de0c115b65e"     /mnt/Data      ext4    users,noauto,exec,rw,async,dev  0       0


title: What's the difference between "dir" and "ls"?

text: I have compared the man pages of `dir` and `ls` and they seem to be exactly the same. Both are part of GNU coreutils and "list directory contents". The only difference I've seen so far is that `dir` doesn't colorize the output. So why do two commands exist? Is there a difference I missed? Why would one prefer `dir` over `ls`?


title: Identify the number of unique values and then the number of occurrences of those values in the file

text: I have a data file which contains 15000 lines, but only 400 unique values. I am looking for a way to identify the number of unique values and then the number of occurrences of those values in the file. I came up with the following but it is very very slow. Any thoughts?               for value in `cat mylist.txt | uniq`     do         counter=`grep $value mylist.txt |wc -l`         echo $value $counter     done


title: Can I use variables inside {} expansion without `eval`?

text: Can I use variables inside `{}` expansion without appealing to `eval`? If so, how? This doesn't work:               $ touch 1.foo 1.bar     $ ls 1.{foo,bar}     1.bar  1.foo     $ extensions=foo,bar     $ ls 1.{$extensions}     ls: cannot access 1.{foo,bar}: No such file or directory      It works with `eval`:               $ eval ls 1.{$extensions}     1.bar  1.foo


title: connect two VMs and one VM to the internet

text: Disclaimer: My knowledge about networking as well as qemu is little to none. I'm using QEMU to run a Debian VM that runs an application. For testing purposes I now want to create a second VM running Windows that is connected to the first VM so it can access it. This, so far, is working. However, with the current setup, the Windows VM has no connection to the Internet. I'd like to change this, though, but without allowing the Debian VM to connect to the Internet. The current setup is that a bridge is being created as well as a number of virtual network devices (tap) which are then added to the bridge. One of the tap devices (let's say it's `tap0`) is then used for the second VM (the other ones are used by the first VM). My question now is: Does it make sense, i.e. is it possible, to configure the bridge `br0` such that only `tap0` can connect to the internet? If so, how can I go about doing that (utilities like `brctl` are available). It is deliberate that the Debian VM can't access the internet and this needs to stay this way. From what I understand I could just add `eth0` to the bridge to allow Internet access, but can I restrict that to the Windows VM (e.g. `tap0`)?


title: sed: substitute text with a string that contains special characters

text: I have a lot of text file with specific tag called "Comment", **example** I have a file called 3dchess.sh, I need change the tag:               Comment=3D chess for X11       to               Comment='3D chess for X11'      The script is:               #!/bin/sh     Package=3dchess     Popcon=48     Section=universe          Comment=3D chess for X11     Exec=3Dc      I have tried this but it doesn't work in my case:               sed -i ':Comment=:s:Comment=:Comment=':g;/Comment=/s/$/'/' $HOME/3dchess.sh


title: Indent like first line

text: How can I indent a file such as its first line? **Example:** A file containing                    x=1+2+3+4+     5+6+7+8     +9+10+12      should be converted to                    x=1+2+3+4+          5+6+7+8          +9+10+12      I need this inside a shell-script on a Linux system. One-liners are preferred.


title: USB HDD not working on linux

text: I have a WD My Passport 1 TB external hard drive which is giving me some problems on different linux machines:   * When I plug it in, nothing happens   * Gparted when detecting connected devices says _"Error opening /dev/sdb: No such device or address"_ and it doesn't list the hard drive   * Typing on terminal `sudo fdisk -l` the hard drive is not listed This happens on both my main Debian PC and on my Raspberry Pi, but I can use the hard drive perfectly normally on my Mac. I can't check its S.M.A.R.T. status since it's a USB hard drive, but I don't think the HDD is failing, because if so it wouldn't work on my Mac. I checked and reformatted the drive several times on my Mac but it still doesn't work on linux. Any ideas on what's going on? **Edit:** here is the output of `lsusb`:               Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 000: ID 1058:0730 Western Digital Technologies, Inc.      Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.      Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB     Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB     Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB      As you can see, the device is listed here (Bus 001 Device 000). **Edit x2:** This is kern.log file since when the hard drive was connected:   * via dropbox: https://www.dropbox.com/s/e11tb8bsstxrgyl/kern.log   * via fpaste: http://fpaste.org/127795/87285661/. **Edit x3:** The hard drive has 4 partitions; two are HFS+ and two are FAT32. The partition table is GUID. **Edit x4:** I found this question about one error in the kernel log file I found too, which means the USB 3.0 drive is requesting too much power from the computer. However I tried using a USB power splitter cable (so that the HDD could have 1000 mA instead of 500 mA) and it didn't solve the problem. The HDD seems to be rated 600 mA, but I've always used on USB 2.0 ports without problems.


title: Can a process running in a linux container communicate with another process running on the host OS via IPC?

text: I have 2 processes A and B. Currently, both A and B are running on the same OS (RHEL6.2) and the processes can intercommunicate via TCP sockets. My objective is to run process B in a Linux Container and still have it communicate (send/receive messages/signals) with process A on the host OS. I've been unable to find a clear answer after a few days of searching the web. Can this be done or are containers completely isolated? If so, how can I achieve this? I'm very new to this concept.


title: Writes to FrameBuffer /dev/fb0 do not seem to change graphics screen

text: In attempting to write directly to the graphics frame buffer /dev/fb0 , (Ubuntu 12.04) , the graphics screen does not change. Has Ubuntu 12.04 invalidated the use of /dev/fb0 , or does it need to be activated in some way ?


title: BSD Net/1 was a free fully operating system?

text: I think that the old BSD Net/1 was not a fully operating system, but an add-on to 4.3BSD for VAX, as I realize from http://gunkies.org/wiki/Net/1 and http://gunkies.org/wiki/Net/2   Is it right? In the same web page I read: "This software suite is copyright The Regents of the University of California and may be freely redistributed. No previous license, either AT&T or Berkeley is required. The release costs $400.00 US." So, it was free or not?   I think that someone could have bought just one copy and then give other copies to all his friend. Is it right? Now the last question: If Net/1 was an add-on, users had also to buy a Unix license from AT&T?   Could someone give me more info?   Thanks to all.


title: Do I need to install LIRC separately in Fedora 18?

text: I just finished installing Fedora 18 and out of the box I noticed that it recognizes my IMON/MCE Remote control. I have had to make some changes to the rc_keymaps/imon_mce file to remap some of the keys, but it is pretty accurate. However, when I use the remote with XBMC, I see that I sometimes get multiple presses instead of just one. For instance, if I press the down arrow once quickly, it will scroll down several lines very fast before stopping. I've done a little searching online and have seen a lot of talk about Lirc, and the need to ensure that only Lirc is decoding the keypresses and not both Lirc and the kernel. However, from what I understand Lirc is already built into the kernel, so I am a little confused. If I check which protocols are listening, I see only rc-6:               # cat /sys/class/rc/rc0/protocols      [rc-6]      What do I need to do to fix this problem? Additionally, when I modify the imon_mce file, what service do I need to restart in order to reread the new file? I know I can force it using ir- keytable, but I presumed that there must be some service that loads up upon bootup.


title: Conky above full screen

text: I would like to run an instance of conky on top, that is, to always be visible. I tried to use               own_window yes     own_window_type normal     own_window_class conky     own_window_transparent no     own_window_hints undecorate,above,sticky,skip_taskbar,skip_pager      I don't know what all these commands means but it works (partially). The problem is that it is not visible if I am using a pdf in full screen mode, like slides during a presentation. How can I do this? ps: I'm trying to run it to show a small clock to have time control during the presentation.


title: Enabling multicast communication between 2 AIX JVM processes

text: I'm having trouble with multicast distribution on a single AIX machine between two JVM processes. Think ehcache or jgroups. In order to enable on Mac OS X:               route add -net 224.0.0.0 -interface lo0      On Linux (from JGroups doco, untested)               route add -net 224.0.0.0 netmask 224.0.0.0 dev lo      What is the equivalent command for AIX?


title: automated bug reporting tool always says "invalid password or login"

text: Every time I get an ABRT bug in Fedora 20 and I try to report it, I have to enter my BZ login/PW again. How do I setup ABRT so that it saves my ID/PW and/or just logs in and reports my bugs when I tell it to?


title: Client-server app for sending and monitoring asynchronous jobs

text: I am looking for a desktop app/IDE in which you can:   1. Maintain a list of UNIX/Linux connections   2. Be able to write a script locally in a local editor, not SCP files to the host or writing them on the host directly   3. Run it in a chosen directory on a remote host from #1 above by SCP-ing first   4. Be able to do #3 above one-time or permanent   5. Have a console of remote jobs that monitors requests   6. Ability to send data from the host back to the client in the form of a structured named pipe rather than SCP-ing files    7. Preferably have an API to do all of this in Java (`Jsch` can do most of this but I've had some difficulty and would like to try something else too) Is there free software out there that matches the above requirements? We have Autosys where I work and we can do some of the above items in it but it is not free and not so great for ad-hoc/on-demand jobs.


title: What does "Empty print file" mean and how can I diagnose it?

text: When trying to print I get this error. What does it mean? How can I diagnose it?


title: Add a new user steps for Oracle Linux 5

text: It's been over 10 years since I last used RedHat (which I believe that Oracle Linux came from). So I cannot remember the steps to create a new user, add them to the appropriate groups, set up their home environment, etc. I can find individual commands for Oracle Linux, but no work flow on how to go about the process (as in what steps an admin must follow to do the complete process of adding a new user to the Oracle Linux environment). Could someone provide the recommended steps when a new user is required for a Oracle Linux system please? --- edit --- I should note that I'm dealing with a headless system so I need to know how to do this from the command line. Looking at the resources on the oracle site keeps showing GUI ways to do things intermingled with the CLI. For example, it states the command of how to create a user at the command line, but doesn't show how to set the user name via the command line. Instead it shows the GUI User Manager tool.


title: iotop but for particular disk?

text: Is there a tool like `iotop` but for monitoring IO on specific volumes? (Or perhaps I missed a way to filter `iotop`?) If not is there any way to get at this information via (say)`/proc`? (`dstat` etc. only show aggregate activity across all processes per volume, whereas I'm interested in seeing how much each process is contributing.)


title: Reading from USB serial port under Cygwin

text: I am actually using Cygwin, but it is my understanding that it responds to Unix commands so hopefully I am in the correct place. I have an Arduino hooked up via USB to my LapTop for data reading. I want to be able to simultaneously be able to output the serial port data to the shell for my viewing and also save all that data as a text file. Is there a command I can use to do this?


title: Determine how much a process is using each disk?

text: How do I tell how much load a particular process is contributing to each of several available volumes/mounts? It seems that `dstat` only shows aggregate stats across all processes per disk, and `iotop` only shows aggregates stats across all disks per process.


title: Vim 7.3 with Lua: How do I use it?

text: The latest Vim release is awesome! I compiled it with `\--enable-luainterp=yes` and it does have the Lua feature:               % gvim --version | egrep '\+lua'     +linebreak +lispindent +listcmds +localmap +lua +menu +mksession +modify_fname       But how do I actually use it? Up until now, I was always using Vim script for my files, but how do I let it interpret Lua? And what are the bindings that I can use from inside Lua?


title: XMonad MouseResizableTile automatic pane rebalancing

text: How can I automatically update the number of windows in the master pane to be the same as or close to the number of windows in the slave pane, while still supporting the default `mod-,` and `mod-.` keys? I've tried to configure XMonad to arrange windows how I want them automatically, and this is the one area where I still find myself making frequent manual adjustments. I think I want to send `IncMasterN` messages at open/close, depending on which column has more windows (or at least that would be enough to get me started), but I'm not clear on how to find `nmaster` at run-time, and my previous attempt at sending such a message seemed to result in an infinite loop (see excerpt below; CPU usage went to 100% and XMonad stopped responding, like it was still stuck in the log hook). Any tips?               main = do         xmonad $ gnomeConfig {             logHook    =  balancePanes         } where             balancePanes :: X()             balancePanes = do                 ws <- gets windowset                 let howMany = windowCount ws in do                     when (howMany == 3) (sendMessage (IncMasterN 1))


title: Understanding getlogin spoofing

text: My question is in three (or so) related parts: 1) My understanding is that `getlogin()` will effectively return the `auid` associated with the process and so isn't actually changable by the user. Is that understanding true? 2) I found this old exploit regarding `getlogin()` used in pam_wheel. I'm familiar with each individual command but not sure I understand how they're accomplishing the end effect. It seems they're accepting input from a symlink called `tty1` which is also the same tty name the root user is on. How is it that the symlink succeeded? Shouldn't /dev/tty1 already be there if `root` is shown as being logged into it (in utmp)? 3) I was just starting out with GNU/Linux (like abut a year or so into it) when this exploit was written up, so it's possible that I'm unaware of some previous iteration in Linux identity/privilege management. How could a normal user create that symlink? I know `/dev` was a static list of `mknod` files back then, but reads/writes on symlinks get evaluated by the hardlink referenced, correct? I realize this is on a udev-based `/dev` hierarchy, but by way of example this is one pty on one of my systems:               crw--w----. 1 jadavis6 tty 136, 3 May 27 00:47 /dev/pts/3      Shouldn't the above prevent any user that's not `jadavis6` nor in the `tty` group access (via symlink or otherwise) for reading or writing? Were the permissions in `/dev` more liberal pre-`devfs`/`udev`? Also, how does reading from the TTY grant the process you're currently in root access? I could see using it to spy on the remote session by reading everything written to the tty device, but how are they getting `logname` to change for them? Are the subsequent commands (after the redirect from tty1) just what is happening on the root console or is there something at play here that actually led to this be a way to get root? If it's the latter, is this exploit really `su` specific? I mean won't a lot of functionality be opened up if all you have to do is create a symlink to a device file and then your `auid` is now root? **Answer:** Found out most of the critical information above in this question


I installed Fedora 20 using the liveOS. While taking the updates I am getting the following result:               [root@localhost bioinfo]# yum update     Loaded plugins: langpacks, refresh-packagekit     Error: Cannot retrieve metalink for repository: fedora/20/i386. Please verify its path and try again      How do I fix this error?


title: install mysql 5.5(remi) with centos 6.2 complains error

text: Finished Dependency Resolution     Error: Package: mysql-server-5.5.31-1.el6.remi.i686 (remi)                Requires: libz.so.1(ZLIB_1.2.0)      I type `yum --enablerepo=remi install mysq` and these error appears. I have epel installed already.


title: Inserting the results of a for loop into an html file - BASH

text: I have a script that takes the results of a command and puts them into a html code. Here's what I have so far...               #!/bin/bash          list_dir=`ls -t downloads/`          for i in $list_dir     do     #----       #       echo "$i"     #----attempt 1        #           ` sed -n 'H;${x;s/placeholder .*\n/<a href="downloads/$i">$i</a>\                            &/;p;}' index.html`     done      I'm trying to get the results of the for loop to replace the contents of the html file where it says "placeholder" (I would rather have it just insert the content below a certain point without having the placeholders). I'm not too certain how to go about this.


title: Set dual screen on Fedora

text: I would like to set dual screen mode on my Fedora 18 XFCE (what I mean is that I want to be able to display different content on every screen). Currently my screens shows the same, i.e. the secondary one is the mirroring primary one. I have a laptop plugged into the docking station with other monitor if that matters. I actually tried to play with `xrandr` but didn't succeed. This command `xrandr --output VGA1 --left-of LVDS1` does what I want but I still can't drag and drop applications between the screens


title: What does -u of diff really do?

text: Looks like `-u` can take an extra number argument, but I don't quiet get the manual, It says,                 -u, -U NUM, --unified[=NUM]               output NUM (default 3) lines of unified context      Someone name an example please? I couldn't find a working one.


title: Redirecting only stderr to a pipe

text: This code snippet is from Advanced Bash Scripting Guide.               # Redirecting only stderr to a pipe.          exec 3>&1                              # Save current "value" of stdout.     ls -l 2>&1 >&3 3>&- | grep bad 3>&-    # Close fd 3 for 'grep' (but not 'ls').     #              ^^^^   ^^^^     exec 3>&-                              # Now close it for the remainder of the script.          # Thanks, S.C.      The comments explains the code closes fd 3 only for 'grep'. but the closes fd 3 twice. Why we need to do like this? Is it wrong to close fd 3 only one time for 'grep' like this?               ls -l 2>&1 >&3 | grep bad 3>&-


title: Automate workflow in shell

text: Coming from GUI interfaces I've come to finally understand the power of having everything piped in text, but I don't really know how to use all that power yet. I realized the workflow for a particular project goes like this...               # compile repo 1     cd ~/workspace/repo1     make -B     # deploys compiled code into repo2     make deploy          # commit repo 1     cd ~/workspace/repo1     git add .     git commit -m "changes"     git push origin master          # commit repo 2     cd ~/workspace/repo2     git add .     git commit -m "changes"     git push origin master      My question isn't so much how to accomplish this, it's what is the right tool for this? Reading around it seems that a Bash script is what I need, but I'd like to know from the experts.


title: Pass colors from ls through pipe to awk 'print' statement

text: This is a follow-up to my question from yesterday, Show sum of file sizes in directory listing. Thanks to Zero Piraeus and a point in the right direction by Mauritz Hansen, I now have               function dir() {             ls -FaGl "${@}" | awk '{print; total += $4}; END {print "\t\ttotal: ",total/1024,"KB"}'     }      in my `.bash_profile`, and it works great. However, at least on Linux (I haven't had a chance to try it on OSX yet), where I'm `ssh`ing in using PuTTY on XP, my dir colors are now gone. Is there some way of passing the color codes through the pipe to the awk `print` statement? ### Update Thanks to Sukminder's answer, adding `\--color=always` does the trick, as it had been set to `auto` before. However, I now get a blank space between the end of the directory listing and the total line:               [19:30:58 mattdmo@server ~/webapps/django15 ] $ dir     drwxr-xr-x  7 mattdmo 4096 Mar 24 20:28 ./     drwxr-xr-x 17 root    4096 Mar 18 20:15 ../     drwxr-xr-x  7 mattdmo 4096 Mar 14 14:57 apache2/     drwxr-xr-x  3 mattdmo 4096 Mar 14 14:57 bin/     drwxr-xr-x  2 mattdmo 4096 Mar 24 20:10 lib/     drwxr-xr-x  3 mattdmo 4096 Mar 14 14:57 myproject/     drwxrwxr-x  3 mattdmo 4096 Mar 24 20:28 pigimal/                          total:  28 KB     [19:30:59 mattdmo@server ~/webapps/django15 ] $      Any suggestions on fixing this?


title: Is the output mixed like this because of xargs and how can I fix it?

text: I'm learning a bit of Bash by using xargs to list whois records for a bunch of IP addresses. The command used is:               echo "$1" | tr "\n" "\0" | xargs -0 -n 1 -t -P 3 -I %  sh -c 'echo "\n 44rBegin whois record -- \n"; whois -h whois.arin.net % ; echo "\n 44rEnd whois record -- \n"'      The executed commands are:               sh -c echo "\n 44rBegin whois record -- \n"; whois -h whois.arin.net 206.190.36.45 ; echo "\n 44rEnd whois record -- \n"     sh -c echo "\n 44rBegin whois record -- \n"; whois -h whois.arin.net 212.146.69.237 ; echo "\n 44rEnd whois record -- \n"     sh -c echo "\n 44rBegin whois record -- \n"; whois -h whois.arin.net 77.238.184.24 ; echo "\n 44rEnd whois record -- \n"      I want the output to appear as if each block of commands executed using `sh -c` is executed sequentially. Instead my output is something like:               44rBegin whois record          44rBegin whois record          44rBegin whois record          whois1 output          44rEnd whois record --          whois2 output          44rEnd whois record --          whois3 output          44rEnd whois record --      How can I fix this problem?


title: Comparing an string by value of a floating number to a number

text: I wrote the code below:               for j in `cat output_10.txt`          do          dri=`echo $j |cut -d':' -f1`      nu=`echo $j |cut -d':' -f2`     tot=`echo $j |cut -d':' -f3`     fre=`echo $j |cut -d':' -f4`               if [ $fre > 2 ]                     then                     echo " $fre 	" >>mailbody.html                     else                     echo " $fre 	" >>mailbody.html     fi     done       where the value of fre is being read from output_10.txt file and is a something like 9.8. The issue is that the `else` condition is not working even if the value of the `$fre` is less than 2 . I want if the value of `$fre` is less than 2, the `else` condition work and it should display the color red in my HTML page. As of now green color is displayed in my HTML page for both the cases.


title: libc.so.6(GLIBC_2.14)(64bit)

text: Installed:       glibc-static.x86_64 0:2.12-1.107.el6_4.4                                 glibc-utils.x86_64 0:2.12-1.107.el6_4.4          Dependency Installed:       fontconfig.x86_64 0:2.8.0-3.el6        freetype.x86_64 0:2.3.11-14.el6_3.1     gd.x86_64 0:2.0.35-11.el6        libX11.x86_64 0:1.5.0-4.el6       libX11-common.noarch 0:1.5.0-4.el6     libXau.x86_64 0:1.0.6-4.el6             libXpm.x86_64 0:3.5.10-2.el6     libxcb.x86_64 0:1.8.1-1.el6               [root@host728 ~]# rpm -Uvh pptpd-1.3.4-2.fc19.x86_64.rpm     warning: pptpd-1.3.4-2.fc19.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 862acc42: NOKEY     error: Failed dependencies:             libc.so.6(GLIBC_2.14)(64bit) is needed by pptpd-1.3.4-2.fc19.x86_64             libc.so.6(GLIBC_2.15)(64bit) is needed by pptpd-1.3.4-2.fc19.x86_64          [root@host728 ~]# uname -a     Linux host728.me.net 2.6.32-042stab079.4 #1 SMP Thu Jul 18 18:57:29 MSK 2013 x86_64 x86_64 x86_64 GNU/Linux     [root@host728 ~]#      What am I missing here? Do I need a different RPM that is RHEL based? I am running CentOS 6.x


title: Change the default terminal for all .desktop files?

text: My `htop.desktop` launches XTerm, but I want to change the default terminal to xfce4-terminal in all "Terminal=true" .desktop files.


title: if env variable exists then exit out of script

text: #!/bin/bash        if  [[ -n "$MYVAR" ]]; then exit; fi     # otherwise the rest of the script continues...      I'm trying to exit out of a shell script if a certain ENV variable is 0. The script above does not seem to work (I've also tried using `return` instead of `exit`. Can someone explain how this would be done, or what's wrong with the line above? When I type that in my terminal (replacing exit with `echo "YES"` it works just fine.


title: How to use nemo actions to mount an iso file?

text: I read these articles: https://wiki.archlinux.org/index.php/Nemo   https://wiki.archlinux.org/index.php/Mounting_images_as_user and try use `Nemo Actions` to mount `iso` files but nothing happened while I clicked the context menu option. My steps:   1. `sudo pacman -S fuseiso`   2. create `nemo-actions-iso-mount.sh` in `/usr/bin/`              #!/bin/bash         FILE=$(basename "$1")         MOUNTPOINT="$HOME/Desktop/$FILE"       fuseiso -p "$1" "$MOUNTPOINT"        3. `sudo chmod a+x /usr/bin/nemo-actions-iso-mount.sh`   4. create the script `mountiso.nemo_action` in `$HOME/.local/share/nemo/actions/`              [Nemo Action]        Name=Mount Image File: %N        Comment=Create an folder in ~/Desktop with the name of the image file        Exec=/usr/bin/nemo-actions-iso-mount.sh %N         Selection=S        Extensions=iso;nrg;bin;img;mdf;         Mimetypes=*/*


title: Are there other LSM (Linux Security Modules) in addition to SELinux and AppArmor?

text: In researching this U&L Q&A titled: permission denied for ptrace under GDB, the question came up, "Is there other software similar to SELinux & AppArmor?". User @IwillnotexistIdonotexist mentioned 2 that I'd never heard of: Smack & Yama. He found them by searching through the Linux source code. So now we're up to 4.   * SELinux   * AppArmor   * Smack   * Yama Are there others?


title: Guide/help using Dialog with bash scripting

text: While I understand how to create menus, no guide I've found teaches how to actually link them to commands I was hoping to have something like:               dialog--clear --title "n00b's spellbook" \             --menu "Choose thine spell:" 20 51 4 \             1 "Name of program"  "blah" \             2 "Name of other program" "blah" \      then somehow 1 runs `./program1` and 2 runs `./program2`


title: command to determine ports of a device (like /dev/ttyUSB0)

text: I have a question regarding the ports in Linux. If I connect my device via USB and want to check its port I cant do it using the command lsusb, which only specifies bus number and device number on this bus:               [ziga@Ziga-PC ~]$ lsusb     Bus 003 Device 007: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC      **Is there a command that tells me the port the device is connected to directly?** Only way to do this untill now was to disconect and reconnect and using the command:               [ziga@Ziga-PC ~]$ dmesg | grep tty     [    0.000000] console [tty0] enabled     [    0.929510] 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     [    4.378109] systemd[1]: Starting system-getty.slice.     [    4.378543] systemd[1]: Created slice system-getty.slice.     [    8.786474] usb 3-4.4: FTDI USB Serial Device converter now attached to ttyUSB0      In the last line it can be seen that my device is connected to **/dev/ttyUSB0**.


title: How do I highlight the current line and the cursor in .vimrc?

text: I am trying to highlight the current line as well as the cursor position in Vim. Here's my .vimrc:               set cursorline     hi CursorLine ctermbg=8 ctermfg=15 "8 = dark gray, 15 = white     hi Cursor ctermbg=15 ctermfg=8      The problem I'm experiencing is that the current line background color covers up the cursor background color, so it looks like this: ![The current line is highlighted but the cursor is not.](http://i.stack.imgur.com/KSlH8.jpg) I can obviously tell where the cursor is because the foreground color is almost black, but when the cursor is on a space or at the beginning/end of a line I have no clue where it is unless I move it. ![The cursor is at the end of the line, though you'd never know it.](http://i.stack.imgur.com/i6YJP.jpg) What am I doing wrong here?


title: Return username of the user who just logged in within a login script

text: I'm writing a login script for OSX 10.8. I need to know the name of the user who logged in via the Login Window within a login script. I've tried "whoami", "$USER", and "ls -l /dev/console | awk '{print $3}'", but they all return "root". I assume this is because login scripts run as root, not as the user who authenticated at the Login Window. Here's an example: If I login as "bob", or "john", I want the to be able to set a variable to "bob", or "john".


title: ls in glorious 256 colours

text: Apart from the ls colors solarized theme, is there any other ls colour themes out there that you would recommend for a dark background with a urxvt terminal?


title: What is Unix for the OpenVMS DUMP command?

text: In OpenVMS the DUMP command: > Displays the contents of a file, a directory, a disk volume, a magnetic tape > volume, or a CD-ROM volume in decimal, hexadecimal, octal format, ASCII, or > formatted data structures. This is frequently used when a file is not a simple text file where the content has a mixture of data types such as strings and integers. What is the Unix/Linux command for this?


title: Why does (GNU?) parallel fail silently, and how do I fix it?

text: In a larger script to post-process some simulation data I had the following line:               parallel bnzip2 -- *.bz2      Which, if I understand `parallel` correctly (and I may not), should run n-core threads of the program over all files with the listed extension. You may notice that I misspelled the command `bunzip2`. I would expect a warning or error message here, but it fails silently. Is this intended? How do I not get bit by this in the future? **Update:** It is possible that I have a different `parallel` installed than I think I do:               > parallel --version`               parallel: invalid option -- '-'     parallel [OPTIONS] command -- arguments         for each argument, run command with argument, in parallel     parallel [OPTIONS] -- commands         run specified commands in parallel      A man page of `parallel` on my system gives:                parallel(1)                                                        parallel(1)     NAME            parallel - run programs in parallel     ....     AUTHOR        Tollef Fog Heen      Which seems this is _not_ the GNU version.


title: Installing jdk7 on Debian server via SSH

text: Currently, I'm trying to launch a java program on a server. The server is launched on my virtual machine (VirtualBox) and controlled over SSH. Its OS is Debian. So, in order to launch my program I need jdk7. I've downloaded its tar.gz archive to the server and extracted it to `/usr/jav`a. But the system can't see the new jdk. When I type "java -version" in my terminal it writes 1.6 instead of desired 1.7. So, a trivial question: how can I install jdk7 on Debian? (No GUI is available).


title: Flatten shell script (include sourced scripts) and remove unused functions

text: I am manually tweaking Debian init scripts in order to optimize the boot time of an embedded device. So far I reduced it by half just with the "low hanging fruits" ie. the smaller scripts that are easy to understand. Now I am left with a few init scripts that take about 20s to run in total. Based on the experience from the other scripts, I can gain another 5 to 10 seconds here. The problem is those scripts are a bit too hard for me to understand because they source several helper scripts from `/lib/init/` which are difficult to follow (`mount-functions.sh` being the first culprit). In order to make those remaining scripts easier to understand so that I can optimize them, I'd like some way to "pre-process" those init scripts so that whenever they source a file it gets inlined in the script itself (recursively of course), and remove the unused functions to unclutter the code. Is there a tool for this?


title: Removing certain fields from a CSV file

text: I have a large CSV file (~15GB) which a client has sent over as an export of a table. The format is a follows:               field, ... , field, field which sometimes contains commas,     another field which sometimes contains commas, field, ... , field      Consequently, I can't import the data because of the shift produced in some rows where the fields contain one or more commas. I do not need the data in those two fields, so getting rid of them would probably be the best option. Consequently, to avoid the two fields in the middle that cause trouble, I was thinking of something that for each row would take the first 9 fields (the ones before the two) and the last 57 fields (the ones after the two). I'm guessing this is something that can be done with `sed` or `awk` but my expertise with these tools (or whatever may be better) is rather limited.


title: Rename multiple files, sub directories, and insert characters at specific location on OSX

text: I have files and directories starting with **"cateory-icon-"** in many sub directories. I am trying to rename them recursively to **"category-icons-"**. Please note that I added missing **"g"** to the **category** and **"s"** at the end of **icons**. I did look at tons of other questions dealing with renaming multiple files and directories but could not make any of them work for me! A little bit explanation about the answer would be greatly appreciated. EDITED: Here is an example of my directory structure:               test/cateory-icon-archery/cateory-icon-archery.png                               cateory-icon-archery@2x.png          test/cateory-icon-automotive/cateory-icon-automotive.png                                  cateory-icon-automotive@2x.png


title: OpenWrt: prevent that an IP address could be reachable in the network, excluding a few hosts

text: So there is a network: 192.168.1.0/24. Router is an OpenWrt 12.04 on a WRT160NL. We got a new network printer. But it's www server is reachable to everyone in the network (and thus everyone can print with it..). **Q:** How can I disable the network access for all the machines in 192.168.1.0/24 - and only let 2 IP's ex.: 192.168.1.10 and .20 to access the printer? - there isn't ANY access control on the network printer...


title: Why the duplications in the command line output

text: Entering the following command prints duplicates as shown below. Not all lines print twice but some do. What gives?               XXXX:~ XXXX$ man -k pid     pid(ntcl)                - Retrieve process identifiers     pidpersec.d(1m)          - print new PIDs per sec. Uses DTrace     rwbypid.d(1m)            - read/write calls by PID. Uses DTrace     syscallbypid.d(1m)       - syscalls by process ID. Uses DTrace     git(1)                   - the stupid content tracker     Sub::Exporter::Cookbook(3pm) - useful, demonstrative, or stupid Sub::Exporter tricks     Tcl_DetachPids(3tcl), Tcl_ReapDetachedProcs(3tcl), Tcl_WaitPid(3tcl) - manage child processes in background     getpid(2), getppid(2)    - get parent or calling process identification     pid(ntcl)                - Retrieve process identifiers     pidpersec.d(1m)          - print new PIDs per sec. Uses DTrace     pthread_setugid_np(2)    - Set the per-thread userid and single groupid     rwbypid.d(1m)            - read/write calls by PID. Uses DTrace     syscallbypid.d(1m)       - syscalls by process ID. Uses DTrace     wait(2), wait3(2), wait4(2), waitpid(2) - wait for process termination     git(1)                   - the stupid content tracker     XXXX:~ XXXX$


title: Where did scp put these files?

text: I ran an `scp` command to download some files from an SSH server. Instead of using the `.` to put it in the current folder, I accidentally typed `*`. It looks like scp copied the files and put them somewhere. My command was similar to this:               $moshe> scp username@server.com:~/SomeDirectory/SubDir/* *      I meant to type something more like this:               $moshe> scp username@server.com:~/SomeDirectory/SubDir/* .      Where would they be?


title: Pacman could not find gnome-system-tools ArchLinux

text: I tried to install gnome-system-tools on ArchLinux using pacman . I've run pacman -Syy before but pacman could not find the package. Here is my pacman.conf file               #     # /etc/pacman.conf     #     # See the pacman.conf(5) manpage for option and repository directives          #     # GENERAL OPTIONS     #     [options]     # The following paths are commented out with their default values listed.     # If you wish to use different paths, uncomment and update the paths.     #RootDir     = /     #DBPath      = /var/lib/pacman/     #CacheDir    = /var/cache/pacman/pkg/     #LogFile     = /var/log/pacman.log     #GPGDir      = /etc/pacman.d/gnupg/     HoldPkg     = pacman glibc     # If upgrades are available for these packages they will be asked for first     SyncFirst   = pacman     #XferCommand = /usr/bin/curl -C - -f %u > %o     #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u     #CleanMethod = KeepInstalled     Architecture = auto          CheckSpace     SigLevel = Never          # REPOSITORIES          [testing]     #SigLevel = PackageRequired     Include = /etc/pacman.d/mirrorlist               [community]     Include = /etc/pacman.d/mirrorlist          [multilib]     Include = /etc/pacman.d/mirrorlist          [core]     #SigLevel = PackageRequired     Include = /etc/pacman.d/mirrorlist          [extra]     #SigLevel = PackageOptional     Include = /etc/pacman.d/mirrorlist          #[community-testing]     #SigLevel = PackageRequired     Include = /etc/pacman.d/mirrorlist          [community]     #SigLevel = PackageOptional     Include = /etc/pacman.d/mirrorlist          [multilib-testing]     #SigLevel = PackageRequired     Include = /etc/pacman.d/mirrorlist          [multilib]     #SigLevel = PackageOptional     Include = /etc/pacman.d/mirrorlist      Do I miss a repository ? Thanks for your help.


title: Why can't I boot off my Debian update CD?

text: I downloaded a .iso file with the name `debian-update-6.0.4-amd64-DVD-1.iso` from http://debian.org and burned it with `k3b` with default settings, but unfortunately found it won't boot. Did I download the wrong image? There are three folders in the image file: `.disk`, `dists`, and `pool`.


title: Schedule halt using ConsoleKit and Dbus

text: I have been playing with Dbus (versions 1.4.0, in Ubuntu 10.10 and 1.4.14) and ConsoleKit (versions 0.4.1 and 0.4.5) to reboot or halt my computer without being a superuser. Everything works fine in both versions. If I execute the commands detailed in this page, the systems halts or reboots without troubles. Now, what I'd like to know is whether I can schedule that halt/reboot at a certain time (still using Dbus/ConsoleKit). Something like the `shutdown` command can do (`shutdown -h 10:56`) Is that possible? I can always use an `at` or `cron`, but if I can do it straight with `dbus`, that'd be perfect.


title: Can't see the free disk space of the drive

text: I am installing redhat 6 with pendrive, I get only two drives option for installing one is the whole hard disk and the other is pendrive, but I've created a free logical disk of 30 GB in windows. I am unable to view my other disks or the free disk as well. Anyone please help


title: Automatic internet connection on startup in OpenBSD?

text: I just installed the OpenBSD in my computer. I am completely new to Unix-like operating systems. I've learned how to connect to my wireless network using the following commands (even though I don't quite know what they mean):               ifconfig iwn0 nwid [network name] wpa wpapsk [password]     dhclient iwn0      I am looking for a way to connect just after the boot. Thank you.


title: How to limit a search to the current line

text: VIM newbie here. I'm trying to write a mapping that will let me move around 'common' insertion points in a line when in insert mode. For ex. I have the delimitMate plugin - so typing a opening delimiter automatically closes the delimiter and puts me in between. once I've typed the text that goes inside, I usually want to jump to the end of the delimiter and stay in insert mode. Taking this forward, for a function like below                $("#someid").live("someevent", function (param1, param2) {      What I'd like is a insert mode mapping that lets me jump to after the first of any of the following delimiter chars (quote, double quote, parens, and/or EOL) and cycle over these points. Checked VIM documentation for search - the \%l operator allows to restrict over a specific line number. I tried \%.l (. being current line ) - but this doesn't work. Any ideas? **UPDATE**               :exe  "/\\%" . line(".") . "l[{}()\"':=\\[\\],]"      seems to work - but doesnt move the cursor to the match.


title: Pinguy OS 11.04 WiFi and Wired Networking is not working

text: I was attempting to install Pinguy OS from a YUMI created USB thumb drive, with the computer wired to my router. The internet, however, was not working. After the install, it still is not working. Wireless itself refused to work, most likely because I do not have the drivers. I was using a DELL Inspiron 1520. I assumed it might be an issue with my router or connection itself, so I went onto my Windows laptop (I hadn't powered it on in a day, and we have issues with connectivity every once in a while). I am sending this message from said laptop, the internet is having absolutely no problems. What do you suggest I do? I know that the driver required is Broadcom STA from prior experience with different versions of Linux on the computer. Before this, I was using Kubuntu 10.10 on the said computer. Thanks in advance! Edit: Is there any possible way for me to download the driver on Windows, put it on a USB drive, extract the tar.gz onto Pinguy, and run the makefile? I've tried that, and I'm not 100% sure it worked. I'm restarting now, just in case it doesn't tell me I need to restart because of it being ran outside of the normal program. Edit 2: The things mentioned in the previous edit do not appear to have worked.


title: Fedora 14 install Fedora 19 software?

text: I am using Fedora 14 right now and find some software in the fc14 repository is a little old. I need some software in my machine to be updated, say, to the Fedora 19 version. Without upgrading the system, what is the best practice to do so?


title: Advantages/Disadvantages of installing GRUB on a software RAID?

text: What **Advantages** are there to installing GRUB on a software RAID-1? What **Disadvantages** are there to installing GRUB on a software RAID-1? * * * I ask this because most tutorials/help sections seems to assume that GRUB is on a _normal_ (i.e not on a RAID) partition. So is there a strong case against installing GRUB on a software RAID? or is this just convention? Everything below is a reflection of my limited knowledge, be warned it is bound to contain errors. If you find errors I'd appreciate it if you offered corrections or/and explanations, Thanks :0) So for me personally (as a newbie) having installed to RAID-1 it's made tutorial/recovery instructions more confusing. e.g `fsck /dev/sda1` is OK for non-RAID systems but **NOT** something that should be done on individual md drives (AFAIK). Also my understanding is that since it's a software RAID that a failure on the first boot drive will halt booting anyway. (I.E. can only use RAID-1 for boot because actually it's not loaded as a RAID drive initially until enough of the OS has loaded to manage md drives. So it's only reading data from the first drive anyway when loading GRUB)


title: Fedora 18: Unable to connect to a WLAN network

text: I'm using Fedora 18 with the LXDE desktop. I seem to be unable to connect to any WLAN network. The network manager applets seem to accept only WEP but no WPA encryption. Am I missing something, or is WLAN networks on Fedora 18 broken right now? Wired network is working OK, WLAN used to work OK with Linux Mint on the same laptop.


title: init.d script is not starting under virtualbox

text: The script is in /etc/init.d:               #!/bin/bash          VMUSER=myname     CURRDATE=(`date +"%m-%d-%Y"` + `date +"%H:%M:%S"`)     CURRTIME=(`date +"%X"`)     FILE=/home/myname/log/vm-services.log     VBPATH=/usr/bin               start(){             echo "Starting VM Guest"        echo "Starting VM Services on $CURRDATE at $CURRTIME" >> $FILE        sudo -u $VMUSER $VBPATH/VBoxManage startvm sherbet --type headless     }          stop(){             echo "Stopping VM Guest"        echo "Stopping VM Services on $CURRDATE at $CURRTIME" >> $FILE        sudo -u $VMUSER $VBPATH/VBoxManage controlvm sherbet savestate     }          restart(){        echo "Restart"        echo "Restarted on $CURRDATE at $CURRTIME" >> $FILE     }          case "$1" in      start)        echo "In Start" >> $FILE        start        ;;      stop)        stop        ;;      restart)        restart        ;;      *)         echo "Usage: vm-service {start|stop}"         exit 1     esac      When I reboot the script stop is called. But Ubuntu restarts the start is never called. The script seems to have the correct execute settings: ![enter image description here](http://i.stack.imgur.com/rV9mJ.jpg) The echo for shutdown is working cause I see the entry.   I installed the script as follows: => sudo update-rc.d vm-services defaults 99 01 I can manually start/stop with no problems: =>/etc/init.d/vm-services start =>/etc/init.d/vm-services stop Any advise would be appreciated **Update 8/19/2014 - 1:24PM**I modified the script above now includes VBPATH that points to the VBoxManage path. But it doesnt work. The stop is always called when it reboots but the start never gets hit. Just sending the string to the file doesnt get hit. On reboot it does it everytime.


title: /usr partition filled up, need to make it larger or mount it somewhere else

text: I have 160 GBhdd. I have `ubuntu` on about 30GB and Rest is `PC-BSD` 9.0. On PC-BSD, my /usr is about 11GB and that is all used up. I realize that when I try to install ubuntu inside `VirtualBox`. I need 15GB at least. I am complete newbie here and I do not understand how 11GB became /usr partition's limit. I do not recall making any such decision while installation. BTW, for now, to solve my problem, here is output of `gpart`. How can I extend /usr? OR, how can I make the home dirs which are now part of /usr/home separate from /usr?               [root@pcbsd] ~# gpart show     =>       63  312581745  ada0  MBR  (149G)              63    2002879        - free -  (978M)         2002942   60825602     2  ebr  (29G)        62828544    6000640     1  linux-data  (2.9G)        68829184       9341        - free -  (4.6M)        68838525  243738180     3  freebsd  [active]  (116G)       312576705       5103        - free -  (2.5M)          =>       0  60825602  ada0s2  EBR  (29G)              0   7997442       1  linux-swap  (3.8G)        7997442  48828416  126944  linux-data  (23G)       56825858      1230          - free -  (615k)       56827088   3998514  902018  linux-data  (1.9G)          =>        0  243738180  ada0s3  BSD  (116G)               0    4194304       1  freebsd-ufs  (2.0G)         4194304    8101888       2  freebsd-swap  (3.9G)        12296192    4194304       4  freebsd-ufs  (2.0G)        16490496  227247684       5  freebsd-ufs  (108G)          [root@pcbsd] ~# df -k     Filesystem         1024-blocks     Used    Avail Capacity  Mounted on     /dev/label/rootfs0     2063900   570260  1328528    30%    /     devfs                        1        1        0   100%    /dev     /dev/label/var0        2063900   207488  1691300    11%    /var     /dev/label/usr0      111838140 11911712 90979380    12%    /usr     procfs                       4        4        0   100%    /proc     linprocfs                    4        4        0   100%    /compat/linux/proc      ![Disk Usage Analyzer for entire disk](http://i.stack.imgur.com/KOLOD.png) ![Disk Usage Analyzer for /usr which is filling up](http://i.stack.imgur.com/mYARc.png)


title: Running python script from terminal without .py extension

text: I want to call a python script _script.py_ from the terminal by simply typing _script_. Is this possible? If so, how? I know I can avoid typing _python script.py_ by adding _#!/usr/bin/env python_ to the top of the script, but I still have to add the suffix _.py_ in order to run the script.


title: Getting error during Installation of Cross Binutils in Linux From Scratch -7.5

text: I am building my first LFS 7.5 using Linux Mint-13 (32-bit) While preparing Binutils for compilation(5.4.1):               ../binutils-2.24/configure  \     --prefix=/tools             \                          --with-sysroot=$LFS         \     --with-lib-path=/tools/lib  \     --target=$LFS_TGT               \     --disable-nls                   \     --disable-werror.      I have got following error :               bash: --with-sysroot=/mnt/lfs--with-lib-path=/tools/lib--target=i686-   lfs-linux-gnu: No such file or directory      This is the output I'm getting:               lfs@jaassi-virtual-machine /mnt/lfs/tools/binutils-2.24 $ ../binutils-2.24/configure \     --prefix=/tools/binutils-2.24      binutils-2.24/         binutils-2.24.tar.bz2       > --prefix=/tools/binutils-2.24       binutils-2.24/         binutils-2.24.tar.bz2       > --prefix=/tools/binutils-2.24        > checking build system type... i686-pc-linux-gnu     > checking host system type... i686-pc-linux-gnu       checking target system type... i686-pc-linux-gnu       checking for a BSD-compatible install... /usr/bin/install -c       checking whether ln works... yes       checking whether ln -s works... yes        checking for a sed that does not truncate output... /bin/sed       checking for gawk... gawk       checking for gcc... gcc       checking for C compiler default output file name... a.out        checking whether the C compiler works... yes       checking whether we are cross compiling... no       checking for suffix of executables...        checking for suffix of object files... o       checking whether we are using the GNU C compiler... yes       checking whether gcc accepts -g... yes       checking for gcc option to accept ISO C89... none needed       checking for g++... g++       checking whether we are using the GNU C++ compiler... yes       checking whether g++ accepts -g... yes       checking whether g++ accepts -static-libstdc++ -static-libgcc... yes       checking for gnatbind... no       checking for gnatmake... no       checking whether compiler driver understands Ada... no       checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2       checking for objdir... .libs       checking for version 0.10 of ISL... no       checking for version 0.11 of ISL... no       checking for default BUILD_CONFIG...        checking for bison... bison -y       checking for bison... bison       checking for gm4... no       checking for gnum4... no       checking for m4... m4       checking for flex... no       checking for lex... no       checking for flex... no       checking for makeinfo... no       checking for expect... no       checking for runtest... no       checking for ar... ar       checking for as... as       checking for dlltool... no       checking for ld... ld       checking for lipo... no       checking for nm... nm       checking for ranlib... ranlib       checking for strip... strip       checking for windres... no       checking for windmc... no       checking for objcopy... objcopy       checking for objdump... objdump       checking for readelf... readelf       checking for cc... cc       checking for c++... c++       checking for gcc... gcc       checking for gcj... no       checking for gfortran... no       checking for gccgo... no       checking for ar... ar       checking for as... as       checking for dlltool... no       checking for ld... ld       checking for lipo... no       checking for nm... nm       checking for objdump... objdump       checking for ranlib... ranlib       checking for readelf... readelf       checking for strip... strip       checking for windres... no       checking for windmc... no       checking where to find the target ar... just compiled       checking where to find the target as... just compiled       checking where to find the target cc... host tool       checking where to find the target c++... host tool       checking where to find the target c++ for libstdc++... host tool       checking where to find the target dlltool... just compiled       checking where to find the target gcc... host tool       checking where to find the target gcj... host tool       checking where to find the target gfortran... host tool       checking where to find the target gccgo... host tool       checking where to find the target ld... just compiled       checking where to find the target lipo... host tool       checking where to find the target nm... just compiled       checking where to find the target objdump... just compiled       checking where to find the target ranlib... just compiled       checking where to find the target readelf... just compiled       checking where to find the target strip... just compiled       checking where to find the target windres... just compiled       checking where to find the target windmc... just compiled       checking whether to enable maintainer-specific portions of Makefiles... no       configure: creating ./config.status       config.status: creating Makefile       lfs@jaassi-virtual-machine /mnt/lfs/tools/binutils-2.24 $ --with-sysroot=$LFS       $LFS      $LFS_TGT         lfs@jaassi-virtual-machine /mnt/lfs/tools/binutils-2.24 $ --with-sysroot=$LFS\       > --with-lib-path=/tools/lib\       > --target=$LFS_TGT \       > --disable-nls\       > --disable-werror       bash: --with-sysroot=/mnt/lfs--with-lib-path=/tools/lib--target=i686-   lfs-linux-gnu: No such file or directory      How can I resolve this?


title: Optimised ZFS in low RAM environment feasibility?

text: I am currently setting up a file server and have come to the point of actually setting up the data drives. The system has 4 drives (one OS disk, 3 data disks). The OS disk is formatted as ext4 and won't be added to the ZFS pool (if I Choose to run ZFS).my main concern is data integrity and minimum risk of data loss(drive caching is disabled in bios) . For this ZFS seems to be the perfect candidate, since it has a stable version for Linux (correct?), and supports data duplication, pooling and raidz, where the hard-drives don't have to be the same size. But here is my problem. The server only has 2GB of RAM and this cannot be upgraded in the near future, and realistically only 1.5 will actually be accessible to ZFS after I install all the other services. A maximum of about 10 clients will use it at any one time (more like 4 on average). Is this too low to be considered safe? From what I understand ZFS can crash in a low RAM situations and take the pool with it. I heard confliciting opinions whether swap will help in alleviating this problem (I have a 20 GB swap dedicated drive). Has anyone experienced data loss with ZFS with little RAM and what optimizations did you include to prevent that? Bearing in mind the above would it be possible to still run ZFS, albeit reduce ack size and trim it down a bit or will this be too risky? System specs: 2GB RAM 20GB swap drive OS, Debian 7, minimal install, with FTP, and XBMC, DNLA, (to give an idea of the RAM requirement). Used for storage server and music media streaming to other devices.


title: Filename completion in gvim

text: for some reason, my filename completion in gvim is not working. In vim, its working properly. Commands and such are, however, completed correctly. I have set `wildmode=full`. An example: Assume i want to open the file `main.c` I type `:op<Tab>` and gvim gives me a list with all possible completions (open and options). I choose open and continue to `:open m<Tab>`. I would expect gvim to now complete my file, what happens however, is this: `:open m^I`, no completion. As mentioned, in vim it works perfectly fine.


title: What's the use dirsync option for mount?

text: Today I stumbled upon this `mount`'s option: > `dirsync` All directory updates within the filesystem should be done > synchronously. This affects the following system calls: creat, link, unlink, > symlink, mkdir, rmdir, mknod and rename. What are some real-life use cases for this option? When would I want to use `dirsync` instead of `sync`?


title: How to create Virtual Network for VM's

text: I have downloaded a Linux Live CD which I am required to do pentesting using VirtualBox . Live CD is configured for router with Pool Starting Address 192.168.2.2 . Now problem is that my router is't configurable to that setting nor I am allowed to change anything in Live CD. How can i create a virtual network that can be configured as per this requirement ?


title: Arguments against Ubuntu?

text: As someone who's been using Ubuntu for a couple of years now both in production and at home, when seeking answers to certain administrative questions for my systems, I often hear the "that's what you get for being on [Ubuntu | Debian]" comment, seemingly indicating that there's something fundamentally ineffective about this specific distro that I'm using. Often you'll hear CentOS/RHEL/Fedora recommended instead. E.g. argument would be: " _Ubuntu starts services by default on`apt-get install` instead of allowing to you change their `configs` before boot_", which sometimes can be convenient when working with configuration management tools. Personally I don't care too much about any specific distro, but I do deeply care about productivity, simplicity, stability and availability of latest versions of critical packages. Now, would anyone be so kind as to explain why Ubuntu tends to receive much criticism from the Linux community, and what my options are? What would be some of the gains if I were to switch to a different distro?


title: GCC error trying to exec 'cc1'

text: I was cross compiling a Linux kernel for my Raspberry Pi on a laptop (running debian 7) (followed the instructions here) but when I start compiling (`make ARCH=arm CROSS_COMPILE=${CCPREFIX}`) I get the following messages:                 CHK     include/linux/version.h       CHK     include/generated/utsrelease.h     make[1]: `include/generated/mach-types.h' is up to date.       CC      kernel/bounds.s     gcc: error trying to exec 'cc1': execvp: No such file or directory     make[1]: *** [kernel/bounds.s] Error 1     make: *** [prepare0] Error 2      I figured that the problem was that cc1 couldn't be found or gcc was not properly installed (and so I re-installed gcc with `apt-get --reinstall install gcc` but no luck). `gcc -v` gives:               Using built-in specs.     COLLECT_GCC=gcc     COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper     Target: i486-linux-gnu     Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu     Thread model: posix     gcc version 4.7.2 (Debian 4.7.2-5)      `gcc -print-prog-name=cc1` gives:               /usr/lib/gcc/i486-linux-gnu/4.7/cc1      `gcc -print-search-dirs` gives:               install: /usr/lib/gcc/i486-linux-gnu/4.7/     programs: =/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/bin/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/bin/i386-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/bin/     libraries: =/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/i386-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/:/lib/i486-linux-gnu/4.7/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i486-linux-gnu/4.7/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../:/lib/:/usr/lib/      and `find / -type f -name cc1` gives:               /opt/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/libexec/gcc/arm-bcm2708-linux-gnueabi/4.7.1/cc1     /opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/libexec/gcc/arm-linux-gnueabihf/4.7.2/cc1     /opt/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/libexec/gcc/arm-bcm2708hardfp-linux-gnueabi/4.7.1/cc1     /usr/lib/gcc/i486-linux-gnu/4.6/cc1     /usr/lib/gcc/i486-linux-gnu/4.7/cc1      Running `dpkg -S cc1` gives:               libopencc1:i386: /usr/share/doc/libopencc1/changelog.Debian.gz     g++-4.7: /usr/lib/gcc/i486-linux-gnu/4.7/cc1plus     cpp-4.6: /usr/lib/gcc/i486-linux-gnu/4.6/cc1     libopencc1:i386: /usr/share/doc/libopencc1     cpp-4.7: /usr/lib/gcc/i486-linux-gnu/4.7/cc1     libopencc1:i386: /usr/share/doc/libopencc1/copyright     libgcc1:i386: /usr/share/lintian/overrides/libgcc1     ncurses-term: /usr/share/terminfo/x/xterm+pcc1     libgcc1:i386: /usr/share/doc/libgcc1      Any ideas?


title: Installing Unity on Debian

text: I'm a former Ubuntu Unity user, and currently running Debian Squeeze. I love Debian's stability over Ubuntu, but I do miss being able to switch between applications use Super+1,2,3 etc. Has anyone successfully gotten Unity running on Debian Squeeze?


title: Permanently changing the ownership (or group) of LVM volume

text: How can I permanently change the ownership (or at least the group) of a LVM volume? I figured that I have to use udev, but I don't know how the rule should look like? Let's say I want to change the ownership of LVM/disk to user/group virtualbox, how would I do that?


title: "Digest verification failed" when updating system

text: When I run `sudo zypper update`:               Overall download size: 134.1 MiB. After the operation, additional 5.7 MiB will be used.     Continue? [y/n/?] (y): y     Automatically agreeing with java-1_6_0-sun-devel package license.     Automatically agreeing with java-1_6_0-sun package license.     Automatically agreeing with java-1_6_0-sun-plugin package license.     Retrieving package libbluray0-0+20111019-1.1.x86_64 (1/54), 60.0 KiB (159.0 KiB unpacked)     Retrieving: libbluray0-0+20111019-1.1.x86_64.rpm [done]     Retrieving package MPlayer-1.0rc4_r34240-2.1.x86_64 (2/54), 17.9 MiB (49.1 MiB unpacked)     Retrieving: MPlayer-1.0rc4_r34240-2.1.x86_64.rpm [done (1.9 MiB/s)]     Retrieving package libcurl4-7.22.0-59.2.x86_64 (3/54), 174.0 KiB (434.0 KiB unpacked)     Retrieving: libcurl4-7.22.0-59.2.x86_64.rpm [done (0 B/s)]     Digest verification failed for libcurl4-7.22.0-59.2.x86_64.rpm. Expected f065534feb71adf943a5e4f86c2bdb4fd930ee36b8ca8b672062f65510f66584, found d9b8e0ac120e1870d6988aa1157190bfd39225fe24aa24e3ab79a60efd3aa6ae. Continue? [yes/no] (no): yes     Package libcurl4-7.22.0-59.2 seems to be corrupted during transfer. Do you want to retry retrieval?     Abort, retry, ignore? [a/r/i] (a): i      I haven't changed anything in my repos recently so I don't know why curl isn't cooperating. What does this error mean? And where does the problem lie? **SOLVED** I ended up having to run `sudo zypper refresh` before re-trying my update. Thanks to _rozcietrzewiacz_ for hinting to it.


title: Unable to chown recursively

text: I'm using this command:               chown root:www-data /var/www/example.com -R       but I get an error message that the directory is not listed. What is wrong?


title: problem with /compress

text: I have script that was provided with some SW. The script output is something like that (in debug mode).               + changeDirectory     + '[' -d /cdr/work/proc_raw/proc ']'     + cd /cdr/work/proc_raw/proc     + echo 'Changed to the directory: /cdr/work/proc_raw/proc'     Changed to the directory: /cdr/work/proc_raw/proc     + retypeFileName     ++ echo ''\''*.old'\'''     ++ sed 's/'\''//g'     + FILE='*.old'     + case $TYPE in     + compressFiles     + echo 'files to compress: '     files to compress:      + find . -name '*.old' -mtime +3     ./file1.cdr.old     ./file2.cdr.old     ...     + find . -name '*.old' -mtime +3     + xargs compress -f     + ecode=0     + '[' 0 -gt 0 ']'     + echo 'executed: find . -name *.old -mtime +3 | xargs compress -f'      However, after that, when looking for the file1.cdr.old.Z, file1.cdr.old.Z, .. in that directory, the file is not there. If to execute the `file` command, it seems that there is no reason for compress to fail:               -bash-3.2# file file1.cdr.old     file1.cdr.old: ASCII text, with very long lines      Any suggestions? EDIT: the relevant parts from the script:               # Change to the selected directory     changeDirectory (){         if [ -d $DIRECTORY ]         then         cd $DIRECTORY         echo "Changed to the directory: $DIRECTORY" >> $LOGFILE         else             echo "$DIRECTORY does not exists" >> $LOGFILE             exit 1         fi     }          # Removes the "'" characters from filename.     retypeFileName (){        FILE=$(echo $FILE | sed s/"'"//g )     }     # COMPRESSING FILES     compressFiles () {        echo "files to compress: " >> $LOGFILE        find . -name "$FILE" -type f $ACTION_TYPE +$PARAM >> $LOGFILE             find . -name "$FILE" -type f $ACTION_TYPE +$PARAM | xargs compress -f        ecode=$?              if [ $ecode -gt 0 ]         then             dt=`date "+%Y-%b-%d %H:%M:%S"`             echo "$dt > ERROR while compressing files. Error Code was $ecode" >> $LOGFILE             exit 2         fi              echo "executed: find . -name "$FILE" -type f $ACTION_TYPE +$PARAM | xargs compress -f" >> $LOGFILE     }


title: lsusb outputs "Illegal Instruction" - why?

text: I'm trying to get a 3G USB dongle to work on a Raspberry Pi running Raspbian Wheezy, using a script called sakis3g. However, in trying to do this, I keep running into problems: when trying to connect to the USB device, the script prints "Illegal Instruction" and gets no further. I've posted a question about this on the Raspberry Pi Stack Overflow site, and was given a guide to try to follow (BigCowPi's answer). However, as I said over there, when I try to run `lsusb` (the first thing in that guide), it still outputs "Illegal Instruction" and gets no further. I've tried reinstalling usbutils and libsub-1.0-0 for armhf, but this hasn't helped the situation. It might also be worth mentioning that I haven't got access to the internet on it at present, so I've been downloading packages for installation and using dpkg, rather than something simpler like apt-get. I haven't managed to get an answer from the Raspberry Pi site, so I thought it might be worth asking here instead as it might be a more Linux-related problem anyway. ## Output from strace lsusb As requested by @Flup, here's the output from `strace`:               pi@raspberrypi ~/Desktop $ strace lsusb -o > lsusblog.log     execve("/usr/bin/lsusb", ["lsusb", "-o"], [/* 28 vars */]) = 0     brk(0)                                  = 0x914000     uname({sys="Linux", node="raspberrypi", ...}) = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4005a000     access("/etc/ld.so.preload", R_OK)      = 0     open("/etc/ld.so.preload", O_RDONLY)    = 3     fstat64(3, {st_mode=S_IFREG|0644, st_size=44, ...}) = 0     mmap2(NULL, 44, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x40155000     close(3)                                = 0     open("/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\10\4\0\0004\0\0\0"..., 512) = 512     lseek(3, 3456, SEEK_SET)                = 3456     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1240) = 1240     lseek(3, 2537, SEEK_SET)                = 2537     read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47     fstat64(3, {st_mode=S_IFREG|0755, st_size=7332, ...}) = 0     mmap2(NULL, 35276, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4022f000     mprotect(0x40230000, 28672, PROT_NONE)  = 0     mmap2(0x40237000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x40237000     close(3)                                = 0     munmap(0x40155000, 44)                  = 0     open("/etc/ld.so.cache", O_RDONLY)      = 3     fstat64(3, {st_mode=S_IFREG|0644, st_size=37860, ...}) = 0     mmap2(NULL, 37860, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40046000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libusb-1.0.so.0", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\f\"\0\0004\0\0\0"..., 512) = 512     lseek(3, 37532, SEEK_SET)               = 37532     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1040) = 1040     lseek(3, 37256, SEEK_SET)               = 37256     read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 53) = 53     fstat64(3, {st_mode=S_IFREG|0644, st_size=38572, ...}) = 0     mmap2(NULL, 70084, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40122000     mprotect(0x4012b000, 28672, PROT_NONE)  = 0     mmap2(0x40132000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8) = 0x40132000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libz.so.1", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0008\33\0\0004\0\0\0"..., 512) = 512     lseek(3, 86632, SEEK_SET)               = 86632     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160     lseek(3, 86300, SEEK_SET)               = 86300     read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49     fstat64(3, {st_mode=S_IFREG|0644, st_size=87792, ...}) = 0     mmap2(NULL, 119072, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4008f000     mprotect(0x400a3000, 32768, PROT_NONE)  = 0     mmap2(0x400ab000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14) = 0x400ab000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\210y\1\0004\0\0\0"..., 512) = 512     lseek(3, 1186592, SEEK_SET)             = 1186592     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1360) = 1360     lseek(3, 1186156, SEEK_SET)             = 1186156     read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47     fstat64(3, {st_mode=S_IFREG|0755, st_size=1187952, ...}) = 0     mmap2(NULL, 1230120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40238000     mprotect(0x40357000, 32768, PROT_NONE)  = 0     mmap2(0x4035f000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11f) = 0x4035f000     mmap2(0x40362000, 9512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40362000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/librt.so.1", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\300\26\0\0004\0\0\0"..., 512) = 512     lseek(3, 25312, SEEK_SET)               = 25312     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1320) = 1320     lseek(3, 24924, SEEK_SET)               = 24924     read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49     fstat64(3, {st_mode=S_IFREG|0644, st_size=26632, ...}) = 0     mmap2(NULL, 57876, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40063000     mprotect(0x40069000, 28672, PROT_NONE)  = 0     mmap2(0x40070000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5) = 0x40070000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\274V\0\0004\0\0\0"..., 512) = 512     lseek(3, 82712, SEEK_SET)               = 82712     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1400) = 1400     lseek(3, 82308, SEEK_SET)               = 82308     read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49     fstat64(3, {st_mode=S_IFREG|0755, st_size=116462, ...}) = 0     mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4003c000     mmap2(NULL, 123412, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400ad000     mprotect(0x400c1000, 28672, PROT_NONE)  = 0     mmap2(0x400c8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13) = 0x400c8000     mmap2(0x400ca000, 4628, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x400ca000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`\364\0\0004\0\0\0"..., 512) = 512     lseek(3, 130212, SEEK_SET)              = 130212     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160     lseek(3, 129880, SEEK_SET)              = 129880     read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 51) = 51     fstat64(3, {st_mode=S_IFREG|0644, st_size=131372, ...}) = 0     mmap2(NULL, 162704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400cc000     mprotect(0x400ec000, 28672, PROT_NONE)  = 0     mmap2(0x400f3000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f) = 0x400f3000     close(3)                                = 0     mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000a000     set_tls(0x4000a4c0, 0x4000ab98, 0x40045048, 0x4000a4c0, 0x40045048) = 0     mprotect(0x400c8000, 4096, PROT_READ)   = 0     mprotect(0x40070000, 4096, PROT_READ)   = 0     mprotect(0x4035f000, 8192, PROT_READ)   = 0     mprotect(0x400ab000, 4096, PROT_READ)   = 0     mprotect(0x40132000, 4096, PROT_READ)   = 0     mprotect(0x40044000, 4096, PROT_READ)   = 0     munmap(0x40046000, 37860)               = 0     set_tid_address(0x4000a068)             = 2041     set_robust_list(0x4000a070, 0xc)        = 0     futex(0xbeb6d5e8, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 400c9000) = -1 EAGAIN (Resource temporarily unavailable)     rt_sigaction(SIGRTMIN, {0x400b220c, [], SA_SIGINFO|0x4000000}, NULL, 8) = 0     rt_sigaction(SIGRT_1, {0x400b20b4, [], SA_RESTART|SA_SIGINFO|0x4000000}, NULL, 8) = 0     rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0     getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0     --- SIGILL (Illegal instruction) @ 0 (0) ---     +++ killed by SIGILL +++     Illegal instruction      ## Output from strace sudo lsusb And just in case it made a difference, I tried sudo too. No `Illegal Instruction`, but no output (such as a list of devices) either.               pi@raspberrypi ~ $ strace sudo lsusb     execve("/usr/bin/sudo", ["sudo", "lsusb"], [/* 27 vars */]) = 0     brk(0)                                  = 0x10e4000     fcntl64(0, F_GETFD)                     = 0     fcntl64(1, F_GETFD)                     = 0     fcntl64(2, F_GETFD)                     = 0     access("/etc/suid-debug", F_OK)         = -1 ENOENT (No such file or directory)     uname({sys="Linux", node="raspberrypi", ...}) = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40001000     access("/etc/ld.so.preload", R_OK)      = 0     open("/etc/ld.so.preload", O_RDONLY)    = 3     fstat64(3, {st_mode=S_IFREG|0644, st_size=44, ...}) = 0     mmap2(NULL, 44, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x40102000     close(3)                                = 0     open("/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\10\4\0\0004\0\0\0"..., 512) = 512     lseek(3, 3456, SEEK_SET)                = 3456     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1240) = 1240     lseek(3, 2537, SEEK_SET)                = 2537     read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47     fstat64(3, {st_mode=S_IFREG|0755, st_size=7332, ...}) = 0     mmap2(NULL, 35276, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40160000     mprotect(0x40161000, 28672, PROT_NONE)  = 0     mmap2(0x40168000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x40168000     close(3)                                = 0     munmap(0x40102000, 44)                  = 0     open("/etc/ld.so.cache", O_RDONLY)      = 3     fstat64(3, {st_mode=S_IFREG|0644, st_size=37860, ...}) = 0     mmap2(NULL, 37860, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4009c000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libselinux.so.1", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0TM\0\0004\0\0\0"..., 512) = 512     lseek(3, 107532, SEEK_SET)              = 107532     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1120) = 1120     lseek(3, 107244, SEEK_SET)              = 107244     read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49     fstat64(3, {st_mode=S_IFREG|0644, st_size=108652, ...}) = 0     mmap2(NULL, 142424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400eb000     mprotect(0x40105000, 28672, PROT_NONE)  = 0     mmap2(0x4010c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19) = 0x4010c000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libutil.so.1", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\344\t\0\0004\0\0\0"..., 512) = 512     lseek(3, 8688, SEEK_SET)                = 8688     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160     lseek(3, 8356, SEEK_SET)                = 8356     read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49     fstat64(3, {st_mode=S_IFREG|0644, st_size=9848, ...}) = 0     mmap2(NULL, 41128, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40085000     mprotect(0x40087000, 28672, PROT_NONE)  = 0     mmap2(0x4008e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0x4008e000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libdl.so.2", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0(\t\0\0004\0\0\0"..., 512) = 512     lseek(3, 8652, SEEK_SET)                = 8652     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160     lseek(3, 8320, SEEK_SET)                = 8320     read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49     fstat64(3, {st_mode=S_IFREG|0644, st_size=9812, ...}) = 0     mmap2(NULL, 41136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40090000     mprotect(0x40092000, 28672, PROT_NONE)  = 0     mmap2(0x40099000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0x40099000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY) = 3     read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\210y\1\0004\0\0\0"..., 512) = 512     lseek(3, 1186592, SEEK_SET)             = 1186592     read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1360) = 1360     lseek(3, 1186156, SEEK_SET)             = 1186156     read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47     fstat64(3, {st_mode=S_IFREG|0755, st_size=1187952, ...}) = 0     mmap2(NULL, 1230120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40169000     mprotect(0x40288000, 32768, PROT_NONE)  = 0     mmap2(0x40290000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11f) = 0x40290000     mmap2(0x40293000, 9512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40293000     close(3)                                = 0     mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4004c000     mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4009b000     set_tls(0x4009b4c0, 0x4009bbe8, 0x40084048, 0x4009b4c0, 0x40084048) = 0     mprotect(0x40290000, 8192, PROT_READ)   = 0     mprotect(0x40099000, 4096, PROT_READ)   = 0     mprotect(0x4008e000, 4096, PROT_READ)   = 0     mprotect(0x4010c000, 4096, PROT_READ)   = 0     mprotect(0x26000, 4096, PROT_READ)      = 0     mprotect(0x40083000, 4096, PROT_READ)   = 0     munmap(0x4009c000, 37860)               = 0     statfs64("/sys/fs/selinux", 88, 0xbef755c8) = -1 ENOENT (No such file or directory)     statfs64("/selinux", 88, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=931609, f_bfree=555069, f_bavail=507743, f_files=237568, f_ffree=171092, f_fsid={1545102210, 1047066944}, f_namelen=255, f_frsize=4096}) = 0     brk(0)                                  = 0x10e4000     brk(0x1105000)                          = 0x1105000     open("/proc/filesystems", O_RDONLY|O_LARGEFILE) = 3     fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0     mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400ae000     read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 1024) = 281     read(3, "", 1024)                       = 0     close(3)                                = 0     munmap(0x400ae000, 4096)                = 0     open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3     fstat64(3, {st_mode=S_IFREG|0644, st_size=1534656, ...}) = 0     mmap2(NULL, 1534656, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40296000     close(3)                                = 0     geteuid32()                             = 1000     open("/usr/share/locale/locale.alias", O_RDONLY) = 3     fstat64(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0     mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000c000     read(3, "# Locale name alias data base.\n#"..., 4096) = 2570     read(3, "", 4096)                       = 0     close(3)                                = 0     munmap(0x4000c000, 4096)                = 0     open("/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en_GB.utf8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en_GB/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en.UTF-8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en.utf8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     write(2, "sudo", 4sudo)                     = 4     write(2, ": ", 2: )                       = 2     write(2, "effective uid is not 0, is sudo "..., 54effective uid is not 0, is sudo installed setuid root?) = 54     write(2, "\n", 1     )                       = 1     close(0)                                = 0     access("/var/run/utmpx", F_OK)          = -1 ENOENT (No such file or directory)     open("/var/run/utmp", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 0     fcntl64(0, F_GETFD)                     = 0x1 (flags FD_CLOEXEC)     _llseek(0, 0, [0], SEEK_SET)            = 0     setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, {it_interval={0, 0}, it_value={0, 0}}) = 0     rt_sigaction(SIGALRM, {0x40265084, [], 0x4000000 /* SA_??? */}, {SIG_DFL, [], 0}, 8) = 0     setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, {it_interval={0, 0}, it_value={0, 0}}) = 0     fcntl64(0, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0     read(0, "\10\0\0\0&\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\2\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\1\0\0\0002N\0\0~\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\10\0\0\0\33\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\6\0\0\0!\7\0\0tty2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\7\0\0\0u\7\0\0tty1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\6\0\0\0#\7\0\0tty4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\6\0\0\0\"\7\0\0tty3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\6\0\0\0%\7\0\0tty6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\6\0\0\0$\7\0\0tty5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\6\0\0\0&\7\0\0ttyAMA0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "\7\0\0\0\7\10\0\0pts/0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384     read(0, "", 384)                        = 0     fcntl64(0, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0     setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, {it_interval={0, 0}, it_value={9, 976098}}) = 0     rt_sigaction(SIGALRM, {SIG_DFL, [], 0x4000000 /* SA_??? */}, NULL, 8) = 0     exit_group(1)                           = ?      ## tl;dr What could cause the `lsusb` command to only print `Illegal Instruction` to the console and then exit?


title: How to format large Size HDD quickly

text: In windows we can do a Quick format just by right clicking the device and boom format. In linux How to do the same I mean if the size of HDD is 2TB or more it takes along time to format using mkfs.ext3 /dev/sda* Is there an option to format it quickily


title: openSUSE 12.3 (64-bit) LiveCD/LiveUSB won't work (MacBook7,1)

text: I wanted to try a live openSUSE 12.3 (64-bit) system on my MacBook 7,1, however:   * When I do it with a LiveUSB created with UNetbootin, it's not recognized as bootable   * When I do it with a LiveCD created with Disk Utility, it boots, but it hangs on the screen with the black-blue background with the openSUSE chameleon on a plant on the right. No matter if I boot it in EFI-mode or not. What is going wrong? It's not really important however, I just wanted to try it for fun.


I am attempting to Install Guest Additions CentOS 64 (guest), Win 8 (host) Oracle's VM Virtual Box quite unsuccessfully. I have tried to follow the method answered here. But, I get the "mount point /media/cdrom does not exist" issue also mentioned in the same post.


title: How to copy a list of files and adjust destination filenames on the fly?

text: When I don't need to adjust destination filenames I can do something like this:               $ find -type f -name '*.pat' -print0  | xargs -O cp -t /path/to/dest      It is safe because the filenames may even contain newline characters. An alternative:               $ find -type f -name '*.pat' -print0 | cpio -p -0 -d /path/to/dest      Now I have the problem that the destination is a VFAT filesystem ... thus certain characters are just not allowed in filenames (e.g. '?'). That means that I have to adjust the destination filenames. Something like               for i `find -type f -name '*.pat'` ; do         cp "$i" `echo $i | sed 's/?/_/'`     done      works only for filenames without spaces - I could change IFS to just newline - but how to set '\0' as IFS? And still - the for loop leads to as much forks/execs (of mv/sed) as you have files - which is much more excessive than the few forks/execs needed for the two examples in the beginning. What are the alternatives to solve that problem?


title: reading from a file and changing its pattern into an array?

text: I have a CSV file containging entries like this :               ipaddress,VLAN,VLANid     10.192.168.1,vlan-xyz,3     10.192.168.1,vlan-abc,8     10.192.168.1,vlan-mnp,11     10.192.163.24,vlan-llz,3     10.192.163.24,vlan-bbz,5     10.192.163.24,vlan-xggz,23      and so on and i need to execute some cisco commands on remote cisco switches like : now if i do somehting like this               while read ipaddress vlan vlanid     ssh user@ipaddress << 'ENDSSH'     int VLAN vlan-xyz     switchport access vlan  vlanid     wr     ENDSSH      done < inputfile      it is going to ssh everytime and prompt me for password for each and every line in the file even for the same ipaddress. Is there any way to get over with this. I was thinking of putting a the other two columns in the file into an array like for a single ip addresses:               eg for IP:10.192.168.1     array="     int VLAN vlan-xyz     switchport access vlan  3     wr     int VLAN vlan-abc     switchport access vlan  8     "     for next ip ......      and so on how do i do this so that i can just pass an array of command for an ip like this :               while read ipaddress     ssh user@ipaddress " $array"     done < inputfile      but still i need to make sure that if i get the similar ipaddress in the while loop it should not ssh into it but only when it finds a new ipaddress. I am using empty to pass the password non-interactively to the remote switch using ssh but its not very good also beacuse it doesn't hrough any erros if the remote commands fail.everything including passwords are logged into its log file. NOTE : all the ips have the same password for a user


title: Troubleshooting `$ wget -A.pdf -r site.com`

text: I am trying to get homework papers with the command but for some reason, it does not return them. Any idea why?               $ wget -A.pdf -r -nd https://noppa.aalto.fi/noppa/kurssi/mat-2.3152/viikkoharjoitukset/      My goal is to download all homework and then merge them with `pdftk` and then search over them with some program -- but I cannot proceed (without again going to Firefox DownloadThemAll -plugin) until I get this working. Ideas why not working? Have sysadmins set up some bans for wgets or why does it fail? I get only this robots.txt -file:               $ cat robots.txt      User-agent: *     Disallow: /          User-agent: Googlebot     Allow: /     Disallow: /cgi-bin/


title: How to gather DNS A record requests?

text: I need to record all outgoing `A` records on a RedHat PC. I tried using `tcpdump`:               tcpdumpdns=OUTPUT-FILENAME-HERE     nohup tcpdump -K dst port 53 -w $tcpdumpdns > /dev/null 2>&1 &      It makes an output file like:               19:26:12.185392 IP 172.16.0.6.57977 > google-public-dns-a.google.com.domain: 51198+ A? yahoo.com. (27)      So I need to process that to get the `yahoo.com`:               echo $tcpdumpdns | awk '/ A\? / {u = NF - 1; print $u}' | sed 's/^www.//g; s/.$//g' | sort -u      Is there any better solution to gather all the outgoing `A` record requests? p.s.: collecting DNS A records is only needed to have an up-to-date list of websites that are reachable via HTTPS. So I can generate xml files for HTTPSEverywhere Firefox Add-on. So this is just a part of a script.