title: gcc 4.6.3 local installation with gmp 5.0.5 mpfr 3.1.1 errors

text: I am trying to install a new gcc version (g++ version) in my home directory on a server I have access too. This server already has gcc elsewhere (and gmp etc) but older versions, and I want to _locally_ install new ones. I followed this guide to the letter, working in my home directory. In summary I downloaded the new tars (gcc,gmp,mpfr,mpc) extracted them and moved gmp,mpfr,mpc into the sources directory of gcc (ensuring they were then named `gmp`, `mpfr`, `mpc`). I then `cd ..` out of sources and then into the build directory (`objdir`) and from there I ran configure. Configure goes through fine but then 'make' eventually returns:               checking for MPFR... yes     checking for recent GMP... yes     checking for recent MPFR... no     configure: error: MPFR version >= 2.4.2 required     make[2]: *** [configure-stage1-mpc] Error 1     make[2]: Leaving directory `/home/myusername/gcc-temp/objdir'     make[1]: *** [stage1-bubble] Error 2     make[1]: Leaving directory `/home/myusername/gcc-temp/objdir'     make: *** [all] Error 2      Does it really have to be version 2.4.2? Is this the problem? Is the fact gcc etc are already installed elsewhere messing things up? I've set things like `LD_LIBRARY_PATH=""` to try to stop it looking elsewhere to no avail. I would have thought it would happily just use the mpfr in the gcc sources directory though, as it seems to be OK using the gmp that is there. The full `config.log`:               This file contains any messages produced by compilers while     running configure, to aid debugging if configure makes a mistake.          It was created by configure, which was     generated by GNU Autoconf 2.64.  Invocation command line was            $ /home/myusername/gcc-temp/gcc-4.6.3/configure --prefix=/home/myusername/opt/gcc-4.6.3 --with-local-prefix=/home/myusername/usr/local          ## --------- ##     ## Platform. ##     ## --------- ##          hostname = erased     uname -m = x86_64     uname -r = 2.6.18-308.1.1.el5     uname -s = Linux     uname -v = #1 SMP Fri Feb 17 16:51:01 EST 2012          /usr/bin/uname -p = unknown     /bin/uname -X     = unknown          /bin/arch              = x86_64     /usr/bin/arch -k       = unknown     /usr/convex/getsysinfo = unknown     /usr/bin/hostinfo      = unknown     /bin/machine           = unknown     /usr/bin/oslevel       = unknown     /bin/universe          = unknown          PATH: /opt/streamline/bin     PATH: /opt/streamline/sbin     PATH: /software/bin     PATH: /usr/kerberos/bin     PATH: /opt/intel/Compiler/11.1/bin/intel64/     PATH: /opt/absoft/bin     PATH: /opt/pgi//linux86-64/9.0/bin     PATH: /usr/local/bin     PATH: /bin     PATH: /usr/bin     PATH: /opt/pathscale/bin               ## ----------- ##     ## Core tests. ##     ## ----------- ##          configure:2222: checking build system type     configure:2236: result: x86_64-unknown-linux-gnu     configure:2283: checking host system type     configure:2296: result: x86_64-unknown-linux-gnu     configure:2316: checking target system type     configure:2329: result: x86_64-unknown-linux-gnu     configure:2383: checking for a BSD-compatible install     configure:2451: result: /usr/bin/install -c     configure:2462: checking whether ln works     configure:2484: result: yes     configure:2488: checking whether ln -s works     configure:2492: result: yes     configure:2499: checking for a sed that does not truncate output     configure:2563: result: /bin/sed     configure:2572: checking for gawk     configure:2588: found /bin/gawk     configure:2599: result: gawk     configure:3913: checking for gcc     configure:3929: found /usr/bin/gcc     configure:3940: result: gcc     configure:4169: checking for C compiler version     configure:4178: gcc --version >&5     gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)     Copyright (C) 2006 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          configure:4189: $? = 0     configure:4178: gcc -v >&5     Using built-in specs.     Target: x86_64-redhat-linux     Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux     Thread model: posix     gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)     configure:4189: $? = 0     configure:4178: gcc -V >&5     gcc: '-V' option must have argument     configure:4189: $? = 1     configure:4178: gcc -qversion >&5     gcc: unrecognized option '-qversion'     gcc: no input files     configure:4189: $? = 1     configure:4209: checking for C compiler default output file name     configure:4231: gcc    conftest.c  >&5     configure:4235: $? = 0     configure:4272: result: a.out     configure:4288: checking whether the C compiler works     configure:4297: ./a.out     configure:4301: $? = 0     configure:4316: result: yes     configure:4323: checking whether we are cross compiling     configure:4325: result: no     configure:4328: checking for suffix of executables     configure:4335: gcc -o conftest    conftest.c  >&5     configure:4339: $? = 0     configure:4361: result:      configure:4367: checking for suffix of object files     configure:4389: gcc -c   conftest.c >&5     configure:4393: $? = 0     configure:4414: result: o     configure:4418: checking whether we are using the GNU C compiler     configure:4437: gcc -c   conftest.c >&5     configure:4437: $? = 0     configure:4446: result: yes     configure:4455: checking whether gcc accepts -g     configure:4475: gcc -c -g  conftest.c >&5     configure:4475: $? = 0     configure:4516: result: yes     configure:4533: checking for gcc option to accept ISO C89     configure:4597: gcc  -c -g -O2  conftest.c >&5     configure:4597: $? = 0     configure:4610: result: none needed     configure:4688: checking for g++     configure:4704: found /usr/bin/g++     configure:4715: result: g++     configure:4742: checking for C++ compiler version     configure:4751: g++ --version >&5     g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)     Copyright (C) 2006 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          configure:4762: $? = 0     configure:4751: g++ -v >&5     Using built-in specs.     Target: x86_64-redhat-linux     Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux     Thread model: posix     gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)     configure:4762: $? = 0     configure:4751: g++ -V >&5     g++: '-V' option must have argument     configure:4762: $? = 1     configure:4751: g++ -qversion >&5     g++: unrecognized option '-qversion'     g++: no input files     configure:4762: $? = 1     configure:4766: checking whether we are using the GNU C++ compiler     configure:4785: g++ -c   conftest.cpp >&5     configure:4785: $? = 0     configure:4794: result: yes     configure:4803: checking whether g++ accepts -g     configure:4823: g++ -c -g  conftest.cpp >&5     configure:4823: $? = 0     configure:4864: result: yes     configure:4953: checking for gnatbind     configure:4983: result: no     configure:5045: checking for gnatmake     configure:5075: result: no     configure:5094: checking whether compiler driver understands Ada     configure:5117: result: no     configure:5126: checking how to compare bootstrapped objects     configure:5151: result: cmp --ignore-initial=16 $$f1 $$f2     configure:5167: checking for objdir     configure:5182: result: .libs     configure:5724: checking for PWL_handle_timeout in -lpwl     configure:5749: gcc -o conftest -g -O2    conftest.c -lpwl   >&5     /usr/bin/ld: cannot find -lpwl     collect2: ld returned 1 exit status     configure:5749: $? = 1     configure: failed program was:     | /* confdefs.h */     | #define PACKAGE_NAME ""     | #define PACKAGE_TARNAME ""     | #define PACKAGE_VERSION ""     | #define PACKAGE_STRING ""     | #define PACKAGE_BUGREPORT ""     | #define PACKAGE_URL ""     | #define LT_OBJDIR ".libs/"     | /* end confdefs.h.  */     |      | /* Override any GCC internal prototype to avoid an error.     |    Use char because int might match the return type of a GCC     |    builtin and then its argument prototype would still apply.  */     | #ifdef __cplusplus     | extern "C"     | #endif     | char PWL_handle_timeout ();     | int     | main ()     | {     | return PWL_handle_timeout ();     |   ;     |   return 0;     | }     configure:5758: result: no     configure:5772: checking for version 0.11 (revision 0 or later) of PPL     configure:5789: gcc -c -g -O2  -I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr -I$$s/mpc/src   conftest.c >&5     conftest.c:10:19: error: ppl_c.h: No such file or directory     conftest.c: In function 'main':     conftest.c:16: error: 'choke' undeclared (first use in this function)     conftest.c:16: error: (Each undeclared identifier is reported only once     conftest.c:16: error: for each function it appears in.)     conftest.c:16: error: expected ';' before 'me'     configure:5789: $? = 1     configure: failed program was:     | /* confdefs.h */     | #define PACKAGE_NAME ""     | #define PACKAGE_TARNAME ""     | #define PACKAGE_VERSION ""     | #define PACKAGE_STRING ""     | #define PACKAGE_BUGREPORT ""     | #define PACKAGE_URL ""     | #define LT_OBJDIR ".libs/"     | /* end confdefs.h.  */     | #include "ppl_c.h"     | int     | main ()     | {     |      |     #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11     |     choke me     |     #endif     |      |   ;     |   return 0;     | }     configure:5793: result: no     configure:7214: checking for default BUILD_CONFIG     configure:7246: result: bootstrap-debug     configure:7736: checking for bison     configure:7752: found /usr/bin/bison     configure:7763: result: bison -y     configure:7784: checking for bison     configure:7800: found /usr/bin/bison     configure:7811: result: bison     configure:7831: checking for gm4     configure:7861: result: no     configure:7831: checking for gnum4     configure:7861: result: no     configure:7831: checking for m4     configure:7847: found /usr/bin/m4     configure:7858: result: m4     configure:7878: checking for flex     configure:7894: found /usr/bin/flex     configure:7905: result: flex     configure:7926: checking for flex     configure:7942: found /usr/bin/flex     configure:7953: result: flex     configure:7973: checking for makeinfo     configure:7989: found /usr/bin/makeinfo     configure:8000: result: makeinfo     configure:8034: checking for expect     configure:8064: result: no     configure:8083: checking for runtest     configure:8113: result: no     configure:8228: checking for ar     configure:8244: found /usr/bin/ar     configure:8255: result: ar     configure:8369: checking for as     configure:8385: found /usr/bin/as     configure:8396: result: as     configure:8510: checking for dlltool     configure:8540: result: no     configure:8651: checking for ld     configure:8667: found /usr/bin/ld     configure:8678: result: ld     configure:8792: checking for lipo     configure:8822: result: no     configure:8933: checking for nm     configure:8949: found /usr/bin/nm     configure:8960: result: nm     configure:9074: checking for ranlib     configure:9090: found /usr/bin/ranlib     configure:9101: result: ranlib     configure:9210: checking for strip     configure:9226: found /usr/bin/strip     configure:9237: result: strip     configure:9346: checking for windres     configure:9376: result: no     configure:9487: checking for windmc     configure:9517: result: no     configure:9628: checking for objcopy     configure:9644: found /usr/bin/objcopy     configure:9655: result: objcopy     configure:9769: checking for objdump     configure:9785: found /usr/bin/objdump     configure:9796: result: objdump     configure:9949: checking for cc     configure:9965: found /usr/bin/cc     configure:9976: result: cc     configure:10110: checking for c++     configure:10126: found /usr/bin/c++     configure:10137: result: c++     configure:10271: checking for gcc     configure:10287: found /usr/bin/gcc     configure:10298: result: gcc     configure:10427: checking for gcj     configure:10443: found /usr/bin/gcj     configure:10454: result: gcj     configure:10588: checking for gfortran     configure:10604: found /usr/bin/gfortran     configure:10615: result: gfortran     configure:10749: checking for gccgo     configure:10779: result: no     configure:10840: checking for ar     configure:10873: result: no     configure:10990: checking for ar     configure:11006: found /usr/bin/ar     configure:11017: result: ar     configure:11070: checking for as     configure:11103: result: no     configure:11220: checking for as     configure:11236: found /usr/bin/as     configure:11247: result: as     configure:11300: checking for dlltool     configure:11333: result: no     configure:11450: checking for dlltool     configure:11480: result: no     configure:11530: checking for ld     configure:11563: result: no     configure:11680: checking for ld     configure:11696: found /usr/bin/ld     configure:11707: result: ld     configure:11760: checking for lipo     configure:11793: result: no     configure:11910: checking for lipo     configure:11940: result: no     configure:11990: checking for nm     configure:12023: result: no     configure:12140: checking for nm     configure:12156: found /usr/bin/nm     configure:12167: result: nm     configure:12220: checking for objdump     configure:12253: result: no     configure:12370: checking for objdump     configure:12386: found /usr/bin/objdump     configure:12397: result: objdump     configure:12450: checking for ranlib     configure:12483: result: no     configure:12600: checking for ranlib     configure:12616: found /usr/bin/ranlib     configure:12627: result: ranlib     configure:12680: checking for strip     configure:12713: result: no     configure:12830: checking for strip     configure:12846: found /usr/bin/strip     configure:12857: result: strip     configure:12910: checking for windres     configure:12943: result: no     configure:13060: checking for windres     configure:13090: result: no     configure:13140: checking for windmc     configure:13173: result: no     configure:13290: checking for windmc     configure:13320: result: no     configure:13348: checking where to find the target ar     configure:13381: result: host tool     configure:13390: checking where to find the target as     configure:13423: result: host tool     configure:13432: checking where to find the target cc     configure:13455: result: just compiled     configure:13474: checking where to find the target c++     configure:13500: result: just compiled     configure:13519: checking where to find the target c++ for libstdc++     configure:13545: result: just compiled     configure:13564: checking where to find the target dlltool     configure:13597: result: host tool     configure:13606: checking where to find the target gcc     configure:13629: result: just compiled     configure:13648: checking where to find the target gcj     configure:13674: result: just compiled     configure:13693: checking where to find the target gfortran     configure:13719: result: just compiled     configure:13738: checking where to find the target gccgo     configure:13774: result: host tool     configure:13783: checking where to find the target ld     configure:13816: result: host tool     configure:13825: checking where to find the target lipo     configure:13847: result: host tool     configure:13856: checking where to find the target nm     configure:13889: result: host tool     configure:13898: checking where to find the target objdump     configure:13931: result: host tool     configure:13940: checking where to find the target ranlib     configure:13973: result: host tool     configure:13982: checking where to find the target strip     configure:14015: result: host tool     configure:14024: checking where to find the target windres     configure:14057: result: host tool     configure:14066: checking where to find the target windmc     configure:14099: result: host tool     configure:14136: checking whether to enable maintainer-specific portions of Makefiles     configure:14145: result: no     configure:14178: checking whether -fkeep-inline-functions is supported     configure:14197: gcc -c -g -O2 -fkeep-inline-functions  conftest.c >&5     configure:14197: $? = 0     configure:14198: result: yes     configure:14395: creating ./config.status          ## ---------------------- ##     ## Running config.status. ##     ## ---------------------- ##          This file was extended by config.status, which was     generated by GNU Autoconf 2.64.  Invocation command line was            CONFIG_FILES    =        CONFIG_HEADERS  =        CONFIG_LINKS    =        CONFIG_COMMANDS =        $ ./config.status           on lin04.hpc.nottingham.ac.uk          config.status:996: creating Makefile          ## ---------------- ##     ## Cache variables. ##     ## ---------------- ##          #### ---snip---     #### (cut ac_cv_xxx variables so that the log would fit in the post)          acx_cv_cc_gcc_supports_ada=no     acx_cv_prog_LN=ln     gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'     gcc_cv_tool_dirs=/home/myusername/opt/gcc-4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3:/home/myusername/opt/gcc-4.6.3/libexec/gcc/x86_64-unknown-linux-gnu:/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.3:/usr/lib/gcc/x86_64-unknown-linux-gnu:/home/myusername/opt/gcc-4.6.3/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu/4.6.3:/home/myusername/opt/gcc-4.6.3/x86_64-unknown-linux-gnu/bin:     gcc_cv_tool_prefix=/home/myusername/opt/gcc-4.6.3     lt_cv_objdir=.libs          ## ----------------- ##     ## Output variables. ##     ## ----------------- ##          AR='ar'     AR_FOR_BUILD='$(AR)'     AR_FOR_TARGET='$(AR)'     AS='as'     AS_FOR_BUILD='$(AS)'     AS_FOR_TARGET='$(AS)'     AWK='gawk'     BISON='bison'     BUILD_CONFIG='bootstrap-debug'     CC='gcc'     CC_FOR_BUILD='$(CC)'     CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'     CFLAGS='-g -O2'     CFLAGS_FOR_BUILD='-g -O2'     CFLAGS_FOR_TARGET='-g -O2'     COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'     COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'     COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'     CONFIGURE_GDB_TK=''     CPPFLAGS=''     CXX='g++'     CXXFLAGS='-g -O2'     CXXFLAGS_FOR_BUILD='-g -O2'     CXXFLAGS_FOR_TARGET='-g -O2'     CXX_FOR_BUILD='$(CXX)'     CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'     DEBUG_PREFIX_CFLAGS_FOR_TARGET=''     DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DLT_OBJDIR=\".libs/\"'     DLLTOOL='dlltool'     DLLTOOL_FOR_BUILD='$(DLLTOOL)'     DLLTOOL_FOR_TARGET='$(DLLTOOL)'     ECHO_C=''     ECHO_N='-n'     ECHO_T=''     EXEEXT=''     EXPECT='expect'     FLAGS_FOR_TARGET=' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'     FLEX='flex'     GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'     GCC_SHLIB_SUBDIR=''     GCJ_FOR_BUILD='$(GCJ)'     GCJ_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/'     GDB_TK=''     GFORTRAN_FOR_BUILD='$(GFORTRAN)'     GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/'     GNATBIND='no'     GNATMAKE='no'     GOC_FOR_BUILD='$(GOC)'     GOC_FOR_TARGET='$(GOC)'     INSTALL_DATA='${INSTALL} -m 644'     INSTALL_GDB_TK=''     INSTALL_PROGRAM='${INSTALL}'     INSTALL_SCRIPT='${INSTALL}'     LD='ld'     LDFLAGS=''     LDFLAGS_FOR_BUILD=''     LD_FOR_BUILD='$(LD)'     LD_FOR_TARGET='$(LD)'     LEX='flex'     LIBOBJS=''     LIBS=''     LIPO='lipo'     LIPO_FOR_TARGET='$(LIPO)'     LN='ln'     LN_S='ln -s'     LTLIBOBJS=''     M4='m4'     MAINT='#'     MAINTAINER_MODE_FALSE=''     MAINTAINER_MODE_TRUE='#'     MAKEINFO='makeinfo'     NM='nm'     NM_FOR_BUILD='$(NM)'     NM_FOR_TARGET='$(NM)'     OBJCOPY='objcopy'     OBJDUMP='objdump'     OBJDUMP_FOR_TARGET='$(OBJDUMP)'     OBJEXT='o'     PACKAGE_BUGREPORT=''     PACKAGE_NAME=''     PACKAGE_STRING=''     PACKAGE_TARNAME=''     PACKAGE_URL=''     PACKAGE_VERSION=''     PATH_SEPARATOR=':'     RANLIB='ranlib'     RANLIB_FOR_BUILD='$(RANLIB)'     RANLIB_FOR_TARGET='$(RANLIB)'     RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'     RPATH_ENVVAR='LD_LIBRARY_PATH'     RUNTEST='runtest'     SED='/bin/sed'     SHELL='/bin/sh'     STRIP='strip'     STRIP_FOR_TARGET='$(STRIP)'     SYSROOT_CFLAGS_FOR_TARGET=''     TOPLEVEL_CONFIGURE_ARGUMENTS='/home/myusername/gcc-temp/gcc-4.6.3/configure --prefix=/home/myusername/opt/gcc-4.6.3 --with-local-prefix=/home/myusername/usr/local'     WINDMC='windmc'     WINDMC_FOR_BUILD='$(WINDMC)'     WINDMC_FOR_TARGET='$(WINDMC)'     WINDRES='windres'     WINDRES_FOR_BUILD='$(WINDRES)'     WINDRES_FOR_TARGET='$(WINDRES)'     YACC='bison -y'     ac_ct_CC='gcc'     ac_ct_CXX='g++'     bindir='${exec_prefix}/bin'     build='x86_64-unknown-linux-gnu'     build_alias=''     build_configargs=' --cache-file=../config.cache '\''--prefix=/home/myusername/opt/gcc-4.6.3'\'' '\''--with-local-prefix=/home/myusername/usr/local'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'     build_configdirs=' libiberty fixincludes'     build_cpu='x86_64'     build_libsubdir='build-x86_64-unknown-linux-gnu'     build_noncanonical='x86_64-unknown-linux-gnu'     build_os='linux-gnu'     build_subdir='build-x86_64-unknown-linux-gnu'     build_tooldir='${exec_prefix}/x86_64-unknown-linux-gnu'     build_vendor='unknown'     clooginc=''     clooglibs=''     compare_exclusions='gcc/cc*-checksum$(objext) | gcc/ada/*tools/*'     config_shell='/bin/sh'     configdirs=' intl libiberty zlib libcpp libdecnumber gmp mpfr mpc fixincludes gcc lto-plugin'     datadir='${datarootdir}'     datarootdir='${prefix}/share'     do_compare='cmp --ignore-initial=16 $$f1 $$f2'     docdir='${datarootdir}/doc/${PACKAGE}'     dvidir='${docdir}'     exec_prefix='${prefix}'     extra_host_libiberty_configure_flags='--enable-shared'     extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'     extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/.libs'     extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'     gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr -I$$s/mpc/src '     gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/.libs -lmpc -lmpfr -lgmp'     host='x86_64-unknown-linux-gnu'     host_alias=''     host_configargs=' --cache-file=./config.cache  '\''--prefix=/home/myusername/opt/gcc-4.6.3'\'' '\''--with-local-prefix=/home/myusername/usr/local'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'     host_cpu='x86_64'     host_noncanonical='x86_64-unknown-linux-gnu'     host_os='linux-gnu'     host_subdir='.'     host_vendor='unknown'     htmldir='${docdir}'     includedir='${prefix}/include'     infodir='${datarootdir}/info'     libdir='${exec_prefix}/lib'     libexecdir='${exec_prefix}/libexec'     localedir='${datarootdir}/locale'     localstatedir='${prefix}/var'     mandir='${datarootdir}/man'     oldincludedir='/usr/include'     pdfdir='${docdir}'     poststage1_ldflags='-static-libstdc++ -static-libgcc'     poststage1_libs=''     pplinc=''     ppllibs=''     prefix='/home/myusername/opt/gcc-4.6.3'     program_transform_name='s,y,y,'     psdir='${docdir}'     sbindir='${exec_prefix}/sbin'     sharedstatedir='${prefix}/com'     stage1_cflags='-g -fkeep-inline-functions'     stage1_checking='--enable-checking=yes,types'     stage1_languages='c,lto'     stage1_ldflags=''     stage1_libs=''     stage2_werror_flag=''     sysconfdir='${prefix}/etc'     target='x86_64-unknown-linux-gnu'     target_alias=''     target_configargs='--cache-file=./config.cache --enable-multilib   '\''--prefix=/home/myusername/opt/gcc-4.6.3'\'' '\''--with-local-prefix=/home/myusername/usr/local'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'     target_configdirs=' libgcc libgomp libstdc++-v3 libmudflap libssp libquadmath libgfortran boehm-gc libffi zlib libjava libobjc'     target_cpu='x86_64'     target_noncanonical='x86_64-unknown-linux-gnu'     target_os='linux-gnu'     target_subdir='x86_64-unknown-linux-gnu'     target_vendor='unknown'     tooldir='${exec_prefix}/x86_64-unknown-linux-gnu'          ## ------------------- ##     ## File substitutions. ##     ## ------------------- ##          alphaieee_frag='/dev/null'     host_makefile_frag='/dev/null'     ospace_frag='/dev/null'     serialization_dependencies='serdep.tmp'     target_makefile_frag='/home/myusername/gcc-temp/gcc-4.6.3/config/mt-gnu'          ## ----------- ##     ## confdefs.h. ##     ## ----------- ##          /* confdefs.h */     #define PACKAGE_NAME ""     #define PACKAGE_TARNAME ""     #define PACKAGE_VERSION ""     #define PACKAGE_STRING ""     #define PACKAGE_BUGREPORT ""     #define PACKAGE_URL ""     #define LT_OBJDIR ".libs/"          configure: exit 0


