title: "Wrong version of libnet" when configuring nemesis

text: Whenever I try to configure Nemesis it stops at "checking libnet version....no" and claims I have the wrong version. I have checked my libnet folder to make sure, and I do have the right version. Version 1.0.2a. So why is it believing that I have the wrong version? Configuration session:               dividan-System nemesis-1.4 # ./configure --with-libnet-includes=/usr/nembuild/Libnet-1.0.2a/include --with-libnet-libraries=/usr/nembuild/Libnet-1.0.2a/lib     checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for gawk... gawk     checking whether make sets $(MAKE)... yes     checking build system type... x86_64-unknown-linux-gnu     checking host system type... x86_64-unknown-linux-gnu     checking for style of include used by make... GNU     checking for gcc... gcc     checking for C compiler default output file name... a.out     checking whether the C compiler works... yes     checking whether we are cross compiling... no     checking for suffix of executables...      checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ANSI C... none needed     checking dependency style of gcc... none     checking for gcc option to accept ANSI C... none needed     checking for gcc... (cached) gcc     checking whether we are using the GNU C compiler... (cached) yes     checking whether gcc accepts -g... (cached) yes     checking for gcc option to accept ANSI C... (cached) none needed     checking dependency style of gcc... (cached) none     checking how to run the C preprocessor... gcc -E     checking for egrep... grep -E     checking whether gcc needs -traditional... no     checking for an ANSI C-conforming const... yes     checking for gawk... (cached) gawk     checking for a BSD-compatible install... /usr/bin/install -c     checking whether ln -s works... yes     checking for fabs in -lm... yes     checking for inet_ntoa in -lnsl... yes     checking for socket in -lsocket... no     checking for hstrerror in -lresolv... yes     checking for libnet_build_ip in -lnet... yes     checking for ANSI C header files... yes     checking whether time.h and sys/time.h may both be included... yes     checking for sys/types.h... yes     checking for sys/stat.h... yes     checking for stdlib.h... yes     checking for string.h... yes     checking for memory.h... yes     checking for strings.h... yes     checking for inttypes.h... yes     checking for stdint.h... yes     checking for unistd.h... yes     checking for unistd.h... (cached) yes     checking errno.h usability... yes     checking errno.h presence... yes     checking for errno.h... yes     checking for strings.h... (cached) yes     checking netdb.h usability... yes     checking netdb.h presence... yes     checking for netdb.h... yes     checking limits.h usability... yes     checking limits.h presence... yes     checking for limits.h... yes     checking machine/endian.h usability... no     checking machine/endian.h presence... no     checking for machine/endian.h... no     checking sys/time.h usability... yes     checking sys/time.h presence... yes     checking for sys/time.h... yes     checking sys/param.h usability... yes     checking sys/param.h presence... yes     checking for sys/param.h... yes     checking arpa/inet.h usability... yes     checking arpa/inet.h presence... yes     checking for arpa/inet.h... yes     checking netinet/in.h usability... yes     checking netinet/in.h presence... yes     checking for netinet/in.h... yes     checking libnet.h usability... no     checking libnet.h presence... no     checking for libnet.h... no             ERROR!  Libnet header not found, go get it from        http://www.packetfactory.net/projects/libnet/        or use the --with-libnet-* options, if you have it installed        in unusual place     dividan-System nemesis-1.4 #      Guide I followed exactly - http://insecurety.net/?p=54 After more attempts, the guide stops at "checking for libnet.h" instead of checking the version. I have checked where it is talking about and yes there is a `libnet.h` file in it. `config.log` extracts (full text: http://pastebin.com/dgb4BjBq):               This file contains any messages produced by compilers while     running configure, to aid debugging if configure makes a mistake.          It was created by configure, which was     generated by GNU Autoconf 2.59.  Invocation command line was            $ ./configure --with-libnet-includes=/usr/nembuild/Libnet-1.0.2a/include --with-libnet-libraries=/usr/nembuild/Libnet-1.0.2a/lib          …          configure:5276: checking libnet.h usability     configure:5288: gcc -c -g -O2 -Wall -funroll-loops -pipe  -I/usr/nembuild/Libnet-1.0.2a/include -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/local/include -I/sw/include conftest.c >&5     In file included from conftest.c:70:0:     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:87:8: warning: missing terminating " character [enabled by default]     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:87:2: error: #error "byte order has not been specified, you'll     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:88:1: error: unknown type name 'need'     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:88:1: error: stray '#' in program     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:88:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'define'     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:88:10: error: unknown type name 'define'     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:89:50: warning: missing terminating " character [enabled by default]     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:89:1: error: missing terminating " character     configure:5294: $? = 1     configure: failed program was:     | /* confdefs.h.  */     |      | #define PACKAGE_NAME ""     | #define PACKAGE_TARNAME ""     | #define PACKAGE_VERSION ""     | #define PACKAGE_STRING ""     | #define PACKAGE_BUGREPORT ""     | #define PACKAGE "nemesis"     | #define VERSION "1.4"     | #define LINUX 1     | #define HAVE_LIBM 1     | #define HAVE_LIBNSL 1     | #define HAVE_LIBRESOLV 1     | #define HAVE_LIBNET 1     | #define STDC_HEADERS 1     | #define TIME_WITH_SYS_TIME 1     | #define HAVE_SYS_TYPES_H 1     | #define HAVE_SYS_STAT_H 1     | #define HAVE_STDLIB_H 1     | #define HAVE_STRING_H 1     | #define HAVE_MEMORY_H 1     | #define HAVE_STRINGS_H 1     | #define HAVE_INTTYPES_H 1     | #define HAVE_STDINT_H 1     | #define HAVE_UNISTD_H 1     | #define HAVE_UNISTD_H 1     | #define HAVE_ERRNO_H 1     | #define HAVE_STRINGS_H 1     | #define HAVE_NETDB_H 1     | #define HAVE_LIMITS_H 1     | #define HAVE_SYS_TIME_H 1     | #define HAVE_SYS_PARAM_H 1     | #define HAVE_ARPA_INET_H 1     | #define HAVE_NETINET_IN_H 1     | /* end confdefs.h.  */     | #include <stdio.h>     | #if HAVE_SYS_TYPES_H     | # include <sys/types.h>     | #endif     | #if HAVE_SYS_STAT_H     | # include <sys/stat.h>     | #endif     | #if STDC_HEADERS     | # include <stdlib.h>     | # include <stddef.h>     | #else     | # if HAVE_STDLIB_H     | #  include <stdlib.h>     | # endif     | #endif     | #if HAVE_STRING_H     | # if !STDC_HEADERS && HAVE_MEMORY_H     | #  include <memory.h>     | # endif     | # include <string.h>     | #endif     | #if HAVE_STRINGS_H     | # include <strings.h>     | #endif     | #if HAVE_INTTYPES_H     | # include <inttypes.h>     | #else     | # if HAVE_STDINT_H     | #  include <stdint.h>     | # endif     | #endif     | #if HAVE_UNISTD_H     | # include <unistd.h>     | #endif     | #include <libnet.h>     configure:5317: result: no     configure:5321: checking libnet.h presence     configure:5331: gcc -E  -I/usr/nembuild/Libnet-1.0.2a/include -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/local/include -I/sw/include conftest.c     In file included from conftest.c:36:0:     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:87:8: warning: missing terminating " character [enabled by default]     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:87:2: error: #error "byte order has not been specified, you'll     /usr/nembuild/Libnet-1.0.2a/include/libnet.h:89:50: warning: missing terminating " character [enabled by default]     configure:5337: $? = 1     configure: failed program was:     | /* confdefs.h.  */     |      | #define PACKAGE_NAME ""     | #define PACKAGE_TARNAME ""     | #define PACKAGE_VERSION ""     | #define PACKAGE_STRING ""     | #define PACKAGE_BUGREPORT ""     | #define PACKAGE "nemesis"     | #define VERSION "1.4"     | #define LINUX 1     | #define HAVE_LIBM 1     | #define HAVE_LIBNSL 1     | #define HAVE_LIBRESOLV 1     | #define HAVE_LIBNET 1     | #define STDC_HEADERS 1     | #define TIME_WITH_SYS_TIME 1     | #define HAVE_SYS_TYPES_H 1     | #define HAVE_SYS_STAT_H 1     | #define HAVE_STDLIB_H 1     | #define HAVE_STRING_H 1     | #define HAVE_MEMORY_H 1     | #define HAVE_STRINGS_H 1     | #define HAVE_INTTYPES_H 1     | #define HAVE_STDINT_H 1     | #define HAVE_UNISTD_H 1     | #define HAVE_UNISTD_H 1     | #define HAVE_ERRNO_H 1     | #define HAVE_STRINGS_H 1     | #define HAVE_NETDB_H 1     | #define HAVE_LIMITS_H 1     | #define HAVE_SYS_TIME_H 1     | #define HAVE_SYS_PARAM_H 1     | #define HAVE_ARPA_INET_H 1     | #define HAVE_NETINET_IN_H 1     | /* end confdefs.h.  */     | #include <libnet.h>     configure:5357: result: no     configure:5392: checking for libnet.h     configure:5399: result: no          ## ---------------- ##     ## Cache variables. ##     ## ---------------- ##          ac_cv_build=x86_64-unknown-linux-gnu     ac_cv_build_alias=x86_64-unknown-linux-gnu     ac_cv_c_compiler_gnu=yes     ac_cv_c_const=yes     ac_cv_env_CC_set=     ac_cv_env_CC_value=     ac_cv_env_CFLAGS_set=     ac_cv_env_CFLAGS_value=     ac_cv_env_CPPFLAGS_set=     ac_cv_env_CPPFLAGS_value=     ac_cv_env_CPP_set=     ac_cv_env_CPP_value=     ac_cv_env_LDFLAGS_set=     ac_cv_env_LDFLAGS_value=     ac_cv_env_build_alias_set=     ac_cv_env_build_alias_value=     ac_cv_env_host_alias_set=     ac_cv_env_host_alias_value=     ac_cv_env_target_alias_set=     ac_cv_env_target_alias_value=     ac_cv_exeext=     ac_cv_header_arpa_inet_h=yes     ac_cv_header_errno_h=yes     ac_cv_header_inttypes_h=yes     ac_cv_header_libnet_h=no     ac_cv_header_limits_h=yes     ac_cv_header_machine_endian_h=no     ac_cv_header_memory_h=yes     ac_cv_header_netdb_h=yes     ac_cv_header_netinet_in_h=yes     ac_cv_header_stdc=yes     ac_cv_header_stdint_h=yes     ac_cv_header_stdlib_h=yes     ac_cv_header_string_h=yes     ac_cv_header_strings_h=yes     ac_cv_header_sys_param_h=yes     ac_cv_header_sys_stat_h=yes     ac_cv_header_sys_time_h=yes     ac_cv_header_sys_types_h=yes     ac_cv_header_time=yes     ac_cv_header_unistd_h=yes     ac_cv_host=x86_64-unknown-linux-gnu     ac_cv_host_alias=x86_64-unknown-linux-gnu     ac_cv_lib_m_fabs=yes     ac_cv_lib_net_libnet_build_ip=yes     ac_cv_lib_nsl_inet_ntoa=yes     ac_cv_lib_resolv_hstrerror=yes     ac_cv_lib_socket_socket=no     ac_cv_objext=o     ac_cv_path_install='/usr/bin/install -c'     ac_cv_prog_AWK=gawk     ac_cv_prog_CPP='gcc -E'     ac_cv_prog_ac_ct_CC=gcc     ac_cv_prog_cc_g=yes     ac_cv_prog_cc_stdc=     ac_cv_prog_egrep='grep -E'     ac_cv_prog_gcc_traditional=no     ac_cv_prog_make_make_set=yes     am_cv_CC_dependencies_compiler_type=none     am_cv_prog_cc_stdc=          ## ----------------- ##     ## Output variables. ##     ## ----------------- ##          ACLOCAL='${SHELL} /usr/nembuild/nemesis-1.4/missing --run aclocal-1.6'     AMDEPBACKSLASH='\'     AMDEP_FALSE='#'     AMDEP_TRUE=''     AMTAR='${SHELL} /usr/nembuild/nemesis-1.4/missing --run tar'     AUTOCONF='${SHELL} /usr/nembuild/nemesis-1.4/missing --run autoconf'     AUTOHEADER='${SHELL} /usr/nembuild/nemesis-1.4/missing --run autoheader'     AUTOMAKE='${SHELL} /usr/nembuild/nemesis-1.4/missing --run automake-1.6'     AWK='gawk'     CC='gcc'     CCDEPMODE='depmode=none'     CFLAGS='-g -O2 -Wall -funroll-loops -pipe'     CPP='gcc -E'     CPPFLAGS=' -I/usr/nembuild/Libnet-1.0.2a/include -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/local/include -I/sw/include'     DEFS=''     DEPDIR='.deps'     ECHO_C=''     ECHO_N='-n'     ECHO_T=''     EGREP='grep -E'     EXEEXT=''     INCLUDES=''     INSTALL_DATA='${INSTALL} -m 644'     INSTALL_PROGRAM='${INSTALL}'     INSTALL_SCRIPT='${INSTALL}'     INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'     LDFLAGS=''     LIBOBJS=''     LIBS='-lnet -lresolv -lnsl -lm  -L/usr/nembuild/Libnet-1.0.2a/lib '     LN_S='ln -s'     LTLIBOBJS=''     MAKEINFO='${SHELL} /usr/nembuild/nemesis-1.4/missing --run makeinfo'     OBJEXT='o'     PACKAGE='nemesis'     PACKAGE_BUGREPORT=''     PACKAGE_NAME=''     PACKAGE_STRING=''     PACKAGE_TARNAME=''     PACKAGE_VERSION=''     PATH_SEPARATOR=':'     SET_MAKE=''     SHELL='/bin/bash'     STRIP=''     VERSION='1.4'     ac_ct_CC='gcc'     ac_ct_STRIP=''     am__include='include'     am__quote=''     bindir='${exec_prefix}/bin'     build='x86_64-unknown-linux-gnu'     build_alias=''     build_cpu='x86_64'     build_os='linux-gnu'     build_vendor='unknown'     datadir='${prefix}/share'     exec_prefix='NONE'     host='x86_64-unknown-linux-gnu'     host_alias=''     host_cpu='x86_64'     host_os='linux-gnu'     host_vendor='unknown'     includedir='${prefix}/include'     infodir='${prefix}/info'     install_sh='/usr/nembuild/nemesis-1.4/install-sh'     libdir='${exec_prefix}/lib'     libexecdir='${exec_prefix}/libexec'     localstatedir='${prefix}/var'     mandir='${prefix}/man'     oldincludedir='/usr/include'     prefix='/usr/local'     program_transform_name='s,x,x,'     sbindir='${exec_prefix}/sbin'     sharedstatedir='${prefix}/com'     sysconfdir='${prefix}/etc'     target_alias=''          ## ----------- ##     ## confdefs.h. ##     ## ----------- ##          #define HAVE_ARPA_INET_H 1     #define HAVE_ERRNO_H 1     #define HAVE_INTTYPES_H 1     #define HAVE_LIBM 1     #define HAVE_LIBNET 1     #define HAVE_LIBNSL 1     #define HAVE_LIBRESOLV 1     #define HAVE_LIMITS_H 1     #define HAVE_MEMORY_H 1     #define HAVE_NETDB_H 1     #define HAVE_NETINET_IN_H 1     #define HAVE_STDINT_H 1     #define HAVE_STDLIB_H 1     #define HAVE_STRINGS_H 1     #define HAVE_STRINGS_H 1     #define HAVE_STRING_H 1     #define HAVE_SYS_PARAM_H 1     #define HAVE_SYS_STAT_H 1     #define HAVE_SYS_TIME_H 1     #define HAVE_SYS_TYPES_H 1     #define HAVE_UNISTD_H 1     #define HAVE_UNISTD_H 1     #define LINUX 1     #define PACKAGE "nemesis"     #define PACKAGE_BUGREPORT ""     #define PACKAGE_NAME ""     #define PACKAGE_STRING ""     #define PACKAGE_TARNAME ""     #define PACKAGE_VERSION ""     #define STDC_HEADERS 1     #define TIME_WITH_SYS_TIME 1     #define VERSION "1.4"          configure: exit


