Can't install 32 bit gstreamer-ffmpeg normally, library can't find other 32 bit libs

I'm on Ubuntu 12.04 64 bits and I'm trying to get a game (GTA SA) working in wine, but it keeps crashing. After reading error logs it seems I needed some 32 bit versions of gstreamer, probably to play the intro video. I already have `ia32-libs`, because I read somewhere I will need that in order to run 32 bit software. I first tried:               sudo apt-get install gstreamer0.10-ffmpeg:i386      Which returns:                gstreamer0.10-ffmpeg:i386 : Depends: libavcodec53:i386 (>= 4:0.7.3-1) but it is not going to be installed or                                           libavcodec-extra-53:i386 (>= 4:0.7.3-1) but it is not going to be installed      And it also depends on libavformat, libpostproc and libswscale with about the same error. So I kept searching and found a nice tool, getlibs, which allows you to install 32 bit libraries. I think it just places them in the `/usr/lib32` directory, which probably isn't the best way to do this, but I tried it anyway. So I installed the 32 bit libraries with getlibs which wine was complaining about. Now I got different errors, basically the 32 bit library is referencing other libraries which it now can't find. For example one of the errors says:               Failed to load plugin '/usr/lib32/gstreamer-0.10/libgstffmpeg.so': libavformat.so.53: cannot open shared object file: No such file or directory      So my initial thought was correct, since it now uses the 32 bit version. Now I was trying to figure it out with ldd to see where the library references other libraries:               # This one is fine     ldd /usr/lib/gstreamer-0.10/libgstffmpeg.so | grep avformat     libavformat.so.53 => /usr/lib/x86_64-linux-gnu/libavformat.so.53 (0x00007f8314181000)          # This one isn't     ldd /usr/lib32/gstreamer-0.10/libgstffmpeg.so | grep avformat     libavformat.so.53 => not found      So indeed, libgstffmpeg.so can't find the correct libavformat.so. I tried installing the 32 bit version of libavformat with getlibs again, which placed it in `/usr/lib32/i386-linux-gnu/libavformat.so`. But ldd still tells me it can't find libavformat. Then I tried to make a symbolic link in the same directory but named it `libavformat.so.53` and even made a symlink to `/usr/lib/i386-linux-gnu/libavformat.so.53', but both give me the same error. Now I am sure this really isn't the correct way to go, but I didn't know the right way to do it. So what is the correct way to do this, or does gstreamer0.10-ffmpeg simply doesn't have 32 bit or multilib support? And how can I find out what the directory is, where libgstffmpeg (or any library I guess) checks for it's 32 bit libs it is referencing?


Is it a bad idea to not have a swap partition on an embedded linux setup?

I have a small embedded linux kernel and file system created via buildroot that is installed onto a compact flash drive running on an x86 board. I am using an initramfs (due to power loss concerns) but mounting a small number of directories on ext3 partitions on the CF drive for data that has to be persistent. However, recently I have been reading about swap partitions and their uses and as my current setup does not employ a swap partition at all. I am wondering if this is safe? I do not anticipate that the applications running on the device will be using a great deal of memory but is it better to create a swap partition regardless? I am very conscious of the limited writes that can be made to CF devices so if it is not vital then I would prefer not to use a swap partition. What would be the worst case scenario if I go ahead without a swap partition?


Fluxbox, bbkeys and java

I have installed `bbkeys` so I could choose a window when `ALT-TAB`ed, but the java applications are not amoung the selectable. Is there anything special that needs to be done for a java app to be amoung the selectable applications?


How do I run a script just before halt using LSB headers on Raspbian

I'm building a shutdown button for my Raspberry pi, and for that I have a python script that needs to change a GPIO pin on my Raspberry Pi just before the system runs the halt script. Now Raspbian uses LSB headers to determine the order in which scripts are run at shutdown, but I can't for the life of me figure out what to put in the header so that the script will run AFTER everything except /etc/init.d/halt has run. The problem right now is that the script runs too soon (it always installs at K01xx), thus cutting the power before all other services have shut down properly. I tried setting a custom priority as described in the guide here: http://www.debuntu.org/how-to-managing-services-with-update-rc-d/, but that does nothing as the command just says "using dependency based boot sequencing", with the end result being the same as before. I tried manually renaming the K01xx script in /etc/rc0.d to K09xx, so that it would be the last one before the halt command in the directory. But that had no effect either. Any suggestions? My init.d script:               #! /bin/sh     ### BEGIN INIT INFO     # Provides:          shutdown     # Required-Start:         # Required-Stop:     # Default-Start: 2 3 4 5     # Default-Stop: 0     # Short-Description: Detect shutdown button     ### END INIT INFO               PATH=/sbin:/usr/sbin:/bin:/usr/bin          . /lib/init/vars.sh     . /lib/lsb/init-functions          do_start() {         if [ -x /home/pi/bin/shutdown.py ]; then                 [ "$VERBOSE" != no ] && log_begin_msg "Starting listening for shutdown button"             python /home/pi/bin/shutdown.py &             ES=$?             [ "$VERBOSE" != no ] && log_end_msg $ES             return $ES         fi     }          do_stop() {         if [ -x /home/pi/bin/shutdown_pin.py ]; then             [ "$VERBOSE" != no ] && log_begin_msg "Lowering pin for complete shutdown"             python /home/pi/bin/shutdown_pin.py             ES=$?             [ "$VERBOSE" != no ] && log_end_msg $ES         fi     }          case "$1" in         start)         do_start             ;;         restart|reload|force-reload)             echo "Error: argument '$1' not supported" >&2             exit 3             ;;         stop)         do_stop             ;;         *)             echo "Usage: $0 start|stop" >&2             exit 3             ;;     esac


contents of xp cd is not visible

I'm using Ubuntu 13.04. I want to take an ISO copy of XP installation CD but when I insert CD it's seen as empty CD. Is there any way to access the content of CD?


Why am I getting apparmor error messages in the syslog about NTP and LDAP?

On my newly installed Ubuntu 12.04 machine, with `ntp` and `slapd` installed, the following messages appear in `/var/log/syslog` at regular intervals:               Feb 23 18:54:07 my-host kernel: [   24.610703] type=1400 audit(1393181647.872:15): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/ntpd" name="/etc/ldap/ldap.conf" pid=1526 comm="ntpd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0      I've searched, but can't find any info on what may be causing these messages and how to fix the problem. Can anyone shed any light on what's causing this and what to do about it?


copy recursively except hidden directory

How do I copy recursively like `cp -rf *`, but excluding hidden directories (directories starting with .) and their contents?


Why do Unix-heads say "minus"?

A couple of weeks ago I attended a talk on Git by someone who seemed to be from a Windows background. I say "seemed to be" because he kept saying "dash" when referring to command-line options. I then recalled something that I found curious in my early days of learning Linux; that is, when referring to options, the resident Unix-heads always said "minus". That is:               rm -rf /var/tmp/bogus/junk      Would be said "arr em minus arr ef" as opposed to "arr em dash arr ef". Why is this?


How to find the driver (module) associated with a device on Linux?

On Linux, given:   * a device, for example `/dev/sda`,    * and its major and minor numbers, for example `8, 0`,  how can I know which module / driver is "driving" it? Can I dig into `/sys` or `/proc` to discover that?


Meaning of the following linux commands

cat "$1" > /tmp/file.$$   2>/tmp/file0.$$     grep "*"  /tmp/file.$$    >/tmp/file0.$$      I understood that in the `cat` command, if an error occurs, the error will be shown in `file0.$$` and if it does not, then contents will be shown in `file.$$`. What I don't understand is what `$1` is. Also what is happening in the `grep` command.


Understanding different Linux Distros

I'm having a little bit of confusion when understanding linux based OS's. When I download the newest version of Mint and Ubuntu, aren't they the "same" at their core (kernel)? It just seems that they have different GUI's? Isn't a GUI technically just a program that runs on startup of a computer? Same as with windows (dos is the core but explorer.exe is the gui). Is anyone able to explain this? With the sudo apt-get command can't I install Ubuntu from a mint Terminal? I know that this is a mess of questions, but hopefully someone can clarify the differences between multiple distros before the GUI appears, and then after the GUI appears.


mysql USER unclear about what can be dropped?

When `show databases` there is the `information_schema` below it listing my created databases but what is 'USER' and 'mysql' listed in there? I don't know if ages ago I made a mistake and created them or if they are default listings which reveal something?


How to save “text/pdf” PDF files on the disk from an incoming mail in Mutt

I receive emails with PDF attachments that have the MIME type "text/pdf". This is obviously not good, but some mail clients are doing that... The problem is that saving such an attachment in Mutt leads to a file on the disk that cannot be opened by a PDF viewer. The file size is indeed different by a few bytes from what it should be. How can I save such attachments?


How can I diagnose and repair missing drive space?

I have a small ext3 `/` partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed. After trying everything I could think of, I forced a fsck on boot which didn't have any affect. I have other systems configured identically which don't exhibit this condition.               # df -h /     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1             9.7G  8.9G  318M  97% /          # du -shx --max-depth 1 /     5.2G    /          # lsof | awk 'BEGIN {t=0} /(deleted)/ {t+=$7} END {print t}'     0          # tune4fs -l /dev/sda1 | grep -E 'state|Free|Reserve|size|Inode'     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file     Filesystem state:         clean     Inode count:              2621440     Reserved block count:     131029     Free blocks:              212317     Free inodes:              2487281     Block size:               4096     Fragment size:            4096     Reserved GDT blocks:      639     Inodes per group:         32768     Inode blocks per group:   1024     Reserved blocks uid:      0 (user root)     Reserved blocks gid:      0 (group root)     Inode size:               128      **Edit:** `fsck` says the partition is 2% non-contiguous. For comparison to `du` above (sparseness):               # du -hxs --apparent-size /     4.9G    /


How do I determine where DNS requests fail in the TCP stack?

I have the networking setup described here: Why is this static route not taking effect? Currently, I can ping my DNS server but all DNS requests fail:               ~$ ping 130.35.249.52     PING 130.35.249.52 (130.35.249.52) 56(84) bytes of data.     64 bytes from 130.35.249.52: icmp_seq=1 ttl=57 time=105 ms     64 bytes from 130.35.249.52: icmp_seq=2 ttl=57 time=111 ms     ^C     --- 130.35.249.52 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 1000ms     rtt min/avg/max/mdev = 105.604/108.388/111.172/2.784 ms          ~$ nslookup oracle.com 130.35.249.52     ;; connection timed out; no servers could be reached      I can think of no good reason for this, because Ubuntu is (to my knowledge) not running a firewall. However, Ubuntu is virtualized, so I hope that it isn't something wrong with the way that its VirtualBox host is set up.


Creating a Linux distribution that only runs one application

