Compiling this: http://linux.softpedia.com/progDownload/Indexed-PDF-Creator- Download-1071.html               anisha@linux-dopx:~/tarBalls/ipdf-1.0.0> ./configure --build=x86_64     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 for gcc... gcc     checking for C compiler default output... 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 for style of include used by make... GNU     checking dependency style of gcc... gcc3     checking build system type... Invalid configuration `x86_64': machine `x86_64' not recognized     configure: error: /bin/sh ./config.sub x86_64 failed      on:               anisha@linux-dopx:~/> uname -a && cat /etc/issue     Linux linux-dopx 3.2.1-12-desktop #1 SMP PREEMPT Thu Jan 19 16:02:50 IST 2012 x86_64 x86_64 x86_64 GNU/Linux     Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).      `config.sub` is as follows:               > #! /bin/sh     # Configuration validation subroutine script, version 1.1.     #   Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.     # This file is (in principle) common to ALL GNU software.     # The presence of a machine in this file suggests that SOME GNU software     # can handle that machine.  It does not imply ALL GNU software can.     #     # This file is free software; you can redistribute it and/or modify     # it under the terms of the GNU General Public License as published by     # the Free Software Foundation; either version 2 of the License, or     # (at your option) any later version.     #     # This program is distributed in the hope that it will be useful,     # but WITHOUT ANY WARRANTY; without even the implied warranty of     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     # GNU General Public License for more details.     #     # You should have received a copy of the GNU General Public License     # along with this program; if not, write to the Free Software     # Foundation, Inc., 59 Temple Place - Suite 330,     # Boston, MA 02111-1307, USA.          # As a special exception to the GNU General Public License, if you     # distribute this file as part of a program that contains a     # configuration script generated by Autoconf, you may include it under     # the same distribution terms that you use for the rest of that program.          # Configuration subroutine to validate and canonicalize a configuration type.     # Supply the specified configuration type as an argument.     # If it is invalid, we print an error message on stderr and exit with code 1.     # Otherwise, we print the canonical config type on stdout and succeed.          # This file is supposed to be the same for all GNU packages     # and recognize all the CPU types, system types and aliases     # that are meaningful with *any* GNU software.     # Each package is responsible for reporting which valid configurations     # it does not support.  The user should be able to distinguish     # a failure to support a valid configuration from a meaningless     # configuration.          # The goal of this file is to map all the various variations of a given     # machine specification into a single specification in the form:     #   CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM     # or in some cases, the newer four-part form:     #   CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM     # It is wrong to echo any other type of specification.          if [ x$1 = x ]     then         echo Configuration name missing. 1>&2         echo "Usage: $0 CPU-MFR-OPSYS" 1>&2         echo "or     $0 ALIAS" 1>&2         echo where ALIAS is a recognized configuration type. 1>&2         exit 1     fi          # First pass through any local machine types.     case $1 in         *local*)             echo $1             exit 0             ;;         *)         ;;     esac          # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).     # Here we must recognize all the valid KERNEL-OS combinations.     maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`     case $maybe_os in       linux-gnu*)         os=-$maybe_os         basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`         ;;       *)         basic_machine=`echo $1 | sed 's/-[^-]*$//'`         if [ $basic_machine != $1 ]         then os=`echo $1 | sed 's/.*-/-/'`         else os=; fi         ;;     esac          ### Let's recognize common machines as not being operating systems so     ### that things like config.sub decstation-3100 work.  We also     ### recognize some manufacturers as not being operating systems, so we     ### can provide default operating systems below.     case $os in         -sun*os*)             # Prevent following clause from handling this invalid input.             ;;         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \         -apple)             os=             basic_machine=$1             ;;         -hiux*)             os=-hiuxwe2             ;;         -sco5)             os=sco3.2v5             basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`             ;;         -sco4)             os=-sco3.2v4             basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`             ;;         -sco3.2.[4-9]*)             os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`             basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`             ;;         -sco3.2v[4-9]*)             # Don't forget version if it is 3.2v4 or newer.             basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`             ;;         -sco*)             os=-sco3.2v2             basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`             ;;         -isc)             os=-isc2.2             basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`             ;;         -clix*)             basic_machine=clipper-intergraph             ;;         -isc*)             basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`             ;;         -lynx*)             os=-lynxos                 ;;         -ptx*)             basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`             ;;         -windowsnt*)             os=`echo $os | sed -e 's/windowsnt/winnt/'`             ;;         -psos*)             os=-psos             ;;     esac          # Decode aliases for certain CPU-COMPANY combinations.     case $basic_machine in         # Recognize the basic CPU types without company name.         # Some are omitted here because they have special meanings below.         tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \             | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \             | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \             | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \             | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \             | mips64 | mipsel | mips64el | mips64orion | mips64orionel \             | mipstx39 | mipstx39el \             | sparc | sparclet | sparclite | sparc64 | v850)             basic_machine=$basic_machine-unknown             ;;         # We use `pc' rather than `unknown'         # because (1) that's what they normally are, and         # (2) the word "unknown" tends to confuse beginning users.         i[34567]86)           basic_machine=$basic_machine-pc           ;;         # Object if more than one company name word.         *-*-*)             echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2             exit 1             ;;         # Recognize the basic CPU types with company name.         vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \               | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \               | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \               | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \               | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \               | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \               | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \               | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \               | sparc64-* | mips64-* | mipsel-* \               | mips64el-* | mips64orion-* | mips64orionel-*  \               | mipstx39-* | mipstx39el-* \               | f301-*)             ;;         # Recognize the various machine names and aliases which stand         # for a CPU type and a company and sometimes even an OS.         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)             basic_machine=m68000-att             ;;         3b*)             basic_machine=we32k-att             ;;         alliant | fx80)             basic_machine=fx80-alliant             ;;         altos | altos3068)             basic_machine=m68k-altos             ;;         am29k)             basic_machine=a29k-none             os=-bsd             ;;         amdahl)             basic_machine=580-amdahl             os=-sysv             ;;         amiga | amiga-*)             basic_machine=m68k-cbm             ;;         amigaos | amigados)             basic_machine=m68k-cbm             os=-amigaos             ;;         amigaunix | amix)             basic_machine=m68k-cbm             os=-sysv4             ;;         apollo68)             basic_machine=m68k-apollo             os=-sysv             ;;         aux)             basic_machine=m68k-apple             os=-aux             ;;         balance)             basic_machine=ns32k-sequent             os=-dynix             ;;         convex-c1)             basic_machine=c1-convex             os=-bsd             ;;         convex-c2)             basic_machine=c2-convex             os=-bsd             ;;         convex-c32)             basic_machine=c32-convex             os=-bsd             ;;         convex-c34)             basic_machine=c34-convex             os=-bsd             ;;         convex-c38)             basic_machine=c38-convex             os=-bsd             ;;         cray | ymp)             basic_machine=ymp-cray             os=-unicos             ;;         cray2)             basic_machine=cray2-cray             os=-unicos             ;;         [ctj]90-cray)             basic_machine=c90-cray             os=-unicos             ;;         crds | unos)             basic_machine=m68k-crds             ;;         da30 | da30-*)             basic_machine=m68k-da30             ;;         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)             basic_machine=mips-dec             ;;         delta | 3300 | motorola-3300 | motorola-delta \               | 3300-motorola | delta-motorola)             basic_machine=m68k-motorola             ;;         delta88)             basic_machine=m88k-motorola             os=-sysv3             ;;         dpx20 | dpx20-*)             basic_machine=rs6000-bull             os=-bosx             ;;         dpx2* | dpx2*-bull)             basic_machine=m68k-bull             os=-sysv3             ;;         ebmon29k)             basic_machine=a29k-amd             os=-ebmon             ;;         elxsi)             basic_machine=elxsi-elxsi             os=-bsd             ;;         encore | umax | mmax)                 basic_machine=ns32k-encore             ;;         fx2800)             basic_machine=i860-alliant             ;;         genix)             basic_machine=ns32k-ns             ;;         gmicro)             basic_machine=tron-gmicro             os=-sysv             ;;         h3050r* | hiux*)             basic_machine=hppa1.1-hitachi             os=-hiuxwe2             ;;         h8300hms)             basic_machine=h8300-hitachi             os=-hms             ;;         harris)             basic_machine=m88k-harris             os=-sysv3             ;;         hp300-*)             basic_machine=m68k-hp             ;;         hp300bsd)             basic_machine=m68k-hp             os=-bsd             ;;         hp300hpux)             basic_machine=m68k-hp             os=-hpux             ;;         hp9k2[0-9][0-9] | hp9k31[0-9])             basic_machine=m68000-hp             ;;         hp9k3[2-9][0-9])             basic_machine=m68k-hp             ;;         hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)             basic_machine=hppa1.1-hp             ;;         hp9k8[0-9][0-9] | hp8[0-9][0-9])             basic_machine=hppa1.0-hp             ;;         hppa-next)                 os=-nextstep3             ;;         i370-ibm* | ibm*)             basic_machine=i370-ibm             os=-mvs             ;;     # I'm not sure what "Sysv32" means.  Should this be sysv3.2?         i[34567]86v32)             basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`             os=-sysv32             ;;         i[34567]86v4*)             basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`             os=-sysv4             ;;         i[34567]86v)             basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`             os=-sysv             ;;         i[34567]86sol2)             basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`             os=-solaris2             ;;         iris | iris4d)             basic_machine=mips-sgi             case $os in                 -irix*)                 ;;                 *)                 os=-irix4                 ;;             esac             ;;         isi68 | isi)             basic_machine=m68k-isi             os=-sysv             ;;         m88k-omron*)             basic_machine=m88k-omron             ;;         magnum | m3230)             basic_machine=mips-mips             os=-sysv             ;;         merlin)             basic_machine=ns32k-utek             os=-sysv             ;;         miniframe)             basic_machine=m68000-convergent             ;;         mipsel*-linux*)             basic_machine=mipsel-unknown             os=-linux-gnu             ;;         mips*-linux*)             basic_machine=mips-unknown             os=-linux-gnu             ;;         mips3*-*)             basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`             ;;         mips3*)             basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown             ;;         ncr3000)             basic_machine=i486-ncr             os=-sysv4             ;;         news | news700 | news800 | news900)             basic_machine=m68k-sony             os=-newsos             ;;         news1000)             basic_machine=m68030-sony             os=-newsos             ;;         news-3600 | risc-news)             basic_machine=mips-sony             os=-newsos             ;;         next | m*-next )             basic_machine=m68k-next             case $os in                 -nextstep* )                 ;;                 -ns2*)                   os=-nextstep2                 ;;                 *)                   os=-nextstep3                 ;;             esac             ;;         nh3000)             basic_machine=m68k-harris             os=-cxux             ;;         nh[45]000)             basic_machine=m88k-harris             os=-cxux             ;;         nindy960)             basic_machine=i960-intel             os=-nindy             ;;         np1)             basic_machine=np1-gould             ;;         pa-hitachi)             basic_machine=hppa1.1-hitachi             os=-hiuxwe2             ;;         paragon)             basic_machine=i860-intel             os=-osf             ;;         pbd)             basic_machine=sparc-tti             ;;         pbb)             basic_machine=m68k-tti             ;;             pc532 | pc532-*)             basic_machine=ns32k-pc532             ;;         pentium | p5 | k5 | nexen)             basic_machine=i586-pc             ;;         pentiumpro | p6 | k6 | 6x86)             basic_machine=i686-pc             ;;         pentiumii | pentium2)             basic_machine=i786-pc             ;;         pentium-* | p5-* | k5-* | nexen-*)             basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`             ;;         pentiumpro-* | p6-* | k6-* | 6x86-*)             basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`             ;;         pentiumii-* | pentium2-*)             basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`             ;;         pn)             basic_machine=pn-gould             ;;         power)  basic_machine=rs6000-ibm             ;;         ppc)    basic_machine=powerpc-unknown                 ;;         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`             ;;         ppcle | powerpclittle | ppc-le | powerpc-little)             basic_machine=powerpcle-unknown                 ;;         ppcle-* | powerpclittle-*)             basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`             ;;         ps2)             basic_machine=i386-ibm             ;;         rm[46]00)             basic_machine=mips-siemens             ;;         rtpc | rtpc-*)             basic_machine=romp-ibm             ;;         sequent)             basic_machine=i386-sequent                 ;;         sh)             basic_machine=sh-hitachi             os=-hms             ;;         sps7)             basic_machine=m68k-bull             os=-sysv2             ;;         spur)             basic_machine=spur-unknown             ;;         sun2)             basic_machine=m68000-sun             ;;         sun2os3)             basic_machine=m68000-sun             os=-sunos3             ;;         sun2os4)             basic_machine=m68000-sun             os=-sunos4             ;;         sun3os3)             basic_machine=m68k-sun             os=-sunos3             ;;         sun3os4)             basic_machine=m68k-sun             os=-sunos4             ;;         sun4os3)             basic_machine=sparc-sun             os=-sunos3             ;;         sun4os4)             basic_machine=sparc-sun             os=-sunos4             ;;         sun4sol2)             basic_machine=sparc-sun             os=-solaris2             ;;         sun3 | sun3-*)             basic_machine=m68k-sun             ;;         sun4)             basic_machine=sparc-sun             ;;         sun386 | sun386i | roadrunner)             basic_machine=i386-sun             ;;         symmetry)             basic_machine=i386-sequent             os=-dynix             ;;         tx39)             basic_machine=mipstx39-unknown             ;;         tx39el)             basic_machine=mipstx39el-unknown             ;;         tower | tower-32)             basic_machine=m68k-ncr             ;;         udi29k)             basic_machine=a29k-amd             os=-udi             ;;         ultra3)             basic_machine=a29k-nyu             os=-sym1             ;;         vaxv)             basic_machine=vax-dec             os=-sysv             ;;         vms)             basic_machine=vax-dec             os=-vms             ;;         vpp*|vx|vx-*)                    basic_machine=f301-fujitsu                    ;;         vxworks960)             basic_machine=i960-wrs             os=-vxworks             ;;         vxworks68)             basic_machine=m68k-wrs             os=-vxworks             ;;         vxworks29k)             basic_machine=a29k-wrs             os=-vxworks             ;;         xmp)             basic_machine=xmp-cray             os=-unicos             ;;             xps | xps100)             basic_machine=xps100-honeywell             ;;         none)             basic_machine=none-none             os=-none             ;;          # Here we handle the default manufacturer of certain CPU types.  It is in     # some cases the only manufacturer, in others, it is the most popular.         mips)             if [ x$os = x-linux-gnu ]; then                 basic_machine=mips-unknown             else                 basic_machine=mips-mips             fi             ;;         romp)             basic_machine=romp-ibm             ;;         rs6000)             basic_machine=rs6000-ibm             ;;         vax)             basic_machine=vax-dec             ;;         pdp11)             basic_machine=pdp11-dec             ;;         we32k)             basic_machine=we32k-att             ;;         sparc)             basic_machine=sparc-sun             ;;             cydra)             basic_machine=cydra-cydrome             ;;         orion)             basic_machine=orion-highlevel             ;;         orion105)             basic_machine=clipper-highlevel             ;;         *)             echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2             exit 1             ;;     esac          # Here we canonicalize certain aliases for manufacturers.     case $basic_machine in         *-digital*)             basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`             ;;         *-commodore*)             basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`             ;;         *)             ;;     esac          # Decode manufacturer-specific aliases for certain operating systems.          if [ x"$os" != x"" ]     then     case $os in             # First match some system type aliases             # that might get confused with valid system types.         # -solaris* is a basic system type, with this one exception.         -solaris1 | -solaris1.*)             os=`echo $os | sed -e 's|solaris1|sunos4|'`             ;;         -solaris)             os=-solaris2             ;;         -svr4*)             os=-sysv4             ;;         -unixware*)             os=-sysv4.2uw             ;;         -gnu/linux*)             os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`             ;;         # First accept the basic system types.         # The portable systems comes first.         # Each alternative MUST END IN A *, to match a version number.         # -sysv* is not here because it comes later, after sysvr4.         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \               | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \               | -aos* \               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \               | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \               | -openstep*)         # Remember, each alternative MUST END IN *, to match a version number.             ;;         -linux*)             os=`echo $os | sed -e 's|linux|linux-gnu|'`             ;;         -sunos5*)             os=`echo $os | sed -e 's|sunos5|solaris2|'`             ;;         -sunos6*)             os=`echo $os | sed -e 's|sunos6|solaris3|'`             ;;         -osfrose*)             os=-osfrose             ;;         -osf*)             os=-osf             ;;         -utek*)             os=-bsd             ;;         -dynix*)             os=-bsd             ;;         -acis*)             os=-aos             ;;         -ctix* | -uts*)             os=-sysv             ;;         -ns2 )                 os=-nextstep2             ;;         # Preserve the version number of sinix5.         -sinix5.*)             os=`echo $os | sed -e 's|sinix|sysv|'`             ;;         -sinix*)             os=-sysv4             ;;         -triton*)             os=-sysv3             ;;         -oss*)             os=-sysv3             ;;         -svr4)             os=-sysv4             ;;         -svr3)             os=-sysv3             ;;         -sysvr4)             os=-sysv4             ;;         # This must come after -sysvr4.         -sysv*)             ;;         -xenix)             os=-xenix             ;;         -none)             ;;         *)             # Get rid of the `-' at the beginning of $os.             os=`echo $os | sed 's/[^-]*-//'`             echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2             exit 1             ;;     esac     else          # Here we handle the default operating systems that come with various machines.     # The value should be what the vendor currently ships out the door with their     # machine or put another way, the most popular os provided with the machine.          # Note that if you're going to try to match "-MANUFACTURER" here (say,     # "-sun"), then you have to tell the case statement up towards the top     # that MANUFACTURER isn't an operating system.  Otherwise, code above     # will signal an error saying that MANUFACTURER isn't an operating     # system, and we'll never get to this point.          c    ase $basic_machine in         *-acorn)             os=-riscix1.2             ;;         arm*-semi)             os=-aout             ;;             pdp11-*)             os=-none             ;;         *-dec | vax-*)             os=-ultrix4.2             ;;         m68*-apollo)             os=-domain             ;;         i386-sun)             os=-sunos4.0.2             ;;         m68000-sun)             os=-sunos3             # This also exists in the configure program, but was not the             # default.             # os=-sunos4             ;;         *-tti)  # must be before sparc entry or we get the wrong os.             os=-sysv3             ;;         sparc-* | *-sun)             os=-sunos4.1.1             ;;         *-be)             os=-beos             ;;         *-ibm)             os=-aix             ;;         *-hp)             os=-hpux             ;;         *-hitachi)             os=-hiux             ;;         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)             os=-sysv             ;;         *-cbm)             os=-amigaos             ;;         *-dg)             os=-dgux             ;;         *-dolphin)             os=-sysv3             ;;         m68k-ccur)             os=-rtu             ;;         m88k-omron*)             os=-luna             ;;         *-next )             os=-nextstep             ;;         *-sequent)             os=-ptx             ;;         *-crds)             os=-unos             ;;         *-ns)             os=-genix             ;;         i370-*)             os=-mvs             ;;         *-next)             os=-nextstep3             ;;             *-gould)             os=-sysv             ;;             *-highlevel)             os=-bsd             ;;         *-encore)             os=-bsd             ;;                 *-sgi)             os=-irix             ;;             *-siemens)             os=-sysv4             ;;         *-masscomp)             os=-rtu             ;;         f301-fujitsu)             os=-uxpv             ;;         *)             os=-none             ;;     esac     fi          # Here we handle the case where we know the os, and the CPU type, but not the     # manufacturer.  We pick the logical manufacturer.     vendor=unknown     case $basic_machine in         *-unknown)             case $os in                 -riscix*)                     vendor=acorn                     ;;                 -sunos*)                     vendor=sun                     ;;                 -aix*)                     vendor=ibm                     ;;                 -hpux*)                     vendor=hp                     ;;                 -hiux*)                     vendor=hitachi                     ;;                 -unos*)                     vendor=crds                     ;;                 -dgux*)                     vendor=dg                     ;;                 -luna*)                     vendor=omron                     ;;                 -genix*)                     vendor=ns                     ;;                 -mvs*)                     vendor=ibm                     ;;                 -ptx*)                     vendor=sequent                     ;;                 -vxsim* | -vxworks*)                     vendor=wrs                     ;;                     -aux*)                     vendor=apple                     ;;             esac             basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`             ;;     esac          echo $basic_machine$os