title: can't decompress .tgz using gunzip

text: I was able to archive and compress a folder with the following command:               tar -cvfz example2.tgz example1      I then removed the example1 folder and tried to unpack the archive using this command:               tar -xvfz example2.tgz       and tried               tar -zxvf example2.tgz       Niether of these commands worked. The error returned was:               gzip: example2.tgz: not in gzip format     tar: This does not look like a tar archive     tar: Exiting with failure status due to previous errors      It clearly used gzip compression since I passed tar the `z` qualifier in the initial command. What am I doing wrong? I am on Ubuntu 14.0.4


title: after ssh login and during apt-get update, is it wrong to suddenly logout?

text: there's a raspberry pi that I ssh logged into it works fine and then I `sudo apt-get update`ed it. during the process, I just turned off the terminal thinking that the update process should be running on its own... but after that, I tried to login again and it doesn't work. Was it wrong for me to suddenly log out like that? How can I make my raspberry do stuff even though I'm logged out?


title: Difference between ctime 1 and ctime +1 in find command

text: If I run the following command:               find . -name "*.jar" -type f -ctime +1      I get no results back, whereas if i run:               find . -name "*.jar" -type f -ctime 1      I get results.


title: How to hold <Caps Lock> when it sends a single event on key press and release?

text: Using the keyboard of a Macintosh IIcI (~1990) with remapping of the `Caps Lock` key to `Ctrl` in Xorg, it is impossible to use it, as holding it does not send events persistently. When holding other keys like `Ctrl` and reading from the keyboard's `/dev/input/`... device, I see data is constantly sent to the computer; but when holding `Caps Lock`, a single event is sent, then nothing, until I release `Caps Lock`, when another single event is sent. After testing with my previous keyboard I was able to confirm it does not have the same behavior; holding its `Caps Lock` key makes it send data constantly until the key is released. Is there a way I can configure Xorg to take this into account to allow me to remap my keys and save my pinky from Emacs? * * * In case someone asks, this is not related to the Xmodmap configuration; that works.


title: How to find and replace files contents that match a pattern?

text: Suppose we have a folder named _Project_. I would like find each file in the folder that contains the pattern `&$` at the function call. For example should replace:               AnyFunction(&$arg);      with               AnyFunction($arg);      Where `AnyFunction` is an unknown function that matches the pattern. I need this to try to solve this php problem. If possible I would like too, if a function matchs the pattern, its declaration changes too:               function AnyFunction(&$arg)      How can I perform this?


title: Copy/Backup all files except the most recent through scp

text: I have a program that is running on multiple machines and which is writing the results to `~/data/machine_name/`, each time the results file exceeds 1MB the program moves on and write to a new file. (All machines have the same directory architecture). I want to do an automatic backup of these files in case one of the machines fail. Knowing that the most recent accessed file is the one being written by the program, and hence, I would copy all the old files except this one. The next time the backup job fires, the most recent file omitted in the previous backup will be included and so on.. Right now I am using only a simple `scp` command, which copies even the file being open by the remote machine. Is there anyway to achieve this? a command line utility or a script for such a job?


title: tr command not working with octal sequences

text: I need to strip non-ASCII characters off a file. I was using the command - ` /usr/xpg4/bin/tr -cd '\0-\177' `<non-ASCII_file.dat` >ASCII_file.dat` Though it worked in the past, it is not working now. It is now stripping off all the alphabet along with non-ASCII characters. The only characters being left in the ASCII file are numbers and special characters in the ASCII set. OS is Solaris 9. What could be causing this issue? Is the Octal range being interpreted incorrectly? Something to do with my environment?


title: Grub2 RAID /boot

text: I'm using Gentoo on my HomeServer. My HDDs are raid1 mirrored with mdadm. My problem is how to boot the /boot partition correct?               /dev/md1 consists of /dev/sdc2 & /dev/sdd2 mounted on /boot      In my `grub.cfg` I have the uuid of `/dev/md1` but at boot time the array is of course not ready. simplest way would be to un-raid the /boot partitions, but that is not what I want to do. so, how do i find out the UUID of the raid members? `ls -l /dev/disk/by-uuid` only shows me the uuid of `/dev/md1`. And when I unraid the disks, I cannot mount them to get their UUID `mount: unknown filesystem type 'linux_raid_member'` so how can I let Grub2 boot those disks, will it be able to determine the contents before they are in raid? (they are in fact ext2). I should maybe add that I use gpt partition tables, therefore I have a small partition `/dev/sdc1 and /dev/sdd1` on both drives to host the bios_grub partition. those are not raided atm. As pointed out in the comments below Gilles' answer my problem persists. Grub won't find the device, telling me               error: no such device: 9f81a-(device uuid)-5580.     entering rescue mode...     grub rescue>       afterwards I added the lines               insmod part_msdos     insmod part_gpt     insmod raid     insmod mdraid      to my grub.cfg, just above the line where root is defined `root='(md0)'` I still get the same error. I did some more research and i really guess its an error related to the uuids:               # grub-probe -d --target=fs_uuid /dev/md1     9f81a35d-0813-481f-9ae0-e4fba57c5580     # blkid     /dev/sdc2: UUID="11adb545-0e80-61d1-61f6-565f18e8c3f0" UUID_SUB="88826c5e-d12b-307d-6e54-556d1ebb2458" LABEL="livecd:1" TYPE="linux_raid_member"     /dev/sdd2: UUID="11adb545-0e80-61d1-61f6-565f18e8c3f0" UUID_SUB="15150fb2-5066-edba-d39b-08b63219453c" LABEL="livecd:1" TYPE="linux_raid_member"     /dev/md1: UUID="9f81a35d-0813-481f-9ae0-e4fba57c5580" TYPE="ext2"     (I cut away the other drives here)      as you can see both partitions have the same UUID, so I edited the UUID of the drives in my grub.cfg and did `grub-install /dev/sdx` again, but I still get the error with the "old" /dev/md1 UUID.


title: TP-Link WN321G USB wlan  in VirtualBox Ubuntu guest