> **Possible Duplicate:**   >  How can I build a custom distribution for running a simple web browser? Is it possible to create a Linux distribution that only runs one application? For example, I want it to just run a browser, and not support any other applications. How can I do that?


Need small distro without a desktop or windows manager, just to run a single graphical app

I am looking for some help on this from a linux expert. I am very novice when it comes to linux so I am hoping someone can help out. I need a small distro, that is stable. I don't need a full X server or window manager, I only need it to run one single application with a basic UI that consists of a viewport. I would like for the distro to be as small as possible. 700 mb or less would be ideal. Is their a base distro of ubuntu or similar that I can add whatever I need to it from the command line. Which basically is the kernel and some way of graphical output. I was thinking of putting Direct FB on it to render the application. Can anyone help me out here? Even a live distro would work.


rkhunter warns about chkconfig

I ran `rkhunter` and received the following warnings in its output:               $ rkhunter --update     $ rkhunter -c          ...     ...     ...          Performing file properties checks         /sbin/chkconfig                                          [ Warning ]      In the `/var/log/rkhunter.log`, it shows this message:               Warning: The command '/sbin/chkconfig' has been replaced by a script: /sbin/chkconfig: Perl script, ASCII text executable      Though I am on a Debian system and am aware of `update-rc.d`, I occasionally use `chkconfig` to configure services. What does this warning mean? How serious is this?


How to run this in sudo?

I have this line that I execute from php `sudo -u db2inst1 -s -- "/opt/ibm/db2/current/bin/db2 connect to PLC; /opt/ibm/db2/current/bin/db2 \"update EDU.contact set MOBILE_PHONE = '123'\""` it works fine on Sudo version **1.7.2**. Now I got new server with `SUSE Linux Enterprise Server 11 (x86_64)`. There was no sudo so I installed it from repository (Sudo version **1.6.9p17** ) But know the above syntax doesn't work. It throws `bin/bash: /opt/ibm/db2/current/bin/db2 connect to PLC; /opt/ibm/db2/current/bin/db2 "update EDU.contact set MOBILE_PHONE = '123'": No such file or directory` Any idea how I can make this work? If I run `/opt/ibm/db2/current/bin/db2 connect to PLC; /opt/ibm/db2/current/bin/db2 "update EDU.contact set MOBILE_PHONE = '123'"` under db2inst1 account everythings work just fine.


Download the Complete Linux Kernel Collection