How to create indexes in a pdf?

iPdf is rotten. Is there any other software or any other way by which an " **index** " can be created in a pdf file?


Confused on user and su in linux

How could I run a script as a specific user (non-root)? As this? `sudo su - john /usr/share/script.pl` for user john?


How to access the history on the fly in unix?

for example, if I do a               mkdir thisismyfolder912      I remember there is some easier way to switch to `thisismyfolder912` than having to do a               cd thisismyfolder912      What is that way and how does it work? Also, what are the other ways I can use this?


Persistent shell arguments

I often find myself running a series of commands on a single set of arguments. For example:               $ nmap -Pn -sS 192.168.1.5     $ ssh 192.168.1.5     $ curl 192.168.1.5     $ wget -r 192.168.1.5      This can be sped up by putting the argument(s) in a variable,               $ a=192.168.1.5     $ nmap -Pn -sS $a     $ ssh $a     $ curl $a     $ wget -r $a      and sped up even more by using a couple of functions such as the following.               $ more .zshrc     ...     paa() { PERSIST_ARGS+=("$@"); }     pa() { eval "$@" "${PERSIST_ARGS[@]}"; }     ...     $ paa 192.168.1.5     $ pa nmap -Pn -sS     $ pa ssh     $ pa curl     $ pa wget -r      Is there a way to speed this up even more? For example,               $ <start special mode> 192.168.1.5     $ nmap -Pn -sS     $ ssh     $ curl     $ wget -r     $ <exit special mode>      I am looking for `bash` or `zsh` solutions. The solution has to work with an arbitrary set of commands.