text: I am trying wifi usb stick tp-link wn321g @ ubuntu 11.04 (in virtualbox), so far I was able to scan the air, connect to a wpa2 network and do some basic information gathering using airodump-ng Now when it comes to packet injection, seems that firmware is not capable. to be more specific, I am locking the wlan0 to a specific channel for `aireplay- ng` and it ignores me completely, setting channel to -1               root@delta:~# iwconfig wlan0 channel 1     root@delta:~# airmon-ng start wlan0 1     Interface       Chipset         Driver          wlan0           Unknown         rt2800usb - [phy0]                                     (monitor mode enabled on mon0)     root@delta:~# iwconfig wlan0     wlan0 IEEE 802.11bg  ESSID:off/any           Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated           Tx-Power=20 dBm           Retry  long limit:7   RTS thr:off   Fragment thr:off           Encryption key:off           Power Management:on      airodump-ng -c1 mon0      CH  1 ][ Elapsed: 8 s ][ 2011-07-27 17:22 ][ fixed channel mon0: -1           BSSID              PWR RXQ  Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID                BSSID              STATION            PWR   Rate    Lost  Packets  Probes          root@delta:~# aireplay-ng -0 1 -a 00:26:18:D8:CC:89 -c 00:1E:65:7B:81:34 mon0     17:43:56  Waiting for beacon frame (BSSID: 00:26:18:D8:CC:89) on channel -1     17:44:02  mon0 is on channel -1, but the AP uses channel 1     root@delta:~#      I have tried different modules ( rt2800usb, rt2870sta ) rt2800usb works for airodump-ng and information gathering, rt2870sta works with `wpa_supplicant` for network connection - not the other way around for some reason. Does anyone have an experience with this wifi card / chipset / firmware and successfully used aircrack suite for pen testing? below some specific data :               root@delta:~# uname -a     Linux delta 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:05:41 UTC 2011 i686 i686 i386 GNU/Linux          root@delta:~# lsusb     Bus 002 Device 002: ID 80ee:0021     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub          Bus 001 Device 002: ID 148f:2070 Ralink Technology, Corp. RT2070 Wireless Adapter     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     root@delta:~# lsmod |grep ^rt     rt2800usb              22184  0     rt2800lib              52239  1 rt2800usb     rt2x00usb              19915  1 rt2800usb     rt2x00lib              47674  3 rt2800usb,rt2800lib,rt2x00usb


title: Fedora 15 address collision on Compaq CQ41?

text: I keep getting an address collision warning at boot time, between ACPI and Video Rom. If I add `acpi=off` to `grub.conf` the error goes away, but then I have no power management (battery icon, proper shutdown, etc.). Anyone know the cause or a possible solution?


title: Reading SIM data via file managers using USB datamodem

text: How to browse a GSM SIM card's filesystem in Linux / nautilus / pcmanfm filemanager, and read the files with suitable editors ? There is one related post: Howto read SMS stored on a SIM card? But this is related to reading the card via mobiles and synching it with computers. Could you direct me to appropriate links please? I have already read the link: How to access a SIM card programatically? The post contains no link related to my issue. The links are on different issue, useful for Windows computers. I use Linux systems only The SIM card is inserted into my Huawei USB datamodem e1731. Can I read it from there? I do not wish to buy a SIM card reader. Further, while researching about various linux packages that could potentially do this I came across the following: comex, Monosim, SIM_Brush, google_talk, minicom pysim_reader, wammu_gammu I tried with minicom but failed to make much headway. I have not read about anyone who has implemented these packages with success. My ultimate plan is to use the USB-datacard I have to make and receive phone calls using a close-talk microphone, and read and write SMSes. I posted my idea in the Debian and Knoppix forums, but have not heard anything positive. If Mobile-> Internet access Modem, why not datacard->mobile Voice call with softmodem, tel_Line & close-talk headset If Mobile-> Internet access Modem, why not datacard->mobile Is voice call possible through USBmodem with minicom? Then there is also Asterisk and Amatisoft. Since I have very little bandwidth at present I can't experiment with these packages. I have knoppix and I could experiment with it (that way I ensure that my system is not damaged while experimenting), had I some bandwidth. I have just about enough to read and write emails and posts in forums. I have had a detailed discussion with Amatisoft when I requested the company to have the live CD file released via rsync or torrent file. The company said that it does not wish to compromise security running rsync in their server. The company has remained mum on the torrent file. In the meanwhile, the amatixoffice was downloaded with kget last month, but the file is corrupt (minor). Had there been rsync running in their servers I would have had no difficulty in downloading the minor correction, and not the entire file once again! The same logic applies with bittorrent server. I was even contacted by one person from Portugal who wanted me to install and test the PBX system in tandem with him, but I could not help him because of the corrupt file that I have from Amatisoft. I did huge research last month, but the bandwidth issue is a dampener. Please read this page: http://www.voip-info.org/wiki/view/Asterisk+Install+CDROM Again, my limited bandwidth is not allowing me to research further. I also researched on servers that allow remote upload and syncing, the potential candidates being those listed in the Wikipedia, and these companies were sent emails. My idea was to upload the amatisoft file remotely and then repair the erroneous portion of the file in my download directory. It is found that none supports remote upload unless they are integrated with the host system, in this case Amatisoft. Also, asterisk has its own live CD at their website http://www.asterisk.org/downloads/asterisknow , but I am stuck. Could someone bridge the gap between Brian's post and mine, i.e., fulfilling my objective with my equipments such as the Huawei e1731 Datacard and the BSNL SIM card using the wisdom from Brian's post?


title: Taking file ownership when file and directory is readable/writable

text: ### I got some files in directory:               drwxrws-wt 2 me      mygroup  4,0K 10.1. 12:34 .     -rw-r----- 1 someone mygroup  10G  10.1. 11:22 someonesfile      `me` and `someone` are regular users without supplementary groups. ### How to take ownership of that file using `me` account? If `me` do:               $ chown me someonesfile     chown: doing bla bla bla: permission denied      However `me` can " _change_ " ownership by replacing file with new one:               cp someonesfile myfile && mv -f myfile someonesfile`      So my main question is if there is any easier ( _cheaper_ ) way to change file ownership in described environment without using root account or other privilege elevations. Basically I wanted to know if `me` can somehow take advantage of directory permissions to somehow reset ownership/permissions without making copy of whole file. I've also noticed that editing file with `vim` and forcing overwrite with `:w!` will change owner of file, is that same as doing `cp && mv`? At least `touch someonesfile` will fail with permission denied.


title: Unix > overwrite command?