I am wanting to download EVERY version of the Linux kernel as source code, Debian files, and RPM files. Where can I find a single site where I can download them all at once? If that is not possible, I know I can get the source code for every kernel here (https://www.kernel.org/pub/linux/kernel/), but I need the .deb and .rpm files as well.


What's the best way to count the number of files in a directory?

If parsing the output of `ls` is dangerous because it can break on some funky characters (spaces, `\n`, ... ), what's the best way to know the number of files in a directory? I usualy rely on `find` to avoid this parsing, but similarly, `find mydir | wc -l` will break for the same reasons. I'm working on Solaris right now, but I'm looking for a answer as portable across different unices and different shells as possible.


Grub error 15 (file not found)

I'm trying to fix a problem with a new installation. I'm running this existing distro (Ubuntu) from `/dev/sdb` with a new OS, Gentoo, installed on `/dev/sda`. I'm glad I took the trouble of setting these up on different disks because I can't boot into the new OS. All I get is grub error 15 "File not found". It also gives the UUID which I have verified is correct:               sudo blkid     /dev/sda1: LABEL="boot" UUID="b891774a-0b2d-4ab4-bcfa-23a11a97cae5" TYPE="ext2"      /dev/sda2: UUID="fc34999a-e85d-4c7b-8775-30510eb4c396" TYPE="swap"      /dev/sda3: LABEL="main" UUID="65a90a0d-a651-4215-8552-0c1859ab61dd" TYPE="ext4"      The menu.lst (on `/dev/sdb`) for the new OS is               title Gentoo Linux 3.10.7-r1     uuid b891774a-0b2d-4ab4-bcfa-23a11a97cae5     #root (hd0,0)     kernel /kernel-3.10.7-gentoo root=UUID=65a90a0d-a651-4215-8552-0c1859ab61dd      I also tried               kernel /boot/kernel-3.10.7-gentoo root=UUID=65a90a0d-a651-4215-8552-0c1859ab61dd      but since the UUID goes directly to the boot partition I think this is wrong. The kernel should be correct; if I mount `dev/sda1` and `ls` I see               grub  kernel-3.10.7-gentoo      Any ideas what I'm doing wrong? It might be very basic; I've only been using Linux for a few years and never Gentoo except for a few days in a `chroot`. * * * I should mention I also have grub2 installed on `dev/sda1` though I don't get as far there: it just shows the grub 'command line'.


mailx and HP-UX to RedHat migration

We are migrating some servers from HP-UX to Linux RedHat, and we have to migrate about 100 shell scripts that are referencing /usr/bin/mailx (instead of /bin/mailx on Linux). We'd like to change all the 100 scripts (from /usr/bin/mailx to /bin/mailx) only if this is the last option. Are there better ways of doing this? P.S.: our system administrators don't want to create a symbolic lynk "/usr/bin/mailx" pointing to /bin/mailx (I didn't understand why, actually). Thanks in advance.


Changed background on Kali Linux and now desktop is buggy

I have been running the latest version of Kali Linux for about a month now. I got tired of seeing the default Kali Linux login screen, so I looked up how to change it. The answer I found said: > Go to `/roor/usr/share/images` and then delete the image file labeled > `login-desktop.png` and replace it with a png image of your choice. > > After which change the replacement image name to `login-desktop.png` and > reboot. I did exactly as recommended, but when I rebooted the desktop environment was odd. There was no toolbar on the top or bottom, and windows were missing the default bar on them with Minimize, Maximize, and Close buttons. What happened?


Archbang look on Archlinux

I installed archlinux but I want to get the look and feel of Archbang. Is there a way to find the config files or scripts for Archbang? http://bbs.archbang.org/viewtopic.php?id=2501 gives a list of packages but I also want the resources and quick ref of key bindings in the background, menus, default application and other things I don't know about. The reason I don't want to install Archbang is because I want to follow the Arch Way. the reason I want Archbang config files is because people already thought about usability and solved that problem for me. I like their solution.


bind backslash to a non-standard keyboard key

I am using a swiss apple keyboard at the moment. This keyboard requires some unreasonable finger acrobatics to type a backslash (shift+right alt+7). I'd like to bind the backslash to another key combination, specifically shift+4, which right now produces a "ç" which I never need. Has anybody done something like that? I don't have any idea how to do that and I have not found any help yet. I use Linux mint xcfe. Thanks in advance for your help.


Are certain parts of startup scripts necessary or just good practice?

I'm currently exploring creating a startup script in the form of a system process located in the /etc/init.d/ on my Fedora 14 Linux installation. It sounds like the following two lines are bare minimum requirements?               #!/bin/bash     # chkconfig: 345 85 15 (however on this one I've seen different combos)      What's the purpose of these lines? Is there a good resource that would help me understand how to better create these and other header lines for such a file?


/proc/pid/maps addresses (and converting them)

When looking at the memory maps in /proc/pid/maps, we can see different length addresses               00400000-0042e000 r-xp 00000000 fb:01 268953                             /bin/nano     0062e000-0062f000 r--p 0002e000 fb:01 268953                             /bin/nano     0062f000-00630000 rw-p 0002f000 fb:01 268953                             /bin/nano     0081e000-00906000 rw-p 00000000 00:00 0                                  [heap]     7f8313e5c000-7f8314109000 rw-p 00000000 fb:01 2399989                    /usr/share/misc/magic.mgc     7f8314109000-7f83142ce000 r--p 00000000 fb:01 2759354                    /usr/lib64/locale/locale-archive     7f83142ce000-7f83142d1000 r-xp 00000000 fb:01 1457046                    /lib64/libdl-2.17.so     7f83142d1000-7f83144d0000 ---p 00003000 fb:01 1457046                    /lib64/libdl-2.17.so      We have addresses with 8 digits length like:   * 00400000-0042e000 And ones with 12 digits length (last 3 digits are always 0):   * 7f8313e5c000-7f8314109000 My question is, why are those addresses formated this way, and can i convert them to 8 digits length?


Virtualbox user home directory

I have a tiny problem. I want to avoid VirtualBox from creating `/home/$USER/.VirtualBox` directory and create another directory like `/home/$USER/DIR` instead to put the log files etc there. I tried to export `$VBOX_USER_HOME` variable in my `.bashrc` so it is set in my shell and also used the `vboxmanage setproperty machinefolder /home/amin/DIR` command but VirtualBox still creates `.VirtualBox` directory under `/home/$USER`. Is there any other way to achive this or am I doing something wrong here?


changing the partition of a linux

I have a ubuntu system as a virtual system on Virtual Box. It uses VHD as its hard disk. I manged to change the size of VHD using VHD resizer, now I want to expand the partition on vhd so it uses the expanded size. How can I do this?


Bandwidth, CPU & Memory stats returned in single line from terminal

I'm trying to create a simple monitoring system that will show a graph of sales that is linked entirely to data of bandwidth, CPU and Memory stats as they relate to sales. So if I sale 1 widget per 5 seconds, that will be contingent upon my bandwidth etc being above a certain threshold. So I've formulated a way to do the graph but I'm just having a time getting the stats. I can use any of a number of monitoring systems but I just need 1 line for bandwidth, CPU Usage, and Memory Usage once per second. I made a python script that gets all the IP information from all interfaces. But for if I had a script I could run from terminal that simply output a single line I could just pipe that to a file and then access the file to run my real time graph. So for network I can use:               $ ifconfig      I pipe it into a json file for easy reference. I can use:               $ free -m      for memory which I suppose I can pipe into a file as well Then I could use:               $ cat /proc/loadavg      for CPU and again pipe that. Is there an easier way to do this? So that I receive a single line for each command and can easily (more importantly quickly) send that information via Javascript or HTML5 FileReader to the graphing solution?


Is it possible to store ssh connection in bash script instead of $(ssh user@ip command) every time?

I think that the code that I already have is not very efficient as it has to connect each time to the same machine and execute a command. Code:               tmp=$(ssh -nq $USER@$IP "$COMMAND" 2>> $LOG)     tmp1=$(ssh -nq $USER@$IP "$COMMAND1" 2>> $LOG)     tmp2=$(ssh -nq $USER@$IP "$COMMAND2" 2>> $LOG)     tmp3=$(ssh -nq $USER@$IP "$COMMAND3" 2>> $LOG)      Where `$COMMAND` in most of the cases is some kind of `grep`. Can I somehow store the ssh connection or refactor the code so it won't connect each time to the machine ?


How to properly start and stop shell script in linux, busybox?

I am trying to write a small shell script that would send some commands to my tv set from my set top box that has busybox on it. The problem is that it generates huge amount of zombie processes, and when I try to killall, I kill also some audio processes, that should not be killed... Here are my scripts: tvstart.sh                #!/bin/sh      echo "ka 1 01" > /dev/ttyUSB0      read -t 5 response < /dev/ttyUSB0      echo "xb 1 70" > /dev/ttyUSB0      read -t 2 response < /dev/ttyUSB0      echo "kf 1 32" > /dev/ttyUSB0      read -t 2 response < /dev/ttyUSB0      echo "km 1 01" > /dev/ttyUSB0      #killall sh      tvstop.sh                #!/bin/sh      echo "ka 1 00" > /dev/ttyUSB0      #killall sh      And I call them like this(part of the script):               case "$1" in       led-on)         echo 3 > /sys/class/leds/mag-front-led/mode         nohup sh /home/default/tvstop.sh &       ;;       led-off)         echo 2 > /sys/class/leds/mag-front-led/mode         nohup sh /home/default/tvstart.sh &       ;;      So, how do I terminate them properly? this is how zombies looks like:                3637 root            Z   [sh]      3660 root            Z   [sh]      3696 root            Z   [sh]      3719 root            Z   [sh]      3751 root            Z   [sh]      3766 root            Z   [sh]      3798 root            Z   [sh]      3829 root            Z   [sh]      3913 root            Z   [sh]      3984 root            Z   [sh]      4489 root       6960 S   sshd: root@pts/0      4533 root       2704 S   -sh     10478 root            Z   [sh]     10516 root            Z   [sh]     10574 root            Z   [sh]     10597 root            Z   [sh]     10630 root            Z   [sh]     10737 root            Z   [sh]     11072 root            Z   [sh]     11103 root            Z   [sh]     11413 root            Z   [sh]     11436 root            Z   [sh]     11457 root            DW  [STVID.InjecterT]     11458 root            SW  [STVID[0].MPEG2P]     11459 root            DW  [tfm_89287480]     11460 root            SW  [STVID[0].Produc]     11461 root            SW  [STVID[0].Displa]     11462 root            SW  [STVID[0].ErrorR]     11477 root            Z   [sh]     11500 root            Z   [sh]     11525 root            Z   [sh]     11548 root            Z   [sh]     11581 root            Z   [sh]     11605 root            Z   [sh]     11638 root            Z   [sh]     11661 root            Z   [sh]     11688 root            Z   [sh]     19185 root       2704 R   ps


"Couldn't resolve host" when downloading Fedora 16 packages

I'm using `yum` to install `make`, I am getting the following error. I tried all solutions from similar questions but the issue remains.               http://download.fedoraproject.org/pub/fedora/linux/releases/16/Everything/i386/os/repodata/repomd.xml: [Errno 14] curl#6 - "Couldn't resolve host"     Trying other mirror


Arch Linux OpenVPN DNS-Problem

I can´t successfully connect with OpenVPN or maybe I´ll connect successfully and something is wrong with my network-settings... this is the Output of OpenVPN while connecting:               Thu Feb 13 23:21:13 2014 OpenVPN 2.3.2 x86_64-unknown-linux-gnu [SSL     (OpenSSL)] [LZO] [EPOLL] [eurephia] [MH] [IPv6] built on Nov 13 2013     Thu Feb 13 23:21:13 2014 WARNING: file     '/home/mak/openvpn-config/mkirchweger.p12' is group or others     accessible Thu Feb 13 23:21:13 2014 Attempting to establish TCP     connection with [AF_INET]83.164.xxx.xx:xxxx [nonblock] Thu Feb 13     23:21:14 2014 TCP connection established with     [AF_INET]83.164.xxx.xx:xxxx Thu Feb 13 23:21:14 2014 TCPv4_CLIENT link     local: [undef] Thu Feb 13 23:21:14 2014 TCPv4_CLIENT link remote:     [AF_INET]83.164.xxx.xx:xxxx Thu Feb 13 23:21:14 2014     [bricks.softpoint.at] Peer Connection Initiated with     [AF_INET]83.164.xxx.xx:xxxx Thu Feb 13 23:21:17 2014 TUN/TAP device     tun0 opened Thu Feb 13 23:21:17 2014 do_ifconfig, tt->ipv6=0,     tt->did_ifconfig_ipv6_setup=0 Thu Feb 13 23:21:17 2014 /usr/bin/ip     link set dev tun0 up mtu 1500 Thu Feb 13 23:21:17 2014 /usr/bin/ip     addr add dev tun0 local 10.10.x.xx peer 10.10.x.xx Thu Feb 13 23:21:19     2014 Initialization Sequence Completed **UPDATE:** I´m pretty sure it as an DNS-Issue, ping via IP works but Hostnames can´t be resolved...


How to fix bash or auto run /bin/bash on SSH login

When logging in as `root` at my server everything works fine, but when I log in as `myusername` the bash is not working correctly. The line starts with:               $       instead of               myusername@myserver:~$      and all specials keys like the arrow keys, tab keys, etc. won't work. When I type `bin/bash` it works again, but I'd like to fix the problem or auto run `bin/bash` on login. How can I fix this?


Print odd-numbered lines, print even-numbered lines

I want to print the odd-numbered and even-numbered lines from files. I found this shell script which makes use of echo.               #!/bin/bash     # Write a shell script that, given a file name as the argument will write     # the even numbered line to a file with name evenfile and odd numbered lines     # in a text file called oddfile.     # -------------------------------------------------------------------------     # Copyright (c) 2001 nixCraft project <http://cyberciti.biz/fb/>     # This script is licensed under GNU GPL version 2.0 or above     # -------------------------------------------------------------------------     # This script is part of nixCraft shell script collection (NSSC)     # Visit http://bash.cyberciti.biz/ for more information.     # -------------------------------------------------------------------------          file=$1     counter=0          eout="evenfile.$$" # even file name     oout="oddfile.$$" # odd file name          if [ $# -eq 0 ]     then         echo "$(basename $0) file"         exit 1     fi          if [ ! -f $file ]     then         echo "$file not a file"         exit 2     fi          while read line     do         # find out odd or even line number         isEvenNo=$( expr $counter % 2 )              if [ $isEvenNo -ne 0 ]         then             # even match             echo $line >> $eout         else             # odd match             echo $line >> $oout         fi         # increase counter by 1         (( counter ++ ))     done < $file     echo "Even file - $eout"     echo "Odd file - $oout"      But isn't there a way to do it in one line? _Yes, use awk,_ I read. Even-numbered lines:               awk 'NR % 2' filename      odd-numbered lines:               awk 'NR % 2 == 1' filename      But it doesn't work for me. Both produce the same output, according to diff. When compared to the original file, they are both indeed half as long, and they both contain the odd-numbered lines. Am I doing something wrong?


Bash vi mode configuration to default to command mode

Is it possible to configure bash vi mode so that initially it is in **command** mode instead on **insert** mode? I find that I have to press `Esc` far too much. It seems that there is possibility to specify this in zsh, but I have not found a way to do this in bash/readline.


Making two drives show as one on debian?

I rented a server from a provider and they won't install RAID0 without an additional fee. So I'm trying to figure out how to link these two drives so that my programs that are installed on the hard disk will see the space from the second drive. This is how it's setup: `df -h`:               Filesystem                                    Size  Used Avail Use% Mounted on     rootfs                                        139G   93G   39G  71% /     udev                                           10M     0   10M   0% /dev     tmpfs                                         599M  208K  599M   1% /run     /dev/disk/by-uuid/e7a9cc0e-9caa-4d33-b60f-... 139G   93G   39G  71% /     tmpfs                                         5.0M     0  5.0M   0% /run/lock     tmpfs                                         2.7G     0  2.7G   0% /run/shm     /dev/sda1                                     961M   36M  877M   4% /boot     /dev/sda5                                     139G   93G   39G  71% /media/hd      `fdisk -l`:               Disk /dev/sda: 160.0 GB, 160000000000 bytes     255 heads, 63 sectors/track, 19452 cylinders, total 312500000 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00066abb             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048     2000895      999424   83  Linux     /dev/sda2         2002942   312498175   155247617    5  Extended     /dev/sda5         2002944   296499199   147248128   83  Linux     /dev/sda6       296501248   312498175     7998464   82  Linux swap / Solaris          Disk /dev/sdb: 160.0 GB, 160000000000 bytes     58 heads, 29 sectors/track, 185790 cylinders, total 312500000 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00088a99             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048   312499999   156248976   83  Linux      I did my best with my n00bness to mount the 2nd drive. Does anyone know what I need to do to make the drives show up as one?


Using symbolic links and git to manage build versions

In general I follow the following workflow when I build any program (e.g. `emacs`, `tmux`, etc.)               /home/opt/[name of the program]/builds/[version]/          bin     lib     share      For example for a program like `tmux` I have the following:               /my_local_opt/tmux/builds/1.7.-227/          bin     lib     share      I then create sym links in `/home/bin/` pointing to the the specific builds that I have, and I never have to touch my `PATH` variable, since I fix it to include `/home/bin`. E.g. For the example above, I would   * Create a sym link: from: `/home/bin/tmux` to: `/my_local_opt/tmux/builds/1.7.-227/bin/tmux`   * Have `PATH` only include `/home/bin` However, I am not sure I can follow a similar approach for the `man` (`MANPATH`) and `lib` (`LD_LIBRARY_PATH`) paths.   1. For example, after I build `tmux` I notice that it creates: > `.. /share/man/man1/tmux.1` so I tried creating a symlink to this file from a place like `/home/share` and then fixing `MANPATH` to include this path. But when I typed `man tmux` it didn't work (it said "`No manual entry for tmux`"). Why?   2. How about `lib`? I thought I could perhaps fix `LD_LIBRARY_PATH` to a specific directory for each program, and then use sym links to control which version gets included. Would this be a good idea? More generally, is it a good idea to manage versions in a system using sym links? In the long run I am hoping to leave the sym links in a git repository to keep track of multiple configurations. In case it helps, I don't have admin privileges in the machine where I build software, so I am hoping to use this as a way easily organize and manage my builds (without having to constantly edit my environment variables holding paths)


how to get tornado 211g (ACX111) working in mint 13 xfce?

I have mint 13 xfce installed on my thinkpad r31. For this laptop, I have a Tornado 211g pcmcia wireless adapter. This is not installed automatically in Mint and I am searching for a way to get this card working. How Can I achieve this? I have the windows XP drivers and have added these using ndiswrapper but so far, nothing has happened. in terminal, I have typed _lspci_ which returned my wireless adapter as an ACX111 chipset.


Piped input to nano

Why does `ls | nano -` open the editor in Ubuntu but close the editor and save a file to `-.save` in CentOS? How can I get nano in CentOS to remain open when reading stdin?


Need advice on using Wireshark + aircrack-ng

I am making acquiantance with wireless security and attacks and was told to run some tests with aircrack-ng and wireshark. So I installed both of them and ran airmon to switch wi-fi card to monitor mode: `sudo airmon-ng start ra0` (this is my DWA-140 usb wi-fi adapter) The wi-fi adapter seems to have restarted after that. Gues that's ok. Still it gave some warnings on processes that might interfere with normal work like `network manager, dhclient` and a few more. I tried to stop them, but they seem to restart all the time. After that I ran wireshark as a superuser, chose the ra0 adapter and tried to sniff the test open network. I have my PC connected to it (via dwa-140) and an HTC phone and some stranger PCs. Wireshark runs on my PC. The problem is that when I login to `%sitename%` with a PC browser, I can see the cookies sent to it in Wireshark. But when I do the same thing with an Opera Mobile browser on my HTC (`Turbo` option disabled), there is nothing detected. I know that stranger PCs are also sending data to `%sitename%`, but I see nothing from them as well. Actually I see a lot of packets from stranger PCs, but not the ones I need. I'd like to know what I'm doing wrong. Will be thankful for any advice. P.S. This runs on Ubuntu 12.04.1


Reformatting a large number of XML files

I'm manipulating a large number of XML files scattered throughout a nested directory structure. I tried the following (which almost works):               $ find . -name "*.xml" -type f | xargs -- xmllint --format      The problem is this generates the formatted XML output on the screen, but doesn't change the file. How can I change this command so that the actual file contents are changed? Thanks!


Why does mapping <esc> cause arrow keys to fail in vim?

When I do               inoremap <Esc> <Esc>`^      in vim, the next time I switch to insert mode (after using `Esc`) the arrow keys fail to move the cursor (they insert letters instead). Why does that happen? * * * **Edit** : It is possible to remap `Esc` and still retain working arrow keys?


Can't insert rt2800usb module: Invalid argument

I just got an ASUS N13 USB wireless dongle, and unfortunately it's not detected and I can't load it with modprobe:               $ sudo modprobe rt2800usb     WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release.     WARNING: Error inserting rt2x00usb (/lib/modules/3.0.0-14-generic/kernel/drivers/net/wireless/rt2x00/rt2x00usb.ko): Invalid argument     WARNING: Error inserting crc_ccitt (/lib/modules/3.0.0-14-generic/kernel/lib/crc-ccitt.ko): Invalid argument     WARNING: Error inserting rt2800lib (/lib/modules/3.0.0-14-generic/kernel/drivers/net/wireless/rt2x00/rt2800lib.ko): Invalid argument     FATAL: Error inserting rt2800usb (/lib/modules/3.0.0-14-generic/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko): Invalid argument      What's the problem here? I read that this works usually out of the box with Ubuntu 11.10? What can I do to fix this? Is there a package I can reinstall to try and fix things?


slow samba seek performance

I am using FreeBSD 9.0 RC3 (PCBSD distro) with samba 3.4.14. I am trying to access portions of several large (4 - 10 GB) files over samba using seek commands, and I am seeing that calls to the front of the file are returning very quickly, but calls to near the end of the file are taking 15+ seconds to respond. It is as if the OS has to read the entire file up to the position I am seeking to. The file system is ZFS v28 on a 5 drive Z2 configuration. Are there any parameters governing seek? When I host these files on a Windows Server 2008 R2 box, I am not seeing any of these issues. ![Disk Mark Performance](http://i.stack.imgur.com/9Uf0f.png) I've attached my results from crystaldiskmark over the network as well.


Checking the order of items in a shell environment variable

I am wanting to check that a certain directories always appear after other directories in an environment variable. List items are separated by a colon, as with the PATH variable. This is not simply for bash, but for a few different shells. The problem is, I'm not sure how to check the order of items in a list using standard unix utilities. What would be a starting point? edit: An example would be               $LIST=/test:/bin/test:/etc/test:/nan/:/var      I would want to test for example that any directory path that had the word test in it was prior in the list to a directory that did not. What I want to do is small enough that I can hardcode the directories, so a dynamic solution is not necessary.


Is there a way to convert IE favourites to bookmark.htm format?

After switching from Windows to Linux, I am left with a favourite directory containing subfolders and `.url` files, each file containing a few lines of text that look like this:               [DEFAULT]     BASEURL=http://www.example.com/faq.html     [InternetShortcut]     URL=http://www.example.com/faq.html     Modified=70E5E788C3B9C9010A      Since I do not have internet explorer installed on my Linux system, it is not possible for me to import the bookmarks directly to my current Firefox browser. I was wondering if there is a quick way to extract the URL from all the `.url` files, together with the filenames to generate a `.htm` file which I can import to any modern browser.


autologin console as root on fedora

Can someone help to autologin in console text mode as root in fedora, usually I can do using script like this : `/sbin/autologin.sh`:               #!/bin/bash     0</dev/$1 1>/dev/$1 2>&1     cat /etc/issue     shift     exec $*      and on `/etc/inittab` do login by calling that script               1:2345:respawn:/sbin/autologin.sh tty1 login -f root     ..     ..      now i can't do that, since fedora use /etc/init/tty.conf :               stop on runlevel [016]     respawn     instance $TTY     exec /sbin/mingetty $TTY      *I know its dangerous to autologin and moreover as root, but I don't care, I don't care about security


Parsing the headers of sequence file

I have a multiple sequence file as               >abc|d017961     sequence1......          >cdf|rhtdm9     sequence2......          >ijm|smthr12     sequence3......          >abc|d011wejr     sequence4......          >stg|eethwe77     sequence5......      I want to edit the file and want the result file as               >abc_ABC__d017961     sequence1......          >cdf_CDF__rhtdm9     sequence2......          >ijm_IJM__smthr12     sequence3......          >abc_ABC__d011wejr     sequence4......          >stg_STG__eethwe77     sequence5......


How can I make a Puppet module that fixes time?

I have written a Puppet module that corrects the time via NTP, but this only works on server with a small NTP offset. There are sometimes server with a time offset higher than 10 minutes for various reasons. I want to make a Puppet module that runs exec "service ntpd stop; ntpdate ntp3.domain.local; service ntpd start" when the ntp offset is too high, to forcably correct the time. How can I see if the NTP offset is too high in order to tell Puppet to run this command? Or are there better solutions?


ixgbe: increase rx performance

I have an Intel 82598EB 10GBE NIC. I need to receive traffic without packet loss. Data rate is 4-5 Gbps, packet size is 1500-9600 bytes. I had already configured smb and irq affinity. I also tried to use packets socket ( PF_PACKET ). None of this helped. Small losses is always present. Now I am planning to compile kernel with disabling any configuration settings that increase the size of sk_buff and disabling IOMMU. What are other ways to improve rx performance?


How to disconnect a server from LDAP

I have a Fedora server configured for LDAP. However, the LDAP server is gone, and now I'm unable to SSH into it. I've rebooted the server into single-user mode, brought up eth0 and started sshd, but when I try and ssh into it, the connection times out and the server reports "nss_ldap: could not search LDAP server server is unavailable". How do I completely purge LDAP from the system and disconnect it from any external LDAP dependency? I've ran `yum remove openldap-servers nss-pam-ldapd` and deleted common ldap conf scripts, but still sshd blocks all connections because it can't validate them against a non-existent LDAP server.


Free Matlab equivalent for Linux

My collaborators are using Matlab to do some simulations. Is there an open source alternative I could use on Linux to run these scripts? It would need to be fairly closely compatible with the (1) matlab language (2) the *.fig files - saved plots.


What's the easiest way to decrypt a disk partition?

I made a mistake of encrypting the entire LVM physical volume (contains both home, root, and swap) when installing a CentOS 6.4 (2.6.32-358.6.1.el6.x86_64) box. I soon came to realize that moving files takes a horrendous amount of time due to `kcryptd` running at 90% of CPU and that encryption was not really necessary as it's just a home server containing no crucial data. However, I already configured it and installed loads of packages, tuned it as far as power management goes, and set up all the services. Is there any way to remove the encryption without having to re-install the whole thing and go through the configuration all over again? I'd love an option that would take less than 30 mins but I'm not sure one exists. Also, if anyone has any recommendations on how to make `kcryptd` more easy to use, let me know. **Edit 1**               ~]# fdisk -l /dev/sda          Disk /dev/sda: 160.0 GB, 160041885696 bytes     255 heads, 63 sectors/track, 19457 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000078c9             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1          64      512000   83  Linux     Partition 1 does not end on cylinder boundary.     /dev/sda2              64       19458   155777024   83  Linux          ~]# dmsetup ls     vg_centos-lv_home       (253:3)     vg_centos-lv_swap       (253:2)     vg_centos-lv_root       (253:1)     luks-2ffcc00c-6d6e-401c-a32c-9c82995ad372       (253:0)          ~]# pvdisplay       --- Physical volume ---       PV Name               /dev/mapper/luks-2ffcc00c-6d6e-401c-a32c-9c82995ad372       VG Name               vg_centos       PV Size               148.56 GiB / not usable 4.00 MiB       Allocatable           yes (but full)       PE Size               4.00 MiB       Total PE              38030       Free PE               0       Allocated PE          38030       PV UUID               euUB66-TP3M-ffKp-WhF5-vKI5-obqK-0qKoyZ      **Edit 2**               ~]# df -h / /home /boot     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/vg_centos-lv_root                            50G  2.3G   45G   5% /     /dev/mapper/vg_centos-lv_home                            94G  1.3G   88G   2% /home     /dev/sda1             485M   53M  408M  12% /boot


Which packages from slackware's X category do I need for a minimal X installation?

I would like to set up Slackware 14.1 with a minimal package count. I already know which packages from A, AP, and N that I need for a minimal install with no X. But I have no idea which packages from the X category that I need and which ones are just unnecessary. Please don't tell me that I should just install everything. I've done that and it works but I end up with hundreds of packages I don't need.


htop reporting much higher memory usage than free or top

The following three outputs were taken essentially simultaneously: top:               top - 02:54:36 up 2 days, 13:50,  3 users,  load average: 0.05, 0.05, 0.09     Tasks: 181 total,   1 running, 179 sleeping,   0 stopped,   1 zombie     %Cpu(s):  2.5 us,  0.8 sy,  0.0 ni, 96.6 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st     KiB Mem:  16158632 total, 11234480 used,  4924152 free,      844 buffers     KiB Swap: 16777212 total,        0 used, 16777212 free, 10640832 cached      free -h:                            total       used       free     shared    buffers     cached     Mem:           15G        10G       4.7G         0B       844K        10G     -/+ buffers/cache:       578M        14G     Swap:          15G         0B        15G      htop: ![htop](http://i.stack.imgur.com/AVrWm.jpg) free and top seem to agree. In top there is 11234480 KiB used, subtracting 10640832 KiB cached gives 579.7 MiB, which is pretty close to what free reports under used +/- buffers/cache. However htop is reporting 1836 (MiB) used, which is neither here nor there as far as I can see. Where does this difference come from? htop is clearly not including the cached data, but it is still reporting more than three times the memory usage of free or top. I am aware that there are many similar questions, but I haven't come across one that explains this discrepancy (the confusion usually seems to be only the with/without cache counting). Edit: I should mention that I am running openSUSE, and I see the same kind of discrepancy in both version 12.2 and 12.3 RC1. Edit2: The included version of htop is 1.0.1. I have also compiled version 1.0.2 from source and see the same discrepancy then as well.


libpam-ck-connector causing apt-get to fail

I used `apt-get autoremove` on my Debian server and now `apt-get` won't install or remove anything as it keeps trying but failing to remove `libpam- ck-connector`. When trying to install anything… for example, `apt-get install php5`               (Reading database ... 28566 files and directories currently installed.)     Removing libpam-ck-connector:armhf ...     dpkg: error processing libpam-ck-connector:armhf (--remove):     unable to securely remove '/usr/share/doc/libpam-ck-connector/changelog.gz': Not a directory     Errors were encountered while processing:      libpam-ck-connector:armhf     E: Sub-process /usr/bin/dpkg returned an error code (1)      I tried to run `apt-get install libpam-ck-connector` and got this…               libpam-ck-connector is already the newest version.     libpam-ck-connector set to manually installed.     The following NEW packages will be installed:     libck-connector0     0 upgraded, 1 newly installed, 0 to remove and 86 not upgraded.     1 not fully installed or removed.     Need to get 0 B/117 kB of archives.     After this operation, 96.3 kB of additional disk space will be used.     Selecting previously unselected package libck-connector0:armhf.     (Reading database ... 28560 files and directories currently installed.)     Unpacking libck-connector0:armhf (from .../libck-connector0_0.4.5-3.1_armhf.deb ) ...     Setting up libck-connector0:armhf (0.4.5-3.1) ...     dpkg: error processing libpam-ck-connector:armhf (--configure):      package libpam-ck-connector:armhf is not ready for configuration      cannot configure (current status `half-installed')     Errors were encountered while processing:      libpam-ck-connector:armhf     E: Sub-process /usr/bin/dpkg returned an error code (1)      Any ideas on how to work around this?


init.d script causes boot hang

I successfully installed a script to automatically launch in /etc/init.d on my new Raspberry Pi. Unfortunately, it is a node.js app that never returns, and therefore hangs the device during boot (this is on Debian). Yes, I'm an idiot. Is there a secret handshake I can do during boot to prevent it from running my init.d script so I can get to login and a shell to fix it?


How to create a bootable USB stick with Debian Squeeze

Using Ubuntu, I want to install Debian Squeeze on my PC with a bootable USB stick. I found this tutorial: Plug the usb key in order to find the device location:               $ df -k     /dev/sdb                244476    217968     26508  90% /media/xxx      It shows that `/dev/sdb` is my usb key. Then I unmount it               # umount /dev/sdb      Download these two files:               # cd /tmp/     # wget http://people.debian.org/~joeyh/d-i/images/daily/hd-media/boot.img.gz     # wget http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/i386/iso-cd/debian-testing-i386-netinst.iso      Copy the first on the stick (it has to be umounted):               # zcat boot.img.gz > /dev/sdb      Then mount the stick and copy `debian-testing-i386-netinst.iso` onto it:               # mount /dev/sdb /mnt/     # cp /tmp/debian-testing-i386-netinst.iso /mnt/     # umount /mnt/      The USB key is now ready. Plug it on the computer to install, select in the BIOS USB for first boot device and start the Debian Squeeze installation. In the step :               # cp /tmp/debian-testing-i386-netinst.iso /mnt/      the ISO file is _just copied_ , not _extracted_ - Is this correct?


How do I stop Apache from running as root?

New on the job, small place, and the security stuff just landed on my desk. I was hired to be a front-end developer. Happy to learn new things, but never had to do sysadmin stuff before. I started digging and it appears that apache, the site, and everything is running on root. There are no other groups or users. ACK! What steps should I take to change this? I know that this is a big no-no... Bonus points if anyone can please point me to a good basic 101 tutorial on apache/php security.


w3m displays inline images in konsole, but not yakuake

I've tested this on two different systems (with TERM set to `xterm-256color`) and got the same result. Nothing in the config files seems relevant. Is there a major difference in these terminal emulators that I'm not aware of? Also, is any thorough documentation available for either of them? They seem to come with no `man` pages. I found the konsole handbook, but it is very basic.


DHCP configuration for iPXE

Is there a way to configure the DHCP process in iPXE? In particular, I want to configure the DHCP Discover message **sent by iPXE** , so that the message issued by iPXE includes more options in Parameter Request List (Option 55) for the server to replied with. Currently, only a restricted subset of options are requested, but I want more.


pwd not being set correctly in zsh prompt

If I type this in my PROMPT in my `.zshrc` file:               PROMPT="`pwd` >"      I expect that it will print the current working directory. However, `pwd` always prints `/Users/kevin`. Why doesn't it show my current working directory? (I know that there is a function called `%~` that will set it for you. I'm curious why this doesn't work though, this is a simpler case of something more advanced that I'm trying to do).