shell saves ip address that you ping?

I was once shown a shortcut that I can't recall/ find. After pinging an ip, then attempting to ssh into it - the ip was saved into to a variable automagically. Something like:                   ping 10.1.23.4         ...         ssh root@$!      and the ip was replicated in the second line replacing $! without further ado. So does this ring a bell as to what the actual syntax is? Or was this some special configuration? I believe this was running centos if that is related. tia


Cloned VirtualBox CentOS disk is unbootable after cloning in GParted

I cloned and enlarged an existing virtual CentOS-6 disk by the following steps:   1. Create 15GB virtual disk and mount the old and the new disks in GParted.   2. In GParted copy boot, swap and ext3 partitions from the old disk to the new one.   3. Mark the new boot partition with boot flag.   4. Resize the new ext3 to bigger size. I disconnected the old disk and connected the new one. Now I cannot boot the VirtualBox. I get a black screen. What seems to be the problem here? Thanks.


How can I manipulate the content of a file, by duplicating and changing some parts?

I want to manipulate a text-file. It contains many blocks of the form               CLASS        ...some stuff ...     END      I want to duplicate each of these blocks and add and remove a line of it's content. Can I script that?


Mysterious write IO

I am just reviewing the disk IO of a XEN VM server. I stumbled across a DomU that has constant write traffic. To narrow that traffic further down I logged in to the DomU (CentOS 5, 64 Bit) and started `iostat 5`. It shows sda1 active with 130-190 Blocks written per second. Disk-layout:               sda: Whole disk (corresponds to DRBD-device in the Dom0, consist of one LV in the Dom0)     sda1: /     sda2: /var     sda3: LVM-PV for application data, contains one LV mounted as subdirectory on /var      I tried to find open file handles on /dev/sda1 by issuing `lsof /dev/sda1`. The output of that command is empty. Whereas the output for `lsof /dev/sda2` shows lots of files, pipes, ... (as is to be expected). How can I track down what is causing this IO?


Setup static IP in redhat 6