title: Simple LiveCD running only Xorg Server

text: I have a netbook without HDD, I think it could be useful for monitoring logs. Do someone know about a light LiveCD, running only a Xserver?


title: Why can't ed be exited with C-c?

text: The program `ed`, a minimal text editor, cannot be exited by sending it an interrupt through using `Ctrl`-`C`, instead printing the error message "?" to the console. Why doesn't `ed` just exit when it receives the interrupt? Surely there's no reason why a cryptic error message is more useful here than just exiting. This behavior leads many new users into the following sort of interaction: > >     $ ed >     hello >     ? >     help >     ? >     exit >     ? >     quit >     ? >     ^C >     ? >     ^C >     ? >     ? >     ? >     ^D >     $ su >     # rm -f /bin/ed >   Such a tragic waste—easily avoidable if `ed` simply agreed to be interrupted. Another stubborn program exhibiting similar behavior is `less` which also doesn't appear to have much reason to ignore `C-c`. Why don't these programs just take a hint?


title: .Xresources font names

text: Many references describing the manipulation of bitmap font face and size for `xterm` via the `~/.Xresources` config file suggest the use of an entry like `XTerm.VT100.font: -*-fixed-*-*-*-100-*-*-*-*-*-*-*`. I have wondered what is the purpose of the `-*` characters and whether there is any logic to their placement and number. All the references I have consulted use these characters in their examples for modifying the font (although the total length of the `-*` string is somewhat variable), but none explain the purpose or significance of these characters.