How to install ubuntu ultimate edition using Wubi?

I had some trouble installing Ultimate Edition 2.9 on my friend's computer using Wubi. Wubi just doesn't accept installation and gives only 2 options - 'Demo & Install' and 'Learn more'. Tried searching the internet for a solution but couldn't find anything. Is it Wubi's fault or is it not designed to give support for UE? If latter, what is the alternative to it (without actually giving UE a seperate partition).


Check a range of IP addresses to see if a host is active

I need to write a bash shell script that will check a range of IP addresses to see if a host is “alive” at that address.I also need to list the IP numbers of those that are “alive”, and provide a summary showing the number of “alive” and “not alive” IP addresses. The range of addresses will all be in a “Class C” network. I'm having problems figuring out how to pass through each arg and get it pinging each individual address within the range. Below is a sample run of the script I intend to create.               $ programName 192.168.42 18 22           Checking: 192.168.42.18 19 20 21 22           Live hosts:       192.168.42.21       192.168.42.22           There were:       2 alive hosts       3 not alive hosts       found through the use of 'ping'.


Script is stuck saying 1 response with 2 available: Math related

I have a script that tells the user the square footage of 2 rooms based on user input. I think I have that part done right. The problem I have is that I need to have the script say which room is bigger and no matter how I try to rebuild the end of the script I get both responses, 1 of the responses which is wrong unless the user is lucky, or I get no response. How do I change this part of the script to get the correct output? I'll have the rest of the script as a reply to this for those that want to skip over the working part along with the question I've been given. Also this is a homework assignment from my Intro to Unix class that I've spent way to much time on trying to figure out so the correction has to be somewhat beginner-ish.                   if [ $R1z -ge $R2z]         then         echo Room 1 is bigger         else         echo Room 2 is bigger         fi      All of the code:                   echo Enter the length of room 1         read R1x         echo Enter the width of room 1         read R1y         echo Enter the length of room 1         read R2x         echo Enter the width of room 2         read R2y         expr $R1x \* $R1y         read R1z         expr $R2x \* $R2y         read R2z              if [ $R1z -ge $R2z]         then         echo Room 1 is bigger         else         echo Room 2 is bigger         fi