I installed Redhat 6 x86_64. I am using the Network connection screen to set a static IP address like below (I want two PC's in my house to see each other: one Redhat PC and one Mac)               192.168.0.5       255.255.255.0       192.168.0.1        When I run `ifconfig` it displays only `lo` and `virbr0` information. I don't know what these items are (I don't really know much about network settings). When I try `ifconfig -a` it displays `eth0`, `lo`, `sit0` and `virbr0`. The information for `eth0` is as follows:               Link encap : Ethernet HWaddr 90:2B:34:74:05:30     BROADCAST MULTICAST MTU:1500 Metric:1     RX packets:192 errors:0 dropped:0 overruns:0 frame:0     TX packets:6 errors:0 dropped:0 overruns:0 frame:0     collisions:0 txqueuelen:1000     RX bytes 53811 (52.5 KiB) TX bytes:468 (468.0 b)     Interrupt:29 Base address:0xc000      Could someone help me to point out if anything wrong with my setting or how to resolve this problem?


can I tell to useradd to execute a script? Maybe in /etc/default/useradd?

There are plenty of people that already answered to the question "how to execute useradd properly in a script?" My question is: "is it possible to tell to useradd to execute one script when it is called?" I am writing a script to push identities files (ssh-keys) in an HPC cluster when a user is created, but I think the "cleanest" way would be to write a script that is executed **by** useradd. The script should do something like this:               #!/bin/bash     # sshpush.sh     #     # a script to SSH without passwords around the cluster nodes          mkdir $HOME/.ssh     cd $HOME/.ssh          ssh-keygen -q          cat id_rsa.pub >> authorized_keys          cat > config <<EOF     StrictHostKeyChecking no     FallBackToRsh no     BatchMode yes     ConnectionAttempts 5     UsePrivilegedPort no     Compression no     Cipher blowfish     CheckHostIP no     EOF          cpush /etc/passwd     cpush /etc/shadow     cpush /etc/groups      notice that the /home directory is mounted as NFS on all nodes. Ideally, the script should be executed **at the end** of the user creation process, after that `$HOME`is created and that the user as a valid group and id.


IPSet - After installing get error message "Broken error report message received"

I get an error message after installation when I try to use ipset. "Broken error report message received". I am wondering what the cause of the issue is, may be some linux guru could point me into the right direction? My Linux is CentOS 6. version 2.6.18-028stab092.1 Here the steps:               yum install ipset          Installed:     ipset.x86_64 0:6.11-1.el6          Dependency Installed:     libmnl.x86_64 0:1.0.2-3.el6      try to use ipset according this link:               ipset create geoblock hash:net      error:               ipset v6.11: Broken error report message received.      My current assumption is that my kernel version is not compatible to the ipset version? or I have somehow to install a kernel module? Please refer here to my assumption Ipset installation on CentOS 6.0 Could this be the issue?


"Unknown terminal type" error when trying to run emacsclient

(I’m using emacs23; on Debian 7; Xfce.) I want to try Gilles’s recommended solution for taking quick notes with Emacs. When trying to run `emacsclient -a "" -e "(remember-other-frame)"`, I get the following error: > *ERROR*: Unknown terminal type **What is wrong?** * * * (Not really sure about what I’m doing,) I tried to start a server from within Emacs: `Ctrl`+`x` and entering `server-start`. Then it says: > Warning (server): Unable to start the Emacs server.   >  There is an existing Emacs server, named "server".   >  To start the server in this Emacs process, stop the existing   >  server or call `M-x server-force-delete' to forcibly disconnect it. When pressing `Ctrl`+`x` and entering `server-force-delete`, it says: > Connection file "/tmp/emacs1000/server" deleted When I now run `emacsclient -a "" -e "(remember-other-frame)"` from a different terminal window (having `emacs -nw` still running in the first one), I get:               emacsclient: can't find socket; have you started the server?     To start the server in Emacs, type "M-x server-start".          Warning: due to a long standing Gtk+ bug     http://bugzilla.gnome.org/show_bug.cgi?id=85715     Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.     Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.     ("emacs")     Loading 00debian-vars...     Loading 00debian-vars...done     Loading /etc/emacs/site-start.d/50a2ps.el (source)...     Loading /etc/emacs/site-start.d/50a2ps.el (source)...done     Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...     Loading debian-ispell...     Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...     Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done     Loading debian-ispell...done     Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...     Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done     Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done     Starting Emacs daemon.     Emacs daemon should have started, trying to connect again     *ERROR*: Unknown terminal type      * * * ## [Edit] Requested information Output of `echo $TERM; echo $DISPLAY`:               xterm     :0.0      * * * > Are you running this from a terminal emulator, if so which, if not where? I’m not sure what a "terminal emulator" is, but the _terminal thing_ I’m using identifies itself (in the "Info" menu) as: **Xfce Terminal-Emulator** (Terminal 0.4.8). It’s the default one that came with installing Debian 7 + Xfce. * * * > What do you have in `~/.emacs` and `~/.emacs.d`?   * `~/.emacs` does not exist.   * `~/.emacs.d` contains only a sub folder `auto-save-list` (which contains an empty file whose name starts with `.saves`).


Looking for meta-recipe for installing homebrew recipes under BSD

Is there a way to install homebrew recipes under BSD? (NetBSD, to be more precise.) (To make matters worse, I don't have write access to `/usr/local` in this system, so I'd be installing `homebrew` itself under `$HOME/homebrew` or somesuch. The `homebrew` documentation discourages, but does not entirely rule out, installing `homebrew` anywhere else other than under `/usr/local`. In this case I'd have no choice on the matter.)


Can't install python because of zypper conflict

I have a virtual machine I just set up. I'm running a completely fresh install of OpenSUSE (with online updates from `yast`). At the terminal I tried to run `python`:               $ python     bash: python: command not found      I tried:               $ python --version     bash: python: command not found      So then I tried:               $ zypper install python          Loading repository data...     Reading installed packages...     Resolving package dependencies...          Problem: patterns-openSUSE-minimal_base-conflicts-12.3-7.10.1.x86_64      conflicts with python provided by python-2.7.3-10.1.1x86_64      The terminal then offers two solutions, to either uninstall the minimal base conflicts business or to not install python. I don't want to uninstall anything because I don't know what it will. I suppose I could if I had a better understanding of it, but perhaps there is a problem someone else can see here? * * * **Edit** : Don't know if this will help, but I did not install any GUI on my virtual machine.


Dealing with GNU Stow conflicts

What is the recommended way of dealing with GNU Stow conflicts? I tried to stow `readline-6.2` and got the following warning:               > stow readline-6.2     Loading defaults from /home/josh/.stowrc     WARNING! stowing readline-6.2 would cause conflicts:       * existing target is stowed to a different package: share/info/dir =>       ../../../stow_dir/stow_2.2.0_canonical_paths/share/info/dir     All operations aborted.      The clash is with the package `stow_2.2.0_canonical_paths` which is the package dir for `stow` (this is because I bootstrapped stow). Here is is what that conflicting target contains:               > cat ~/local/share/info/dir      This is the file .../info/dir, which contains the     topmost node of the Info hierarchy, called (dir)Top.     The first time you invoke Info you start off looking at this node.          File: dir,      Node: Top       This is the top of the INFO tree            This (the Directory node) gives a menu of major topics.       Typing "q" exits, "?" lists all Info commands, "d" returns here,       "h" gives a primer for first-timers,       "mEmacs<Return>" visits the Emacs manual, etc.            In Emacs, you can click mouse button 2 on a menu item or cross reference       to select it.          * Menu:          System administration     * Stow: (stow).                 GNU Stow.      What would be the recommended way of resolving this conflict?


How to demonstrate invalid PID assumptions?

It seems many programmers are happy with saving a PID to a file, and then later read and use the PID as if it was guaranteed to be the same process. It seems the general idea is that the odds are good enough to ignore. How can I simply demonstrate this problem? Ideally in such a way that existing shell scripts can be adapted to demonstrate this with the minimum of trial and error.


How to find from what computer I connected to a current server

I often work on one of available to me Linux/HP-UX servers (let's say it is server1) and then do `ssh server2` ((let's say it is server2)) and start working on another Linux/HP-UX server. Then I can connect another server ((let's say it is server3) and start working on it. While working on server3 how to get in command line information from what server I came from? So on server3 I want to get information that I came from server2 and on server2 I want to get information that I came from server1? What is a command or utility for it?


help for shared web hosting in lan

I have this senario and what i am doing is.   1. Emulating Web hosting service and Internet (in LAN)   2. I have Linux Server which is in private LAN network   3. and other clients in other Lan network connected to router and using NAT like internet   4. What i want is i want to make shared webhosting like 000webhost.com or godaddy.com so that clients go to the site e.g www.company.com and they see my hosting site and they can signup for hosting and register there domains and have cpanel and all services like professional hosting. **What I Know already** I have setted up LAMP in ubunutu server Bind in ubuntu server for DNS and already have one site created i.e www.hosting.com what i need is cpanel for web hosting provider administration ,I choosed VHCS for that. I can now create users asign them domains, quotas etc BUT, **What i dont understand** how users can register through www.hosting.com and get there panel automatically ?


Second monitor detected but not receiving signal?

I'm at my wit's end trying to figure this one out. I have an ATI Radeon X1600 (DMS-59 connector with DMS-59 to dual-DVI adapter). I'm trying to get dual monitors working properly. So far, I've tried a few different Debian-based distributions. The only one I can get to properly display on both monitors is Backtrack 5 R3. The problem: both monitors are detected by xrandr, and all settings look exactly the same. However, one monitor will not come out of standby. It doesn't appear to ever receive a signal. I've even changed the display layout in the System Settings. The screen size is correct, and the positioning is correct. I can even move the mouse to the second monitor, but it just stays in standby mode. Any ideas? _**EDIT_**   Output of xrandr follows:                 ~# xrandr     Screen 0: minimum 320 x 200, current 2880 x 900, maximum 8192 x 8192     DVI-0 connected 1440x900+1440+0 (normal left inverted right x axis y axis) 408mm x 255mm        1440x900       59.9*+   75.0          1280x1024      75.0     60.0          1280x960       60.0          1366x768       60.0          1360x768       60.0          1280x800       74.9     59.9          1152x864       75.0          1280x768       74.9     60.0          1024x768       75.1     70.1     60.0          1024x576       60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          848x480        60.0          640x480        72.8     75.0     66.7     60.0          720x400        70.1       S-video disconnected (normal left inverted right x axis y axis)     DVI-1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 408mm x 255mm        1440x900       59.9*+   75.0          1280x1024      75.0     60.0          1280x960       60.0          1366x768       60.0          1360x768       60.0          1280x800       74.9     59.8          1152x864       75.0          1280x768       74.9     59.9          1024x768       75.1     70.1     60.0          1024x576       60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          848x480        60.0          640x480        72.8     75.0     66.7     60.0          720x400        70.1      And the monitor is a Dell SE198WFPv.


Possible to source a file in .i3config

I want to extract the default keybindings from my `.i3config` file and source it from another file I did that like this:               #~/.i3config     ...     #source default keybindings     . ~/.path_to_other_file      But this doesn't work. Restarting i3 causes an error "you have a syntax error in your config file!" I can't think why this wouldn't be possible, but `. ~/path_to_other_file` and `source ~/path_to_other_file` both don't work.


systemctl start depending on tty

I would like to start Apache automatically on my machine, but only if I login from TTY1 (I do not run a display manager). If I log in from any other TTY, it should not start. I tried this in my `bash_profile`:               [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && systemctl start httpd      But this does not work. Other commands DO work like this, so I assume the issue is permission related (only `su` can run `systemctl`). Is there another way to start the httpd server that is TTY dependent? I am running Arch (see this page for how X is start upon login without a display manager, for instance).


Telnet on Linux Server

I want to know if it is necessary to have telnet enabled on both sides of machines to get telnet connection. Here's the issue: I am trying to telnet some public IP on port 80 from a Linux web server (Red Hat). This public IP has got HTTP (80) enabled on it. I'm not sure if telnet is enabled but the owner says it is. On my Linux server, HTTP (80) is enabled but not telnet. Instead SSH is enabled. When I telnet from my Linux server: `telnet PublicIP 80` it says:               Trying "PublicIP"...     Connected to "PublicIP" ("PublicIP").     Escape character is '^]'.     Connection closed by foreign host Do is have to enable telnet on my server for it to work? Because there's no issue at the other end as confirmed by other sources. Public IP: 220.226.190.180 Please explain how can I make it work. If I have to enable telnet on my Linux server, please share the command and method to do so.


br0 causes to drop multicast connection after 5 minutes

I have these interfaces set up on the router (Linux machine):               br0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500             inet 192.168.0.3  netmask 255.255.255.0  broadcast 192.168.0.255          bridge name bridge id       STP enabled interfaces     br0     8000.00156d8591ec   no      eth0                                 wlan0          eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet6 fe80::7271:bcff:feb1:d9cf  prefixlen 64  scopeid 0x20<link>          eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 10.200.44.147  netmask 255.255.255.128  broadcast 10.200.44.255          wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet6 fe80::215:6dff:fe85:91ec  prefixlen 64  scopeid 0x20<link>      In br0 there are two interfaces (eth0 - local home network and wlan0 - wireless home network). eth1 is internet connection interface and is not part of the br0. I use mumudvb for sending multicast IPTV with IP group 239.100.0.1 (udp/1234) and receiving this multicast traffic on a different machine on LAN using VLC player. When I configure it to send multicast over eth0 all works well on home LAN but I can't join the multicast group from the router itself. That's why I configured it to send multicast over br0 (makes more sense - then I can join the multicast group from the LAN eth0 as well as router itself) but after about 5 minutes since join, LAN multicast connection drops (without sending any IGMP message). But I can join again and it will work for next 5 minutes again, then drop. Why is it dropping when sending multicast over br0 and not dropping when sending directly through eth0? Am I missing some configuration on the bridge? What can expire during this period? For example STP is disabled for the bridge but it shouldn't affect this? When I join the br0 multicast group from the router itself, it won't drop. Only when subscribed from a machine connected to the br0 through eth0.


NetBSD: /etc/man.conf man search path does not work

I've added a new man page directory               /usr/local/share/man/man1b      which contains files like e.g.               troff.1b      In /etc/man.conf I added               _subdir ...some names... man1b     _default /usr/{share,X11R7,X11R6,pkg,local,local/share}/man/     local /usr/local/share/man/     1b {cat,man}1b      _man -p_ prints               ...     /usr/local/share/man/man1b      But if I input               man 1b troff      I get the error message               man: no entry for troff in the manual.      (I can't use _man troff_ since _groff_ is installed too with a man page elsewhere in cat1.) How can I add the man path correctly? PS: If I rename the file to _troff.1_ then _man 1b troff_ works. But I thought that the category can also be the file name extension. Could it be a bug of NetBSD (file name _troff.1b_ works in OpenBSD and Linux)?


Unable to install CentOS in VirtualBox

I am trying to install CentOS 5.6 in My VirtualBox but I got this error on boot screen. `Your CPU Does not support long mode : use a 32 bit Distribution` My CPU is 64 bit I checked that using `uname -a` command and the output is `Linux localhost.localdomain 2.6.43.8-1.fc15.x86_64 #1 SMP Mon Jun 4 20:33:44 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux` As per my knowledge I need to enable 32 bit support to my VirtualBox but I don't know from where I can enable that. If you have any idea regarding this then please suggest me.


Xubuntu 13.10 on Dropbox

I have a Mac OS X 10.5.8, and I would like to use Linux on a virtual machine. I use Dropbox, and the most modern version I can run on my PC is Version 4.1.8. I created a virtual machine running Xubuntu 13.10, and everything works fine except for the following problem. My display is 1280x800, but for some reason Xubuntu cannot have a higher resolution than 1024x768. I don't think it's a problem related to Dropbox itself. I have read many posts of people having the same problem, but nothing seems to work. Please note that I'm really new to all this. I can barely use the basic commands in the Terminal.


Changing user to root when connected to a linux server and copying files

My script is coded in a way that doesn't allow you to connect to a server directly by root. This code basically copies files a server to my computer and it works but I don't have access to many files because only root can access them. How can I connect to a server as a user and then copy its files by switching to root? Code I want to change:               sshpass -p "password" scp -q -r username@74.11.11.11:some_directory copy_it/here/      In other words, I want to be able to remotely copy files which are only accessible to root on a remote server, but don't wish to access the remote server via ssh/scp directly as root. Is it possible through only ssh and not sshpass?


tmux: Keep scroll position when changing session

Sometimes I'm scrolling up a log file and need to switch sessions, so open the session menu with prefix-s. This causes tmux to forget the window's scroll position, so that when I return it's at the bottom of the log file. Is there any way to keep scroll position when switching session?


How to get start time for a defunct process on AIX?

When I run the following commands on AIX:               22:root@SERVER:/root # ps -ef | head -1          UID      PID     PPID   C    STIME    TTY  TIME CMD     22:root@SERVER:/root # ps -ef | grep defunct | head -1          foo  9364552  7975688   0                  0:00 <defunct>      I came across this process that was in a state of `<defunct>`. Bringing up the kernel debugger, `kdb`, if I poke inside this process' PID:               22:root@SERVER:/root # kdb     WARNING: Version mismatch between unix file and command kdb            START              END <name>     0000000000001000 0000000004160000 start+000FD8     F00000002FF47600 F00000002FFDF9C8 __ublock+000000     000000002FF22FF4 000000002FF22FF8 environ+000000     000000002FF22FF8 000000002FF22FFC errno+000000     F1000F0A00000000 F1000F0A10000000 pvproc+000000     F1000F0A10000000 F1000F0A18000000 pvthread+000000     read vscsi_scsi_ptrs OK, ptr = 0x0     (0)> tpid -d 9364552                 SLOT NAME     STATE    TID PRI   RQ CPUID  CL  WCHAN          pvthread+05FE00 1534 <zombie> ZOMB  5FE00AD 03C    5         0        Noting which `SLOT` it was occupying, looking at the `start` of this process:               (0)> u 1534 | grep -i start     (0)> where 1534     thread F1000F0A1005FE00 not loaded          (0)>      (0)> exit      Looking, there isn't any `STIME` associated with the process. Here's additional information about my system:               22:root@SERVER:/root # oslevel -s     6100-08-03-1339     22:root@SERVER:/root # uname     AIX      AS well as additional information about my `<defunct>` process:               22:root@SERVER:/root # procstack 9364552     procstack: 9364552 is a kernel process     22:root@SERVER:/root # proctree 9364552     7975688    /foo/foobinary        9364552          **My question** : there is no STIME in "ps" command for the defunct processes. Are there any ways to get the start time of them?


double-quoting parameter (representing filename) doesn't help if spaces are contained

When iterating over some filenames double-quoting the parameter does not prevent the filename from being broken:               $ mkdir temp     $ cd temp/     $ touch a\ b     $ for f in $(find .) ; do echo "$f" ; done     .     ./a     b


Can I safely delete ~/Trash file?

My Uni account is over disk quota and requesting more quota takes time. Unfortunately, I need disk space _now_ and I noticed that the `Trash` file in my home directory is quite a large file. Now I’m a total postfix noob but I’m assuming that this somehow relates to my mail inbox? (I do have some doubts, since although his file clearly contains email messages, `tail Trash` reveals that the last message is from 2006). Furthermore, my mail client (connected via IMAP) reveals that my trash folder is empty. **Can I just delete the Trash file** or do I need to fear dire consequences? The very first message in that file reads as follows:               From MAILER-DAEMON Sun Dec  3 13:40:15 2006     Date: 03 Dec 2006 13:40:15 +0100     From: Mail System Internal Data <MAILER-DAEMON@human>     Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA     Message-ID: <1165149615@human>     X-IMAP: 1135694114 0000000927 $NotJunk $Junk JunkRecorded     Status: RO          This text is part of the internal format of your mail folder, and is not     a real message.  It is created automatically by the mail system software.     If deleted, important folder data will be lost, and it will be re-created     with the data reset to initial values.      Furthermore, there’s another file in my home folder called `Deleted Messages` – what’s the difference between the two?


Arch Linux pacman specifying package version

I know that I can define wanted package version in `pacman` like shown in its manual `pacman -S "bash>=3.2"`. But how do I know what versions are available? I also know that `pacman` is creating copy of mirrors upon syncing in .db files in `/var/lib/pacman/sync/`, but those files are not human-readable. And what if I want to install some version `virtualbox` for example, that I hope is in mirrors somewhere, that wouldn't require newer version of `linux` (set as `IgnorePkg` in `pacman.conf`) than I have installed (because of `nvidia` drivers)? How do I know what version that is and if it is available?


inotify and rsync on large number of files

I am using inotify to watch a directory and sync files between servers using rsync. Syncing works perfectly, and memory usage is mostly not an issue. However, recently a large number of files were added (350k) and this has impacted performance, specifically on CPU. Now when rsync runs, CPU usage spikes to 90%/100% and rsync takes long to complete, there are 650k files being watched/synced. Is there any way to speed up rsync and only rsync the directory that has been changed? Or alternatively to set up multiple inotifywaits on separate directories. Script being used is below. UPDATE: I have added the --update flag and usage seems mostly unchanged               #! /bin/bash          EVENTS="CREATE,DELETE,MODIFY,MOVED_FROM,MOVED_TO"          inotifywait -e "$EVENTS" -m -r --format '%:e %f' /var/www/ --exclude '/var/www/.*cache.*' | (     WAITING="";     while true; do         LINE="";         read -t 1 LINE;         if test -z "$LINE"; then             if test ! -z "$WAITING"; then                     echo "CHANGE";                     WAITING="";                     rsync --update -alvzr --exclude '*cache*' --exclude '*.git*' /var/www/* root@secondwebserver:/var/www/             fi;         else             WAITING=1;         fi;     done)


Cannot delete File on Fedora

I have a file with following permission:               -rwSr-s---. 1 1634630331 1818884080 118784 Jun 29 1970 DailyUpdateClass.class      If I try to delete this file with root login, I get error.               rm: cannot remove ‘model/DailyUpdateClass.class’: Operation not permitted      I cannot change ownership nor I can do anythig else. I posted it on StackOverflow and tried few things but no help so far. I was recommended that I should try this on Unix Stack Exchange so requesting your assistance.


kill all process of executables in a folder

I need to kill all the child process. The main process in lmbench               pkill -9 lmbench       is not killing it, but               kill -9 <pid>      kills the parent process, but even after killing the parent process some process from /usr/lib/lmbebch/bin keeps running, **How to kill all process or executables located inside /usr/lib/lmbench ?** or kill lmbench with its children. I cannot use ctrl + c as I start it from a shell script and use pipe to control lmbench * * * Solved the problem by using               busybox killall -9 lmbench     busybox pkill -P $lmbenchPID      but is there any single command way? lmbenchDriver.sh is the shell script that calls lmbench so after lmbenchDriver exits, I still can see process > lmbenchDriver, lembench, mem, line,


Why does my Fedora 14 system with an Intel Mobile GME965/GLE960 Integrated Graphics Controller come up with the wrong aspect ratio?

I have a:      Compaq 610 VC275EA 15,6" WXGA i CELERON T1500      and I installed Fedora 14 on it. Everything is great, except one: the aspect ratio of the screen is not very good :\      http://bit.ly/e18LgF   http://pastebin.com/raw.php?i=dCbg5qNt   http://pastebin.mozilla.org/1165203                    00:02.0 VGA compatible controller: Intel Corporation Mobile GME965/GLE960 Integrated Graphics Controller (rev 0c)     00:02.1 Display controller: Intel Corporation Mobile GME965/GLE960 Integrated Graphics Controller (rev 0c)         Can someone please say, that it cannot be fixed, or say: yes, it could be fixed, do xy, read xy, etc. :\ This is an issue for me for months now.. :\ Please help


Recursively create directories for all letters

I want to create a directory in such a way that I need to label the directories from `a` to `z`. Inside each of these directories, I need to create sub-directories so that they are labelled as `aa`, `ab` etc. So, for instance, for the directory `m`, my sub-directories will be labelled as `ma`, `mb` upto `mz`.


Get driver location for particular printer via command line

This is on OS X 10.8. I want to be able to arbitrarily pull the configuration for a particular printer, so I can use it in a package-creation script. The script (not mine) uses               /usr/sbin/lpadmin -p "$printername" -L "$location" -D "$gui_display_name" -v "$address" \     -P "$driver_ppd"      to set up a new printer. If I supply `$printername` on the system I'm pulling from, I can get `$location` and $address from `lpoptions`. But I can't seem to find a command that will give me `$driver_ppd` (which takes the form `/Library/Printers/PPDs/Contents/Resources/HP LaserJet P4010_P4510 Series.gz`). I know it's available to the system because I can see it in the CUPS web interface under that printer.


Why does ssh -g say that address is already in use?

I setup an SSH connection with port forwarding that allows remote hosts to connect to the local forwarded ports like this:               ssh -g -L 5115:localhost:5115 <server>      The connection works fine even though I get this error message:               bind: Address already in use      I get this message no matter what ports I choose. I'm wondering why I get this message even though the connection appears to work flawlessly. Am I doing something wrong? Thanks in advance for your help


How to open a PDF file using PuTTY as a terminal?

I connected to a Linux system using the `putty` SSH client on my Windows PC. Now it's unable to open a PDF document in `putty`. The error message:               gnome-open .pdf          (gnome-open:4137): GConf-WARNING **: Client failed to connect to the D-BUS daemon:     Unable to autolaunch a dbus-daemon without a $DISPLAY for X11     GConf Error: No D-BUS daemon running      How can I open this document for viewing?


Internal Server Errors with CUPS

Recently, I get internal server errors with CUPS.               > sudo lpinfo -m     lpinfo: Internal Server Error      Here is my `/etc/cups/cupsd.conf`. I’m not even sure where to start. I tried commenting out suspicious lines, but to no success. How can I fix this? I run CUPS `1.7.2-1` on debian wheezy/sid. If you need any more information, please let me know. Any help is greatly appreciated.


Can I overwrite LUKS partition with it's decrypted content?

I have HDD with my data (partial backup of most important data available on other HDD), currently it's formatted as Ext4 over LVM over LUKS. I want to remove LUKS layer, but reformatting and data restore from backup is too long/no fun. Is there any possibility/chance to overwrite LUKS partition with it's content without using big buffer and without data corruption?


How does `shutdown -k` disable logins?

This is the `-k` option's documentation in `man shutdown` (at least on Ubuntu):                -k   Only send out the warning messages and disable            logins, do not actually bring  the  system down.      I initially assumed that this will use `pam_nologin` to lock out logins. However, I tested it out and do not see `/etc/nologin` created after running `shutdown -k`.   1. How does `shutdown -k` disable logins?   2. How can you re-enable logins after a `shutdown -k`?


Adding www-data to /etc/sudoers dos not work for PHP shell_exec() to run a command

I'm running the webserver lighttpd on Raspbian (Debian based) on a Raspberry Pi. The server runs as user www-data (checked with `ps aux`). I added the following line to `/etc/sudoers`:               www-data ALL=NOPASSWD:/opt/vc/bin/vcgencmd      to be able to run the `vcgencmd` tool from the Raspberry Pi that gives status information from within a PHP file with               <? echo shell_exec('vcgencmd version'); ?>      All it prints is "VCHI initialization failed" (instead of the supposed version information that appears when I run it on my user even without `sudo`) which appears when vcgencmd is run with wrong permissions. Running for example               <? echo shell_exec('cat /sys/class/thermal/thermal_zone*/temp'); ?>      works fine without any `/etc/sudoers` change, so there's no problem with PHP (like forbidden `shell_exec` or something). What else needs to be set in order to execute a command?


Is it OK to use "." to run files instead of source - in .bashrc in Ubuntu and OS X?

OK, so `source` runs the script in the current shell and `.` separately, as detailed in running script with ". " and with "source " for example, but, specifically, in my **`.bashrc`** file, I have:               [ -f ~/.bash_aliases ] && source ~/.bash_aliases     [ -f ~/.git-completion.bash ] && source ~/.git-completion.bash     [ -s ~/.autojump/etc/profile.d/autojump.sh ] && source ~/.autojump/etc/profile.d/autojump.sh      Can I replace this with:               [ -f ~/.bash_aliases ] && . ~/.bash_aliases     [ -f ~/.git-completion.bash ] && . ~/.git-completion.bash     [ -s ~/.autojump/etc/profile.d/autojump.sh ] && . ~/.autojump/etc/profile.d/autojump.sh      Will that work on OS X - is that the "POSIX" issue? I tried it and the above still seem to work on Ubuntu (so they actually work with both `source` and `.`, that is, they give me the desired functionality in the shell). Should I choose one over the other, or am I missing something? FWIW, on OS X, I source my `.bashrc` from my `.bash_profile`.


How can I use `sudo` with a command, but still "be myself"?

My SysAdmin is requiring me to use `sudo` to run a certain script. This script (depending on which subcommand you pass in as an argument) connects to another machine using ssh keys, but this is failing, presumably because it is run as root and not as me. How can I still use `sudo` (which my sysadmin requires and which I don't have the power to change) to gain the privileges to run the script, and yet make the command run with access to my ssh keys?


Use eth0 and eth1 for different subnets and assigned host name to interface?

I have a machine running SELES 10 with dual NIC Both the NICs are on separate subnets. The server uses a DHCP. So when one interface, `eth0`, gets the IP from DHCP and registers with DNS and then the other interface, `eth1`, gets an IP and registers with the DNS, it overwrites the DNS record. ### Questions   * Is there a way I can keep both records in the DNS and be able to use the interfaces separately?    * I've come across an article titled: 14.3. Configuring a DHCP Client, has anyone used the option `DHCP_hostname` where you can tie the interface to the hostname for the first `eth0` and `eth1` can be anything else?   * Has any one tested that?    * According to the article it would appear that it's possible, does that sound correct? **NOTE:** The article mentioned above is for Red Hat based distros if that matters.


Why doesn't source work when I call bash -c

I want to run a command that sources a script to take on some env. variables before executing, without sourcing them in my current shell. test.env               export test=1      None of these commands echo the env. variable: a) Shouldn't this work? Aren't I just executing these commands in a new shell and returning the output?               $ bash -c "source test.env && echo $test"      b) Here I execute test.env and try to run echo $test in the same process using exec.               $ bash -c "./test.env && exec echo $test"      c) Lastly I just tried this since it was a possible permutation. But it executes test.env and the echo command as separate processes.               $ bash -c "./test.env && echo $test"      And how can I get this to work where the env. variables are sourced before the 2nd command is executed?