title: How to find in which overlay is desired package?

text: How do I identify which overlays (if any) contain a particular package/application?


title: Installing drivers in ubuntu

text: I just installed Ubuntu 10.4LTS on my machine and I'm having trouble following the driver install directions. I am told to execute this command in the 'linux source tree':               make include/linux/version.h.       How do I get to this source tree from a terminal?


title: Find files that were not installed by the package manager

text: I'd like to get a list of all files in my Gentoo Linux system that were not installed by the package manager (Portage). This is because I want to keep my system as clean as possible, removing all useless files lying around. Let me tell you what I've tried until now. First of all, I generate the list of all files that belong to some package tracked by Portage:               equery files "*" | sort | uniq > portage.txt      Then I generate the list of all files on my system, except those that I don't care about:               find / \( -path /dev -o -path /proc -o -path /sys -o -path /media \               -o -path /mnt -o -path /usr/portage -o -path /var/db/pkg \               -o -path /var/www/localhost/htdocs -o -path /lib64/modules \               -o -path /usr/src -o -path /var/cache -o -path /home \               -o -path /root -o -path /run -o -path /var/run -o -path /var/tmp \               -o -path /var/log -o -path /tmp -o -path /etc/config-archive \               -o -path /usr/local/portage -o -path /boot \) -prune \               -o -type f | sort | uniq > all.txt      Finally, I get the list of all files that are not tracked by Portage:               comm -13 portage.txt all.txt > extra.txt      Some statistics:               wc -l portage.txt all.txt extra.txt       127724 portage.txt        78371 all.txt         8438 extra.txt      As you can see I still get more than eight thousands extra files. I'd like to reduce that number, in order to focus more on files that really need to be deleted. I noticed that in `extra.txt` there are thousands of files in a small number of directories, such as `/usr/lib64/gcc`, `/usr/lib64/python2.7` and `/usr/lib64/python3.2`. The `/usr/lib64/gcc/x86_64-pc-linux- gnu/4.6.3/crtbegin.o` file, for example, is not in `portage.txt` because, in its place, there is `/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/crtbegin.o`. On my system `/usr/lib` is a symlink to `/usr/lib64`. So it seems that I need to properly handle symlinks to get better results. Perhaps by adding in `portage.txt` all files they point to. I don't really know how to do that. Also, why `portage.txt` is bigger than `all.txt`? Shouldn't be the opposite since files tracked by Portage are a subset of all files in my system? Finally, am I forgetting any other location in the `find` command that should be also excluded?


title: How to make patch ignore already applied hunks

text: I have a very large patch file that I'm trying to apply to my code. The problem is, some of the changes in my patch already exist in the code. Is there a way to make patch gracefully ignore the changes that have already been applied? The `-N` option doesn't do what I want. If it encounters an already applied hunk it will generate a reject file and will not apply any more hunks to that file. I want it to just ignore that hunk and continue applying the rest of the patch. The only time I want it to generate a .rej file is if a hunk can't be applied and doesn't appear to already be applied. Is there a way to do this?


title: Why might tmux only be capable of attaching once per shell session?

text: I'm using tmux on a Fedora 8 server (workplace restriction) to monitor several boxes on a stress rack. I noticed that I can only attach to my detached `tmux session` once per shell session. In order to reattach, I must kill the terminal session and start another one, otherwise my `attach` command simply hangs (although, `Ctrl`-`b`,`d` detaches from the hung command). Has anyone seen behavior like this before? Any guidance or pointers to references would be greatly appreciated.


title: Xen, bridge and multiple IPs on CentOS

text: There's a new server that is assigned 5 IP addresses. I want to use Xen to run several VMs with various services. This is my first attempt to install Xen, I use this tutorial as a guideline. Stuck in the very beginning: they talk about replacing a single ip on an eth0 with a bridge `br0`. My server has 5: `eth1` and 4 aliases `eth1:1` .. `eth1:4`. How should the network config look like?   1. bridge that replaces eth1 completely, and then 4 aliases added to the bridge?   2. bridge can only replace a single IP out of the 5? Pardon my lame questions, first time in this forest.


title: Is there a man section or other doc repository for data structure definitions?

text: For the millionth time or so I had to look in `/usr/include/foo.h` to find the members of a `struct foo` or `foo_t` or whatever. There's a man section for library and kernel calls, some of which include descriptions of data structures and others not. Is there a single place to look up the definitions of kernel and library data structures?


title: Does Live Linux CD in general have safe handling of Windows NTFS files

text: I was reading this article - how do I Access or mount windows NTFS partition in Linux that mentions: > NTFS3G is an open source cross-platform, stable, GPL licensed, POSIX, NTFS > R/W driver used in Linux. It provides safe handling of Windows NTFS file > systems viz create, remove, rename, move files, directories, hard links, > etc. So, is it compulsory to have NTFS3G on a Live Linux CD so that when I am moving my files from one NTFS partitions to another NTFS partitions of a disk will ensure that it will not corrupt the files in the NTFS partitions? Or in another words, does a Live Linux CD or DVD in general (without NTFS3G) provide safe handling of Windows NTFS file operations (such as moving files)? Also does it apply on a certain version of NTFS too?


title: installpath in OpenBSD 5.5

text: In the FAQ section of OpenBSD 5.5, it is recommended to use               export PKG_PATH=ftp://your.ftp.mirror/pub/OpenBSD/5.5/packages/`machine -a`/      and to add the above line to ~/.profile Instead of doing the above, I appended the following line to pkg.conf as in the following:               echo installpath=ftp://your.ftp.mirror/pub/OpenBSD/$(uname -r)/packages/$(uname -m) | sudo tee /etc/pkg.conf      When I tried to download a package, there was an warning message stating: **wrong server 229** What happened?


title: Delete everything not matching this pattern 'something.swf' in txt file

text: Can `sed` or `awk` do this, what I want do to is delete everything not matching this pattern `'something.swf'` It doesn't need to be these commands. And im kind off new the text processing via the terminal so I would prefer if it didn't just display the output but save it to a txt file. ### Example. On an input like:               Hey stackoverflow im 23 years old 'lol.swf' and '33.swf'      It should output:               'lol.swf'     '33.swf'


title: removing linux kernels

text: Below are all the linux kernels that are running on my machine. I am trying to make a debian base install as light as possible. The kernel I am running is linux-image-2.6.30-vortex86mx-apm. I am wondering will it be safe to remove all others using `apt-get remove kernel-image-xxxxxx`                   ||/ Name                               Version                      Description         +++-==================================-============================-===================================================================         un  linux-image                        <none>                       (no description available)         un  linux-image-2.6                    <none>                       (no description available)         ii  linux-image-2.6-486                2.6.32+29                    Linux 2.6 for old PCs (meta-package)         un  linux-image-2.6-686                <none>                       (no description available)         un  linux-image-2.6-686-bigmem         <none>                       (no description available)         un  linux-image-2.6-amd64              <none>                       (no description available)         un  linux-image-2.6-k7                 <none>                       (no description available)         un  linux-image-2.6-openvz-686         <none>                       (no description available)         un  linux-image-2.6-vserver-686        <none>                       (no description available)         un  linux-image-2.6-vserver-686-bigmem <none>                       (no description available)         un  linux-image-2.6-xen-686            <none>                       (no description available)         ii  linux-image-2.6.30-vortex86mx-apm  1.1                          Linux kernel binary image for version 2.6.30-vortex86mx-apm         ii  linux-image-2.6.32-5-486           2.6.32-41                    Linux 2.6.32 for old PCs