Are there any pitfalls to overriding ls?

Is there anything to watch out for if you wanted to override `ls`? Is there a more reliable way of getting pagination out of `ls`? For example:               function ls() { command ls -hp $@ | more; }


add members of wheel group, sudo access

On Fedora15, following this wiki, I added a user to wheel group, which is already in the sudoer config file. but still I get not-a-sudoer error prompt. Should I specifically name every member of a group in sudoer file to be able to sudo with that user?


PF and types of NAT(Network Address Translation)

As you know, at least 3 types of `NAT` are used. Of course i need to two types of them.`DNAT` and `SNAT`. `DNAT` : hiding server behind `NAT`, `SNAT` : hiding your client behind `NAT`. **Question:** I read a quick tutorial of `PF filrewall`, but didn't   distinguish `DNAT` and `SNAT` in `PF Firewall`. How can i define ruleset as `DNAT` and `SNAT`?


renaming a fat16 volume

What's the easiest way to rename (change the volume label of) a fat16 volume (e.g. on a USB drive) from linux? It seems like `mlabel` from the `mtools` package is meant to do this, but the documentation is not geared to rapid assimilation.


Is it possible to run KVM over a qemu emulated powerpc architecture

I understand that qemu uses binary translation to emulate machines, so irrespective of the underlying architecture, it can provide emulation.   And, KVM uses Hardware Virtualization technique to make this process faster. Thus, KVM requires VT support from underlying architectures (which x86 processor provides). I have emulated powerpc architecture with qemu over x86 architecture. My question is whether it is possible to run KVM over this powerpc architecture.


Confused about the purpose of MESA with proprietary nVidia drivers