text: I'm doing a shell command (such as `sh run.sh > log.txt`). How do you overwrite the file each time (so each time I run it `log.txt` doesn't get appended) I'm doing this in a python script and I'm checking the log file each time for a specific number (and I don't want the numbers to get added onto the `log.txt`, just replaced)


title: How to partition my hard-drive to be used for dual OS?

text: I'm using HP G42 laptop with 320GB hard-drive and 4 GB memory. I'm pretty sure that, it can be used for dual OS(Windows 7 & fedora) Currently, I'm using only Windows 7, but, I need to install fedora. * * * This my hard-drive: Local disk(C) = 50GB(Windows 7 installed here)   Local disk(D) = rest(249GB) (Data) Both are formatted with NTFS file system. I need to access the data which I saved in _Local Disk D_ from both OSs. How can I do this?


title: Is the VG encrypted with dm_crypt OR luks? How to find out?

text: A system is installed with an encrypted VG. How can I find out if they used dm_crypt or luks? It's running Fedora 14, so I think it's one of those. Or are they the same thing?


title: Reinstall mysql keeping db intact

text: basically on my vps somehow mysql.sock vanished in tmp as well lib folder. I want to reinstall mysql but will db get lost?


title: Start QT Application on bootup on an Embedded Linux Device (Beaglebone Black)

text: Below is picture of the display on bootup. Expected display is overwritten by Angstrom screen ![enter image description here](http://i.stack.imgur.com/OaGb9.jpg) Expected Display ![enter image description here](http://i.stack.imgur.com/zbWUx.jpg) Application is been started as a service. Below is the content of the service file               [Unit]     Description=QTAccelerometer GUI     After=systemd-user-sessions.service          [Service]     WorkingDirectory=/home/root/projects/qt-projects     ExecStart=/home/root/projects/qt-projects/QTAccelerometer -qws     SyslogIdentifier=QTAccelerometer     Restart=on-failure     RestartSec=5          [Install]     Alias=display-manager.service      Below are the other options tried without success               [Install]     WantedBy=multi-user.target     WantedBy=graphical.target      The system sometimes boots up as expected. When the issue occurs the expected screen splashes followed by the Angstrom screen. Then the dynamic widget update the screen but the static information is not visible. Any thoughts as to how to fix this issue? **References**   * Creating Ångström System Services on BeagleBone Black   * What Is Systemd and How It Works (Part 1)


title: Explain the output of -D rates in GNU find

text: I did               ~/pythonsource1/python2.6-2.6.5$ find -D rates . -type d      and got               Predicate success rates after completion:     [need type] -type d [0.4] [280/4350=0.0643678] -a [0.4] [280/4350=0.0643678] -print [1] [280/280=1]       What does the `[0.4]` indicate ?


title: SSH Do not connect even with publickeys installed

text: I'm trying to connect two servers. I got the id_dsa.pub key from user john from server A and paste into authorized_keys of user mike from server B. Then I tried to connect from server A to server B using mike login, however it is still asking for password. In mike's .ssh/ directory I have only `authorized_keys` file, like this:               bash-3.00$ ls -l     total 16     -rw-------   1 mike users    2422 Oct  8 14:47 authorized_keys     bash-3.00$      The admin guy from server B assured that having only this file it's enough to let us connect at B server. Am I missing something? Thanks guys! EDIT: Here is the Log:               johndbb3:/home/john/.ssh> ssh -vvv mike@fpnld1.uk.db.com     Sun_SSH_1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Rhosts Authentication disabled, originating port will not be trusted.     debug1: ssh_connect: needpriv 0     debug1: Connecting to fpnld1.uk.db.com [10.240.1.215] port 22.     debug1: Connection established.     debug1: identity file /home/john/.ssh/identity type -1     debug3: Not a RSA1 key file /home/john/.ssh/id_rsa.     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug3: key_read: no key found     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug2: key_type_from_name: unknown key type '-----END'     debug3: key_read: no key found     debug1: identity file /home/john/.ssh/id_rsa type 1     debug3: Not a RSA1 key file /home/john/.ssh/id_dsa.     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug3: key_read: no key found     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug3: key_read: no space     debug2: key_type_from_name: unknown key type '-----END'     debug3: key_read: no key found     debug1: identity file /home/john/.ssh/id_dsa type 2     debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1.3     debug1: no match: Sun_SSH_1.1.3     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-Sun_SSH_1.1     debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc     debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib     debug2: kex_parse_kexinit: none,zlib     debug2: kex_parse_kexinit: i-default     debug2: kex_parse_kexinit: i-default     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible     Unknown code 0     )     debug1: SSH2_MSG_KEXINIT sent     debug3: kex_reset_dispatch -- should we dispatch_set(KEXINIT) here? 0 && !0     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc     debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib     debug2: kex_parse_kexinit: none,zlib     debug2: kex_parse_kexinit: i-default     debug2: kex_parse_kexinit: i-default     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: kex_parse_kexinit: gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc     debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib     debug2: kex_parse_kexinit: none,zlib     debug2: kex_parse_kexinit: ar-EG,ar-SA,bg-BG,ca-ES,cs-CZ,da-DK,de,de-AT,de-CH,de-DE,de-LU,el-CY,el-GR,en-AU,en-CA,en-GB,en-IE,en-MT,en-NZ,en-US,es,es-AR,es-BO,es-CL,es-CO,es-CR,es-EC,es-ES,es-GT,es-MX,es-NI,es-PA,es-PE,es-PY,es-SV,es-UY,es-VE,et-EE,fi-FI,fr,fr-BE,fr-CA,fr-CH,fr-FR,fr-LU,he-IL,hr-HR,hu-HU,is-IS,it,it-IT,kk-KZ,lt-LT,lv-LV,mk-MK,mt-MT,nb-NO,nl-BE,nl-NL,nn-NO,pl,pl-PL,pt-BR,pt-PT,ro-RO,ru,ru-RU,sh-BA,sk-SK,sl-SI,sq-AL,sr-CS,sv,sv-SE,tr-TR,ar,ca,cz,da,el,et,fi,he,hu,lt,lv,nl,no,no-NO,no-NY,nr,pt,sr-SP,sr-YU,tr,i-default,uk-UA     debug2: kex_parse_kexinit: ar-EG,ar-SA,bg-BG,ca-ES,cs-CZ,da-DK,de,de-AT,de-CH,de-DE,de-LU,el-CY,el-GR,en-AU,en-CA,en-GB,en-IE,en-MT,en-NZ,en-US,es,es-AR,es-BO,es-CL,es-CO,es-CR,es-EC,es-ES,es-GT,es-MX,es-NI,es-PA,es-PE,es-PY,es-SV,es-UY,es-VE,et-EE,fi-FI,fr,fr-BE,fr-CA,fr-CH,fr-FR,fr-LU,he-IL,hr-HR,hu-HU,is-IS,it,it-IT,kk-KZ,lt-LT,lv-LV,mk-MK,mt-MT,nb-NO,nl-BE,nl-NL,nn-NO,pl,pl-PL,pt-BR,pt-PT,ro-RO,ru,ru-RU,sh-BA,sk-SK,sl-SI,sq-AL,sr-CS,sv,sv-SE,tr-TR,ar,ca,cz,da,el,et,fi,he,hu,lt,lv,nl,no,no-NO,no-NY,nr,pt,sr-SP,sr-YU,tr,i-default,uk-UA     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: mac_init: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_init: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: Peer sent proposed langtags, ctos: ar-EG,ar-SA,bg-BG,ca-ES,cs-CZ,da-DK,de,de-AT,de-CH,de-DE,de-LU,el-CY,el-GR,en-AU,en-CA,en-GB,en-IE,en-MT,en-NZ,en-US,es,es-AR,es-BO,es-CL,es-CO,es-CR,es-EC,es-ES,es-GT,es-MX,es-NI,es-PA,es-PE,es-PY,es-SV,es-UY,es-VE,et-EE,fi-FI,fr,fr-BE,fr-CA,fr-CH,fr-FR,fr-LU,he-IL,hr-HR,hu-HU,is-IS,it,it-IT,kk-KZ,lt-LT,lv-LV,mk-MK,mt-MT,nb-NO,nl-BE,nl-NL,nn-NO,pl,pl-PL,pt-BR,pt-PT,ro-RO,ru,ru-RU,sh-BA,sk-SK,sl-SI,sq-AL,sr-CS,sv,sv-SE,tr-TR,ar,ca,cz,da,el,et,fi,he,hu,lt,lv,nl,no,no-NO,no-NY,nr,pt,sr-SP,sr-YU,tr,i-default,uk-UA     debug1: Peer sent proposed langtags, stoc: ar-EG,ar-SA,bg-BG,ca-ES,cs-CZ,da-DK,de,de-AT,de-CH,de-DE,de-LU,el-CY,el-GR,en-AU,en-CA,en-GB,en-IE,en-MT,en-NZ,en-US,es,es-AR,es-BO,es-CL,es-CO,es-CR,es-EC,es-ES,es-GT,es-MX,es-NI,es-PA,es-PE,es-PY,es-SV,es-UY,es-VE,et-EE,fi-FI,fr,fr-BE,fr-CA,fr-CH,fr-FR,fr-LU,he-IL,hr-HR,hu-HU,is-IS,it,it-IT,kk-KZ,lt-LT,lv-LV,mk-MK,mt-MT,nb-NO,nl-BE,nl-NL,nn-NO,pl,pl-PL,pt-BR,pt-PT,ro-RO,ru,ru-RU,sh-BA,sk-SK,sl-SI,sq-AL,sr-CS,sv,sv-SE,tr-TR,ar,ca,cz,da,el,et,fi,he,hu,lt,lv,nl,no,no-NO,no-NY,nr,pt,sr-SP,sr-YU,tr,i-default,uk-UA     debug1: We proposed langtags, ctos: i-default     debug1: We proposed langtags, stoc: i-default     debug1: Negotiated lang: i-default     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: Remote: Negotiated main locale: C     debug1: Remote: Negotiated messages locale: C     debug1: dh_gen_key: priv key bits set: 129/256     debug1: bits set: 1594/3191     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug3: check_host_in_hostfile: filename /home/john/.ssh/known_hosts     debug3: check_host_in_hostfile: match line 120     debug3: check_host_in_hostfile: filename /home/john/.ssh/known_hosts     debug3: check_host_in_hostfile: match line 119     debug1: Host 'fpnld1.uk.db.com' is known and matches the RSA host key.     debug1: Found key in /home/john/.ssh/known_hosts:120     debug1: bits set: 1573/3191     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug3: kex_reset_dispatch -- should we dispatch_set(KEXINIT) here? 0 && !0     debug1: newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: done: ssh_kex2.     debug1: send SSH2_MSG_SERVICE_REQUEST     debug2: service_accept: ssh-userauth     debug1: got SSH2_MSG_SERVICE_ACCEPT     debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive     debug3: start over, passed a different list gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive     debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password     debug3: authmethod_lookup gssapi-keyex     debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password     debug3: authmethod_is_enabled gssapi-keyex     debug1: Next authentication method: gssapi-keyex     debug2: we did not send a packet, disable method     debug3: authmethod_lookup gssapi-with-mic     debug3: remaining preferred: publickey,keyboard-interactive,password     debug3: authmethod_is_enabled gssapi-with-mic     debug1: Next authentication method: gssapi-with-mic     debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible     Unknown code 0     )     debug2: we did not send a packet, disable method     debug3: authmethod_lookup publickey     debug3: remaining preferred: keyboard-interactive,password     debug3: authmethod_is_enabled publickey     debug1: Next authentication method: publickey     debug1: Trying private key: /home/john/.ssh/identity     debug3: no such identity: /home/john/.ssh/identity     debug1: Trying public key: /home/john/.ssh/id_rsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive     debug1: Trying public key: /home/john/.ssh/id_dsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive     debug2: we did not send a packet, disable method     debug3: authmethod_lookup keyboard-interactive     debug3: remaining preferred: password     debug3: authmethod_is_enabled keyboard-interactive     debug1: Next authentication method: keyboard-interactive     debug2: userauth_kbdint     debug2: we sent a keyboard-interactive packet, wait for reply     debug2: input_userauth_info_req     debug2: input_userauth_info_req: num_prompts 1     Password:          johndbb3:/home/john/.ssh>


title: Why can I not copy a direcotry from *nix to a mounted smbfs share on Windows 7?

text: I've mounted a Windows 7 directory on my FreeBSD box via smbfs:               mount     ...     //ROOT@BARYONYX/GVKV on /usr/home/gvkv/win (smbfs)      but for some reason when I try to copy a directory:               cp .vim /win       I get the following error:               cp: .vim is a directory (not copied).      I can copy files just fine. Is there something special about directories and smb shares?


title: extract fields from "tail -f" of a syslog stream

text: Example line from syslog file:     Aug  1 10:25:50 10.10.10.1 id=firewall sn=XXXX time="2012-08-01 14:35:18 UTC" fw=x.x.x.x pri=6 c=1024 m=537 msg="Connection Closed" f=11 n=195273698 src=x.x.x.x:60246:X3: dst=x.x.x.x:443:X6:host.domain.com proto=tcp/https sent=181793 rcvd=649678      I want to do a               $ tail -f /var/log/log.log | SOMETHING      That will return               "src=x.x.x.x dst=x.x.x.x"      In plainspeak I want to be able to extract specific fields from text. I do not want to select these fields based on a field number (position in the line) because the order of things can change slightly with the system generating this file, so it doesn't work. Open to suggestions but would prefer it to be a one-liner.


title: The n mode on "iwlist wlan0 scan"

text: I know how to determine if scanned AP uses B or G mode, but how to know (using "iwlist wlan0 scan") it uses N protocol ? if I use "iw dev wlan0 scan" and see if the cell has a "HT capabilities" block. OK. "iw dev wlan scan" partially works, but i can not get data about the signal quality, Channel mode (is it master or ad hoc) and security options. I need to find all security algorithm options in one command. Is there other options? like third party commands? Any source code hack suggestions?


title: How to kill both process and subprocess?

text: I asked a question to know how to get multiple lines of message from Python's subprocess module. The problem is that in the course of testing, I had to kill the python process that runs gnuchess process. Using ^c in the command line seems to kill the python process, but not the gnuprocess. For killing gnuchess, I get the pid with **ps aux | grep gnuchess** and run **kill -9 PID**. Are there other methods to kill both python and gnuchess process?


title: Display a menu of files names and let the user select a file by entering a number

text: I have created a script that allows the user to select a file by copying and pasting that file. Then perform a grep on that file. I want to know is it possible to put a number in front of each files in the directory so the user will only have to type a number. What I have tried:   * Do `ls -l` then `ls | wc -l` then have the user select the corresponding file number, no luck.   * Next, `ls -i`, tried to perform a grep using the node number for that file, no luck.


title: Where can I find historical documentation for bash?

text: Are there any sources for documentation for old versions of some GNU software, in this case particularly `bash`? I have a embedded system that is running bash 3.00.16, and I'm trying to do some shell scripting, and things are not working as expected (no process substitution, apparently). Furthermore, since this is an embedded system, I don't have `man` or `info`, so there is really no help available on the system. Is there anywhere I can view the documentation for older versions of `bash` as they were for various releases?


title: Splitting WavPack files when the .cue file and .wv file have different names?

text: If a directory contains an album encoded as one large .wv file and a .cue file, splitting the entire album into individual .flac tracks is a simple task: `$ cuebreakpoints foo.cue | shnsplit -o flac foo.wv` What I'd like to know is how to split a file where the names don't match up, e.g.: 'foobar.wv' and 'foo.cue'. If I attempt this I get this error message:               shnsplit: warning: none of the builtin format modules handle input file: [foobar.wv]     shnsplit: error: cannot continue due to error(s) shown above      Do I need to alter the .cue file? Because simply renaming 'foobar.wv' to 'foo.wv' prior to splitting doesn't seem to work for me. Or is there something wrong with the `wavpack` package? PS: I didn't know how to tag this question properly. Sorry 'bout that. **Some more info** To be clear, I should point out that the text inside the .cue files points to the appropriate .wv files. **Yet more info** I'm having a bit of luck, for whatever reason, by decompressing the .wv to .wav and then altering the .cue file accordingly. Not ideal but it's working so far.


title: Is it possible to use one SSH key per account for each account on a given remote server?

text: Suppose I have a number of accounts on a server called _SERVER_. Let's call them _ACCOUNT1_ , _ACCOUNT2_ and _ACCOUNT3_. Suppose I don't want to have to type in the password for the account each time I ssh into one of those accounts from my local computer, _DESKTOP_. Obviously, I could use a single ssh key pair to allow myself passwordless login to all three accounts, but is it possible to use a different ssh key pair for each account?


title: Send file to opened editor using command line

text: Recently I found out a new very useful command. It is: > gnome-open or > xdg-open or just > open on mac. It opens file or directory in by default specified program. But, in the event that I need to open a file in an already running redactor (I mean send the file to a running processes somehow) I have no solution. I wonder if there is any way to achieve that or if it is possible to write a script that can do that. For example if I want to send it to an already running instance of eclipse. Kind of drag-and-drop through commandline.


title: Setting primary monitor in XFCE?

text: I have to monitors:               ------   ------     |VGA-1| |HDMI-1|     ------  --------      for some reason VGA-1 defaults to the primary monitor. Now this is what I have tried to fix this:   1. Go to settings edit and set primary on HDMI-1 to True   2. This: Fedora primary monitor selection   Now it seems it did a trick since HDMI-1 is primary according to "xrandr --current". However the panel is still on the left (VGA-1) monitor and I'm not sure that my HDMI-1 is primary at all. Is this a bug or I'm doing something wrong here?


title: Extract graphs from PDFs

text: I have a situation where I need to extract images from lots of PDF files and display them on a website. My PDFs have "regular" images as well as lots of graphs. I used pdf2xml and it pulls out the images in jpeg, ppm, pbm and vec formats. I see the "regular" images being extracted (for the most part) as jpeg/ppm/pbm, but I don't see the graphs being there - and so I am guessing that pdf2xml is storing them as .vec files. So the question is how to I get my graphs? I used `convert` that comes with imagemagick to convert .vec to jpeg/png etc but to no avail.


title: File manager that shows bit rate for mp3 files (Part 2)

text: A couple of hours ago I asked this question: File manager that shows bit rate for mp3 files. Since I am new to this site I cannot make comments on it, so I cannot ask for additional help and am forced to create this new thread. To summarize what I said: I use Fedora 20, use Thunar File Manager, and am looking for a file manager which, when viewing files in detailed-list-mode, has a column for the bit rate of the mp3 files so I don't have to go song by song to find out if they are 128kbps or 320kbps. A user answered that Nautilus has the feature, but when I downloaded it I found mine lacks the column. So I wonder if anybody know why is this and how can I fix it? Thanks.


title: Ricoh Aficio SP 100su E

text: After installing a Ricoh Aficio SP 100su E printer (it does scanning as well), I've tried a tenth of the GDI and PCL (5e/6) generic and Ricoh drivers without any success. I've learned from Ricoh that this printer uses GDI standard... but these drivers don't seem to work. No errors occur, but no pages are printed out. Has anybody succeeded to print under Linux with this one?


title: How to use keyboard instead of mouse middle-click for copy/paste?

text: > **Possible Duplicate:**   >  Pasting X selection (not clipboard contents) with keyboard Is there a shortcut for copy-paste under X? I'd like to use the keyboard for pasting.


title: RandR not recognizing monitor

text: I just plugged my EeePC to a Sony BRAVIA KDL-32EX710. Such TV supports resolutions up to 1920x1080, but RandR only let me use resolutions from 640x480 to 1024x768. In order to use full resolution I have to manually add a new mode to RandR at any boot.   * Why does this happen?   * Is there any clean way to let RandR know of this monitor? (cleaner than `xrandr --newmode`, `xrandr --addmode`)


title: Conflict? dpkg, apt, apt-get, aptitude, and synaptic

text: So, I ssh into a (very) remote Ubuntu 10.4 server to do some admin and web dev+design. And I was looking through the various package manager options. There's a **lot.** The big ones are dpkg, apt, apt-get, aptitude, and synaptic. I don’t remember where I got the idea, but I seem to remember that each of these is basically building on top of its predecessors, so I kind of assumed that if I do some stuff in one tool, then do some more stuff in another tool, it wouldn’t cause any conflicts. (And I haven’t noticed any so far.) But then I saw some dotfiles/dot-directories in my home directory and started to think more about it. Are these just storing configuration information for each tool’s “front end”? Or are they all tracking package management activities separately? Separate would be bad. ☺ Is this safe?


title: How to set the TMOUT in Putty

text: I'm working in Linux. My connection to PuTTY times out very quickly and I need to have it remain active as long as I wish. I set the `TMOUT` in my Linux `.profile` but that has not seemed to make any difference. How do I set `TMOUT` or whatever for PuTTY?


title: Reinstalling all Debian packages

text: I killed by mistake a dpkg process running in the background and I would like to reinstall all packages to be sure everything is allright. First, I tried to get a list of all packages and reinstall them               dpkg --get-selections | grep -v deinstall | awk '{print $1}' > list.log     apt-get install --reinstall $(cat list.log)      But there are messages like :               E: Couldn't configure pre-depend debconf:i386 for console-setup:i386, probably a dependency cycle.      I tried `apt-get -f install`, without success. As a last resort, I reinstalled all programs which failed the checksums :               dpkg -l | grep ^ii | awk '{ print $2 }' | xargs debsums -s -a      What should I do to reinstall everything ? **Edit :** Problem solved. The issue was something else (see the comments). I understand it's something to avoid with Debian though.


title: how to get network QoS statistics in linux kernel?

text: Is there a way to get the bandwidth, delay, jitter collision, error rate and loss rate of a certain link through the interface on a local machine? let's say my machine is connected to a network via two interfaces, one wireless and the other ethernet. I want to compare the quality of these two links through these measurements. Is there any way to get these measurements in the Linux kernel? (v. 3.5.0)


title: Is there any other way to restrict USB storage?

text: I have been using `/etc/modprobe.d/blacklist.conf` to restrict USB storage but all employees are given root permissions, so they are removing restriction very easily. What I'm looking for is is there any other way to restrict USB storage usage (which is more hard to undo)? I'm using ubuntu12.04 LTS.


title: &> redirection not working correctly

text: Please see the following shell transcript:               $ ls     input.txt  test-amp-gt.sh  test-both-2.sh  test-both.sh  test-gt.sh          $ cat input.txt     input file          $ cat test-gt.sh     #! /bin/sh     cat input.txt > /dev/null && echo "DEBUG >"          $ ./test-gt.sh     DEBUG >          $ cat test-amp-gt.sh     #! /bin/sh     cat input.txt &> /dev/null && echo "DEBUG &>"          $ ./test-amp-gt.sh     DEBUG &>     $ input file     ^C     $               $ cat test-both.sh     #! /bin/sh     cat input.txt > /dev/null && echo "DEBUG >"     echo "***"     cat input.txt &> /dev/null && echo "DEBUG &>"          $ ./test-both.sh     DEBUG >     ***     DEBUG &>     $ input file     ^C     $          $ cat test-both-2.sh     #! /bin/sh     cat input.txt &> /dev/null && echo "DEBUG &>"     echo "***"     cat input.txt > /dev/null && echo "DEBUG >"          $ ./test-both-2.sh     DEBUG &>     ***     input file     DEBUG >     $      It was not clear to me as to why the redirect &> to /dev/null is apparently not working properly when the plain > is working fine. That is, in running test-amp-gt.sh, the contents of the text file should not have been output but they are. test-both-2.sh shows an even more curious behaviour of the &> -- the text should not have been output at all, but not only is it being output, but it is output _after_ the output of the echo command on the next line! Why is this?


title: Socksify like program for Fedora?

text: I need a program that allows me to pass an application through a socks server, even if the program does not have native socks support. Under Ubuntu I can use socksify for this. What can I use under Fedora?      Thank you!


title: System beep not working in TigerVNC

text: I just upgraded my Gentoo Linux computer (where I'm running Xvnc from TigerVNC 1.0.90 (1.1 beta 1) compiled myself against xorg-server 1.9.5), and I'm no longer getting any bell sounds, just silence. (In particular, when I hit Ctrl-G in Emacs.) This used to work before the upgrades. (I upgraded quite a lot of things, unfortunately, so I'm not really sure which one caused it.) I double-checked my viewer settings, and "Beep when requested" is checked. I do get beeps when they're generated by a program on my local computer, so it must be the server that isn't sending beep requests. How can I fix this?


title: Command substitution in Shell Script

text: 511@ubuntu:~/Unix$ cat pass          hellounix     file1          #!/usr/bin     echo "Enter File Name"     read file     if [ -f $file ]      then         echo "File Found with a Name $file\n"         echo "File Content as below\n"         count=0         val=0         while read line             do             val=$("$line" | wc -c)             echo "$line -->Containd $val Charecter"                     count=$((count+1))             done < $file         echo "Total Line in File : $count"     else          echo "File Not Found check other file using running script"     fi      Output :               511@ubuntu:~/Unix$ sh digitmismatch.sh     Enter File Name     pass     File Found with a Name pass          File Content as below          digitmismatch.sh: 1: digitmismatch.sh: hellounix: **not found**     hellounix -->Containd 0 Charecter     digitmismatch.sh: 1: digitmismatch.sh: file1: **not found**     file1 -->Containd 0 Charecter     Total Line in File : 2     ==============================================================      Can anyone help me find out why the value of `wc -c` is not assigned to the variable `val`. If possible please share some good links for the same.


title: How can I automatically restart gnome-shell coming out of suspend mode?

text: So, due to an issue with gnome-power-manager, gnome-shell, and my nvidia card, I'm left in the awkward position of coming out of suspension/sleep with my graphics broken. This problem resolves itself if I'm able to use the Alt + F2 command line to restart gnome-shell. However, sometimes, I'm unable to actually access that menu, and I have to do it blindly with the broken graphics. Rather than switching to the power-eating nouveau drivers, I thought I'd just try to replicate the functionality of               r      or               restart      in the Alt + F2 menu in a script and have it execute upon recovering from suspend. Any advice/ideas? I don't really know where to start. (Alternately, if you've got another workaround/solution..?) edit: these guys are discussing the same problem: https://bbs.archlinux.org/viewtopic.php?pid=932527


title: How to use a defined local IP instead of external one

text: I have a Gentoo Linux server. Server is connected to two networks: internal and external.               Internal network ip: 192.168.1.200     External network ip: 192.168.0.2      If I'm trying to make request from server to itself, it uses external network IP. Connecting to nginx using Wget gives me this log record:               server ~ # tail -n 1 /var/log/nginx/error_log     192.168.0.2 - - [27/Aug/2014:19:04:42 +0300] "GET / HTTP/1.1" 200 5 "-" "Wget/1.14 (linux-gnu)"      Despite that I connecting directly to 192.168.1.200:               server ~ # wget http://192.168.1.200/      Routing table (metric is higher on external network, but seems ignored): **ip route show**               server ~ # ip route     192.168.0.0/30 dev wan  scope link  metric 20      192.168.1.0/24 dev lan  scope link  metric 10       **ip route get** :               server ~ # ip route get 192.168.1.200     local 192.168.1.200 dev lo  src 192.168.1.200          cache <local>       How can I get this machine to connect using 192.168.1.200 to itself, instead of 192.168.0.2?


title: Some keys on keyboard map to numbers instead

text: I'm running Leenux 5.1 from a USB stick using unetbootin. It works ok, except my keyboard is messed up -- pressing `k` results in a `2` instead (the `2` key also types a `2`). How could this happen?


title: Prompt for sudo password and programmatically elevate privilege in bash script?

text: I'm currently working on a bash script that installs and sets up various programs on a stock Linux system (currently, Ubuntu). Because it installs programs and copies a number of files to various folders that require elevated privileges, I've already done the standard "I need elevated privileges"-and- exit. However, I would like, if possible, to be able to prompt the user for their sudo password and elevate the script's privileges automatically if the user doesn't run the script command with sudo (such as launching it from the GUI file manager), without the user having to restart the script. As this is designed to run on stock Linux installs, any option that modifies the system won't work for my purposes. All options need to be contained to the script itself. Is this possible within Bash? If so, what's the best (secure, yet concise) way to do this?


title: Checking & Installing files in yum

text: I'm a beginner picking up RHEL... To check if some packages are present , i will type :               yum check <packages_name>      And then install by typing               yum install <packages_name>      Is there a way/cmd to check the files & install only those that are present ?


title: More sophisticated file command for deep inspection?

text: Sometimes it seems that the standard `file` command (5.04 on my Ubuntu system) is not sophisticated enough (or I am just using it wrong, which could well be). For example when I run it on an `.exe` file, and I am quite positive that it contains some archive, I would expect output like this:               $ improved-file foo.exe     foo.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit              .zip archive included (just use unzip to extract)      Other issues:   * It doesn't detect concatenations of different formats   * It doesn't detect common file formats, e.g. .epub, which is just a .zip container with some standardized .xml files etc. inside (`file` displays 'data') An example of such a .exe file containing an archive - I guessed some archive- formats and tried the corresponding unpack-commands with a trial'n'error approach - which worked in the end - but I would rather prefer a more auto- inspection oriented workflow.


title: change entire directory tree to lower-case names

text: I'm working on a website conversion. The files as they were linked and served from the web server were case insensitive. But, I've made a dump of the site on my linux system and I'm writing scripts to migrate data. The problem is that I'm running into case sensitivity problems between link strings in the pages and the actual word case on the file system. For instance, a page might have a link like `<a href='/subfolder/PageName.asp'>` while the actual file is `/subfolder/pagename.asp`. Likewise with images -- `<img src='spacer_sm.gif'>` might be `Spacer_Sm.gif`. So my thought is to change all directory and filenames to their lower-case equivalents for the site download. How do I do this (and might there be a better way?) Even if there are unix commands that have case-insensitve switches, I'm using php, so not all of the filesystem commands there have options for case sensitivity.


title: Disable loading of Touchpad

text: I am currently trying to fix an Advent 4211 Netbook (a rebranded MSI Wind) - and whenever I use the touchpad the mouse (even an external USB mouse) stops working - when I run xev it does not register any mouse events. I wanted to prevent the system from loading a driver for the touchpad or disable it all together - is there a way to do this? I just want to be able to 'touch' the touchpad without breaking my external mouse as well. The running distro is open suse 11.04 lxde.


title: Sleep until next occurrence of specific time

text: I need a series of commands or a single command that sleeps until the next occurrence of a specific time like "4:00" occurs. How would I do that? The `at` command or a cronjob is not a option because I must not leave the script I'm currently in. The specific case I am talking about is a script running in screen. It is very important that I do not stop the execution of the script by the script itself because there are store many important variables which are needed at some point of the script. The script is not always supposed to be executed in a regular matter. It just needs to be executed at a specific time. It would be very benificial if the script would have to create any files or any other tasks such as cronjobs or other screens. This is simply a question of design. I just had an awsome idea:               difference=$(($(date -d "4:00" +%s) - $(date +%s)))          if [ $difference -lt 0 ]     then         sleep $((86400 + difference))     else         sleep $difference     fi      Do you have any better ideas? _More information will be added if requested!_


title: Scripting `rm` and `rm -i`

text: I want to create a script that whenever there are more than three files being removed, it invokes `rm -i` by default. I know it will go in initialization files but can't seem to get it working. So far:               if [$file -ge 3]; then       rm -i        exit 0      else       rm     exit 1


title: Running program as root without using sudo with normal user account

text: Is there a way to force to run program as root (with normal user) when there's no sudo on the machine (and can't be added)?


title: Debian linux installation cannot play sound

text: I am trying to get my Linux installation to play musix. I have debian linux. The contents of /etc/debian_version are: 6.0.2 I cannot seem to get any sound to play from my speakers and after looking through forum postings, I have hit a brick wall. lspci | grep Audio gives the following:               02:00.0 PCI bridge: Creative Labs [SB X-Fi Xtreme Audio] CA0110-IBG PCI to PCIe Bridge     03:00.0 Audio device: Creative Labs [SB X-Fi Xtreme Audio] CA0110-IBG     0a:00.1 Audio device: ATI Technologies Inc Cypress HDMI Audio [Radeon HD 5800 Series]      When I attempt to run the speaker-test command I the following error:               Playback open error: -16,Device or resource busy      So I look for the process which might be blocking the soundcard: lsof | grep snd (command taken from some forum). Once the process has been killed, I get the following error:               Write error: -5,Input/output error     xrun_recovery failed: -5,Input/output error     Transfer failed: Operation not permitted      I dont know what else to do. Can anyone guide me in the correct direction? Much appreciated


title: What's the easiest way to make a list of most common words in a list?

text: Say I have a bunch of textfiles containing fiction, non-fiction, newspaper articles, &c (random examples of text in a given language.) I want a frequency list of the given words, most common word first. I could write some C code to do this, but if there's a faster way to do this, I'd like to know it. (When I say faster, I mean coding time, not run time.)


title: Split an existing prompt command line in a few lines

text: I understand I can type `\` `enter` at the end of a `bash` command line to continue that command in another line. But how can I split a **prompt** command line — that has already been fully typed — into two? For example, how can I break this line right before `then` without having to cut the remainder off and type it all over again?               $ if true; then ls; fi


title: How to put isolinux on an sd card

text: Hey I need to put the isolinux bootloader on an sd card but how do I properly do that?


title: Using USB 3 controller with Linux 2.6.x

text: I have a laptop that has an USB controller and an SD card which I believe connected to USB3. I need to do some development on a Linux version 2.6 which doesn't support USB3. Can I use USB 3 controller in USB 2 mode? I am not interested in supporting USB 3 on my linux, just be able to read/write to my SD card (or any Flash drive) using my Linux system. I am using Linux in a virtual environment.


title: Rsync --bwlimit not working

text: I am currently using rsync to transfert large file from a host to another. I would like to limit the debit for this transfert. After reading the man page I found the option --bwlimit which is expecting a KB/s value. I want to limit the transfert to arround 100Mbit/s So I used the following settings :               rsync --progress -v --bwlimit=10000 --temp-dir=/tmp srv:/tmp/* /tmp/      But this doesn't seems to be respected according to the output of rsync :               file.sql.gz        570851702 100%   33.90MB/s    0:00:16 (xfer#5, to-check=34/39)     file.sql.gz         11195140 100%    7.45MB/s    0:00:01 (xfer#6, to-check=33/39)     file.sql.gz         51439169 100%   19.41MB/s    0:00:02 (xfer#7, to-check=32/39)     file.sql.gz            34022 100%    1.55MB/s    0:00:00 (xfer#8, to-check=31/39)     file.sql.gz          2305698 100%    6.96MB/s    0:00:00 (xfer#9, to-check=30/39)     file.sql.gz          2152942 100%    2.73MB/s    0:00:00 (xfer#10, to-check=29/39)     file.sql.gz         86655633 100%   19.33MB/s    0:00:04 (xfer#11, to-check=28/39)     file.sql.gz       3614476032  40%   34.82MB/s    0:02:28      If I'm not wrong : 19.33MB/s ~= 154Mbit/s So what is wrong here ? PS : rsync version 3.0.6 protocol version 30 Thanks for your help !


title: No make target "uImage" with Buildroot 2013.05

text: After enabling Linux Kernel option and setting the Kernel binary format to uImage, I always get the following error: make[1]: _*_ No rule to make target `uImage'. Stop. My buildroot configuration is almost the default one. Any idea why it doesn't work anymore? (in an older revision it worked without errors)


title: Elegantly get list of descendant processes

text: I would like to get a list of all the processes that descend (e.g. children, grand-children, etc) from $pid. This is the simplest way I've come up with: `pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ /g" |sed "s/\s\s*/ /g"` Is there any command, or any simpler way to get the full list of _all_ descendant processes? Thanks!


title: How to reset password on an encrypted fs?

text: I've got a laptop which I haven't used since the last summer vacation: I did put Debian 7 on it and used Debian's feature to fully encrypt the disk, besides a tiny bootloader (or a tiny partition) I guess (not too sure which encryption this is nor how to find out). I _do_ know the password of the encrypted filesystem so the system boots, but I'm stuck the login prompt: I did forgot my password(s). Seen that I know the password of the encrypted filesystem, I take it I can boot from a Live CD (or even maybe from the Debian install CD?) and somehow "mount" the encrypted partition. If that's the case, can someone explain me how to do this? (knowing that I've never mounted an encrypted partition / filesystem manually)


title: Help writing bash function as one-line alias

text: How do I write this as an alias?               p() {         DIR=~/projects/$@         pushd "$DIR"     }      This is as far as I got, but it's piping stdin to pushd instead of xargs:               alias p="xargs printf ~/projects/%s | pushd"      It's probably better as a function, but I feel like I would learn something by knowing how to write it on one line and get the piping correct. Thanks!


title: Timer in bash script not accurate when using it with longer times

text: #!/bin/bash          # get user input     ZENITY1=$(zenity --entry --text '  1m:    60s\n  5m:   300s\n10m:   600s\n15m:   900s\n20m: 1200s\n25m: 1500s\n30m: 1800s\n35m: 2100s\n40m: 2400s\n45m: 2700s\n50m: 3000s\n55m: 3300s\n   1h: 3600s' --entry-text "Input only int in seconds!" --title "Timer")          # put starting date in variable     STARTTIME=$(date)          # audit/check user input     WAITINGTIME=$(echo $ZENITY1 | egrep "[0-9]{1,}" -o)     if [ "$WAITINGTIME" == "" ]; then exit 1; fi          # main stopwatch     for i in `seq $WAITINGTIME -1 1`; do echo $i | osd_cat -A left -p top -i 100 -c black -d 1; done          # time expired message     zenity --info --text="Time expired@\n$(date)\n\nStarted@\n$STARTTIME"      So this is the script that I have on my desktop. If I need to warn somebody for e.x.: "please warn me after 15 minutes". But if I use it in a longer time, e.x.: 12 hours it's not very accurate! it could get ~10 minutes difference to the real time... :\ Why is it?


title: IO and other shell commands when a program is not started by a terminal

text: I have several launchers on my desktop for various programs, and there is a "run in a terminal" setting for those launchers. When I check that setting, the program runs from a terminal, and logs its output there. I suppose that it could read `stdin` from the terminal too. However: what happens to IO when the program is not ran by a terminal? **Also, what happens when I execute system (shell) commands from a program like that?** Is there a "background" shell that runs those programs? Or does every program get its shell through which it interfaces with the rest of the system?


title: Apache install on Debian: configuring CGI

text: I installed CGI via the package manager and enabled the mod, but two hours later I still cant get it to work. My `/etc/apache2/sites-available/default` is:               <VirtualHost *:80>         ServerAdmin webmaster@localhost              DocumentRoot /var/www         <Directory />             Options FollowSymLinks             AllowOverride None         </Directory>         <Directory /var/www/>             Options Indexes FollowSymLinks MultiViews             AllowOverride None             Order allow,deny             allow from all         </Directory>              <IfModule mod_alias.c>             ScriptAlias /cgi-bin/ /var/www/cgi-bin/                  <Directory /var/www/cgi-bin/>                 AllowOverride None                 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch                 Order allow,deny                 Allow from all             </Directory>         </IfModule>              ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/          <Directory "/usr/lib/cgi-bin">             AllowOverride None             Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch             Order allow,deny             Allow from all         </Directory>              ErrorLog ${APACHE_LOG_DIR}/error.log              # Possible values include: debug, info, notice, warn, error, crit,         # alert, emerg.         LogLevel warn              CustomLog ${APACHE_LOG_DIR}/access.log combined          </VirtualHost> CGI is enabled. When I browse to `mydomain.com/cgi-bin/` it goes to `/usr/lib/cgi` (I believe) instead.               root@zeus:~# a2enmod cgi     Module cgi already enabled     root@zeus:~# apt-get install php5-cgi     Reading package lists... Done     Building dependency tree     Reading state information... Done     php5-cgi is already the newest version.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     root@zeus:~# sudo service apache2 restart     [....] Restarting web server: apache2[Wed Apr 23 20:20:28 2014] [warn] The ScriptAlias directive in /etc/apache2/sites-enabled/000-default at line 29 will probably never match because it overlaps an earlier ScriptAlias.     apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName     ... waiting [Wed Apr 23 20:20:29 2014] [warn] The ScriptAlias directive in /etc/apache2/sites-enabled/000-default at line 29 will probably never match because it overlaps an earlier ScriptAlias.     apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName     . ok


title: How many packages does RHEL 6 provide?

text: I'd like to know how many binary and source packages Red Hat provides with their current RHEL 6.4 Release.


title: What audited server programs are shipped in a default OpenBSD install?

text: OpenBSD has a process by which they audit programs by doing a "comprehensive file-by-file analysis of every critical software component". Which OpenBSD programs have been audited? Is there a list? I know `httpd`, `ftpd`, and `sshd` have been audited, but I can't find a comprehensive list


title: How to install GTK3 in Centos 6.2

text: I have Centos 6.2 and I want to install GTK3 to be able to install gitg. I looked up on Google, and couldn't find anything useful. The thing is people suggest I need to install GTK3 by manually compiling it. But there is a big list of dependencies (and these dependencies also have dependencies I need to mess with, which is a PITA). Any better suggestions/ideas?


title: Install a .deb completely 'by hand'

text: So, I recently acquired a brand new Nokia N900 phone off of an online auction site for a fairly reasonable price. The N900 is a Linux phone, and it came out a long time ago, but it's only just now within my budget. I've spent the past day struggling with it. Its version of `apt` is particularly frustrating. The point I'm at now is, I can't get `dpkg` to properly configure a package because of how some guy at Nokia decided the phone shouldn't have any files whatsoever in `/usr/share/doc`. Apparently. And the `\--configure` of this particular package demands that a file be put into `/usr/share/doc` and then "optified", which is a Nokia Linux term I don't really understand, but seems mainly to have to do with treating `/opt/maemo` as if it were the root directory when it comes to certain types of files. Needless to say, this documentation can not be "optified"... I don't really care why, I just want to be able to:   * Decompress the `.deb` file myself.   * Look at the script that tells `dpkg` where to put things.   * _Modify the script and/or move those files around myself._   * Do whatever else is necessary so that the right files are in the right place, _myself_.   * _Inform the list of packages that this package has been 'installed'._   * Get on with my life, knowing a lot more about `.deb`s than I currently do.


title: Why is my X11 app's save dialogue suddenly defaulting to "Recently Saved" in Places sidebar?

text: I make a lot of text files using a basic text editor (in the F15 with Xfce DE I use Leaf). Recently the save dialogue is defaulting the "Places" sidebar to "Recently Used" where before it was always my home directory. This adds an extra step to my routines, because you can't save to "Places". And for the same reason the change is obvious, real, and aggravating.


title: Impossible to log out from OpenSuSE's KDE menu

text: I'm running OpenSuSE 12.1 with the KDE desktop on a test machine. The "logout" menu entry in the KDE menu does not seem to do anything. I am not aware of changing any KDE settings that might be relevant. How can I find out the cause of this behaviour, and how can I remedy it?


title: Simple feed aggregation server

text: I’m looking for a program that runs as daemon, downloads Atom and RSS feeds at least every minute, and provides a paginated Atom feed of all entries of all feeds through a simple HTTP server. It should also retain deleted entries. A useful extra would be to be able to label feeds, as in Google Reader, so that each label gets its own aggregate feed. If you don’t know of such a program or know that it probably doesn’t exist, please let me know if you think there are any principle hurdles, because if not, I would queue it up as a project of my own. The use cases are similar to that of services like Google Reader. I follow a larger number of RSS and Atom feeds and want to avoid having to regularly synchronize the list between multiple computers and my smartphone. On my smartphone, I also want to save traffic. In addition to those use cases, I need a high update rate, so I can react in a timely fashion, and to catch entries that are quickly deleted again, and I don’t want to have to leave one of my computers running non-stop either.


title: Cleaning log files under linux

text: I am using a kvm ubuntu 10.04 virtual machine to test some features of a kernel module. I grep through the `/var/log` files to observe the kernel messages about that module. To start from a clean state, I remove log files containing older messages by executing `rm -rf /var/log/*` and then rebooting the virtual machine. However, after I reboot, the new log files still contain those old log messages. It takes about 5-6 cycles of deleting files and rebooting virtual machine to finally get rid of those log file messages. Why is this happening? Is there an easier way to cleanup log files?


title: Create Zip for each subfolder but containing only matched files

text: I am trying to figure out how to create a zip file for each subfolder containing only files that match my criteria. For instance I have:               Folder1     Folder2     Folder3      Each folder contains the same set of files but the filenames in each are slightly different, but the extensions are always the same. I would like to zip the .shp, .shx, .qpj, .prj and .dbf in each folder. Each folder would be its own zip file. I would rather not store the actual folder name other than as the name of the zip file. I have tried:               find . -type d | xargs -I {} zip -r {}.zip {}      This creates each zip file but would zip every file not just the ones with the extensions I would like, it also stores the folder name in the zip.               find . -type d | xargs -I {} zip -r {}.zip {}'/'*.shp {}'/'*.shx {}'/'*.dbf {}'/'*.prj {}'/'*.qpj       The above does nothing other than gives errors that there is nothing to do. Hopefully my poor attempts give a better idea of what I'm trying to do. Any help appreciated.


title: Is there any way to test out PS1 Bash Prompts before committing them?

text: I'd like to mess with my Bash prompt, but I'd like to do so in a way that doesn't corrupt my already extant one. I could just comment it out, but is there a way to test it either with an online tool or a CLI tool?


title: Unzipping certain archives works on Windows but not on Linux

text: I've asked a few people and just thought about asking it here. We get sent files from an international company for design work in a zip format. Well when I run a script to unzip the files in the terminal, I receive a zip error **only** in Linux. We can test, unzip, browse, and modify the files with 7zip and winzip all day. When 7zip or Winzip is ran they do not indicate any security, too. Terminal error:               compressed WinNT security missing (-7 bytes)      I've searched everywhere and find no solution or correction on this. One collegue suggested, > "using a different language version of Unzip could potentially change the > Unicode required to extract the file. Think of it like a password, without > the right code, you can't get in." **Why in the Ubuntu terminal will unzip display an error?**


title: Free space: 0 bytes and files full of data shown as empty

text: I don't know what's going on. The last evening I left my computer with about 700MB of free space on the system partition and today there is no free space on disk, moreover a lot of files containing data is, according to system, 0 bytes, but actually files are full of right data like text (and they have the icon of blank document). After deleting some files I can see no changes - still no free space. These files were deleted permanently and were not used during deleting. Yesterday I did command `sync` once and for the first time ever. Today I also did following as root: `sync; sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'`. It looks like it's something wrong with partition or actually file system. There was no rebooting the system for a long time and this is in my case the last thing I would like to do now. Moreover, I noticed that I've got no command history in terminal - the file `.bash_history` is empty. Is this because of dropping cache or my disk is broken down? If the first, what else was cleared among noticeable things like the bash history? Yesterday I used to make the disk working hard due to some actions like file serching and things alike but after that untill the evening everything was fine. One more annoying thing I noticed was working process called `update-apt- xapian-index-dbus` which is still in background but it's sleeping now (I couldn't kill it, it comes back everytime I try so). I see no other errors - the system is still working and it's stable. I'd like to know what is happening with my system... Do you have any suggestion? How to diagnose it? How to display real free space and sizes of files? Is a reboot necessary? Edit: One thing else is that key strokes like Shift+Del are not working. And I was trying to find files created during the night, but `find / -ctime=0` shows then also older files, same for `-mtime`. I frgot to mention that I use Ubuntu. **EDIT: I just found the file called `.xsession-errors` and it's about 650MB, so maybe it's the space I lost (it maches), it's accessed and modified today one hour ago, but I can't say (and check) when it's created. How about this? Next to that file is `.xsession-errors.old` modified in the day of last reboot and it's under 0,5MB. Did I just find my "free space"? And command `sync` can be a cause of problem with partition? I read so somewhere, but really can it?** Edit: I opened the file `.xsession-errors` and what can I see inside is some true errors with description about displaying windows and thousands of lines with `Illegal character <2e> in hex string` and millions lines with `Write error: Unknow error`. I guess it was writing till free space on disk was available. The character is not always <2e> but it repeats the most often.