title: How to mount a filesystem from a given USB bus:device

text: Recently I bought a new smartphone (with Android). When I connect it to my laptop, the (gui)file manager (PCManFM) recognize it and show me the filesystem at route `gphoto2://[usb:001,003]`. But I can't found it in a terminal (nothing in `/mnt` nor in `/media`). But this is the output of `lsusb`:               Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 002: ID 046d:c05a Logitech, Inc. Optical Mouse M90     Bus 002 Device 002: ID 04f2:b1d8 Chicony Electronics Co., Ltd      Bus 001 Device 003: ID 0fce:0171 Sony Ericsson Mobile Communications AB       How can I mount it knowing the bus and device numbers?. (001:003 in this case). My OS is Debian Wheezy. The output of the `mount` command:               sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)     proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)     udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=497357,mode=755)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)     tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=405696k,mode=755)     /dev/disk/by-uuid/ec90e556-b90e-467c-80b6-bde9048e6686 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)     tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)     tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=2486440k)     rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)


title: mongodb "hijacking" port

text: I'm having some trouble with Python HTTP Server and MongoDB. In this case HTTP server represents a REST service providing data from MongoDB. MongoDB is running on default port (27017) at all times. When I run my HTTP server on port 7000 and terminate it afterwards with Ctrl+C **MongoDB port**                 netstat -tulpen | grep :27017     tcp   0  0 0.0.0.0:27017  0.0.0.0:*  LISTEN  498    8984    1276/mongod      **Python HTTP server port**                 netstat -tulpen | grep :7000     tcp  0  0 0.0.0.0:7000  0.0.0.0:*  LISTEN   0    4697443    1522/python      Now, when I press Ctrl+C terminating this HTTP server and do a quick netstat **MongoDB port**                 netstat -tulpen | grep :7000      tcp 0 0 0.0.0.0:7000     0.0.0.0:*  LISTEN  0 4697443    1550/mongod      If I try to connect to MongoDB using port 7000, it fails. However, MongoDB is up and running on port 27017. I'm not even sure where to look anymore, all this is confusing.


title: Prevent focus stealing in Awesome WM, especially from Skype

text: When I use KDE with Awesome WM and get a new message in Skype, Plasma Desktop steals the focus. This drives me crazy as I cannot just continue typing in my current window. Is there some way to prevent this for any open window? It seems that such a focus steal is prevented by Awesome WM or Plasma, but the window switcher from Plasma still highlights the window. Therefore, the Plasma control bar (the one at the bottom) is un-hidden and therefore stealing the focus itself. When I did a `killall plasma-desktop`, the focus stealing stopped. However, I also killed `plasma-nm` and other things that I'd like to use.


title: How to extract the Nth file using 7-zip

text: I have an archive which, for reasons beyond my comprehension, contains 900 files all with the same name. That means that if I ask 7zip to extract them all, at the end there is just one file. The solution, of course, is to ask 7zip to extract the files one at a time, and rename each one to something else. But how, pray tell, do you ask 7zip to extract one particular file when they all have the same name?? Is there some way to ask 7zip to extract the Nth file in the archive? That would work... (I want to do this from a script, so I don't really want to use 7zip's interactive mode.)


title: Set difference from two files in unix

text: I am looking for an efficient way to achieve set difference from 2 files. I do know that `grep -vxF -f setA setB` gives me B - A. This is what I want, but my files are as follows:               setA:     2     4     5     6          set B:     1 123     2 abc     3 def     4 hij      I want the set difference to be calculated based on the first column of set B; hence the expected output for B - A would be:               1 123     3 def      Any pointers on how to achieve this?


title: How to delete a line with variable search using sed command

text: I am new to `sed`. What is wrong with the `sed` command on deleting the line which matches the input data? InputData.txt               123,     1234,     1453,      Datatodelete.txt               1234,hellofirstline     123,hellosecondline     14676,hellothirdline     1453,hellofourthline      expected output in the Datatodelete.txt               14676,hellothirdline      Script:               echo "the script starts now"     while read EachLine     do       echo $EachLine       sed "/$EachLine/d" < /home/Datatodelete.txt >/home/dummy     done < /home/InputData.txt


title: solaris netstat -rn output clarification

text: We have couple of servers performing the same function. On some I see following output:               Routing Table: IPv4       Destination           Gateway           Flags  Ref     Use     Interface      -------------------- -------------------- ----- ----- ---------- ---------      default              10.201.33.1          UG        1         84                10.201.11.128        10.201.18.33         UG        1         80                10.201.11.128        10.201.18.1          UG        1          0            (*)     10.201.11.160        10.201.18.1          UG        1         64                10.201.11.160        10.201.18.33         UG        1          0            (*)     ....      On other ones:               Routing Table: IPv4       Destination           Gateway           Flags  Ref     Use     Interface      -------------------- -------------------- ----- ----- ---------- ---------      default              10.202.33.1          UG        1         50                10.201.11.128        10.202.18.1          UG        1         70           (*)     10.201.11.160        10.202.18.33         UG        1         71           (*)     10.201.16.128        10.202.16.129        UG        1          3                10.202.11.128        10.202.18.1          UG        1         69                10.202.11.160        10.202.18.33         UG        1         65                ...      Comparing the marked packets `(*)` is there any problem? or everything is fine.


title: Please explain what's going on in my XMonad config file

text: I'm new to XMonad and I'd like to understand what's going on in this config file. It is a working config file, nothing is broken. I understand what each setting does but I don't understand what's happening under `main = ...`. Any explanation is appreciated. Also, in this setup, how would one go about changing/adding a keybinding?               -- Imports     import XMonad     import XMonad.Hooks.DynamicLog          -- The main function     main = xmonad =<< statusBar myBar myPP toggleStrutsKey myConfig          myBar = "xmobar"          myPP = xmobarPP { ppCurrent = xmobarColor "#429942" "" . wrap "<" ">" }          toggleStrutsKey XConfig { XMonad.modMask = modMask } = (modMask, xK_b)          myConfig = defaultConfig { modMask = mod4Mask                              , terminal = "urxvt"                              , borderWidth = 2 }      If this is the wrong StackExchange website please feel free to move it to a more appropiate one. :)


title: Linux equivalent to ReadyBoost?

text: Is there a kernel module or some other patch or something similar to Windows' ReadyBoost? Basically I'm looking for something that allows disk reads to be cached on a Flash drive.


title: Is there a web based converter between rwx and the octal version?

text: I can never remember what the conversion is from something like `rw-r--r--` to `644`. Is there a simple web based converter between the 2?


title: iozone runs fail with “No such file or directory” errors

text: I want to start using iozone to benchmark an aufs filesystem on a virtual machine on ubuntu. I tried following the manual to use relevant parameters, but I keep getting a weird error on most runs. I wrote this command with "root" user:               iozone -R -b bench_u01_test.xls -r 8k -s 1g -l 2 -u 5      but iozone output was:               iozone -R -b bench_u01_test.xls -r 8k -s 1g -l 2 -u 5         Iozone:     Performance Test of File I/O                   Version $Revision: 3.397 $              Compiled for 64 bit mode.               Build: linux-AMD64            Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins                        Al Slater, Scott Rhine, Mike Wisner, Ken Goss                        Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,                        Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,                        Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,                        Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,                        Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer.                        Ben England.           Run began: Sun Aug 31 08:26:29 2014           Excel chart generation enabled       Record Size 8 KB       File size set to 1048576 KB         Command line used: iozone -R -b bench_u01_test.xls -r 8k -s 1g -l 2 -u 5     Output is in Kbytes/sec             Time Resolution = 0.000001 seconds.     Processor cache size set to 1024 Kbytes.            Processor cache line size set to 32 bytes.      File stride size set to 17 * record size.           Min process = 2         Max process = 5              Throughput test with 2 processes           Each process writes a 1048576 Kbyte file in 8 Kbyte records     Error writing block 48922, fd= 3 write: No space left on device     Error writing block 94869, fd= 3 write: No space left on device           Children see throughput for  2 initial writers  =       0.00 KB/sec           Parent sees throughput for  2 initial writers   =       0.00 KB/sec           Min throughput per process                      =       0.00 KB/sec             Max throughput     per process                   =       0.00 KB/sec          Avg throughput per process                    =    0.00 KB/sec       Min xfer             =       0.00 KB     Child 0 iozone.DUMMY.0: No such file or directory     Child 1 iozone.DUMMY.1: No such file or directory      . . .      Can anyone please provide some advice on what am I doing wrong?


title: get numeric ASCII value for a character

text: I'm trying to write a shell script which asks for an ASCII character in the range A-Z or a-z and returns its equivalent numerical value. For example, the output might look like the following:               scarlet$ Please type a character between A and Z or between a and z:     scarlet$ A            scarlet$ The decimal value of A is: 65       * * * My attempt:               #!/bin/bash     echo Enter a letter:     read A     echo -n ${A} | od -i | head -1 | cut -b 10- | tr -d " "


title: What graphics card is "best" in 3D on Linux?

text: I've been wondering about this for a while and my usual resources don't seem to really know. The base question is; which 3D card performs the best on Linux (any distro)? But of course, the question is really two-fold; 1) What's the best bet, performance-wise, if I insist on using strictly open- source drivers with no closed firmware or anything of the sort? 2) If the best performance can only be acquired with closed-source drivers or/or closed firmware, what's the best bet? EDIT: I am flabbergasted by how difficult it is to get people to even tell me anything at all about this. I don't know how to ask this in a better way so I'm leaving it closed.


title: TrueCrypt is destoying mdadm volume