Since a MESA upgrade today (10.2.5-1 -> 10.2.6-1 in Debian Sid, which is _unbearable_ lately, keep away), I noticed 3D-dependant applications complaining about missing the software rasterizer `swraster` - `compiz` (standalone) won't even start any any more, glxgears is extremely choppy etc. Aside from the usual "fun" fixing this that I'm already in the middle of (pointers welcome, downgrading didn't work), this demonstrated me once again that I don't understand how 3D rendering works on Linux. So, my question is: Why is MESA even interacting with this - and why do I even need it installed? Isn't it a free implementation of the same things the proprietary nVidia drivers provide as well? Shouldn't any 3D use by X11 go directly to the proprietary drivers' APIs? On the project's site itself, they specify that they either interact with open source drivers (`nouveau` in this case, which doesn't support my card), or do things in software, which I obviously do not want. My nVidia drivers were installed through sgfxi, i. e. not from Debian's packaging system, but I don't think this would make a difference - for instance, libcairo2 rigidly specifies it needs MESA, period. (And also, why do I need to ask these question to simply run a 3D application...) If this is what's happening, it would explain why my performance in 3D games is so absolutely frustrating, but I somehow can't believe that things are _this_ counterintuitive...


What is a sure fire way to find all files and/or path that contains 2 keywords?

I was doing a               find . -iname '*sitesearch*' | grep demo      because I know the file should be `some/path/SiteSearch/demo/SiteSearch.html`, but it turned out a person put the file in as `some/path/SiteSearch/demo/index.html`, so the file cannot be found. Is there a better way to do the search? Such as for this case, if I do               find . -iname '*demo*' | grep -i sitesearch      it would have found it. But I don't want to always THINK what possibility it is and figure out what pattern to use. I just want a way that whenever the file and path have both of these 2 keywords, then print it out. For example, if there is a way to `ls` all files will the full path on each line, then we can do               ls --some-flags | grep -i demo | grep -i sitesearch      or maybe another way / better way.


Maximum password length

Is there a maximum password length on unix systems? If so, what is that limit and is it distribution dependent?


24 hour crash course in ZFS... some final questions

Due to various circumstances I've given myself a crash course on the ZFS file sytem. I need some help getting comfortable with the unknowns. Whatever those are. Data:   * Running www.zfsonlinux.org on CentOS 6.2    * I have an array with 12x2TB sata disks.    * I created a raidz2 pool and a couple zfs file systems inside that.    * Performance is better than I expected. (How often do you get to say that?) Some questions:   * What type of maintenance should I schedule? I have read that doing a "zpool scrub" is advised. At what interval would you run this? Is there anything else to do?   * Is there any performance monitoring other than "zpool iostat" - snmp?    * I need to be alerted by email or similar about disk failures, etc.... What are my options?


How to check and block processes connecting to internet directly?

Is there a way to find which processes in my system are getting connected to net automatically. Is there a way to select and block net access of some processes permanently? I use mint 11. I use a USB datacard.


pulse-audio does not recognise my Logitech mic and my Webcam mic

I use the (great) AK5370 microphone for Skype, but it is not recognized by my archlinux i86_64. It also fails to recognize the mic on my Logitech Webcam (PTZ, which I do not use). Both are connected through the monitor's built-in hub, and both work through hubs an another system. Both work on the same hardware with Ubuntu and Windows. Here they are on lsusb…                ~]# lsusb     Bus 001 Device 002: ID 03f0:2524 Hewlett-Packard LP3065 30" Monitor Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 003: ID 1532:001c Razer USA, Ltd RZ01-0036 Optical Gaming Mouse [Abyssus]     Bus 001 Device 004: ID 04ca:002a Lite-On Technology Corp.      Bus 001 Device 005: ID 0556:0001 Asahi Kasei Microsystems Co., Ltd AK5370 I/F A/D Converter     Bus 001 Device 006: ID 046d:08cc Logitech, Inc. Mic (PTZ)      But not on aplay's list-devices...               ]$ aplay --list-devices     **** List of PLAYBACK Hardware Devices ****     card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]       Subdevices: 0/1       Subdevice #0: subdevice #0     card 0: NVidia [HDA NVidia], device 3: ALC1200 Digital [ALC1200 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 7: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 8: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 9: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 7: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 8: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 9: HDMI 0 [HDMI 0]       Subdevices: 1/1      note: card0 mobo card1&2 nvidia graphics (not used) PulseAudio Volume Control reports "No input device available". No problem with these devices on other systems Alas... pulseaudio 3.0-3 pavucontrol 2.0-1 skype 4.2.0.11-1 alsa-lib 1.0.27.1-1 * * * Note: the webcam (UVC) with the min (PTZ) is recognized and works. * * * Per _Ignacio Vazquez-Abrams_... (thanks)               ~]$ lsmod | grep '^snd' | column -t     snd_usb_audio          112569  0     snd_usbmidi_lib        18931   1   snd_usb_audio     snd_rawmidi            18742   1   snd_usbmidi_lib     snd_seq_device         5180    1   snd_rawmidi     snd_hda_codec_hdmi     29298   8     snd_hda_codec_realtek  30893   1     snd_hda_intel          35816   4     snd_hda_codec          145704  3   snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel     snd_hwdep              6364    2   snd_usb_audio,snd_hda_codec     snd_pcm                76860   4   snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     snd_page_alloc         7330    2   snd_pcm,snd_hda_intel     snd_timer              18687   1   snd_pcm     snd                    58893   19  snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device      And in addition...               ]# ls -l /dev/snd     total 0     drwxr-xr-x  2 root root      100 May 24 10:07 by-path     crw-rw----+ 1 root audio 116,  8 May 24 10:07 controlC0     crw-rw----+ 1 root audio 116, 17 May 24 10:07 controlC1     crw-rw----+ 1 root audio 116, 26 May 24 10:07 controlC2     crw-rw----+ 1 root audio 116,  7 May 24 10:07 hwC0D0     crw-rw----+ 1 root audio 116, 16 May 24 10:07 hwC1D0     crw-rw----+ 1 root audio 116, 15 May 24 10:07 hwC1D1     crw-rw----+ 1 root audio 116, 14 May 24 10:07 hwC1D2     crw-rw----+ 1 root audio 116, 13 May 24 10:07 hwC1D3     crw-rw----+ 1 root audio 116, 25 May 24 10:07 hwC2D0     crw-rw----+ 1 root audio 116, 24 May 24 10:07 hwC2D1     crw-rw----+ 1 root audio 116, 23 May 24 10:07 hwC2D2     crw-rw----+ 1 root audio 116, 22 May 24 10:07 hwC2D3     crw-rw----+ 1 root audio 116,  6 May 24 10:07 pcmC0D0c     crw-rw----+ 1 root audio 116,  5 May 24 14:51 pcmC0D0p     crw-rw----+ 1 root audio 116,  2 May 24 10:07 pcmC0D2c     crw-rw----+ 1 root audio 116,  4 May 24 10:07 pcmC0D3c     crw-rw----+ 1 root audio 116,  3 May 24 10:07 pcmC0D3p     crw-rw----+ 1 root audio 116, 12 May 24 10:07 pcmC1D3p     crw-rw----+ 1 root audio 116, 11 May 24 10:07 pcmC1D7p     crw-rw----+ 1 root audio 116, 10 May 24 10:07 pcmC1D8p     crw-rw----+ 1 root audio 116,  9 May 24 10:07 pcmC1D9p     crw-rw----+ 1 root audio 116, 21 May 24 10:07 pcmC2D3p     crw-rw----+ 1 root audio 116, 20 May 24 10:07 pcmC2D7p     crw-rw----+ 1 root audio 116, 19 May 24 10:07 pcmC2D8p     crw-rw----+ 1 root audio 116, 18 May 24 10:07 pcmC2D9p     crw-rw----  1 root audio 116,  1 May 24 10:06 seq     crw-rw----+ 1 root audio 116, 33 May 24 10:07 timer


How to fix Mint 16 Desktop crash/freeze after adding second toolbar and enabling/disabling monitor?

My operating system is Mint 16, forgot what flavor, probably KDE. My desktop crashed after I connected a second monitor, added a second toolbar to the second monitor and then disable the monitor, and then rebooted. After I rebooted, my desktop is now frozen, with a fuzzy blank toolbar. I forgot what the command is to open up the terminal outside of the desktop environment. The last time this happened to me, my friend explained to me that two desktops were running at the same time and a "watcher" program was disabling the second desktop environment while a "checker" was re-enabling the second desktop environment at the speed of the computer clock. My conky reports a 100% CPU usage, though I forgot to check the name of the top running programs. The power block was reporting 95 watts continuous. How do I fix my Mint 16 Desktop crash/freeze after adding a second toolbar and enabling/disabling monitor?


openSUSE Linux Kiosk Setup

Working on setting up a kiosk with openSUSE, where users can only view a single webpage. Obviously open to any Linux distro. Also would prefer to use Gnome. I'm wanting only Firefox to be available (which will be displaying a local webpage), a link on the desktop and the home page to open full screen when booted up and logged in automatically. Just interested in some guidance, or if there are any tools that could be used to 'lock down' the system. Thanks!


How to determine which sd* is usb?

> **Possible Duplicate:**   >  How to know if /dev/sdX is a connected USB or HDD? The output of `ls /dev/sd*` on my system is -               sda  sda1  sda2  sda3  sda4  sda5  sda6  sda7  sdb  sdc  sdc1  sdc2      How should I determine which drive is which?


Find FreeBSD ports that depend on another port

I have a headless FreeBSD server where some port has installed tons of X11-related packages. I would like to find out what these ports are so I can get rid of the unwanted X-related packages. Is there a way to figure this out?


What is the best way to find a list of several strings within a large text file

The short, general question is: In Unix/Linux, what is the best way to find a list of several (about 150) strings within a large text file? I am asking this to all Unix/Linux experts as a general question, in the hopes that I can find a solution that pertains to my particular case: I have a feeling this is going to take a little tinkering. I have a large text file (actually, an MVS dataset) on an IBM Unix System Services (USS) machine-- I believe it is somewhere around 6GB. I also have a list of about 150 5-character identifiers in the format AAAAA that I need to find within this file-- that is, I'd like to extract rows from the file that contain any one of the 150 the specific identifers that I am looking for. The format of each line in the large file is:               00000000000A00000000000000000AAAAA\n      where 0 represents a digit, and A represents an alphanumeric character. The string that I'm searching for is always at the end of the row. Working with datasets seems to be a little awkward in USS, and I am not able to copy it over into the Unix environment because it is too large. The standard Unix utilities don't all operate on datasets (dd for example); however sed, awk, and grep seem to work to some degree (although the command line switches seem to be a bit different). I can grep the dataset as follows:               cat  "//'MVS.DATASET'" | grep -e"LOOKFOR1" -e"LOOKFOR2" -e"LOOKFOR3" > output_to_file.txt      However, it won't allow me to grep for all 150 items on one line; I could split it up and run it several times, but I feel like there should a better way. I tried using a sed script as follows, but I don't know sed at all, and I got an error that said "garbage after command". I saved the following in a file sed-script.txt:               s/AAA01/&/p     s/AAA30/&/p     s/AAA10/&/p     ... etc ...      and then ran `sed -f sed-script.txt "//'MVS.DATASET'"` Again, this failed with "sed: FSUM7294 garbage after command". So, 1. How would one normally tackle this problem in the "average" Unix environment, and 2. Do you have any specific insights to this particular case?


Select code block in vim

Given a code like this:               588          while ($linecounter > 0) {     589             $token = " ";     590             while ($token != PHP_EOL) {     591                 if (fseek($handle, $pos, SEEK_END) == -1) {     592                     $beginning = true;     593                     break;     594                 }     595                 $token = fgetc($handle);     596                 $pos--;     597             }     598             $linecounter--;     599             if ($beginning) {     600                 rewind($handle);     601             }     602         }      The cursor is at the character `=` in the line 590. Which is the most efficient way to select the code block:   1. lines 590-597   2. lines 591-596 (just the inner part)


Why can't I sed two [or more..] empty lines to one empty line? What is the trick?               echo -e "hello\n\n\nhello2" | sed 's/^$\n^$/\n/g'     hello               hello2