Kali Linux Postgresql Error

I recently installed kali Linux and keep getting an error code starting metasploit this is the code               [...] Starting PostgreSQL 9.1 database server: main     [...] Error: could not exec /usr/lib/postgresql/9.1/bin/pg_ctl /usr/lib/postgresql/9.1/bin/pg_ctl start -D /var/lib/postgresql/9.1/main -l /var/log/postgresql/postgresql-9.1-main.log -s -[FAILconfig_file="/etc/postgresql/9.1/main/postgresql.conf": ... failed!     failed!      Would really appreciate a solution been stuck for awhile.


can't connect using telnet, ssh. Connection refused

My imagine network (using marionnet) looks like that:               m1[eth0 192.168.1.1/26]      switch      m2[eth0 192.168.1.2/26] [eth1 192.168.2.1/28]     switch      m2[eth0 192.168.2.2/28]      I can ping from any machine to another. Now I want to:   1. run telnet on m1.   2. run ssh on m3.   3. connect from m3 to m1 using telnet.   4. start capturing packets and writing to the file from m2 using tcpdumy.   5. make a few commands on m1 through telnet session.   6. stop capturing packets   7. disconnect telnet session   8. stop telnet server on m1   9. start capturing packets on m2, but this time writing to other file.   10. connect from m1 to m3 using ssh   11. make a few commands.   12. stop capturing packets But I stayed at the beginning. What I've done: ### on m1:               $ xinetd start     $ nmap 192.168.1.1     ...     All ports are closed     ...      ### on m2:               $ dropbear start     $ telnet 192.168.1.1      Which results in this message: > unable to connect to remote host: Connection refused               $ nmap 192.168.2.2     ...     All ports are closed     ...


How to change font colors in terminal?

I know how to change the font color via preferences, but it changes the color of ALL text, as in below:    ![what I have](http://i.stack.imgur.com/J0N9L.png) What I'm going for is something more like this:    ![what I want](http://i.stack.imgur.com/Z6sCg.png) Any tips?


ctrl c vs. ctrl z with foreground job

`Ctrl`+`Z` stops the job whereas `Ctrl`+`C` kills the job. Why is that? Wouldn't the other way make more sense?               z@z-lap:~$ sleep 100&     [1] 4458     z@z-lap:~$ sleep 200&     [2] 4459     z@z-lap:~$ jobs     [1]-  Running                 sleep 100 &     [2]+  Running                 sleep 200 &     z@z-lap:~$ fg %1     sleep 100     ^Z     [1]+  Stopped                 sleep 100     z@z-lap:~$ jobs     [1]+  Stopped                 sleep 100     [2]-  Running                 sleep 200 &     z@z-lap:~$ fg %1     sleep 100     ^C     z@z-lap:~$ jobs     [2]+  Running                 sleep 200 &


Properly configuring symmetric active NTP?

I'm trying to configure two NTP servers to be peers to each other but I have no idea how to tell if it is working or not or whether my NTP configuration is even correct. I've put a simplified view of how my NTP servers are configured below.               Server A :        ntp.conf :          restrict default kod nomodify notrap noquery         peer Server B          Server B :       ntp.conf :          restrict default kod nomodify notrap noquery         peer Server A      I have two questions with regards to this setup: EDIT : Added clarification to question 1   1. Using the simplified `ntp.conf` I have put up, will the two NTP servers act as peers to each other by attempting to correct their time? I am looking for the simplest possible setup for ntp peers and I am not sure whether I am configuring it correctly.    2. How do I confirm that my NTP peer configuration is working? The reason I'm asking the above questions is because I have an alternative setup where the only change is that I've re-added the `nopeer` setting to the `restrict` stanza and in both cases the following output is returned:               Server A:       ntpdc -l         sym_active : Server B          Server B:       ntpdc -l         sym_active : Server A      Which makes no sense whatsoever since the `nopeer` directive should not enable me to peer the two servers together. Note : This is run on CentOS 6 EDIT : Actual ntp.conf files and ntpq -p as requested. I am not sure how useful these would be:               Server A:       driftfile /var/lib/ntp/drift            restrict default kod nomodify notrap noquery       restrict -6 default kod nomodify notrap noquery                 restrict 127.0.0.1        restrict -6 ::1             peer 192.168.122.3          Server B:       driftfile /var/lib/ntp/drift            restrict default kod nomodify notrap noquery       restrict -6 default kod nomodify notrap noquery            restrict 127.0.0.1       restrict -6 ::1            peer 192.168.122.2      The output of ntpq -p after more than 5 minutes (which exceeds the poll interval) is the following for each server.               Server A:          remote           refid      st t when poll reach   delay   offset  jitter     ==============================================================================      secure.jzhu.loc .INIT.          16 u   55   64    0    0.000    0.000   0.000          Server B:          remote           refid      st t when poll reach   delay   offset  jitter     ==============================================================================      masterdns.jzhu. .INIT.          16 u   33   64    0    0.000    0.000   0.000      Note : With or without the nopeer directive, the reach remains consistently at 0. Although that's more likely due to the fact that they are both stratum 16 servers than anything else. Note : iptables -F was run when performing this test and the default policy for the chain INPUT was ACCEPT.


Very high CPU load, but nothing significant in top

I'm running Ubuntu Linux 12.04.1, with VirtualMin 4.08.gpl GPL and 2 CPU cores. Pretty much all the time for the last few weeks, it's been running at well above load average of 5, usually up closer to 10, sometimes reaching 20. Right now, CPU load averages: 9.20 (1 min) 8.20 (5 mins) 7.81 (15 mins) At the same time, VirtualMin returns:               Virtual Memory: 996 MB total, 15.44 MB used     Real Memory: 3.80 GB total, 972.43 MB used      Local disk space: 915.94 GB total, 116.03 GB used      Have restarted (`shutdown -rf now`) the machine a few times and sure enough sooner or later we're back up with high CPU loads. Running `top` (or `htop`) returns nothing significant at all running at high CPU - in fact watching it for a few minutes and the highest item would maybe high 3% CPU. Top returns this also:               Cpu(s): 2.2%us, 1.2%sy, 0.0%ni, 0.0%id, 96.5%wa, 0.0%hi, 0.2%si, 0.0%st      The `%wa` concerns me as it's so high - seems to stay up above 80%. I understand this is % in wait, but not sure what that means in practical terms. Where can I start to debug this and figure out what's causing the high CPU load?


How do you make less show the filename?

I often have multiple terminal windows opened with less (eg comparing various log files). I forget which file is which. Is there a similar command to ^G in vi which displays the name of the file currently being viewed?


Bash: double equals vs -eq

I am doing integer comparison in bash (trying to see if the user is running as root), and I found two different ways of doing it: Double equals:               if [ $UID == 0 ]     then     fi      -eq               if [ $UID -eq 0 ]     then     fi      I understand that there's no >= or <= in bash, only -ge and -le, so why is there a `==` if there's a `-eq`? Is there a difference in the way it compares both sides?


We need a "C" list that contains all the elements of "A", but doesn't have any of "B"

We have two lists. A bigger "A":               A=`echo -e '1\n2\n3\n4\n5'`     echo "$A"     1     2     3     4     5      and a smaller "B":               B=`echo -e '1\n2\n3'`     echo "$B"     1     2     3      **Q:** But we need a third list that contains all the elements of "A", but doesn't have any of "B", how do I do it in bash?               echo "$C"     4     5      The numbers could be anything, from "foo" to 99, etc.. **UPDATE:** It's working in the shell by hand, but it's strange because if I put it in a script, it doesn't works!               cat a.txt      A=$(seq 5)     B=$(seq 3)     comm -23 <(sort <<< "$A") <(sort <<< "$B")     sh a.txt      a.txt: line 3: syntax error near unexpected token `('     a.txt: line 3: `comm -23 <(sort <<< "$A") <(sort <<< "$B")'      doing it by hand it works..:               A=$(seq 5)     B=$(seq 3)     comm -23 <(sort <<< "$A") <(sort <<< "$B")     4     5      **Why?** update on update: Need to use bash instead of "sh" :D


Which Hex code for /boot partition

I planned to install ArchLinux on my laptop. I'm only at the begining, trying to understand all the step before doing them. I'm only at the first step, i.e. partitioning, that I already have a small problem. I want to use my SSD as Raid0. My laptop uses UEFI boot so I have GPT table. To create the raid0, I have understood that I need to create one partition on each drive, then use `mdadm` to create the raid. However, before doing this, I need to create a partition for /boot. I have read that the size of this partition must be 300 MB. Is it true? My second question is about the hex code I've to use. I've seen that there is a code ef00 for EFI System, but also a code for MBR partition scheme and one for BIOS boot partition. I suppose that I have to use ef00. Is that correct?


Can a script be running even after it's been killed?

I know it sounds so stupid and I know it IS stupid but I ran a unix script to send me and my friend emails every few seconds to test mailx. Stupid thing is I used $ while true; do blah blah blah... and as far as I can tell, it has not stopped running because I kept getting emails long after I killed the process and deleted the file, or so it would seem at least. The flow of emails suddenly stopped at some point, but that's simply because we believe gmail started gave up on our accounts or something. We sent regular emails to ourselves and we haven't received any of it, and we haven't received anything for the past few hours. No, there's nothing new in the Spam box either. Would absolutely love some help right now!


SSH + Sudo + Expect in Bash script: Run command with sudo in remote machine

I am trying to automate the deploy of some .deb packages with an script. I want to execute `sudo dpkg -i $myDeb.deb` in a list of remote machines I can access with ssh. I've tried to automate the command with 'expect' inside a bash script, but I am obviously doing something wrong because I get a number of different errors (depending on where I put the quotation marks, basically) This is the function I have (will be called with something like: `_remoteInstallation "myPackage115.deb" "192.168.1.55"`. I know that in the remote machine, the .deb is going to be located in $HOME/Documents/:               function _remoteInstallation(){         local retval=1         local debToInstall=$(basename "$1")         local remoteMachine="$2"         spawned=$(expect -d -c "               set timeout 1800               spawn "/usr/bin/ssh -t borrajax@$remoteMachine /usr/bin/sudo /usr/bin/dpkg -i /home/borrajax/Documents/$debToInstall"'               expect {                     \"Are you sure you want to continue connecting\" { send \"yes\r\"; exp_continue }                     \"password\" { send \"myPassword\r\";  exp_continue }                     \"[sudo] password\" { send \"myPassword\r\";  exp_continue }                     default { exit 1 }               }         " )         retval=$?         return $retval     }      With the quotes in the spawned area like that, I get               expect: invalid option -- 't'      If I change it to:                spawn /usr/bin/ssh -t borrajax@$remoteMachine '/usr/bin/sudo /usr/bin/dpkg -i /home/borrajax/Documents/$debToInstall'      It looks like is trying to run the sudo dpkg command locally (first ssh(s) to '$remoteMachine' and then runs sudo dpkg locally, like two separate commands) With this:               spawn '/usr/bin/ssh -t borrajax@$remoteMachine \'/usr/bin/sudo /usr/bin/dpkg -i /home/borrajax/Documents/$debToInstall\''      I get that `couldn't execute "'/usr/bin/ssh": no such file or directory` (which is not true) ... and at this point, I ran out of ideas... **:-)** Any hint will be appreciated. Thank you.