title: Linux: Current correct/recommended use of games-group?

text: What is currently considered the correct/recommended/best-practice use of the games-group...   * As a "device group" for game-ports and joy-sticks, unassociated with the games-user (except for being one of the many groups the game-user probably would have to belong to) and with a (very) different GID than UID of the games-user...   * Or as a "pair" together with the games-user – preferably with matching UID and GID – where the group lists users allowed to execute programs belonging to the games-user. This to limit what user is allowed to enjoy themselves. Are there alternatives? Other names you've seen or think would work for a group for game-ports and joy-stick devices; for a group of users allowed to play; and/or user for running games as? (e.g. 'rec' for recreational) Do you think this could be a good idea or does it break tradition too much? I'm toying with the idea of building/customizing my own distro, so I'm not encumbered with how other distros do it or what's most common... I'm more asking for what you've seen, what you've tried and what you think would work best. I'm also interested for such experiences from users of other Unices too, after all most of them don't break down their devices quite as much as Linux does... Do they still have a games-group? How and for what is it used?


title: How can I check if a file is being downloaded?

text: I have a Raspberry Pi which I want to use to automate downloads to a network drive. I would like to restart the machine on a regular basis using `cron` (I've heard they're not the most stable of things) but obviously, I would prefer not to restart it half way through an incomplete download. I'll probably be downloading using several different methods but one of the ways I'll be using soon is get_iplayer and probably basic `wget` stuff too. Is there a way I can check if one is in progress? Any advice appreciated.