text: I'm setting up a new file server using the same storage configuration as my existing server, but the procedure is failing and i cannot figure out why. my goal is to create a TrueCrypt volume on top of a RAID 10 volume. however, when i start `truecrypt -c`, it destroys the RAID volume. The same procedure worked for my previous server, so i'm not sure what's going on. My procedure:               # create a data partition on each disk (/dev/sdb, /dev/sdc, /dev/sdd, /dev/sde):     fdisk /dev/sdX     new, p, 1, 4096, 2930273071, type, da, write          # combine data partitions into raid10 array:     mdadm --create /dev/md0 -v --raid-devices=4 --chunk=512 --level=raid10 --layout=f2 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1          # create a truecrypt volume on the new data partition /dev/md0:     truecrypt -c /dev/md0      shortly after truecrypt starts, i get a component failure from mdadm for one or more of the disks:               $ cat /proc/mdstat; echo; mdadm --misc --detail /dev/md0           Personalities : [raid10]     md0 : active raid10 sdd1[4] sdc1[1] sde1[3] sdb1[0](F)           2930006016 blocks super 1.2 512K chunks 2 far-copies [4/3] [_UUU]          unused devices: <none>          /dev/md0:             Version : 1.2       Creation Time : Fri Sep 21 14:27:31 2012          Raid Level : raid10          Array Size : 2930006016 (2794.27 GiB 3000.33 GB)       Used Dev Size : 1465003008 (1397.14 GiB 1500.16 GB)        Raid Devices : 4       Total Devices : 4         Persistence : Superblock is persistent              Update Time : Tue Sep 25 10:54:06 2012               State : active, degraded      Active Devices : 3     Working Devices : 3      Failed Devices : 1       Spare Devices : 0                   Layout : far=2          Chunk Size : 512K                     Name : emma:0  (local to host emma)                UUID : 21c2f9b7:923dacab:805375f8:96a2959b              Events : 33268              Number   Major   Minor   RaidDevice State            0       0        0        0      removed            1       8       33        1      active sync   /dev/sdc1            4       8       49        2      active sync   /dev/sdd1            3       8       65        3      active sync   /dev/sde1                 0       8       17        -      faulty spare   /dev/sdb1      and dmesg gives those error messages:               [326876.652057] ata3.00: status: { DRDY ERR }     [326876.652801] ata3.00: error: { ABRT }     [326876.653543] ata3.00: failed command: WRITE FPDMA QUEUED     [326876.654301] ata3.00: cmd 61/80:f0:80:f6:58/00:00:57:00:00/40 tag 30 ncq 65536 out     [326876.654301]          res 41/04:00:00:00:00/04:00:00:00:00/00 Emask 0x1 (device error)     [326876.655812] ata3.00: status: { DRDY ERR }     [326876.656563] ata3.00: error: { ABRT }     [326876.657326] ata3: hard resetting link     [326876.657328] ata3: nv: skipping hardreset on occupied port     [326877.124117] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     [326877.138346] ata3.00: configured for UDMA/133     [326877.138397] sd 2:0:0:0: [sdb]     [326877.138399] Result: hostbyte=0x00 driverbyte=0x08     [326877.138402] sd 2:0:0:0: [sdb]     [326877.138404] Sense Key : 0xb [current] [descriptor]     [326877.138408] Descriptor sense data with sense descriptors (in hex):     [326877.138411]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00     [326877.138423]         00 00 00 00     [326877.138428] sd 2:0:0:0: [sdb]     [326877.138430] ASC=0x0 ASCQ=0x0     [326877.138434] sd 2:0:0:0: [sdb] CDB:     [326877.138435] cdb[0]=0x2a: 2a 00 57 58 f0 80 00 00 80 00     [326877.138446] end_request: I/O error, dev sdb, sector 1465446528     [326877.138844] sd 2:0:0:0: [sdb]     [326877.138846] Result: hostbyte=0x00 driverbyte=0x08     [326877.138847] sd 2:0:0:0: [sdb]     [326877.138849] Sense Key : 0xb [current] [descriptor]     [326877.138851] Descriptor sense data with sense descriptors (in hex):     [326877.138852]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00     [326877.138860]         00 00 00 00     [326877.138864] sd 2:0:0:0: [sdb]     [326877.138865] ASC=0x0 ASCQ=0x0     [326877.138867] sd 2:0:0:0: [sdb] CDB:     [326877.138868] cdb[0]=0x2a: 2a 00 57 58 f1 00 00 00 80 00     [326877.138875] end_request: I/O error, dev sdb, sector 1465446656     [326877.139208] sd 2:0:0:0: [sdb]     [326877.139210] Result: hostbyte=0x00 driverbyte=0x08     [326877.139212] sd 2:0:0:0: [sdb]     [326877.139213] Sense Key : 0xb [current] [descriptor]     [326877.139215] Descriptor sense data with sense descriptors (in hex):     [326877.139217]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00     [326877.139224]         00 00 00 00     ...     [326877.155726] sd 2:0:0:0: [sdb]     [326877.155727] ASC=0x0 ASCQ=0x0     [326877.155729] sd 2:0:0:0: [sdb] CDB:     [326877.155730] cdb[0]=0x2a: 2a 00 57 58 f6 80 00 00 80 00     [326877.155736] end_request: I/O error, dev sdb, sector 1465448064     [326877.155987] ata3: EH complete     [326877.281684] md/raid10:md0: Disk failure on sdb1, disabling device.     [326877.281684] md/raid10:md0: Operation continuing on 3 devices.     [326877.801033] RAID10 conf printout:     [326877.801038]  --- wd:3 rd:4     [326877.801040]  disk 0, wo:1, o:0, dev:sdb1     [326877.801042]  disk 1, wo:0, o:1, dev:sdc1     [326877.801044]  disk 2, wo:0, o:1, dev:sdd1     [326877.801046]  disk 3, wo:0, o:1, dev:sde1     [326877.801071] RAID10 conf printout:     [326877.801074]  --- wd:3 rd:4     [326877.801076]  disk 1, wo:0, o:1, dev:sdc1     [326877.801078]  disk 2, wo:0, o:1, dev:sdd1     [326877.801079]  disk 3, wo:0, o:1, dev:sde1     [326899.233166] ata4: EH in SWNCQ mode,QC:qc_active 0x7 sactive 0x7     [326899.233384] ata4: SWNCQ:qc_active 0x1 defer_bits 0x6 last_issue_tag 0x0     [326899.233384]   dhfis 0x1 dmafis 0x0 sdbfis 0x0     [326899.233643] ata4: ATA_REG 0x41 ERR_REG 0x4     [326899.233775] ata4: tag : dhfis dmafis sdbfis sactive     [326899.234078] ata4: tag 0x0: 1 0 0 1     [326899.234458] ata4.00: exception Emask 0x1 SAct 0x7 SErr 0x0 action 0x6 frozen     [326899.234843] ata4.00: Ata error. fis:0x41     [326899.235230] ata4.00: failed command: WRITE FPDMA QUEUED     [326899.235617] ata4.00: cmd 61/80:00:80:e0:5b/00:00:57:00:00/40 tag 0 ncq 65536 out     [326899.235617]          res 41/04:00:00:00:00/04:00:00:00:00/00 Emask 0x1 (device error)     [326899.236423] ata4.00: status: { DRDY ERR }     [326899.236818] ata4.00: error: { ABRT }     [326899.237200] ata4.00: failed command: WRITE FPDMA QUEUED     [326899.237609] ata4.00: cmd 61/80:08:00:e1:5b/00:00:57:00:00/40 tag 1 ncq 65536 out     [326899.237609]          res 41/04:00:00:00:00/04:00:00:00:00/00 Emask 0x1 (device error)     [326899.238428] ata4.00: status: { DRDY ERR }     [326899.238865] ata4.00: error: { ABRT }     [326899.239288] ata4.00: failed command: WRITE FPDMA QUEUED     [326899.239730] ata4.00: cmd 61/80:10:80:e1:5b/00:00:57:00:00/40 tag 2 ncq 65536 out     [326899.239730]          res 41/04:00:00:00:00/04:00:00:00:00/00 Emask 0x1 (device error)     [326899.240682] ata4.00: status: { DRDY ERR }     [326899.241162] ata4.00: error: { ABRT }     [326899.241653] ata4: hard resetting link     [326899.241654] ata4: nv: skipping hardreset on occupied port     [326899.760685] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     [326899.774644] ata4.00: configured for UDMA/133     [326899.774695] sd 3:0:0:0: [sdc]     [326899.774698] Result: hostbyte=0x00 driverbyte=0x08     [326899.774700] sd 3:0:0:0: [sdc]     [326899.774702] Sense Key : 0xb [current] [descriptor]     [326899.774707] Descriptor sense data with sense descriptors (in hex):     [326899.774709]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00     [326899.774721]         00 00 00 00     [326899.774727] sd 3:0:0:0: [sdc]     [326899.774728] ASC=0x0 ASCQ=0x0     [326899.774732] sd 3:0:0:0: [sdc] CDB:     [326899.774734] cdb[0]=0x2a: 2a 00 57 5b e0 80 00 00 80 00     [326899.774744] end_request: I/O error, dev sdc, sector 1465639040     [326899.775097] sd 3:0:0:0: [sdc]     [326899.775098] Result: hostbyte=0x00 driverbyte=0x08     [326899.775100] sd 3:0:0:0: [sdc]     [326899.775102] Sense Key : 0xb [current] [descriptor]     [326899.775104] Descriptor sense data with sense descriptors (in hex):     [326899.775105]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00     [326899.775113]         00 00 00 00     [326899.775117] sd 3:0:0:0: [sdc]     [326899.775118] ASC=0x0 ASCQ=0x0     [326899.775120] sd 3:0:0:0: [sdc] CDB:     [326899.775121] cdb[0]=0x2a: 2a 00 57 5b e1 00 00 00 80 00     [326899.775128] end_request: I/O error, dev sdc, sector 1465639168     [326899.775404] sd 3:0:0:0: [sdc]     [326899.775405] Result: hostbyte=0x00 driverbyte=0x08     [326899.775407] sd 3:0:0:0: [sdc]     [326899.775408] Sense Key : 0xb [current] [descriptor]     [326899.775410] Descriptor sense data with sense descriptors (in hex):     [326899.775412]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00     [326899.775412]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00     [326899.775420]         00 00 00 00     [326899.775423] sd 3:0:0:0: [sdc]     [326899.775424] ASC=0x0 ASCQ=0x0     [326899.775427] sd 3:0:0:0: [sdc] CDB:     [326899.775428] cdb[0]=0x2a: 2a 00 57 5b e1 80 00 00 80 00     [326899.775434] end_request: I/O error, dev sdc, sector 1465639296     [326899.775691] ata4: EH complete     [326899.830768] Buffer I/O error on device md0p1, logical block 1474688     [326899.830965] lost page write due to I/O error on md0p1     [326899.831257] Buffer I/O error on device md0p1, logical block 1474689     [326899.831419] lost page write due to I/O error on md0p1     [326899.831424] Buffer I/O error on device md0p1, logical block 1474690     [326899.831585] lost page write due to I/O error on md0p1     [326899.831589] Buffer I/O error on device md0p1, logical block 1474691     [326899.831751] lost page write due to I/O error on md0p1      This isn't an actual disk failure because a) smartd doesn't see any issues with the disks and b) I can create a full TrueCrypt volume on each of the disks individually. I also tried creating a partition on /dev/md0 (both 83/Linux and da/Non-FS data) and then creating a TrueCrypt volume on the partition /dev/md0p1 (where this dmesg output came from), but this does not work either. I'm assuming TrueCrypt is somehow destroying mdadm-important meta data. But what's weird is that this exact procedure has worked fine before. What's going on here?               [root@emma]# uname -a     Linux emma 3.5.4-1-ARCH #1 SMP PREEMPT Sat Sep 15 08:12:04 CEST 2012 x86_64 GNU/Linux     [root@emma]# mdadm --version     mdadm - v3.2.5 - 18th May 2012     [root@emma]# truecrypt --version     TrueCrypt 7.1a     [root@emma]# fdisk -l          Disk /dev/sda: 160.0 GB, 160040803840 bytes     255 heads, 63 sectors/track, 19457 cylinders, total 312579695 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xe256e256             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *          63      208844      104391   83  Linux     /dev/sda2          208845      738989      265072+  82  Linux swap / Solaris     /dev/sda3          738990    62187614    30724312+  83  Linux     /dev/sda4        62187615   312579694   125196040   83  Linux          Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes     16 heads, 62 sectors/track, 2953908 cylinders, total 2930277168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0xcbb904fc             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            4096  2930273071  1465134488   da  Non-FS data          Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes     16 heads, 62 sectors/track, 2953908 cylinders, total 2930277168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x6978c214             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1            4096  2930273071  1465134488   da  Non-FS data          Disk /dev/sdd: 1500.3 GB, 1500301910016 bytes     16 heads, 62 sectors/track, 2953908 cylinders, total 2930277168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x8dd1e314             Device Boot      Start         End      Blocks   Id  System     /dev/sdd1            4096  2930273071  1465134488   da  Non-FS data          Disk /dev/sde: 1500.3 GB, 1500301910016 bytes     16 heads, 62 sectors/track, 2953908 cylinders, total 2930277168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x70b7ece7             Device Boot      Start         End      Blocks   Id  System     /dev/sde1            4096  2930273071  1465134488   da  Non-FS data          Disk /dev/md0: 3000.3 GB, 3000326160384 bytes     2 heads, 3 sectors/track, 976668672 cylinders, total 5860012032 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 524288 bytes / 2097152 bytes     Disk identifier: 0xce6d6f88              Device Boot      Start         End      Blocks   Id  System     /dev/md0p1            4096  4294967294  2147481599+  83  Linux      EDIT: when this procedure worked, it was probably using TrueCrypt 6 -- I'm going to give it a try with 6 to see what happens. I'll update with the results...