Creating MySQL database and user without password

I am building a set of bash scripts which basically prepare apache virtual hosts, git repositories and other stuff on a cloud server. So far so good, everything is working, but a big problem occurred: **MySQL database and users creation**. The current scripts use ssh with keys to authenticate to the cloud server and everyone from my team can execute commands. I want to keep it this way and somehow let them create new MySQL database and user without needing to login to mysql as root or any other user with high privileges, but I don't have any solution for this. **Idea #1** is to create a new mysql user without password and give it full rights (like root) but make it usable only `@'localhost'`. **Idea #2** is to store the password for this MySQL control user in a file and make it accessible only to the current ssh user which the other scripts use. Then the mysql login will use this stored password to login and create the database and user. I don't know which option is better and I know they are dangerous. I ask for opinion and any better ideas.


Error in Script. Command find is skipping folders with space character

I need a script that counts the files in a directory (and sub). I've taken the followed script, and changed it to my need. It works like it should, except for folders with space characters. I'm pretty sure I'm missing quotes anywhere, but can't figure it out yet. ### Additional Informations   * Linux 2.6.22.19-0.4-default (this server is not in a productive environment anymore.)   * GNU find version 4.2.31   * I'm not able to rename the directories. ### Example Directory Structure               .     ..     01_infos     02_sent     03_inbox     04_public and private     197.     145.     329.     13.      ### Script               #!/bin/bash     # Write a script that will count the number of files in each of your subdirectories.     # -------------------------------------------------------------------------     # Copyright (c) 2001 nixCraft project <http://cyberciti.biz/fb/>     # This script is licensed under GNU GPL version 2.0 or above     # -------------------------------------------------------------------------     # This script is part of nixCraft shell script collection (NSSC)     # Visit http://bash.cyberciti.biz/ for more information.     # -------------------------------------------------------------------------          START=$HOME          # change your directory to command line if passed     # otherwise use home directory     [ $# -eq 1 ] && START=$1 || :          if [ ! -d $START ]     then             echo "$START not a directory!"             exit 1     fi          # use find command to get all subdirs name in DIRS variable     DIRS=$(find "$START" -type d)          # loop thought each dir to get the number of files in each of subdir     for d in $DIRS     do             echo "$d directory has $(find "$d" -maxdepth 1 -regex '.*\.' -type f | wc -l) files" || :     done      ### output               ./01_infos directory has 1 files     ./02_sent directory has 9 files     ./03_inbox has 4 files     find: ./04_public: No such file or directory