title: Is there a structured format of version info for OS-level executables?

text: I am looking for a structured format of version info for OS-level executables, such as in `/usr/bin` and `/usr/local/bin`. The problem we are having is the inconsistent architecture between our PROD and TEST environments and we are finding that many executables in our lower environments have had patches applied whereas PROD has not, which invalidates a lot of testing -- stuff works in TEST but doesn't in PROD because of such system discrepancies. So I would like to run a system assurance check to list all executables and get the version number but nothing else and then produce deltas. Some commands don't support the `-version` option but even those that do display very verbose, free-text format of a version narrative and the version number is buried somewhere within, with no way to extract it programmatically. Alternatively, I was thinking to run a file-level `cksum` for every executable as an option of last resort but I was hoping that there would be a way to extract version info relevant fields programmatically. Thanks


title: Run a script on multiple shells?

text: I have two servers one AIX with default shell ksh, the other RHEL with default shell bash. I have a script that is mounted on both that will run similar commands but for either AIX or Linux. This script does not work on the bash servers, is there a way to make this script run on both bash and ksh, or would the best option be to create two different scripts?               #!/usr/bin/ksh     export OS=`uname -s`     echo "OS is "$OS"."     case $OS in             "AIX")                     #run AIX commands;;             "Linux")                     #run Linux commands;;             "*")                     echo "Exiting. The OS type is not found.";;     esac     echo "Done."     exit 0      **UPDATE** The commands I need to run are for user accounts on each server. An example of unlocking an account. AIX /usr/bin/chuser account_locked=false $USERNAME Linux /usr/bin/passwd -u $USERNAME Through further investigation I have found that the the shells location in AIX are located at /usr/bin/sh, while Redhat's are located at /bin/sh. Can I define the shebang based on the results of "uname"?