title: Installing Linux distro on PogoplugPro

text: I have a PogoplugPro and I want to install a Linux distro on it. However, none of the tutorials I have found cover the model I have:               Model: POGOPLUG PRO     BusyBox v1.16.1 (2010-11-30 12:06:37 PST) multi-call binary.     uname -a         Linux PogoplugPro 2.6.31.6_SMP_820 #96 SMP Tue Feb 8 10:06:27 PST 2011 armv6l GNU/Linux      I have tried optware but I want to boot a "real" distro, replacing the on- board OS. Can anyone point me in the right direction?


title: Remove all files without a keyword in the filename

text: I have a list of files in the following fashion:               > file1.jpg      > file1_orig.jpg      > file2.jpg      > file2_orig.jpg      I want to keep all the files with the extension _orig.jpg and discard those without. How can this be achieved using bash?


title: Cannot mount exFAT even though I installed exfat-fuse

text: So, I installed exFAT support (Lubuntu 14.04) and it all works fine in a file manager (PCManFM), but I want to mount a disk in terminal, and it says exFAT is not found? It must be if its mounted though, right?               $> sudo mount -t exfat -o uid=plex,gid=nogroup /dev/sdc /media/chris/plex_disk/      FUSE exfat 1.0.1     ERROR: exFAT file system is not found.      I installed it manually using aptitude:               apt-get install -y exfat-fuse exfat-utils      Any help gratefuly received, Chris


title: Why does 'find -delete ' delete all files in a directory recursively

text: So the following behaviour of unix find just cost me dearly:               > touch foo     > touch bar     > ls       bar  foo     > find . -name '*oo' -delete     > ls     bar     > touch baz     > ls     bar  baz     > find . -delete -name '*ar'     > ls     > #WHAAAT?      How does this make sense?


title: Network interfaces for Jails

text: I have been reading over the creation of Jails on FreeBSD, and one stumbling block I have is regarding network interfaces. Say my local router is 10.0.2.1, and the BSD box is 10.0.2.5. I would like jails on 10.0.2.6-10. Do I just define them in `rc.conf` (without any other work), or do I have to set up a bridge or something like that (I see FreeNAS uses a bridge)? I'm not particularly strong the networking side of things, so any good explanation about how the Jails share and access the network would be valuable.


title: Availability of software during update?

text: Imaging I am running a mail server, e.g. exim4 (or a database, a syslog daemon...). Now, while updating this package I would assume the application has to be stopped or at least restarted after update. If one would send an email during this time, it would fail. Is this case considered during updates, are there any countermeasures taken or is it up to a software sending mails to send the mail again later?


title: Debugging hanging bash process

text: After some bad performance today, I checked `top`:                1  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND       14229 myuser    20   0  8776 5264 1684 R   99  0.2   1383:47 bash      98-100% use by a Bash process which should have died a long time ago (I just closed all terminals to verify it)? I'm not sure what's causing it.               $ lsof -p 14229     COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME     bash    14229 myuser  cwd    DIR   0,23     4096 11059271 /home/users/myuser (company.com:/home/users/)     bash    14229 myuser  rtd    DIR    8,2     4096        2 /     bash    14229 myuser  txt    REG    8,2   920788  7617113 /bin/bash     bash    14229 myuser  mem    REG    8,2    30520   657679 /lib/i386-linux-gnu/libnss_compat-2.15.so     bash    14229 myuser  mem    REG    8,2    13940   657672 /lib/i386-linux-gnu/libdl-2.15.so     bash    14229 myuser  mem    REG    8,2  1713640   657666 /lib/i386-linux-gnu/libc-2.15.so     bash    14229 myuser  mem    REG    8,2   121024   660635 /lib/i386-linux-gnu/libtinfo.so.5.9     bash    14229 myuser  mem    REG    8,2    47040   657683 /lib/i386-linux-gnu/libnss_files-2.15.so     bash    14229 myuser  mem    REG    8,2    42652   657690 /lib/i386-linux-gnu/libnss_nis-2.15.so     bash    14229 myuser  mem    REG    8,2   134344   657659 /lib/i386-linux-gnu/ld-2.15.so     bash    14229 myuser  mem    REG    8,2    92016   657678 /lib/i386-linux-gnu/libnsl-2.15.so     bash    14229 myuser  mem    REG    8,2  2919792  7748495 /usr/lib/locale/locale-archive     bash    14229 myuser  mem    REG    8,2    26256  7757442 /usr/lib/i386-linux-gnu/gconv/gconv-modules.cache     bash    14229 myuser    0r   CHR  136,1      0t0        4 /dev/pts/1 (deleted)     bash    14229 myuser    1w   CHR  136,1      0t0        4 /dev/pts/1 (deleted)     bash    14229 myuser    2w   CHR  136,1      0t0        4 /dev/pts/1 (deleted)     bash    14229 myuser  255u   CHR  136,1      0t0        4 /dev/pts/1 (deleted)      Except for the `/dev/pts` lines this is identical to other bash processes:               COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME     bash    6674 myuser  cwd    DIR   0,23     4096 11059271 /home/users/myuser (company.com:/home/users/)     bash    6674 myuser  rtd    DIR    8,2     4096        2 /     bash    6674 myuser  txt    REG    8,2   920788  7617113 /bin/bash     bash    6674 myuser  mem    REG    8,2  1713640   657666 /lib/i386-linux-gnu/libc-2.15.so     bash    6674 myuser  mem    REG    8,2   121024   660635 /lib/i386-linux-gnu/libtinfo.so.5.9     bash    6674 myuser  mem    REG    8,2    47040   657683 /lib/i386-linux-gnu/libnss_files-2.15.so     bash    6674 myuser  mem    REG    8,2    13940   657672 /lib/i386-linux-gnu/libdl-2.15.so     bash    6674 myuser  mem    REG    8,2    30520   657679 /lib/i386-linux-gnu/libnss_compat-2.15.so     bash    6674 myuser  mem    REG    8,2    42652   657690 /lib/i386-linux-gnu/libnss_nis-2.15.so     bash    6674 myuser  mem    REG    8,2    92016   657678 /lib/i386-linux-gnu/libnsl-2.15.so     bash    6674 myuser  mem    REG    8,2   134344   657659 /lib/i386-linux-gnu/ld-2.15.so     bash    6674 myuser  mem    REG    8,2  2919792  7748495 /usr/lib/locale/locale-archive     bash    6674 myuser  mem    REG    8,2    26256  7757442 /usr/lib/i386-linux-gnu/gconv/gconv-modules.cache     bash    6674 myuser    0r   CHR  136,2      0t0        5 /dev/pts/2     bash    6674 myuser    1w   CHR  136,2      0t0        5 /dev/pts/2     bash    6674 myuser    2w   CHR  136,2      0t0        5 /dev/pts/2     bash    6674 myuser  255u   CHR  136,2      0t0        5 /dev/pts/2      Standard `kill` doesn't work:               $ kill 14229 && sleep 1m && kill -0 14229 && echo Alive     Alive      According to `ps wafux` it has no child processes. Tried tracing it as recommended by @ChandraRavoori:               $ sudo strace -p 14229     Process 14229 attached - interrupt to quit      After that I get no output. I tried to `kill 14229` multiple times, and it just printed the following every time:               --- SIGTERM (Terminated) @ 0 (0) ---      What are other things to check **before`kill -9`**?


title: Why the difference between network addresses reported by hostname and ping?

text: I have tried `hostname` and `ping` in a cluster machine, with different outputs. I am wondering what is the difference between the two? For example, on the same machine, `hostname` outputs `node4.XXX` and               ping -c 1 $(hostname)      outputs `pc333.XXX`.


title: How to give the same order for "OK" and "Cancel" buttons in KDE and GNOME applications?

text: I have installed some KDE and GNOME applications on the same computer. I use the applications at the same time. I find, I often hit the wrong button when I see "OK" or "Cancel" or "Yes" or "No" buttons, because the order is different. Is there any way to set these consistently, either changing to the KDE order or to the GNOME order?


title: The difference between -r and -R

text: It often happens that I want to apply an operation recursively. Some commands, such as grep, use a lowercase r to indicate recursion. For example               grep -r foo .      Other commands seem to prefer an uppercase R:               chmod -R 755 .      I am constantly getting these the wrong way around and forgetting which is which. Is there any logic behind the selection of case for these arguments?


title: In Gedit, how might I jump from the command line (bottom frame) to the file explorer frame to the text editor frame using keyboard shortcuts

text: I know how to jump from tab to tab in the text editor frame, but jumping from the text editor (center-right top frame) to the command line (center-right bottom frame) using only the keyboard eludes me. I know that jumping straight out of the command line frame probably won't be possible (or as easy as jumping out of one of the other two frames), but knowing how to do the other jumps would save me (and stackexchange posterity) a fair amount of time.


title: Linux thin station

text: I have this pc that I just installed and set it up as Linux thin station. I did all the formatting procedures and copying of image to the HD. When I boot it up, I get these, which I think are driver messages, appearing on screen.               Thinstation init script          Loading modules:     ...............................................................     .............................................................     ....................................          Initializing rc0 packages...     profile_setup -  secure - pcmia - network -           Configuring and starting network...     DHCP server not found! Network now initialize.     This error as probably occurred because you haven't got the correct     module loaded for your network card.     Debug not enabled, boot halted.     *********************************************************************      Now it won't boot all the way; it's stuck there. I am trying to connect to my Windows Terminal server (RDP). I suspect that there must be something missing or wrong in my build.conf file.


title: Piping in awk scripts