What is the :0 terminal in the who command's output?

When I type `who` in my console terminal, I get the following output:               hubert   :0           2014-05-16 21:40 (:0)     hubert   pts/0        2014-05-16 21:46 (:0)      From `info who` I know that both `:0` and `pts/0` should name instances of the terminal. It is clear to me what `pts/0` means but I have no idea how to interpret the first line of the output. What is even more confusing, when I type who `hubert :0`, I get:               hubert   pts/0        2014-05-16 21:46 (:0)


Dovecot: Corrupted index cache file

I received following error message in `/var/mail/mail.err`:               Jun 14 00:03:42 max dovecot: IMAP(bernhard):      Corrupted index cache file /home/bernhard/Mail/.indexes/.imap/INBOX/dovecot.index.cache:      Broken virtual size for mail UID 5618      What is the preferred way to restore the index?


debootstrap error in Ubuntu 13.04 raring

I'm trying to create a file system in Ubuntu with the command:               sudo debootstrap --foreign --no-check-gpg --include=ca-certificates --arch=armhf testing rootfs http://debian.raspbian.com/debian      but it got the following error:               /usr/sbin/debootstrap: 1294: /usr/sbin/debootstrap: cannot create /home/.../rootfs/test-dev-null: Permission denied     E: Cannot install into target '/home/.../rootfs' mounted with noexec or nodev      can anyone help me here?


vaio grub removal after default windows setup

After installing default factory windows xp from VAIO VGN-NR, and hence removing the Ubuntu on its hard drive, the grub does not allow the windows to boot up properly, giving the prompt: "no such partition" and grub rescue appears. The Windows can not be recovered by rescue mode, since the administrator password of newly installed default windows (from hidden drive on the laptop) is not known to me. Booting up with live-Ubuntu and trying to erase the MBR did not help a bit.               dd if=/dev/null of=/dev/sdX bs=446 count=1      I can simply install another windows on it, fixmbr and fixboot it and re- install the original factory windows. But I'm not like that. I want to find a way through, not around. Any suggestion?


What is the difference between `/sbin/ip route` and `/sbin/route`?

Linux comes with two utilities   * `/sbin/route`   * `/sbin/ip route` What is the difference between the two and what is the rule of thumb to use when you decide which one of the two you should use? I know they're both documented in two separate locations,   * `man 8 route`   * `man 8 ip-route`


XBMC crash after selecting "play". Ubuntu 14.04 and 13.0 gotham. Link to crashlog

I have a brand new machine with fresh install of Ubuntu 14.04 and I'm trying to run Gotham 13.0 on it. I've already added the restricted multimedia codecs (just in case) to Ubuntu.                sudo apt-get install ubuntu-restricted-extras      As well as Unrestricted LibavCodec               sudo apt-get install libavcodec-extra      My graphics is AMD/ATI Tahiti (Radeon HD 7970) with a core i7. Here's the XBMC crashlog: http://xbmclogs.com/show.php?id=209365 Here's what's happening: I just download the appropriate PPA's etc. through the XBMC wiki.               sudo add-apt-repository ppa:team-xbmc          sudo apt-get update          sudo apt-get install xbmc      The first time I installed it on this machine, I went through installed Fusion and ran the Hub wizard Template/Setup. Everythings seems good, but when I select Al Jazeera, for example, I click "watch live", and then I get the "working" scroll in the bottom right for few seconds, and then the entire program force closes. The same happens with " The Daily Show" "Youtube" "UsTv Now" etc. I completly uninstalled XBMC               sudo apt-get purge xbmc xbmc-standalone      and started over. This time only installing one add on and trying it out. Still I get the same results. The music add-ons work though. I have this posted a few days on XBMC forums, and no replies yet. I'm not sure if this is an Ubuntu or XBMC issue ,at this point. ![enter image description here](http://i.stack.imgur.com/7y0qj.png)


hydra verification before stopping

I am getting false positives when I try a penetration test on my local service with `hydra`:               hydra -l admin -x 1:8:1 -t 1 -f -vV 127.0.0.1 http-form-post '/login.php:username=^USER^&password=^PASS^:Bad password'       I guess due to the fast rate of requests sometimes my server doesn't deliver the whole page and the part with "Bad password" is missing, so hydra thinks the password worked. Is there a way to tell hydra to verify the password and try it several times with success before stopping the whole pentest? * * * A solution I could imagine: you could write a loop somehow, that stores away the hydra.restore file often, and then if a solution is found try again with that solution and if it doesn't work start over at the point in the wordlist where you stopped - unfortunately the restore file is gone as soon as a solution seems to be found


How to use awk through multiple files?

I want a solution for the general case (N folder) I'm using awk to process a file and extract its content and put it in a variable then echo it: This is the file:               H1 H2 H3 H4 H5 H6 H7 H8 H9     not important     not     not      This is the code:               $value1=awk '/H1/ { print $1}' file     $value2=awk '/H1/ { print $2}' file     $value3=awk '/H1/ { print $3}' file     echo $value1     echo $value2     echo $value3      I get the result:               H1     H2     H3      My question if I have multiple files with the same format (not the exact content, the same format) with the file and which is located in different folders but the same name:               /folder1     file     /folder2     file     /folder3     file      How can I echo the first 3 values of the H1 line but from each file in those folders so I get 9 results?


Can the /home folder in Linux contain anything else but user folders?

Can the /home folder contain anything else but user folders? I have a folder I want to share between Windows and Arch - can it go in the home folder under a name not belonging to any existing user? E.g.               /home       |-/james (my home folder)       |-/shared (folder I want to share)


Fedora 15: em1 recently dissapeared and hostapd no longer serves internet to wirelessly connected devices

I have a laptop running hostapd, phpd, and mysql. This laptop uses an Ethernet connection to connect to the internet and acts as a wireless access point for my workplace's wifi devices. After installing some software and reconnecting my Ethernet elsewhere, my "em1" device is no longer present and wirelessly connected devices can no longer reach the internet. The software I recently installed is: pptp, pptpd, and updated some fedora libraries. I have also recently moved my desk and laptop to another location and thus had to reconnect the Ethernet elsewhere. Wifi devices no longer have access to the internet. Wirelessly connected devices are able to successfully log into the laptop, showing full strength, correct SSID, and uses the proper password. However, when I tried to connect to a site like google, the request times out. The device "em1" also no longer appears on my machine. Running: `# ifup em1` will give me the following output: `ERROR : [/etc/sysconfig/network- scripts/ifup-eth] Device em1 does not seem to be present, delaying initialization.` And running: `# dhclient em1` has the following output: `Cannot find device "em1"` When I run `# dmesg|grep renamed`, I get the following: `renamed network interface eth0 to p4p1`. I've tried to connect to the internet through p4p1 and was successful. However, my wireless devices connected to my laptop are no longer able to connect to the internet. I have uninstalled pptp and pptpd using `# yum erase ...` but the problem still persists. To install pptp I used: `# yum install pptp` To install pptpd I did the following:               # rpm -Uvh http://poptop.sourceforge.net/yum/stable/fc15/pptp-release-current.noarch.rpm     # yum install pptpd      To update my fedora libraries I used:               # yum check-update     # yum update      EDIT: Running `# route` produces the following results:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         10.11.200.1     0.0.0.0         UG    0      0        0 p4p1     10.11.200.0     *               255.255.252.0   U     0      0        0 p4p1     172.16.100.0    *               255.255.255.0   U     0      0        0 wlan0


Is there an easy way to update information in known_hosts when you know that a hosts key has changed?

If a host's operating system has been re-installed and had its public key regenerated sshing to it will of course fail because the new key doesn't match the old one. Is there an easier way to tell ssh that you know that the host's key has changed and that you want it to be updated. I think it feels a bit error-prone to use a text editor or something like sed to remove the offending line.


gksudo not caching credentials

I've built a shell script for mounting ISO images in Nautilus, and it worked fine in earlier versions of Ubuntu. One of the many problems encountered in 11.04 is that `gksudo` doesn't seem to cache the credentials - There are three commands in the script which need to be run as root, but now for every command I get prompted for a password. Sudo privileges are cached when using plain `sudo`, so why not with `gksudo`?


xorg memory leaks

On my desktop Xorg leaks a lot of memory. I use to let this machine on for days (weeks, months ...), but about once a week I'm forced to restart xorg, because it is taking too much memory. Am I the only one affected by this issue? Why does this is happen?   Is it xorg to be _bugged_ , or is it something else (maybe some xorg modules)?   Can I do anything to avoid it? * * * Some more infos: I'm on ArchLinux, kernel 2.6.36, nvidia drivers 260.19.36, gnome 2.32.1. Anyway I've got this issue from a lot of time, like more than one year. * * * Here is how the Xorg process is shown by top after about 9 days of uptime...                PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND     1591 root      20   0  278m 229m 9364 S    2 11.8 244:38.73 Xorg      I've got only a few open windows. 229MB of resident memory looks like a lot to me (and it will keep growing with time). As soon as I reboot Xorg I'll also add process stats at the beginning of its life. * * * Here is as soon as my Gnome desktop gets up:                PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      1573 root      20   0 89508  43m  11m S    1  2.2   0:03.53 Xorg


How to turn my linux laptop into wireless repeater?

**I need to use my laptop to extend the range of my wireless router.** I have a Samsung laptop with FEdora19 installed (but those should be irrelevant for a good answer). My wireless card supports master mode (`iw list` listing includes `AP` mode). The card is:               01:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)      I am trying to follow this resource link, but am getting errors, and my knowledge is too limited to get me through the errors.               [sci@localhost ~]$ su -c "iwconfig wlp1s0 mode master"     Password:      Error for wireless request "Set Mode" (8B06) :         SET failed on device wlp1s0 ; Invalid argument.      Following the Atheros specific advice at the middle of the page:               modprobe: FATAL: Module ath_pci not found.      I am very surprised that the procedure is not trivial, and that a dedicated application doesn't exist. How should I approach this? Further reading is in order, if it is focused on the problem at hand!


How to get list of urls from a URL recursively with filtering

I want to get list of URLs that contains `vimeo.com` from a web site recursively by a command , so that I can pipe it to vimeo_downloader.sh. I prefer to use `wget`, but also I'm happy with other options. ### Example `index.html`               01     02     03     04     05     06      `01.html`               ...     ... src="//player.vimeo.com/video/xxxxxxxxxx?api=1" ...     ...      Likewise `02.html` to `06.html` have a vimeo's URL. How to get all vimeo URLs from `01~06.html`?


copying specific files in directory