title: I'm only allowing pubkey auth via ssh. How can I still log in with password?

text: vi /etc/ssh/sshd_config     egrep -i 'Pubkey|Password|Listen' /etc/ssh/sshd_config | grep -v '^#'         ListenAddress 0.0.0.0         PermitRootLogin without-password         PubkeyAuthentication yes         PasswordAuthentication no      on an OpenBSD 5.1 server. But I can still login with FileZilla, and FileZilla only knows my password AFAIK (or not?). How can I restrict any ssh/scp/sftp access to only accept key auth? UPDATE: clinet side is a Scientific Linux 6.3, afaik the key is not cached.


title: How to ensure a process has started reading a file before continuing?

text: I'm trying to write a command to test that data is written to a file. My first approach was:   1. Start reading in the background.   2. Write some data to the file.   3. Wait for the reader to find a result.   4. Repeat indefinitely to see if there's a timing issue. In script form:               while true     do         grep -q foo <(tail -n0 -f /var/log/syslog) &         logger foo && logger line && wait     done      (the `logger line` command is to avoid `last message repeated N times` lines in the file) This version will typically loop a once or twice before getting stuck at the `wait` command, so it looks like `tail` didn't have time to start reading before `logger foo` had written to the file. What is the best way to **_guarantee_ that `tail` is reading before continuing**? These workarounds are not ideal:   * Pause before `logger` (won't work in the case of slow file systems)                  sleep 1 && logger foo && logger line && wait        * Start a second reader, and assume that the first one has started reading by the time the second has been shown to. This looped a few thousand times before getting stuck:                  grep -q foo <(tail -n0 -f /var/log/syslog) &         grep -q bar <(tail -n0 -f /var/log/syslog) &         while kill -0 $!         do             logger bar             logger line         done         logger foo && logger line && wait