text: I'm trying to write a `ls` wrapper that uses `awk` to parse the output of `ls -lhF`. Right now I've split the program into two files - `my_ls.sh` and `my_ls.awk`. `my_ls.sh`'s only purpose is to pipe the output of `ls -lhF` into `my_ls.awk`. It looks like:               #!/bin/bash     ls -lhF "$@" | my_ls.awk      I was wondering if there was any way to read the output of `ls -lhF` through the awk script itself. **EDIT:** My main purpose is to write a script which shows the current directory contents in the form of a nice tree. A draft version of `my_ls.awk` would look like:               #!/usr/bin/awk -f          ( NF >= 9 ) {         print "|-- [" $5 "] " $9     }      This is where I've reached so far.


title: Execute remote script with local parameter value

text: How can I automatize this task? 1) You are at A. 2) You ssh into B. 3) You run a script at B, that needs a parameter known at A. First, I thought perhaps I could send the value when I opened the connection with ssh. Then, probably simpler, between 1) and 2), scp the entire script to the same location at B (replacing the old one). But still, how do I **execute** the script at B? (That is, how to automatize that last step. Of course, I could run it manually after ssh.) Another thought, maybe discard of ssh altogether - I have a web page at B, so could the script somehow be invoked through an "under the hood" web interface? Or would you do it in an altogether different way?


title: opendir and readdir encoding strings behind my back?