I am trying to copy some of the files in a directory. The directory contains following files my current directory is ~/certificate/               drwxrwxr-x 2 ubuntu ubuntu     4096 Oct 16 11:58 apache     -rw-rw-r-- 1 ubuntu ubuntu     5812 Oct 16 11:20 apache.keystore     -rw-rw-r-- 1 ubuntu ubuntu     1079 Oct 16 08:31 csr.txt     -rwxr-xr-x 1 ubuntu ubuntu 36626564 Oct 16 10:08 my.war     drwxrwxr-x 2 ubuntu ubuntu     4096 Oct 16 09:39 tomcat     -rw-rw-r-- 1 ubuntu ubuntu     6164 Oct 16 09:31 tomcat.keystore      I want to copy all files to ~/certs/ except my.war. I have tried following command without success. I do not want to move my.war out of the folder even temporarily.               cp -r ~/certificate/(?!m)* ~/cert/.       Please help me with suitable regular expression or any other tool.


SNAT with network alias IP RHEL 5.5

I have Rehat Enterprise Linux Server Release 5.5(Tikanga) with two interfaces as below   * eth0: with public IP as xxx.xx.64.118   * eth0:0: with public IP as xxx.xx.116.19   * eth1: with private IP as 172.16.23.2 By default my iptable POSTROUTING chain rule is as below:               Chain POSTROUTING (policy ACCEPT)     target      prot  opt source              destination     MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0      which means it has NAT IP as IP of eth0. Now I want a specific host computer(172.16.23.6), connected to eth1, to have source IP as that of eth0:0 (ie. xxx.xx.116.19) while connecting to internet. So I added a rule as below               iptables  -t nat -A POSTROUTING -s 172.16.23.6 -o eth0 -j SNAT --to-source xxx.xx.116.19      Which added new rule above MASQUERADE as show :               Chain POSTROUTING (policy ACCEPT)     target     prot opt source               destination     SNAT       all  --  172.16.23.6       0.0.0.0/0           to:xxx.xx.116.19     MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0      After what I supposed was that the host having IP 172.16.23.6 would have public IP xxx.xx.116.19 when connecting to the internet(checked via whatismyip.com). But it still shows the public IP of eth0(xxx.xx.64.118). The same worked well for Ubuntu. Can anybody please suggest what is the problem ?


Printer is not recognized by CUPS

I have a printer (Product code: PRP-085, Vendor BIRCH), I'm using Fedora 20 KDE (also tested on Ubuntu 13. 10) and CUPS 1. 7. 2 My issue is printer is not recognized by CUPS, the output of `lpinfo -v` is:               network ipps     network lpd     network beh     direct hp     network http     network https     network ipp     network socket     network smb     direct hpfax     network bjnp      I have tried some guides in https://wiki.archlinux.org/index.php/CUPS#Device_node_permissions. I can not find anyways to recognize this device.


How a piped shell programs balance their output/input rates?

> **Possible Duplicate:**   >  Bash while loop and reading from pipe I come from web programming background, and find myself interested in one peculiarity of using a local shell. I understand that when a program reads from file, it can read at whatever rate's necessary. But I'm curious to know, how does it work when a program gets other program's input piped in and can't process it in realtime? A good example would be video encoding. Suppose I point a decoder to video file, then it's output gets piped in as encoder's input. The total size of decoded video is more than ram+swap, so I guess there's no way to have it buffered altogether. I found about read and write calls to stdin and stdout, but I'm interested to know what actually happens when this example's encoder can't cope with all the data at once. Does it somehow informs the decoder about desired rate? Does decoder program needs to be specifically prepared for such a signal and modify it's processing speed accordingly? If not, how does it all gets balanced in the end?


Where should I keep personal files so they are safe across system re-installs?

I want to make sure that at the next system installation/restoration my files are not lost. Using tweakers I can change Window's default folders (e.g. move "My documents" from C: drive to D:). Right now I have Linux Mint 15 Mate installed on partition `/` and the rest of HDD mounted to `/home`. Is this right approach? If yes, how can I move default folders to this partition? If no, what is the best approach?


Log-me-in on Angstrom

Has anyone got Log-me-in Hamachi running on the Angstrom distribution? When I attempt to install it, it tells me I need the lsb package. I googled it and found that it is a package you can get rpm packages for. I tried to install the rpm packages, but obviously on Angstrom they don't work. I then tried to install `rpm2cpio` by installing `busybox` using `opkg`, but `busybox` on `opkg` does not have the program!


How to know why server keeps restarting?

It seems that my server keeps restarting. I want to know why. How can I know when the last time server was rebooted and why?               root     pts/0        139.193.156.125  Thu Aug  8 21:10   still logged in     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 20:38 - 21:11  (00:33)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 20:15 - 21:11  (00:56)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 19:16 - 21:11  (01:55)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 18:56 - 21:11  (02:14)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 18:24 - 21:11  (02:47)     root     pts/1        139.193.156.125  Thu Aug  8 18:16 - crash  (00:07)     root     pts/0        195.254.135.181  Thu Aug  8 18:10 - crash  (00:13)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 17:52 - 21:11  (03:19)     root     pts/0        195.254.135.181  Thu Aug  8 17:38 - crash  (00:13)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 17:08 - 21:11  (04:02)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:58 - 21:11  (04:12)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:45 - 21:11  (04:26)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:35 - 21:11  (04:36)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:27 - 21:11  (04:44)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 15:59 - 21:11  (05:12)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 06:15 - 21:11  (14:56)     root     pts/1        208.74.121.102   Wed Aug  7 06:03 - 06:04  (00:00)     root     pts/1        208.74.121.102   Tue Aug  6 15:34 - 17:40  (02:05)     root     pts/0        139.193.156.125  Tue Aug  6 11:28 - 04:40 (1+17:11)      In Linux is there ANY WAY to know why the system rebooted? Specifically did high load cause it? If not that then What?


Mail queue keep growing

My server keeps running short on inodes due the mail queue getting crazy. First, I assumed I had `postfix` not configured properly, so I switched it off. But, it happened again, last time I did it I had :                 # postsuper -d ALL     postsuper: Deleted: 375122 messages      While I could put a cron to run this every morning, that does not seem to be the optimal solution. What could be the cause of such a behaviour? How can I prevent this too happen?


GTK Frontend for locate

I am a heavy user of the `locate` tool, which is part of the `findutils` package. It's fine to use it on command line, but sometimes I would also like to search for a file (as fast as with `locate`) within my Xfce 4.10 desktop. Is there any nice GTK frontend (or a panel applet) for the `locate` command?


Switch between tabs (panels) in Mint

How to switch between tabs (panels) in any window (i.e. setting windows for keyboard) in Linux Mint? I use `Ctrl`+`Tab` in Windows.


How does reverse SSH tunneling work?

As I understand this, firewalls (assuming default settings) deny all incoming traffic that has no prior corresponding outgoing traffic. Based on Reversing an ssh connection and SSH Tunneling Made Easy, reverse SSH tunneling can be used to get around pesky firewall restrictions. I would like to execute shell commands on a remote machine. The remote machine has its own firewall and is behind an additional firewall (router). It has an IP address like 192.168.1.126 (or something similar). I am not behind a firewall and I know the remote machine's IP address as seen from the Internet (not the 192.168.... address). Additionally, I can ask someone to execute `ssh (something)` as root on the remote machine first. Could anyone explain me, step by step, how reverse SSH tunneling works to get around the firewalls (local and remote machines' firewalls and the additional firewall between them)?   What is the role of the switches (-R, -f, -L, -N)?


SSH: connect through intermediary server in just one step (through forwarded port)

Related question: initiate ssh connection from server to client I have intermediary server with public IP (let it be `SERVER`), and I need to establish connection between two computers (`A` and `B`) without public IP, through this intermediary server. So, to connect from `A` to `B`, I can now do this:               B$ ssh -N -R 2222:localhost:22 server_user@SERVER      and now, from `A`, I can connect to `B` in two steps:               A$ ssh server_user@SERVER     SERVER$ ssh -p 2222 b_user@localhost      Or in one line, but there are two steps anyway:               A$ ssh -t server_user@SERVER "ssh -p 2222 b_user@localhost"      But, I can't connect in just one step, like this:               A$ ssh -p 2222 b_user@SERVER     ssh: connect to host SERVER port 2222: Connection refused      Why is this, and how to make it work? Note: I don't have any firewall at the `SERVER`, so it should accept incoming connection at port `2222`, it seems.


ssh port forward to access my home machine from anywhere

http://serverfault.com/questions/303937/how-to-make-freebsd-box-accessible- from-internet I want to understand this whole process of `port forwarding`. I read so many things but failing to understand the very basic concept of port forwarding it self. What I have: > a freebsd server sitting at my home.   >  netgear router This is what I am trying to achieve:   > to be able to access freebsd server from a windows machine over internet to > be able to open a webbrowser and access internet.   > > > I also want to access this freebsd box from a ubuntu machine that I have. It will be great if someone can please help me. **Edit:0** here is the netgear router setup that I did for portforwarding. ![netgear port forwarding](http://i.stack.imgur.com/KiPhu.png)


Accessing Apache server over the Internet

I'm trying to access my Apache server over the Internet. When I use my external IP to connect from a different system, my router's welcome page is displayed. How can I access the server?


Reverse connection to SSH server

Machine A is connected to the internet and is behind firewall so it cannot receive incoming connections. Machine B is open to the internet. I want to be able to type commands into B and have them execute on A. Except it is A that has to reach out to B to establish the connection before B can send it commands. Can this be done running SSHd on A and plain SSH client on B or do I need a combination of SSHd and SSH client on A (client to establish reverse tunnel pointing to SSHd).


What's ssh port forwarding and what's the difference between ssh local and remote port forwarding

I feel confused about ssh port forwarding and the difference between ssh local and remote port forwarding. Could you please explain them in detail and with examples? Thanks!


Boot Menu Fedora and Window 7

I have install Fedora 20 before, a few days ago , I just install Window 7, and now I can not boot to Fedora because I don't have a boot menu. Is there anyway to recover the Fedora boot menu, is there any free software to do it without using the Fedora CD to recover it.


wget files by pattern only from specified directories recursively

I need to download on an hourly basis (sometimes more frequently), files which are being written in segments of 24 hours. The files I am interested in are in specific subdirectories which I am trying to specify with `-I list` but this doesn't work for some reason. If I don't specify directories the files I need download fine with the `-A acclist` option but I end up with lots of empty directories that are being created because they exist on the host. my current line reads:               wget -np -nH --cut-dirs=X -c -N -r -l 0 \          -I /dir1,/dir2,...,/some_dir -A acclist \          http://hostname/X_sub_directories/      How do I download **only** the files I want and create **only** the directory hierarchy for those files?


Linux equivalent for Windows Startup

**Is there any way to add an application/script to the Linux startup so every time the system is on it executes** [i'm looking for some automated way, user should not add this by cron job or something like that].   Yeah you are right, i want to create a little cute virus :) and also want to know if it is possible.