How can I uniquely identify which device is on USB `hub 6-0:1.0: port 2`? I receive messages in my `dmesg` every now and then and I want the system to tell me which device is connected to that port. **EDIT:** OK, I can figure out which hub it is, but how can I figure out which device is on port 2 (out of four).               udevadm info -q all -p /sys/bus/usb/devices/6-0:1.0     P: /devices/pci0000:00/0000:00:1d.0/usb6/6-0:1.0     E: DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb6/6-0:1.0     E: DEVTYPE=usb_interface     E: DRIVER=hub     E: INTERFACE=9/0/0     E: MODALIAS=usb:v1D6Bp0001d0302dc09dsc00dp00ic09isc00ip00     E: PRODUCT=1d6b/1/302     E: SUBSYSTEM=usb     E: TYPE=9/0/0     E: UDEV_LOG=3


title: The myths about malware in unix/linux

text: Is it possible for my Linux box to become infected with a malware? I haven't heard of it happening to anyone I know, and I've heard quite a few times that it isn't possible. Is that true? If so, whats up with Linux Anti-Virus (security) software?


title: Is Linux really malware safe? Or people just don't bother creating them for Linux?

text: > **Possible Duplicate:**   >  The myths about viruses in unix/linux I've never used Linux before and I heard that you don't need to worry about malware on Linux. So, as the title said, is Linux really malware safe? Or do people just not bother creating them for Linux because Linux is not popular for standard end-users ?


title: delay to get password prompt when ssh'ing to a public server

text: i have a server (debian 7) setup in my university with public ip. when I ssh into the system (from outside the campus), I get a weird delay of 5-10 seconds before I get the password prompt. Why is that? I run `ssh -v` to get verbose output:               debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received          .... delay of 5-10 seconds here          debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Trying private key: /home/nass/.ssh/id_rsa     debug1: Trying private key: /home/nass/.ssh/id_dsa     debug1: Trying private key: /home/nass/.ssh/id_ecdsa     debug1: Next authentication method: password      then I get the password prompt fine. my `resolv.conf` looks like               domain <mydomain>.edu     nameserver <dns ip address>      firewall is controlled by `webmin` , and the config `/etc/webmin/firewall/iptables.save` looks like:               # Generated by iptables-save v1.4.14 on Mon Feb 10 17:41:38 2014     *filter     :FORWARD DROP [0:0]     :IP_TCP - [0:0]     :INPUT DROP [0:0]     :IP_UDP - [0:0]     :OUTPUT ACCEPT [0:0]     :IP_ICMP - [0:0]     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state ESTABLISHED -j ACCEPT     -A INPUT -m state --state RELATED -j ACCEPT     -A INPUT -p tcp -m tcp --tcp-flags ACK ACK -j ACCEPT     -A INPUT -s 127.0.0.1/32 -i eth0 -j DROP     -A INPUT -p icmp -i eth0 -j IP_ICMP     -A INPUT -p udp -m udp -i eth0 -j IP_UDP     -A INPUT -p tcp -m tcp -i eth0 -j IP_TCP     -A INPUT -m limit --limit 3/second --limit-burst 3 -j ULOG --ulog-prefix "FW_INPUT: " --ulog-nlgroup 1     -A IP_ICMP -p icmp -m icmp --icmp-type 0 -j ACCEPT     -A IP_ICMP -p icmp -m icmp --icmp-type 3 -j ACCEPT     -A IP_ICMP -p icmp -m icmp --icmp-type 4 -j ACCEPT     -A IP_ICMP -p icmp -m icmp --icmp-type 11 -j ACCEPT     -A IP_ICMP -p icmp -m icmp --icmp-type 12 -j ACCEPT     -A IP_ICMP -p icmp -m icmp --icmp-type 8 -j ACCEPT     -A IP_ICMP -p icmp -j RETURN     -A IP_TCP -p tcp -m tcp --dport 2049:2050 -j DROP     -A IP_TCP -p tcp -m tcp --dport 6000:6063 -j DROP     -A IP_TCP -p tcp -m tcp --dport 7000:7010 -j DROP     -A IP_TCP -p tcp -m tcp --dport 19001 -j ACCEPT     -A IP_TCP -p tcp -m tcp --dport 12321 -j ACCEPT     -A IP_TCP -p tcp -m tcp --dport 80 -j ACCEPT     -A IP_TCP -p tcp -m tcp --dport 443 -j ACCEPT     -A IP_TCP -p tcp -m tcp -j RETURN     COMMIT     # Completed on Mon Feb 10 17:41:38 2014     # Generated by iptables-save v1.4.14 on Mon Feb 10 17:41:38 2014     *mangle     :PREROUTING ACCEPT [2386474:238877913]     :INPUT ACCEPT [2251067:225473866]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [1100410:5416839301]     :POSTROUTING ACCEPT [1100428:5416842284]     COMMIT     # Completed on Mon Feb 10 17:41:38 2014     # Generated by iptables-save v1.4.14 on Mon Feb 10 17:41:38 2014     *nat     :PREROUTING ACCEPT [211832:26633302]     :INPUT ACCEPT [444:26827]     :OUTPUT ACCEPT [1817:114098]     :POSTROUTING ACCEPT [1817:114098]     COMMIT     # Completed on Mon Feb 10 17:41:38 2014      Last but not least, a colleague who also has an account on the same system gets the prompt immediately!


title: What's hotplug?

text: Many questions are tagged : hot-plug . However , No wiki found in : Tag info I've read this: > Modularized USB drivers are loaded by the generic /sbin/hotplug support in > the ker- nel, which is also used for other hotplug devices such as CardBus > cards. Therefore , Could we say that hotplug is the responsible on loading/unloading modules automatically ?


title: How to call a method of configuring the result of which is active until the first reboot?

text: For example, you can configure a network interface and other settings from the command line of your terminal. But you can also save the settings to the file `/etc/network/interfaces` (Debian GNU/Linux) or appropriate of NetworkManager. Another example, if you want to add a permanent entry to the ARP table of FreeBSD, you should execute the command:               # arp -S 192.168.0.1 01:23:45:ab:cd:ef      or add to `rc.conf` the following:               static_arp_pairs="gw"     static_arp_gw="192.168.0.1 01:23:45:ab:cd:ef"      Similar examples are numerous. The result takes effect immediately when you use the first method. With the second method, you must restart your system completely or only appropriate service. Is there a name for the first method as a single word or abbreviation? As far as I remember there is a more precise term and I stumbled on it somewhere.