text: (You can skip the details to the last couple of lines if you're able to answer the question :) ) I'm on an Ubuntu 12.04. I'm trying to resolve an old issue that I've posted about in the past (if you're curious: http://superuser.com/questions/339877/trouble-viewing-files-with-non-english- names-on-hard-disk/339895#339895). There is a known compatibility issue between Linux, Mac, HFS+ and Korean-named files, and I spent all day today trying to finally find some kind of workaround. Basically, I've mounted my HFS+ drive onto linux. Normal ls and cd have trouble accessing the files, because they are in Korean. So I wrote a C program to try to access these files at the lowest level, so I can be more sure that nothing would be happening behind my back:               DIR* dp;      struct dirent *ep;     char* parent = "/media/external/Movies";     dp = opendir( parent );     if( dp != NULL )     {            while( ep = readdir(dp) )         {                printf( "%d %s %X\t", ep->d_ino, ep->d_name, ep->d_type );              // now print out the filenames in hex             for( int i = 0; i != strlen( ep->d_name ) ; i++)             {                    printf( "0x%X " , ep->d_name[i] & 0xff );             }                printf("\n");         }            closedir(dp);     }     else     {             perror("Couldn't open the directory! ");     }         Here's a sample of the output I get for this: 433949 밀양 4 0xEB 0xB0 0x80 0xEC 0x96 0x91 413680 박쥐 4 0xEB 0xB0 0x95 0xEC 0xA5 0x90 434033 박하사탕 4 0xEB 0xB0 0x95 0xED 0x95 0x98 0xEC 0x82 0xAC 0xED 0x83 0x95 So on the surface, it looks like openddir has no problem viewing the directory entries. The inode numbers are there, they are correctly marked as directories (4 means directory) and it appears that the filenames are stored as UTF-8 encoded, since those hexadecimals are the correct UTF-8 codes for the korean filenames. But now if I were to do a readdir of one of these directories (and I'll be using the filename in hex to be extra careful that nothing's happening behind my back):               unsigned char new_dirname[] = {'/',0xEB,0xB0,0x80,0xEC,0x96,0x91,'\0'};     unsigned char final[ strlen(parent) + strlen(new_dirname) + 1 ];     memcpy(final, parent, strlen( parent ));      strcpy(final + strlen(parent), dirname );     dp = opendir( final ); // dp == NULL here!!!      It is not able to open the directory. This befuddles me because if opendir was just reporting the raw bits of the file name in the directory entry, and readdir was just taking my given filename and matching it with the correct directory entry, then I would've thought there should be no problem in finding the inode and opening the directory. This seems to suggest that opendir is not being completely honest about the filenames. Are the file names in the directory entries reported by opendir not what's actually on disk (i.e. are they being encoded)? If so is there any way that I can either control how opendir and readdir are encoding names, or perhaps use some other system calls that works with raw bytes instead of encoding stuff behind my back? In general, I find it very confusing at what level encoding is happening and I'd appreciate any explanations or better yet, a reference to understand this! Thanks!


title: How to capture stdout of a running process redirected to /dev/null

text: I want to capture `stdout` of running process whose `stdout` is being redirected to `/dev/null`. I tried using system call `fcntl()`, however the moment I close fd "1", it was being allocated for other files as it was lowest available fd number. Any ideas how to lock given fd and reassign to other file?


title: On partition table

text: I'm using Lubuntu 11.10. Here is my hard disk. I have two partitions mounted, `sda1` and `sda2`. ![enter image description here](http://i.stack.imgur.com/qnQLM.png) As you can see I have a lot of free space in the middle (yes, I wanted that). Now I'd like to use that free space to create some new partitions and install many distros on each one. So I have two mayor questions: **1.** Should I create a logical (or it would be extended) partition there, using the total free space and after that could I divide it into maybe 5 or 6 partitions? I'd like to have something similar to this:               sda1 # already there     sda3 # new      sda4 # new     sda5 # new     sda6 # new     sda2 # already there      I don't if the names would be correct. **2.** Suppose that I'm installing Ubuntu on the first new partition (lets call it `sda3`). During the process I'll need to choose where to install the GRUB (or boot loader?!) Should I install it on `sda3` instead of `sda` so I'll be able to keep my current GRUB and only update it after to see the two distros installed?


title: What is "System Memory " displayed in nmon in AIX?

text: I have a host with AIX 6.1 (6100-04-02-1007) upgraded from AIX 5.1 with Veritas Storage Foundation 5.1. Since the upgrade from AIX 5.3 to 6.1, Run vx services means a lots of memory consumed that I can not explain. This memory appears in 'nmon' as System (see below System 41.2%). If I do not start Veritas it is <20%. Whay does mean that "System" memory? How can I know what is consuming this memory?                Memory ───────────────────────────────────────────────────────────────────────               Physical  PageSpace |        pages/sec  In     Out | FileSystemCache      % Used       93.9%     10.7%  | to Paging Space   0.0    0.0 | (numperm)  3.4%      % Free        6.1%     89.3%  | to File System    6.0    0.0 | Process   49.3%      MB Used    7695.0MB   871.5MB | Page Scans    20430.7        | System    41.2%      MB Free     497.0MB  7304.5MB | Page Cycles       1.5        | Free       6.1%      Total(MB)  8192.0MB  8176.0MB | Page Steals       0.0        |           ------                                   | Page Faults   10066.8        | Total    100.0%      ------------------------------------------------------------ | numclient  3.4%      Min/Maxperm     237MB(  3%)  7105MB( 87%) <--% of RAM        | maxclient 86.7%      Min/Maxfree     960   1088       Total Virtual   16.0GB      | User      49.7%      Min/Maxpgahead    2      8    Accessed Virtual    7.5GB 47.2%| Pinned    41.3%


title: Country flags icons

text: Is there any standard in *nix systems for country flags? Like, icon theme specification.


title: How to install OpenBSD/vax 4.7 on multiple disks?

text: I've got an old VAXstation 3100 Model 76, and I'd like to install OpenBSD/vax 4.7 on it. I've got two drives in it, an RZ23 (104MB) and a another 1.09GB. Now, since the 1.09GB is too large for an operating system to boot from (VAXen have that "magical 1.072GB boundary"), I'd like to use the 104MB drive as `/` partition, and all other partitions, including swap should go on to the other drive. But how do I do this with the OpenBSD install, since it lets me chose one disk only? I tried installing NetBSD/vax 5.0.2 beforehand, but `sysinst` segfaults right after I give the OK to install the sets. The VAXstation has the both hard drives I mentioned above and 16MB RAM (which I'd like to expand some day). The machine is otherwise in perfect working order, expect the NVRAM and RTC don't work any more, I'll change them (new chip is already ordered). In case you'd advice another OS (aside from OpenVMS), you might give me hints here, too.


title: tunneling VNC/rdesktop over ssh

text: I'm having a friend behind a firewall, with a windows computer. I'm having a Linux machine at home which is not behind a firewall. I want to have an rdesktop connection to his machine, without using any intermediate service such as `LogMeIn`. My plan is:   1. Have him SSH to my machine (SSH is allowed by the firewall), and set the appropriate tunnel.   2. Activate rdesktop/vnc on my machine, on the currently ran `X` server. What I don't like about it, is the hassle of running programs as his user on the currently running `X` server. I'd rather have him set the tunnel somehow for _my_ user, so that I'll just be able to `rdesktop localhost:1234` as long as he's connected to me. Any smarter way?


title: Will enabling Hyper-Threading create two virtual half-speed processors?

text: If I enable Hyper-Threading for my netbook which has an Intel Atom (1.6 GHz) will the kernel see two virtual 800 MHz processors?


title: In /etc/group what is the meaning of the second field?

text: A sample `/etc/group` file contains the following entries:               root:*:0:     adm:!:4:logcheck     antoine:x:1000:      The man pages I've read (Debian & OSX) says the second field is to store a group password. As they are rarely used, an asterisk `*` or a `x` is usually placed in it rather than leaving it blank. The `shadow` man page also says that this second field should store the result of the `crypt` function. And if an invalid result is stored (such as `*` or `!`) it means the password cannot be used as authentication method. Does that hold true for the `group` file as well? Why do I end up with 3 different characters in my `group` file all having the same meaning? Can I safely change all to `*`?


title: Set starting directory for gnome-terminal profile

text: In gnome-terminal if I choose File->"Open Terminal" or "Open Tab" I get a new window in the same directory as the current window. I would like to create a gnome-terminal profile that starts in a particular directory. I have experimented with the "run a custom command" option in the "Title and Command" section of the profile's properties, but so far all my attempts result in the terminal immediately exiting. Is there a way to do this?


title: possible spots to configure BIND-DNS forwarders

text: i'm investigating our BIND's configuration and can not figure out how it is aware of it's next name server to ask for some domain he's not authorative server for... e.g. home domain is 'workgroup.lan'   lookup `dig www.google.com` answer > ;; QUESTION SECTION:   >  ;www.google.com. IN A > > ;; ANSWER SECTION: [...] > ;; AUTHORITY SECTION:   >  google.com. 87465 IN NS ns1.google.com. [...] > ;; Query time: 4 msec   >  ;; SERVER: 127.0.0.1#53(127.0.0.1)   >  ;; WHEN: Tue Aug 28 15:56:08 2012   >  ;; MSG SIZE rcvd: 220 But who / what told him to ask other name servers? Or does it is the default behaviour? May it have something to do with that 'root.hint'-file that is responsible for the '.'- (root-) zone containing IPs of root-nameservers?


title: How do I tell if a folder is actually a symlink and how do I fix it if it's broken?

text: How do I tell if I have a symlink, a shortcut of some sort, or a folder in Linux? Please see following screenshot. ![symbolic link in linux shell](http://i.stack.imgur.com/yciav.png) As you can see, the `ls` command lists objects where some are colored in dark blue while others are colored light blue (cyan). What are these cyan colored objects? Are these actual symbolic links? As you can see, I cannot `cd` to the one called hdd.               root@dm500hd:/# cd hdd     -sh: cd: can't cd to hdd      I think it has to redirect to `/media/hdd` and I have noticed that the hdd folder is missing. Is there a way to fix this? **Update:** Here are results of the `ls -al` command. ![symbolic link in linux shell 2](http://i.stack.imgur.com/lTR1A.png) As you can see it says `hdd -> /media/hdd` and it's colored in red. Does this mean that it's broken or that it is automounted, i.e. when a physical hdd is connected? **Update:** Here is result of the `grep media /etc/auto*` command. ![symbolic link in linux shell 3](http://i.stack.imgur.com/lJLCL.png) What do these `/etc/auto.master:/media/net` and `/etc/auto.network` entries do? Here are results of `ls -Fal /media` command. ![symbolic link in linux shell 4](http://i.stack.imgur.com/m1Zrh.png) Is this of any help?... Here are results of `stat` and `file` commands, as well as listings of /usr and /bin. ![symbolic link in linux shell 5](http://i.stack.imgur.com/X4ER5.png) Does this help me in any way?... does it help you help me?... As a side not, what you should know is that this is a Linux based STB with BusyBox, it's an embedded system. So not all commands might be supported. **Update:** Last screenshot, showing files and supported commands in /sbin and /usr/sbin. ![symbolic link in linux shell 6](http://i.stack.imgur.com/tBpCE.png) **Update:** New share added... I have now removed that old share and recreated one with the same name as before and also added a second share now. So now I have two of them.               SHARES     remote share   local share     mydream        dream1     mydream2       dream2          LOCATIONS     remote        local     C:\mydream    /media/net/dream1     C:\mydream2   /media/net/dream2      The recordings are placed in /media/net/dream1/movie. Also, for the share dream2 I have chosen not to mount it as a HDD replacement in the Mount Manager, as I suspect that it's not possible to have more than one act as a HDD. Where would it record? To both locations? With double the data rate?... I don't think it's possible. So for this reason there is no subfolder named movie for the dream2 share. Only the ones that are specified as HDD replacement when created get the movie subfolder. If I `cd` to hdd from root it goes to `/media/net/dream1`. If I `cd` to `..` (parent) it goes back to `root (/)`. At root `ls -al` gives `hdd -> media/hdd`. `ls -al hdd` gives `hdd -> media/hdd`. `ls -al media` gives `/media/net/dream1`. Also, if I `cd` to `/media` there is another `hdd` symlink. I have not noticed it before. I think this is created automatically when a share is mounted. And if I `cd` to this hdd it goes to `/media/net/dream1`. A symlink `hdd` (/hdd) that points to another `hdd` symlink (/media/hdd), which in turn points to the share folder (/media/net/dream1)?..... I'm getting dizzy... It was not like this before version 3.2.3 or at least 3.2.0 of the Enigma2 image. _Edit:_ By settings the second share to act as a HDD replacement it becomes the active share for recording. At the same time the share that was previously set to act as a HDD replacement is no longer active, even if it is still set to "yes" (act as HDD replacement). If dream1 was first used as HDD replacement ("yes" to act as replacement) and then dream2 is set to act as HDD replacement, it becomes the new share for recording. I can still see and view video files stored in dream1 but I can no longer record to it. If I want to go back to use dream1 for recording I first have to set dream2 to "no" (stop acting as HDD replacement) and then reset dream1 to "yes". So no, it cannot record to two shares at the same time. One of them has to go. So it's either dream1 or dream2, not both. Although I should mention that it's possible to record more than one service (tv channel) if they are both on the same transponder, if not you get the "no free tuner" message. This is a STB with only one tuner.


title: bash script to verify rhel patching

text: we have several redhat servers which we patch from redhat satellite. To avoid confusion, I'll use the term "host" to denote the server which is being patched. We have a script, say, **_patch.sh_** , which we'll schedule to run in all redhat hosts (virtual machine) using "Remote command" option in **Redhat satellite**. This **_patch.sh_** script runs " ** _yum update_** " followed by " ** _vmware-config-tools -d_** " and **_reboot_**. There's more to it, but this is just the outline. My understanding is, " ** _yum update_** " downloads all packages to **_/var/cache/yum/_** of the host, under various sub-directories that are named based on the channels the hosts are subscribed to, and then installs the packages and remove them from there. Have pasted the output of command " ** _ls -lt /var/cache/yum_** " below for better understanding.               [root@xyzdev01]#ls -lt /var/cache/yum     total 64     drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit     drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit-supplementary     drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit-rhn-tools      Here under these directories, for example, say under **rhel-5-64bit** , there are few files along with a sub-directory called **_packages_** , where packages from this channel gets downloaded to. Per my understanding, this **_packages_** sub-directory is empty in servers where the patching is successful. Sometimes, what happens is, the package gets downloaded to the host, but due to some intermittent connectivity issue between **Redhat satellite server** and host where patching is happening (i.e) where the **_patch.sh_** script is being run, it doesn't gets installed. But when Redhat satellite server re- establishes the connection with the host, it thinks that the host is patched and proceeds with the reboot and these servers gets listed under "Completed Systems" in Redhat satellite, whereas actually the host is not patched. Here, the package stays in the **_/var/cache/yum/channel_name/packages_** without being installed. To avoid this corner case, we're planning to implement an additional check in the **_patch.sh_** script. I have 2 questions. 1) Is my understanding right? 2) If yes, then if i place an additional check in the script to check for ****.rpms*** under **_/var/cache/yum_** before it actually performs the next steps (i.e) **_vmware-config-tools -d_** and **_reboot_** , would it work? Appreciate any suggestions and clarifications. Thank you.


title: How to use scanner drivers api in Linux shell script

text: Usually when scanning any page using Canon DR- 2050C scanner in windows it rotates vertical text paged to horizontal automatically for the easy reading of the user. In Linux we are manually scanning pages using same scanner but it doesn't rotate the pages, but how to use drivers routines to perform this rotation automatically.


title: Screen: Resuming most recent screen? Making selection easier?

text: I have a couple of questions regarding screen: When I type `screen -r`, I get the following:               There are several suitable screens on:         25154.tracks    (Detached)         29278.mywork    (Detached)         29138.mywork    (Detached)         30915.mywork    (Detached)         20065.mywork    (Detached)     Type "screen [-d] -r [pid.]tty.host" to resume one of them.      I'm not sure, but I believe most of these screens are old, since I haven't used screen in some time, and I just accidentally detached from one. With this, my questions are:   * Is there a way to resume the **most recently** detached screen?    * How do I "delete" older screen sessions?   * Is it possible to display the date and # of screens within each session?   * Is there a way to temporally associate aliases to the screens listed by `screen -r` to facilitate their choice? For example, it would be great if `screen -r` listed screens as follows: > >     There are several suitable screens on: >     [1] 25154.tracks  (Detached) >     [2] 29278.mywork  (Detached) >     [3] 29138.mywork  (Detached) >     [4] 30915.mywork  (Detached) >     [5] 20065.mywork  (Detached) >     Choose  one to resume: >   And then I could just type 1,2,3,4 or 5 without having to type the full `pid` of the screen I want to resume. Is there anything that would do the trick?


title: Securely reading and parsing a string from a parameter or file in bash

text: I've been writing a number of bash scripts lately which get variables from a parameter or from a file. Some of the scripts run as root (using sudo) This is on my notebook, so there aren't any other users to cause security problems in this situation, but ... I'd like to be able to write a script I can release into the wild. Probably, what this question does is make a strong case for not writing anything in bash where root/sudo is involved and input/parameters can't be trusted. Other than locking everything down with sudoers, is there a way to read an arbitrary string into a bash program and parse it _without_ allowing bash to expand it, potentially executing something along the way? I don't see any solution for defending against a rogue parameter. For a file, there might be a way, but it's not simple. The string could be safely input to the script using read, but once it's in one or more variables, I can't see any method of accessing it that wouldn't involve potentially dangerous variable expansion. I think it would be possible to read from a file using read -n 1 to get one character at a time in a loop into an array. That ought to defang just about anything, but it's a bit cumbersome having to reassemble everything character by character later. I'm thinking of input like: '$(rm -rf ./*)' or 'eval shutdown -h now' or similar given as input which would run when a variable containing it was referenced. If the script was running as root, this could be a real problem! Any ideas on how to address this other than, "Get a real programming language"?


title: How to disable gzip compression with wget?

text: There are other questions asking how to _enable_ gzip compression with wget, and lots of web pages out there telling how to do this, but I need the opposite. I'm trying to locally mirror a site, and I'm just getting the home page as a gzipped file, which in turn breaks the recursion, so I can't get the whole site. I can gunzip that file, but that still doesn't give me a recursive download of the whole cotton-pickin' site. How do I turn off or prevent gzipping? _**EDIT_** : The exact command I issued is               wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com --reject png,jpg,jpeg,gif  --progress=dot --wait=7


title: How to list files and directories with directories first

text: I have two questions. First, which command lists files and directories, but lists directories first? Second question: I want to copy a list of files into a single directory, but make the target directory the first filename in the command.


title: How can I write a "idempotent" .Xmodmap

text: Currently I have an `.Xmodmap` file that changes my `Command` to `Ctrl`, then changes my `Ctrl` to `Super` (I'm running Linux on a Mac). It works quite well, when only run once but on successive runs (for example when I restart my desktop environment (Cinnamon) it reloads the `.Xmodmap` file) it basically resets the settings by reverting the changes. Effectively toggling between my desired setup and the original setup. How can I write an `.Xmodmap` file that only sets the settings one time, but doesn't change them back on successive runs? Here is my existing `.Xmodmap` file:               clear control     clear mod4          keycode 105 =     keycode 206 =          keycode 133 = Control_L NoSymbol Control_L     keycode 134 = Control_R NoSymbol Control_R     keycode 37 = Super_L NoSymbol Super_L          add control = Control_L     add control = Control_R


title: How do you integrate a media player with the Xfce taskbar i.e. for play/stop controls?

text: In a Debian sid Xfce set-up I'm trying to get the volume control in the taskbar to show the media player controls like it does in some more preconfigured distros. How do I do that? Searches in synaptic and Google have so far turned up nothing.


title: Convert .ISO to .IMG in terminal (Mac) (Linux)

text: I am trying to make a bootable flash drive with Linux on it for my Mac. I have Ubuntu desktop downloaded, and it is in my downloads. The instructions on the Ubuntu website tell me I need to convert the ISO to IMG (of course, because its a Mac, and I cannot boot otherwise, so converting is necessary). This is the terminal command they tell me to run: `hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso` I understand I need to replace both paths, and I know I need to change the ubuntu.iso path to the file located in my downloads, but what path do I put in the place of `~/path/to/target.img`? Can someone give a specific example? I tried putting `~/Users/Gurpreet/Desktop/target.img`, but it says no such file or directory. I understand that there is not a file named target.img on my desktop. What path do I use? Specific example and help will get 10 points.