How can I shorten an if then else using the [] format

I want to shorten this to a one liner:               if ls --version 2>/dev/null | grep -q 'coreutils'; then alias ls='ls --color=always'     else alias ls='ls -G'     fi      I frequently use `[]` for conditionals, e.g. `[ -z(or -n) condition]` but haven't had to do an else part in this format yet. In ruby I would do `condition ? true : false` Is there an equivalent in bash? I tried               [ -z ls --version 2>/dev/null | grep -q 'coreutils'] ? alias ls='ls --color=always' : alias ls='ls -G'      but obviously that's not the right way to do it. I want a one-liner because I want all my `.bashrc` to fit in a smallish window (< ~50 lines) so, as with other multi-liners I condense them into one liners when possible. I am comfortable with sacrificing readability for size for this example. I also tried:               [ -z ls --version 2>/dev/null | grep -q 'coreutils'] && alias ls='ls --color=always' || alias ls='ls -G'      and               [ -n ls --version 2>/dev/null | grep -q 'coreutils'] && alias ls='ls --color=always' || alias ls='ls -G'      and               [ ls --version 2>/dev/null | grep -q 'coreutils'] && alias ls='ls --color=always' || alias ls='ls -G'      but I always get the 'else' alias not the 'then' alias I could just reverse it but I suspect that as it's not working right that wouldn't help. Only way to be sure though is to try it on OSX and I'm on ubuntu right now.


zsh copy and paste like emacs

I have noticed that zsh has a lot of things I see in emacs. I can make a selection with ctrl+space and selecting a region. I can make copies just like in emacs while I stay inside zsh. In emacs I'm able to use my system clipboard (previously with some additional configuration needed but this works out of the box now in emacs). In zsh I can't seem to paste from my clipboard using C-y and copying from zsh to my system cliipboard has the same issue. Is there a way around this?


What happens in UNIX/Linux when a program is bigger then size of memory?

I was wondering how embedded systems are able run programs bigger than the size of memory. If I had 1 GB of memory and the program was 1.5 GB, would the program load? Are there systems that only use available memory?


How can I make Flash fullscreen on an external display?

The question is: I have a laptop, and I extend my desktop on external display, so I get a wide desktop (3200px). When I make the videos on flash fullscreen, don't know why, but the fullscreen appears on my little part of desktop (the laptop display). Is there any way to tell flash to play fullscreen on my bigger part?


Disable a user's login without disabling the account

Let's say I create a user named "bogus" using the `adduser` command. How can I make sure this user will NOT be a viable login option, without disabling the account. In short, I want the account to be accessible via `su - bogus`, but I do not want it to be accessible via a regular login prompt. Searching around, it seems I need to disable that user's password, but doing `passwd -d bogus` didn't help. In fact, it made things worse, because I could now login to bogus without even typing a password. Is there a way to disable regular logins for a given a account? _Note: Just to be clear, I know how to remove a user from the menu options of graphical login screens such as gdm, but these methods simply hide the account without actually disabling login. I'm looking for a way to disable regular login completely, text-mode included._


How can I enable internet sharing without using the gui or apple script on snow leopard?

for some rather strange reason my sharing preferences tab crashes (it's a long story and there seems to be no good solution for it, it's looking for a ui object that no longer exists). Anyway, I want to enable internet sharing to share my macbook's internet connection with my iPad but I can't find a way to do it without the gui or apple script (which basically calls the gui).


No sound when attached to docking station

I have been using Linux and Ubuntu only since the last two months on my (2006) Sony Vaio VGN A617S laptop which is going pretty well on Ubuntu 10.10. When installing Ubuntu audio did get installed alright, and the speakers on the laptop itself are working well even now with the right drivers (snd-hda-intel) for the Realtek ALC260 soundcard. My problem is when laptop is docked to the A/V docking station (I have seen it referred as a port replicator as well - the model number is VGP-PRAV2), with its two external speakers. And these were not on when Ubuntu was being installed. What is interesting is the headphones jack on the laptop does work when the docking station does not. I have been trying hard and have already tried quite a few things I saw to be related issues, like: a) adjustments to some IEC958 in alsamixer b) using a custom mod for the ALC260 card All this is to no avail. If someone could help me with this, that would be really appreciated. Thank you.


Linux configuration settings

Where are the following configuration files located (e.g., Redhat)?   1. network settings (static/DHCP/DNS)   2. timezone   3. proxy for network   4. default language


Where can I see a list of kernel killed processes?

Is there some way I can check which of my processes the kernel has killed? Sometimes I log onto my server and find that something that should've run all night just stopped 8 hours in and I'm unsure if it's the applications doing or the kernels.


I am failing to 'git clone clutter'

While trying to build clutter from JHBuild, I get stuck at the stage where I have to clone it:               $ jhbuild buildone clutter     *** Checking out clutter *** [1/1]     git clone http://git.clutter-project.org/clutter     Cloning into clutter...      It just chills there, and it seems nothing is happening at all. When I check the bandwidth usage, there's hardly anything. **update 1** : Well, I wonder what happened, but it works now. Probably slow network on my (or their) side. **update 2** : One of JHBuild developers (on IRC): > git.clutter-project.org is unreliable; it will soon be moved to > git.gnome.org, afaik.


filter cron emails through procmail?

I'm using postfix/mutt/procmail on a Linux/Debian and I've some trouble filtering cron emails with procmail, I just want to move them to the cron/ maildir directory, but no lucky till now. I've several other rules on .procmailrc to move emails with ^From: to a specific directory, only the cron rule doesn't work. /etc/aliases:               postmaster:    root     root:          alex      .procmailrc:               :0:     * ^From: Cron Daemon <root@hellspawn>     * ^Subject: Cron .*     cron/      headers of a mail sent by cron:               Return-Path: <alex@hellspawn>     X-Original-To: alex     Delivered-To: alex@hellspawn     Received: by hellspawn (Postfix, from userid 1000)         id 27E2E1920C5B; Fri, 31 Jan 2014 16:30:09 +0100 (CET)     From: Cron Daemon <root@hellspawn>     To: alex@hellspawn     Subject: Cron <alex@hellspawn> $HOME/.getmail/getmail2.sh     Content-Type: text/plain; charset=UTF-8     X-Cron-Env: <SHELL=/bin/sh>     X-Cron-Env: <HOME=/home/alex>     X-Cron-Env: <PATH=/usr/bin:/bin>     X-Cron-Env: <LOGNAME=alex>     Message-Id: <20140131153009.27E2E1920C5B@hellspawn>     Date: Fri, 31 Jan 2014 16:30:09 +0100 (CET)      ~/.forward (guess it is useless in this case, just given a try):               |/usr/bin/procmail      What's wrong? **update 12/5/14** I ended up using the negated `!` rule below with _noop_ nested block `{ }` and _else_ `E`, seems like is the "Cron Daemon" part of the address creating the problem.               :0     * ! ^From.*root@hellspawn     * ! ^Subject:.*Cron Daemon     { }     :0 E     cron/


Switch to an application using its PID

I'm using Gnome. In vim, I want to map a key to switch to Firefox. I know that I should use bash commands (a command in form of `!...`). Is it possible to switch to an application using its PID?


Is there a way to make this one-liner faster?

## Context I have a directory of thousands of zip files that are dated in the form `YYYYMMDD_hhmmss.zip` and each about 300K. Within each zip file is about 400 xml files each about 3K. ## The problem I need to be able to search and find a given string within a date-range of the zip files. ## The current (albeit mediocre) solution I have the following one-liner               find /home/mydir/ -type f | sort | \     awk "/xml_20140207_000016.zip/,/xml_20140207_235938.zip/" | \     xargs -n 1 -P 10 zipgrep "my search string"      The point of it is to   1. list all the files in my thousand-file directory   2. sort this list of files   3. retrieve a range of files based on given dates (this `awk` command only prints lines after that first matched string and up to that second matched string)   4. pass each line of the result which corresponds to a single file to `zipgrep` ## The question This one-liner runs horribly slow, even with 10 processes on a 24-core machine. I believe it's slow because of the `zipgrep` command but I'm not wise enough to know how to improve it. I don't know if I should be, but I'm a little embarrassed that a colleague wrote a java tool that runs faster than this script. I'd like to reverse that if possible. Then, does anyone know how to make this command faster in this context? Or to improve any part of it at all?


Kali Linux is not booting after installation after/before Windows 7

I have GPT, EFI (or UEFI?). I've installed Windows 7, then Kali Linux (in opposite order too), but Kali doesn't want to boot -- Windows wants. I tried to use `update-grub`, tried to switch the `bootable` flag of Windows loading partition off, but Kali boots only after deleting that partition. The problem is -- I can't boot Windows in this case. Also my `update-grub` doesn't see Windows 7 (I've installed `grub-efi-amd64` using LiveUSB and `chroot`), so I'll have to resolve this problem too.


DNS lookups sometimes take 5 seconds

I have a VM running Debian Wheezy on which some hostname lookups take several seconds to complete, even though the resolver replies immediately. Strangely, lookups with `getaddrinfo()` are affected, but `gethostbyname()` is not. I've switched to the Google resolvers to exclude the possibility that the local ones are broken, so my `/etc/resolv.conf` looks like:               search my-domain.com     nameserver 8.8.4.4     nameserver 8.8.8.8      My `nsswitch.conf` has the line:               hosts: files dns      and my `/etc/hosts` doesn't contain anything unusual. If I try `telnet webserver 80`, it hangs for several seconds before getting a name resolution. An `ltrace` output [1] shows that the hang is in a `getaddrinfo()` call:               getaddrinfo("ifconfig.me", "telnet", { AI_CANONNAME, 0, SOCK_STREAM, 0, 0, NULL, '\000', NULL }, 0x7fffb4ffc160) = 0 <5.020621>      However, `tcpdump` reveals that the nameserver replied immediately, and it was only on the second reply that `telnet` unblocked. The replies look identical:               05:52:58.609731 IP 192.168.1.75.43017 > 8.8.4.4.53: 54755+ A? ifconfig.me. (29)     05:52:58.609786 IP 192.168.1.75.43017 > 8.8.4.4.53: 26090+ AAAA? ifconfig.me. (29)     05:52:58.612188 IP 8.8.4.4.53 > 192.168.1.75.43017: 54755 4/0/0 A 219.94.235.40, A 133.242.129.236, A 49.212.149.105, A 49.212.202.172 (93)          [...five second pause...]          05:53:03.613811 IP 192.168.1.75.43017 > 8.8.4.4.53: 54755+ A? ifconfig.me. (29)     05:53:03.616424 IP 8.8.4.4.53 > 192.168.1.75.43017: 54755 4/0/0 A 219.94.235.40, A 133.242.129.236, A 49.212.149.105, A 49.212.202.172 (93)     05:53:03.616547 IP 192.168.1.75.43017 > 8.8.4.4.53: 26090+ AAAA? ifconfig.me. (29)     05:53:03.618907 IP 8.8.4.4.53 > 192.168.1.75.43017: 26090 0/1/0 (76)      I've checked host firewall logs and nothing on port 53 is being blocked. What is causing the first DNS reply to be ignored? [1] I've added a couple of lines to my `ltrace.conf` so I can see inside the `addrinfo` struct.


Which extension to use for text files? (Unix/Linux)

I noticed that I can read text files without an extension `.txt` just fine. How come? Should I save these files with or without the `.txt` extension? Also, what about `.ini` files? I usually use them like this: `config.ini`, should I remove the extension here to? Any general resources on how Linux handles file extensions would be useful.


Logrotate does not work for httpd service

We have logrotate working for several Centos servers. One new server has a slightly different setup, and for some reason logrotate does not work for the httpd service. When I start it manually, it does work as expected. I've set this up last week, and it didn't run once in four days. The file /etc/cron.daily/logrotate exists, so I guess the cron job should run daily. Contents of /etc/logrotate.conf               # see "man logrotate" for details     # rotate log files weekly     weekly          # keep 4 weeks worth of backlogs     rotate 4          # create new (empty) log files after rotating old ones     create          # use date as a suffix of the rotated file     dateext          # uncomment this if you want your log files compressed     #compress          # RPM packages drop log rotation information into this directory     include /etc/logrotate.d          # no packages own wtmp and btmp -- we'll rotate them here     /var/log/wtmp {         monthly         create 0664 root utmp             minsize 1M         rotate 1     }          /var/log/btmp {         missingok         monthly         create 0600 root utmp         rotate 1     }          # system-specific logs may be also be configured here.      Contents of /etc/logrotate.d/httpd. I suppose these override the logrotate.conf settings.               /var/log/httpd/*log {         daily         compress         rotate 20         missingok         notifempty         sharedscripts         delaycompress         postrotate             /sbin/service httpd reload > /dev/null 2>/dev/null || true         endscript     }      Why doesn't it work?


How to create a bootable USB with Windows?

How would I go about creating a CentOS 7 bootable USB drive with Windows? I've read the howto page for it and it says that Unetbootin and Universal USB installer won't work for CentOS 7. In addition, I've already tried dd for Windows, and that didn't work properly either - booting from the USB drive resulted in a "Machine Check Error".