title: ttyUSB0 permission changes after restart

text: I'm trying to install a device. I plug in the device which creates a `ttyUSB0` file. When I open it in the program I need it for, it says the permission is denied. I type in terminal               sudo chmod 666 /dev/ttyUSB0      This resolved the problem but after restarting my computer I get the same problem and need to re-enter the same command to get permission. How do I fix this where I dont need to change the permission after every reboot?


title: Why does a=0; let a++ return exit code 1?

text: Try it:               $ a=0     $ let a++     $ echo $?     1 # Did the world just go mad?     $ echo $a     1 # Yes, it did.     $ let a++     $ echo $?     0 # We have normality.     $ echo $a     2      Contrast with this:               $ b=0     $ let b+=1     $ echo $?     0      And this (from Sirex):               $ c=0     $ let ++c     $ echo $?     0      What is going on here?               $ bash --version     GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)


title: Ctrl-R style interactive search in custom file

text: I want to be able to search a custom text file similar to the interactive history search in bash. Once the wanted entry is found, executes the line. Bonus Points: have each record contain two fields - the search target, and the command that will be executed What I'm trying to accomplish with this is to allow quick auto completion of server names from a server list.


title: Xvfb memory leak running VTK visualization offscreen

text: I'm running a Python VTK visualization script. I want to be able to do that offscreen, so I can launch the visualization in a server. I can do that by doing               renWin.OffScreenRenderingOn()      in the Python code, and running the script under Xvfb               $ xvfb-run --server-args="-screen 0 1024x768x24" ./prtclviz.py      At this moment I visualize 480 frames in 800x600, then I make a video with FFMPEG. The problem is that the memory of the xfvb process grows up to 15GB. I saw that there are memory leaks in Xvfb and a possible workaround is to restart the server. Xvfb does not release memory But I can't figure out how to do that in my case, because the script loops over the 480 frames, but it is not easy to me to shut down the script, restart the server and relaunch the script. I think at several solutions:   * To find a workaround to the xvfb call, for instance there is the `-noreset' recipe above but it didn't work for me.    * Use Xdummy instead of plain Xvfb? I dind't find an RPM for Fedora 16 (the distribution on the server)    * Find a way to launch the xvfb from the script itself, and then connect to it, make one or some frames and restart the server.  Something like this               #! /usr/bin/env python          # initialize data...          renWin.OffScreenRenderingOn();          p = subprocess.Popen("xvfb ...") ## Launch xvfb server      for k in range(0,nstates):         ## set up frame `k' ...              ## Connect to the server and render ...         renWin.Render()         ## Write image to file         writer.SetFileName(png)         writer.Write()              if k%20==0:   ## Restart server            p.terminate()            p = subprocess.Popen("xvfb ...") ## Launch xvfb server       ### EDIT 1 - 2014-07-27 16:42:28 I still can't find a way to run the VTK script offscreen.   * If I do the `renWin.OffScreenRenderingOn()` and run under Xvfb then the memory for Xvfb growths up to 15GB for 480 frames of 800x600.    * If I don't run under Xfvb then the memory of NXagent grows to 8GB aprox (I'm running on a remote server under NX).    * If I don't include the `renWin.OffScreenRenderingOn()` line and run under Xvfb then I don't have memory growth but I get black frames.


title: VPS SSH and my OWN IP

text: Is it possible to to stay in total anonymous mode for the VPS provider? I have got a VPSVZ machine with UBUNTU server. Is it possible to do anonymous tunneling: VPS1 -> VPS2 -> VPS3 (all UBUNTU) and VPS2 provider can NOT see VPS1 IP number AND VPS3 provider can NOT see VPS2 IP number after I login I always see "cumentation: https://help.ubuntu.com/ Last login: Sun Jul 27 01:55:30 2014 from 79.124.xxxxxxx" and i would like to stay 100% anonymous is it possible?


title: Postfix: save every outgoing mail in files

text: I am using postfix as a SMTP server on a network that does not have internet connection. I would like to configure every mail client to send mail to the postfix SMTP server. When the server receive a mail, it can't deliver it because it is not connected to internet, so I want it to save the mail in a file. I will then handle this file myself to send it when possible. Is it possible to use postfix as describe above? Could you give me some advice to acheive this?


title: How do I set up a .emacs initialization file?

text: I am using Linux Fedora 13 (Constantine) and emacs 23.1.1. I am trying to set up a .emacs file for initialization, by using emacs itself to edit and save a file .emacs in my home directory. However, although the file is there, emacs does not seem to recognize it. What might I be doing wrong, and is there a simple text for .emacs that will show me if it is being used, one that will display a message on emacs start up?


title: How to configure sudoers to allow running sudo command under other group and user name?

text: How to configure `sudoers` to prevent having the `Sorry, user ****** is not allowed to execute` error message. _Background_ For the purpose of testing how a python script under a less privileged user and group daemon account, there is a need to run:               $ sudo -u _denyhosts -g _denyhosts python /usr/local/bin/denyhosts.py      -c /usr/share/denyhosts/denyhosts.cfg -n --purge --sync --verbose      The result is:               Sorry, user ****** is not allowed to execute      '/usr/bin/python /usr/local/bin/denyhosts.py -c /usr/share/denyhosts/denyhosts.cfg      -n --purge --sync --verbose' as _denyhosts:_denyhosts on ***.***.***.      The guess is that this command fails due to an extra configuration required in `sudoers`.               $ sudo -l     Matching Defaults entries for *** on this host:         editor=/usr/bin/nano, env_reset, env_keep+=BLOCKSIZE, env_keep+="COLORFGBG         COLORTERM", env_keep+=__CF_USER_TEXT_ENCODING, env_keep+="CHARSET LANG         LANGUAGE LC_ALL LC_COLLATE LC_CTYPE", env_keep+="LC_MESSAGES LC_MONETARY         LC_NUMERIC LC_TIME", env_keep+="LINES COLUMNS", env_keep+=LSCOLORS,         env_keep+=SSH_AUTH_SOCK, env_keep+=TZ, env_keep+="DISPLAY XAUTHORIZATION         XAUTHORITY", env_keep+="EDITOR VISUAL", env_keep+="HOME MAIL"          User *** may run the following commands on this host:         (ALL) ALL      Already tried to add the group `_denyhosts` to `sudoers` by executing `sudo visudo` and inserting the line:               %_denyhosts    ALL=(ALL) ALL      Saving and trying again does not improve.


title: Send email on SSH connection OpenWrt

text: Is there a way to send an email when anyone connects via SSH (or LuCI for that matter)? I'm setting up my router to log to a flash drive so I guess I could grep the logs or possibly look at connections periodically with:               netstat -ntu | grep 22      but this feels more than clunky. Could I use: `cat /proc/net/nf_conntrack` somehow?


title: How can I delete a hidden folder?

text: I want to delete many configuration folder in my home user folder but I can't figure out how to delete them. How can I delete a hidden folder?


title: Why isn't there a djvu2text?

text: This has been bothering me for a while. .djvu files are often searchable, in my experience. So somewhere in there, all the text is just one big string, right? But there's no djvu2text program. And trying to select text in a djvu reader is a bit nightmarish, I find.


title: Splitting Apache Vhosts into Individual Files

text: I have several vhosts in one file that I am looking to break each into a file of their own corresponding to the `ServerName`. I'm looking to take this file               <VirtualHost *:80>       ServerName host1.example.com     </VirtualHost>          <VirtualHost *:80>       ServerName host2.example.com     </VirtualHost>          <VirtualHost *:80>       ServerName hostN.example.com     </VirtualHost>      to subfiles `host1.example.com` ... `hostN.example.com`. I looked at this question-answer, which is closest to what I'm looking for, but I'm unsure on how to match two lines. It tried a nested if statement,               gawk '{       if(match($0, /(\<VirtualHost \*:80\>)/, v)){         if(match($0, /  ServerName (.*)/, s)){           name=s[1]           {print name}              }}}     ' samplevhost      and               gawk '{       if(match($0, /(\<VirtualHost \*:80\>)(\n  )(ServerName)(.*)/, k)){           name=k[1]           {print name}              }}     ' samplevhost      to print to screen, but I don't get any output. What am I missing?


title: How to restrict output of iw dev wlp3s0 scan?

text: I am trying to configure a wireless network on a newly installed Arch Linux. The command `iw dev wlp3s0 scan` gives information about all the found networks. I only need the information about my SSID.


title: Data transfer between ATmega16 microcontroller and Linux?

text: Can any one tell me how can I know status of any pin of an ATmega16 microcontroller using Ubuntu? When I connect ATmega16 to my system a file in `/dev/` is created by name `ttyUSB0`. I am using an USB-to-serial converter in order to connect the ATmega16.


title: Pass parameter from one shell script to another

text: I have two shell scripts namely `test1.sh` and `test2.sh` I have to call `test2.sh` from `test1.sh` For `test1.sh` I need to pass one parameter as a command line argument and for `test2.sh` I need to pass a parameter at the prompt. Code sample:               $ cat test2.sh     echo "enter id value"     <br>read id     #do some processing here      How do I call `test2.sh` from `test1.sh`? **I can not edit test2.sh file here**


title: Is there a WinSpy++ like tool for Linux/X/GTK/QT?

text: When I was using Windows I have some times made a good use of WinSpy++ which allowed to point to a window or a control (a widget, a window element) to see details about it (including the values of the fields of the structure/class describing this particular instance), send window manager messages to it etc. One of usual trivial tasks I have been using it for was to copy text from a non-selectable widget (like a label, which does not allow to select and copy text from it the way a text field does). Is there an analogous tool I can use with GNU/Linux GUI applications?


title: Text only mode in Linux (No Gnome, KDE, Unity) to prolong battery life

text: If I want to disable my GUIs completely to save battery life, how would I proceed? I know that I can hit Ctrl + Alt + F3 and be on the command line, but the desktop manager would be in the background still (I suppose). So, after Ctrl + Alt + F3, I need three commands to:   * tell me battery life from the command line    * close desktop environments Does this make sense?


title: How to print numbers horizontally?

text: I would like to print something as 5,4,3,2,1. This is my program, but it prints the numbers vertically.               numbers=5     i=1     while [ "$i" -le "$numbers" ]     do     echo “$i”     i=$(( $i + 1 ))     done      Do you have any solution that could help me?


title: How to install tar file (jhead) on Mac or Linux machine

text: I'm new to Linux and tar balls and was wondering how to properly install them on a Mac or Linux machine. I would prefer to know how to install on a mac but I just need some help understanding them. I want to install jhead-2.97.tar.gz and I download the zipped source tar ball, yielding a folder containing a myriad of files. I know this is a silly question, but how do I properly install this file on my machine in the Terminal/LXTerminal? `jhead` is a command tool that is used to extract from an Exif jpeg file in the Terminal


title: Is there a tool to view a torrent file?

text: I am interested in rendering a torrent file into a readable form (to see what files does it reference, what tracker information does it contain etc.). What a tool can I use to do just this?


title: How can I copy a file between server using bsdtar?

text: I'm looking for the fastest way of copying a file between 2 linux servers using bsdtar. With normal tar, I would do something like:               ssh root@remote 'tar -cz -C /my/path/ big_file.txt' | tar -zxv      However, just replacing "tar" with "bsdtar" does not seem to work. So, my questions are:   1. How would I do this with bsdtar?   2. Instead of using gzip, I would like to use something that can use multiple cores for the compress/uncompress, like pbzip2. How would I pipe this in?   3. I want the file "big_file.txt" to be called "hello_world.txt" on the destination server without using a temp-file with renaming. How? UPDATE 1: I solved number 1 myself:               ssh root@localhost 'bsdtar -cz -f - -C /my/path/ big_file.txt' | tar -zxv      UPDATE 2: I solved number 3 myself:               ssh root@localhost 'bsdtar -cz -f - -C /my/path/ big_file.txt' | tar -zxv -O > test.txt


title: How to configure OpenIndiana(151a8 aka "hipster") for development?

text: I saw a similar post about Solaris and thought of a similar howto. I've heard of recent news (as in 2013) with the distribution and I learned I could easily update my initial _OpenIndiana_ 151a7 release to **hipster** (0.5.11-0.151.1.8.1 to be more precise - you can check individual files in the distribution with the link). In this upcoming release, many things are different from what is explained in the old OpenIndiana wiki or the _Illumos_ build howto and its "how to use gcc only" section because of the ownership of SunStudio etc. I've learned a long time ago that setting up an environment for development, or simply to compile a few things like I do, involves more than just having the right software. It's a lot about configuration and information - and development skills when you do develop software. ### Software OpenIndiana uses IPS just like Solaris. `pkg install pkgname` / `pkg search -r keyword` and `pkg info -r keyword` are quite helpful as the GUI frontend packager is broken for the moment in 151a8. Extra repositories need to be configured to access extra packages:               $ pkg set-publisher -p http://pkg.openindiana.org/sfe      and the encumbered one if applicable               pkg set-publisher -p http://pkg.openindiana.org/sfe-encumbered      On a clean install, I've settled for these 2 big metapackages (about 600mb of downloads total, some few GBs installed) and a few things which appeared appropriate when I compiled _fvwm_ :               sudo pkg install pkg://openindiana.org/metapackages/build-essential@1.0,5.11-0.151.1.8.1:20130803T052718Z     sudo pkg install sunstudio12u1     sudo pkg install pkg:/library/desktop/gtk1@1.2.10-0.151.1.8     sudo pkg install pkg:/library/java/java-gnome@2.30.0-0.151.1.8     sudo pkg install pkg://sfe/library/fribidi@0.19.2,5.11-0.151.1.5:20120805T091919Z      _Build-essential_ contains mostly everything you need including but not limited to:               pkg install -v pkg:/archiver/gnu-tar pkg:/compress/p7zip pkg:/compress/unzip \     pkg:/developer/build/ant pkg:/developer/build/autoconf pkg:/developer/build/automake-110 \     pkg:/developer/build/gnu-make pkg:/developer/build/libtool pkg:/developer/build/make \     pkg:/developer/gnome/gettext pkg:/developer/java/jdk \     pkg:/developer/java/junit pkg:/developer/lexer/flex pkg:/developer/macro/cpp \     pkg:/developer/macro/gnu-m4 pkg:/developer/object-file pkg:/developer/parser/bison \     pkg:/file/gnu-coreutils pkg:/file/gnu-findutils \     pkg:/library/libtool/libltdl pkg:/library/libxslt pkg:/library/pcre \     pkg:/system/library/math/header-math pkg:/text/gawk \     pkg:/text/gnu-diffutils pkg:/text/gnu-gettext pkg:/text/gnu-grep \     pkg:/text/gnu-patch pkg:/text/gnu-sed pkg:/text/groff \     pkg:/text/texinfo pkg:/library/neon pkg:/library/apr-util-13 \     pkg:/developer/library/lint pkg:/system/header pkg:/developer/build/onbld \     pkg:/data/docbook \     pkg:/library/glib2 \     pkg:/library/libxml2 \     pkg:/library/libxslt \     pkg:/library/nspr/header-nspr \     pkg:/library/perl-5/xml-parser \     pkg:/system/library/install \     pkg:/system/library/dbus \     pkg:/system/library/libdbus \     pkg:/system/library/libdbus-glib \     pkg:/library/python-2/python-extra-26 \     pkg:/system/library/mozilla-nss/header-nss      `gcc 4.7.3` is the latest available in the _hipter_ branch (pkg://openindiana.org/developer/gcc-47@4.7.3,5.11-0.151.1.8.1:20130802T223703Z). There is also the _gcc-dev_ and _ss-dev_ metapackages but I'm not sure to what extent they'd add anything to what I have now. ### Configuration (highlights from my .bashrc file) In some cases there might be a need to use another version of gcc than 4.7 but for now I'm using the latest available and have been relying on some suggested configuration from both the _OpenIndiana_ and _Illumos_ site, doing the best I could:               [...]     CW_GCC_DIR="/usr/gcc/4.7/bin/"; export CW_GCC_DIR     GCC_ROOT="/usr/gcc/4.7"; export GCC_ROOT     ONBLD_TOOLS="/opt/onbld"; export ONBLD_TOOLS     ONLY_LINT_DEFS="-I/sunstudio12.1/prod/include/lint"; export ONLY_LINT_DEFS     __GNUC=""; export __GNUC     amd64_LINT="/opt/sunstudio12.1/bin/lint"; export amd64_LINT     i386_LINT="/opt/sunstudio12.1/bin/lint"; export i386_LINT          PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/opt/onbld/bin:/opt/onbld/bin/i386:/opt/sfw/bin:/usr/sfw/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/gnu/bin/:/usr/sbin/:/sbin:/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/dt/bin:/usr/gnu/bin/"; export PATH      ### The challenge(s) The challenge may be great, even for a developer, which I am not. After configuring my environment, I try to compile fvwm 2.6.5 because it's something standard, it's small and is sort of a landmark piece of software I'm interested in... to see what gives. Trying to improve on the features afforded by the configuration, I thought I had an issue and had to compile glib from source. So I came across this amazing account from this obviously very knowledgeable person who actually compiled this on OI. I realized I didn't need to install any further glib package, but this person maintains a repository of ported compiled software and that can be quite useful considering some of the complexity... Also, as a general rule, one should pay attention to bug tracking on the platform as well as the mailing lists (especially oi-dev). ### Common Build Environment In the old section of the wiki on building the OI OS proper, there's reference to this tool called CBE 1.7.0. It cannot be installed at this point because it requires SUNWperl510core and force installing this will ruin your acl in my experience. When I succeeded in installing it, I'll admit to having no clue whatsoever on how to use that as it's way over my head and I wish I knew if this can simplify something when compiling userland stuff. What I know is that in the latest releases you have a mini-version of it 1.8.0 (pkg://openindiana.org/developer/build/cbe@1.8.0,5.11-0.151.1.8:20130305T143840Z) so I installed that which doesn't require the old perl dependency. Still nowhere near grasping what it's about (I'll have to read about _specs_ and such) but it's there. I see some 2013 dated thread in the mailing list in the context of contributing SFE packages and pkgbuild. * * * ### Questions   * I was able to build fvwm 2.6.5 easily but does my setup look like a minimally acceptable build environment and is there anything specific that doesn't comply with best practices here?  * * * ### References and links Basic admin commands cheat sheet for someone new to SunOS (PDF)                 [1]: http://openindiana.org/pipermail/oi-dev/2013-May/002109.html       [2]: http://pkg.openindiana.org/hipster/en/index.shtml       [3]: http://wiki.openindiana.org/oi/Compiler+Migration       [4]: http://wiki.illumos.org/display/illumos/How+To+Build+illumos       [5]: http://wiki.illumos.org/display/illumos/How+To+Build+illumos#HowToBuildillumos-BuildingwithGCC-444iewithoutSunStudio       [6]: http://docs.oracle.com/cd/E23824_01/html/E21802/ips_intro.html#scrolltoc       [7]: http://docs.oracle.com/cd/E19963-01/html/820-6572/managepkgs.html       [8]: http://wiki.openindiana.org/oi/Spec+Files+Extra+Repository       [9]: http://www.fvwm.org/download/       [10]: http://www.openindiana.co.uk/tags/c-standards       [11]: http://www.openindiana.co.uk/content/repository-update-73-new-packs       [12]: https://www.illumos.org/projects/openindiana/issues?page=1       [13]: http://openindiana.org/mailman/listinfo       [14]: http://wiki.openindiana.org/oi/Setting+up+the+recommended+build+environment       [15]: http://comments.gmane.org/gmane.os.openindiana.devel/1887       [16]: http://sourceforge.net/apps/mediawiki/pkgbuild/index.php?title=Pkgbuild_on_OpenSolaris       [17]: http://i.stack.imgur.com/xSB2n.png       [18]: https://blogs.oracle.com/JeffV/entry/comparing_solaris_11_zones_to       [19]: http://ptribble.blogspot.ca/2013/05/sparse-root-zones-in-tribblix.html       [20]: http://tribblix.blogspot.co.uk/       [21]: http://unixed.com/blog/2013/02/the-solaris-11-immutable-zone/       [22]: http://www.logiqwest.com/dataCenter/Demos/RunBooks/Zones/createBasicZone.html       [23]: http://www.oracle.com/technetwork/server-storage/solaris/solaris-dtrace-wp-167895.pdf       [24]: http://www.oracle.com/technetwork/server-storage/solaris11/documentation/solaris-11-cheat-sheet-1556378.pdf


title: sox returns an error when I try to handle mp3 files

text: Hello so here is the deal, I used:               $ yum install sox       To install it in CentOS 6. After that I did a quick test:               $ sox test.mp3 test.amr      and this is what it returns:               $ sox formats: no handler for file extension `mp3'      Any help/suggestions please? I need this done with `sox` not `lame` because I will need to use it for mixing and other functions not available with `lame`.


title: best programming language for I/O intensive tasks

text: I need to process "big data" (nearly 1TB which can be partitioned into smaller chunks). Consider several programming languages (Java, Python, C++, Perl) and other scripting options (Perl, awk, sed, etc.), how do/would they compare in performance in the following cases:   1. The data are in files, I just need to read them in and process them.    2. The data are in Oracle server, I need to fetch them from Oracle, process and then put them back to Oracle.  The language's syntactical complexity (i.e. how hard it is to learn or program) is not really important for my tasks. The main question is whether one is better than another at doing I/Os.


title: How to remove popup window when changing volume in XFCE

text: When I am changing sound volume in XFCE, it always shows this popup at the top right corner: ![enter image description here](http://i.stack.imgur.com/SYL8P.png) How to get rid of it and all the similar popups?


title: Help With Visual Differences in Google Chrome

text: Okay, so I just moved over to Ubuntu yesterday. I'm loving it and am trying to get the hang of everything. Yesterday everything seemed to look fine in terms of Google Chrome, but today everything is all Windows-XP styled. Text boxes don't pop out, it looks like I went back in time to 2008. I think I must have changed some setting. What my Chrome looks like now.. (Please note the navigation bar and it's flat 1-D appearance.    ![Notice navigation bar ontop](http://i.stack.imgur.com/3mbEK.png) But this is what I'm used to. Any way I can switch back to this look?                                     ![google chrome](http://i.stack.imgur.com/LKoyx.png)


title: Segmentation fault with dialog

text: I'm getting a segmentation fault with the following script when it's more that one child dir past the pwd. The program kills with the error message and I have to reset the shell. For example: I start in `/` and run the script. I navigate to from `/` to `/etc` just fine. When I try to go to `/etc/httpd/` that's when I get the segment fault. Another example: I start the script with `lsgui /etc` and at that point it will display that dir but when I try to navigate to another dir it faults again.               #!/bin/bash          output=${1-$PWD}     IFS=$'\r\n' lss=($(ls -1 $output))     for ((i=0;i<${#lss[@]};i++));do     x+=($i \"${lss[$i]}\")     done          justdir=($(basename $output))     desc=($(grep $justdir /root/lsgui.conf))     if [ -z $desc ]     then     desc=$output     fi          dialog --keep-tite --title 'lsgui' --menu $desc 40 70 ${#lss[@]} ${x[@]} 2>/tmp/lsgui.$$          if [ $? -gt 0 ]; then     rm -f /tmp/lsgui.$$     clear     exit 0     fi          result=`cat /tmp/lsgui.$$`          case $? in     0)       if [ -d ${lss[$result]} ];then         /root/lsgui $output/${lss[$result]}       else         dialog --keep-tite --title "${lss[$result]}" --textbox $output/${lss[$result]} 40 70       fi          esac      **UPDATE** The problem was `if [ -d ${lss[$result]} ];then`. It was looking to open a file in a dir. This was fixed by changing the previous statement to `if [ -d $output/${lss[$result]} ];then`. I probably could have prevented the segfault in the first place by checking if the dialog textbox was a file or not.


title: How do I generate SSHFP records?

text: I need to setup SSHFP records in the DNS for my host. I have done some searching but I haven't found any good example.   * What are SSHFP records?   * What does SSHFP records look like?   * How do I create SSHFP records?


title: When is it safe to disconnect my external HDD?

text: In Windows, there's an option to "safely remove hardware". Ignoring the fact that it almost always fails, and that most of the time I simply have to plug the device out, I get the initiative behind it (not completely though). So, when using Debian, when is it "safe" (i.e. not damaging to any party) to remove my external HDD? After it has been unmounted (Xfce seems to use the term "ejected" but I guess that's the same thing)? Or simply when there are no programs using the disk?


title: How to group alphanumeric permissions

text: As an addition to my previous question: Which is more widely used: chmod 777 or chmod a+rwx. If I were to use the chmod a+rwx (which I wouldn't in the real world) format, but I wanted to use the alphanumeric value of 755. How would I write that out? e.g.:               $ chmod u+rwx,g+rx,o+rx      That just seems such a long expression.


title: output only file names(with spaces) in ls -Al

text: I should echo only names of files or directories with this construction:               ls -Al | while read string     do     ...     done      `ls -Al` output :               drwxr-xr-x  12 s162103  studs         12 march 28 12:49 personal domain     drwxr-xr-x   2 s162103  studs          3 march 28 22:32 public_html     drwxr-xr-x   7 s162103  studs          8 march 28 13:59 WebApplication1      for example if I try               ls -Al | while read string     do     echo "$string" | awk '{print $9}     done      then output only files and dirs without spaces. If file or dir have spaces like "personal domain" it will be only word "personal". PLEASE, help! I need very simple solution. Maybe there is better solution than awk. Need very simple!


title: NFS - What does the "sticky bit" mean?

text: I'm trying to figure how is the sticky bit used in NFS v3. RFC 1813 says on page 22: > 0x00200 Save swapped text (not defined in POSIX). What do they mean by "swapped text"? In "NFS Illustrated", the author, Brent Callaghan, says it means not to cache. However, I haven't seen this explanation in other places.


title: Copy only regular files from one directory to another

text: I'd like to copy a content of directory 1 to directory 2. However, I'd like to only copy files (and not directories) from my directory 1. How can I do that ?               cp dir1/* dir2/*      then I still have the directories issue. Also, all my files don't have any extension, so _._ won't do the trick


title: Why is a user started process running when not logged in?

text: Following a tutorial on setting up gnupg to manage ssh keys I've managed to get several instances of gpg-agent running:               [root@frylock ~]# ps aux | grep agent     root      2764  0.0  0.0   4208   432 ?        Ss   11:15   0:00 ssh-agent     xtian     2785  0.0  0.1   3500   972 ?        Ss   11:18   0:00 gpg-agent -s --enable-ssh-support --daemon --write-env-file /home/frylock/xtian/.gnupg/gpg-agent.env     root      2958  0.0  0.0   3168   688 ?        Ss   11:39   0:00 gpg-agent -s --enable-ssh-support --daemon --write-env-file /root/.gnupg/gpg-agent.env     root      3036  0.0  0.0   4740   392 ?        Ss   11:43   0:00 gpg-agent --daemon     root      3186  0.0  0.0   4740   388 ?        Ss   11:53   0:00 gpg-agent --daemon     root      3299  0.0  0.0   4740   388 ?        Ss   11:58   0:00 gpg-agent --daemon     root      3549  0.0  0.0   4740   392 ?        Ss   12:54   0:00 gpg-agent --daemon      I can resolve most of this mess by going back over the instructions--a fifth time. But what I don't understand, why is my user account owner of a running process when I'm only logged in one tty as root?


title: FEDORA 12 freezed at login screen

text: I have Fedora 12 OS in my 32 bit Intel pentium D computer, 1GB RAM, inbuilt Intel corporation 82945G/GZ graphics. Till yesterday it was working fine.. When I started this morning my system is frozen at the login screen. But as I observed, after some experiments, in GUI mode - time and CPU usage - everything seems working. But keyboard and mouse are not responding. I am able to work on text mode. However when I get into text mode: if I enter the command `startx` I am able to login to it but keyboard & mouse are not responding to anything. As I am a bit new to Linux, requesting you to help me out of this without formatting the HDD.


title: Multiple network adapters with Virtualbox guests?

text: I'm running VBox under Mac OS with multiple Linux guests (Redhat). Everything works fine except I want to test dual NICs in one of my guests. I'm using `host-only` adapters and would like to simulate multiple NICs in the guests. I added the second NIC but it doesn't show up in the OS. Nothing under `/etc/sysconfig/network-scripts/` besides `ifcfg-eth0`


title: Reverse two finger scroll direction with BCM5974?

text: I'm looking to reverse the scroll direction specifically on my Apple trackpad, and I'm not sure if there's an input option to do so:               Device 'bcm5974':     Device Enabled (144):   1     Coordinate Transformation Matrix (146): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000     Device Accel Profile (262): 1     Device Accel Constant Deceleration (263):   2.500000     Device Accel Adaptive Deceleration (264):   1.000000     Device Accel Velocity Scaling (265):    12.500000     Synaptics Edges (266):  108, 1172, 68, 732     Synaptics Finger (267): 25, 30, 256     Synaptics Tap Time (268):   180     Synaptics Tap Move (269):   66     Synaptics Tap Durations (270):  180, 180, 100     Synaptics Tap FastTap (271):    0     Synaptics Middle Button Timeout (272):  75     Synaptics Two-Finger Pressure (273):    282     Synaptics Two-Finger Width (274):   7     Synaptics Scrolling Distance (275): 30, 30     Synaptics Edge Scrolling (276): 0, 0, 0     Synaptics Two-Finger Scrolling (277):   1, 1     Synaptics Move Speed (278): 1.000000, 1.750000, 0.132538, 40.000000     Synaptics Edge Motion Pressure (279):   30, 160     Synaptics Edge Motion Speed (280):  1, 120     Synaptics Edge Motion Always (281): 0     Synaptics Off (282):    0     Synaptics Locked Drags (283):   0     Synaptics Locked Drags Timeout (284):   5000     Synaptics Tap Action (285): 0, 0, 0, 0, 0, 0, 0     Synaptics Click Action (286):   1, 3, 2     Synaptics Circular Scrolling (287): 0     Synaptics Circular Scrolling Distance (288):    0.100000     Synaptics Circular Scrolling Trigger (289): 0     Synaptics Circular Pad (290):   0     Synaptics Palm Detection (291): 0     Synaptics Palm Dimensions (292):    10, 200     Synaptics Coasting Speed (293): 20.000000, 50.000000     Synaptics Pressure Motion (294):    30, 160     Synaptics Pressure Motion Factor (295): 1.000000, 1.000000     Synaptics Resolution Detect (296):  1     Synaptics Grab Event Device (297):  1     Synaptics Gestures (298):   1     Synaptics Capabilities (299):   1, 0, 0, 1, 1, 1, 1     Synaptics Pad Resolution (300): 1, 1     Synaptics Area (301):   0, 0, 0, 0     Synaptics Noise Cancellation (302): 5, 3      Is there any way I could swap the axes for two finger scrolling to make it more natural? If I globally swap it, then my mouse scrolls backwards too :(


title: Memory profiling the linux kernel on an embedded device

text: I have an linux kernel 2.6.30 on an ARM based embedded device and I have to do some kernel memory usage profiling on the device. I am thinking of monitoring the ps output on various kernel threads and modules while I carry out actions like wifi on/off etc. Can you suggest me: Which threads I need to monitor? How to monitor the kernel module memory usage?


title: Unix mail command not sending email

text: I'm having trouble trying to send email with the unix mail command. Currently I'm trying this:               echo "something" | mail -s "test mail" email@address.com      But when I check my email, I haven't received it. How do I get it working? I'm using Mac OS X 10.7


title: Quota utilities

text: Are there any **command line** utilities that make it easier to read quotas (e.g. showing percentages, approximate size in MB, etc.). Perhaps something like what `htop` does for `top`, but for quota?


title: How to fix mpc timeout error

text: I'm using mpc/mpd on Raspbian (debian). Running MPD it starts:               sudo mpd --no-daemon --stdout --verbose  /etc/mpd.conf     config: loading file /etc/mpd.conf     path: path_set_fs_charset: fs charset is: UTF-8     database: reading DB     disabling the last.fm playlist plugin because account is not configured     daemon: opening pid file     daemon: writing pid file     avahi: Initializing interface     avahi: Client changed to state 101     avahi: Client is CONNECTING     state_file: Loading state file /var/lib/mpd/state     decoder_thread: clearing mixramp tags     decoder_control: mixramp_start = NULL     decoder_control: mixramp_prev_end = NULL     playlist: queue song 1:"http://mp3channels.webradio.rockantenne.de/classic-perlen"     input_curl: icy-metaint=16000     decoder: audio_format=44100:24:2, seekable=false     output: opened plugin=pulse name="Pulse" audio_format=44100:16:2     output: converting from 44100:24:2      But playing stream from playlist fails:               mpc play 1     error: Timeout      Logfile says:               client: [3] opened from 127.0.0.1:55768     client: [3] process command "status"     client: [3] command returned 0     client: [3] process command "play "0""     playlist: play 0:"http://mp3.webradio.rockantenne.de:80"      The URL itself is reachable from the device. Any clues how to diagnose/ fix the timeout error? **Update:** It hangs on various other occasions, too:               pi@raspberrypi ~ $ sudo mpd --no-daemon --stdout --verbose  /etc/mpd.conf     config: loading file /etc/mpd.conf     path: path_set_fs_charset: fs charset is: UTF-8     database: reading DB     disabling the last.fm playlist plugin because account is not configured     daemon: opening pid file     daemon: writing pid file     avahi: Initializing interface     avahi: Client changed to state 101     avahi: Client is CONNECTING     state_file: Loading state file /var/lib/mpd/state     decoder_thread: clearing mixramp tags     decoder_control: mixramp_start = NULL     decoder_control: mixramp_prev_end = NULL     playlist: queue song 1:"http://mp3channels.webradio.rockantenne.de/classic-perlen"     input_curl: icy-metaint=16000     decoder: audio_format=44100:24:2, seekable=false     icy_metadata: unknown icy-tag: 'StreamUrl'     client: [0] opened from 127.0.0.1:55789     client: [0] process command list     client: command_process_list: process command "status"               ROCK ANTENNE: Heroes Del Silencio - Entre dos tierras     [paused]  #1/5   4:43/0:00 (0%)     volume: 30%   repeat: off   random: off   single: off   consume: off     ERROR: problems opening audio device


title: shell scripts are still working without #!(sha-bang line)

text: I am new to shell scripts and many books have written that use #!(sha-bang) line in starting of the script to invoke the interpreter .And this will invoke a new shell for script and do the interpretation line by line.But one of my basic script is still running without the magic line. so my questions are:   * from where did my basic script get the interpreter.   * how did the script manages to locate the interpreter. now let me tell you about my basic script it just contains the following line: echo "basic script without the magic lines"


title: Why ln -s creates relative broken links?

text: I have an issue with `ln -s` on Ubuntu 14.04, while using it in the following scenario:               $ cd ~/programming/tmux/     $ ln -s tmux ~/bin/tmux     $ ls -l ~/bin/tmux     lrwxrwxrwx 1 USER USER 4 sie 31 11:02 /home/USER/bin/tmux -> tmux      Why is it like so? When I create it giving the absolute path everything works fine:               $ ln -s ~/programming/tmux/tmux ~/bin/tmux     $ ls -l ~/bin/tmux     lrwxrwxrwx 1 USER USER 4 sie 31 11:02 /home/USER/bin/tmux -> ~/programming/tmux/tmux


title: ATI friendly distro?

text: I've been researching on problems with ATI catalyst drivers and there is no fix as far as I can see. I have an ATI Radeon 7470m (HP Pavilion dm4). And I haven't managed to have a properly working distro. Is there any Linux distro that behaves well with this card and allows me to have GNOME3 without burning my laptop? If there is not a solution yet this question should help new users to get a quick update :)


title: How to tell if syslog.conf has a typo

text: I recently did in fact have a typo in my syslog.conf file, but I had no idea initially why I couldn't restart the daemon. In Ubuntu, all I seemed to get was a FAIL message after a rather long wait period. Without it running properly, I was curious, is there a way I could have figured it out without scouring random logs pointlessly before considering there may have been a typo? Edit: I really felt like using service to start/restart/etc the daemon should have given more than FAIL. Perhaps it does and I just don't know where to look, but if another service had a similar silly issue, I'd hope to be able to figure it out easily as well.


title: Is it safe to reformat an lvm root partition?

text: My system currently has a volume group containing root, swap, and home logical volumes. I would like to reinstall the operating system in the root volume and format the partition in the process. I don't know how logical volumes work so I don't know if there is any information about the volume group that is stored on the root partition. If I reformat the root partition, will this remove my ability to access the volume group?


title: Why is my notifications applet displaying incorrectly?

text: I'm using Linux Mint 16 Petra with the MATE desktop environment. Perhaps I shouldn't have done this, but when I was adding a new application to my list of startup applications, I saw what seemed like duplicate entries, and so I removed the duplicates. After a reboot, the notification area in my panel is now displaying incorrectly, with some icons being duplicated, and others, like my sound and network icons, not displaying at all. Here is what it looks like: ![broken notification area](http://i.stack.imgur.com/FWIQT.png) I have tried uninstalling and reinstalling the `Notification Area 1.6.1` applet, and manually adding applets like my sound applet, but without any impact. How do I get my notification area back to normal?


title: fdupes - delete files after comparing two directories

text: I'm currently trying to solve an issue using `fdupes`. I'd like to compare two folders with each other, and afterwards delete all duplicate files within one of these directories. Example: Files are being stored automatically in `/srv/`--lots of duplicates there. They shall be all left untouched. I also have a dir called `/watchfolder/` and I want to remove all files in `watchfolder` if they are existent in `/srv/`. I've tried `fdupes -r srv/ watchfolder/` and the other way around. But it keeps messing with my files in `srv/`.


title: Bash: pair up two series of files

text: I have a number of files with this pattern:               file1_foo.ext     file1_bar.ext     file2_foo.ext     file2_bar.ext      and so on. I need to "pair them" and put them in a file like this               file1_foo.txt    file1_bar.txt      (tab separated) What's the best course of action in this case?


title: Retrieve value of RTS threshold without iwconfig

text: Is there a way in OpenWrt to read the current value of the RTS threshold for a specific interface without installing iwconfig? What I'm looking for is the value of `RTS thr` that can be found in the output of `iwconfig _device_`:               wlp2s0    IEEE 802.11bgn  ESSID:"my_essid"                 Mode:Managed  Frequency:2.412 GHz  Access Point: 00:DE:AD:BE:EF:00                  Bit Rate=54 Mb/s   Tx-Power=16 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off      Since `iwconfig` is deprecated, I'm looking for a way to obtain this value with `iw` or by reading some system files. What seems strange is that with `iw` I can set the RTS threshold by using                iw phy phy0 set rts 80      but I can't read it. After that command the output of `iwconfig` is               wlp2s0    IEEE 802.11bgn  ESSID:"my_essid"                 Mode:Managed  Frequency:2.412 GHz  Access Point: 00:DE:AD:BE:EF:00                   Bit Rate=54 Mb/s   Tx-Power=16 dBm                  Retry  long limit:7   RTS thr=80 B   Fragment thr:off               Encryption key:off               Power Management:off               Link Quality=70/70  Signal level=-19 dBm                 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:26  Invalid misc:1916   Missed beacon:0      So the actual question is: where does iwconfig read the value of **RTS thr**?


title: -bash: cd: .ssh/: Permission denied

text: When I type in `cd .ssh` in terminal, it returns with `-bash: cd: .ssh/: Permission denied`. Now I cannot add my ssh keys to ssh. When I type `ssh-add ~/.ssh/idname` it says `/Users/Dan/.ssh/idname: Permission denied`. I think it has to do with me typing `ls -d` because it worked before I typed this into terminal?


title: Sorting ls output by time, when there are too many files for a single invocation

text: I know that I can sort the output of `ls` by time with the `-t` option. I know that when I have so many files that they don't fit in a single `ls` invocation, I can normally use `xargs` (or `find ... -exec ... {} +`) to let `ls` be called multiple times. How can I combine the two? I have more files than fit on the command-line, and wish to list them sorted by time. `find . -type f -exec ls -t {} +` doesn't work, because supposing exactly 1000 file names fit on the command-line, and 3000 files are present, this will run `ls -t [first 1000 files]; ls -t [second 1000 files]; ls -t [last 1000 files]`, where the last 1000 files `find` sees may well have a modification time before any of the first 1000. It doesn't seem like anything involving `xargs` or equivalent has any chance whatsoever of working, it seems like that approach is fundamentally flawed, but I cannot find a way that _does_ work.


title: scp hangs on SSH2_MSG_SERVICE_ACCEPT received

text: I frequently scp my file to remote host. But suddenly it started taking more than 30 seconds to copy 20kb file.It used to take not more than half a second. After referring to some blog I appended `UseDNS no` in `/etc/ssh/ssh_config` . But now while I scp it gives `/etc/ssh/ssh_config: line 61: Bad configuration option: UseDNS`


title: NAT with transparent proxy

text: is there a way to redirect all non local http requests that through my computer to use my transparent proxy, so i can log all websites are they visiting? and if possible all https requests too.. my computer was used as NAT server because we only have 1 real IP..               eth1 = w.x.y.z (real/public IP)     eth0 = a.b.c.d (fake/private IP)      my transparent proxy listen on localhost:3128 all computers in my home connected to eth0 to access the internet..


title: Encoding of a zip file

text: When I extract some file (mp3) with japanese or korean characters within its filename on Windows, they appear normally, but when I extract it on Linux (Ubuntu/Mint) they appear as something like this               5thƒAƒ‹ƒoƒ€w1“x      “¡“c–ƒˆßŽq     03 ‘²‹Æ     ?????      The question is:   1. How to fix those already extracted files?    2. How to fix the id3 tags also when I don't know what's the correct text/characters?   3. How to make extraction defaults as Windows' character encoding?


title: Yum doesn't work

text: Today I try to list installed php packages with yum but when I run "yum list php*". I have got a strange error "There was a problem importing one of the Python modules required to run yum. The error leading to this problem was", I google it and there is a lot of information about that and try few "fixes" but they doesn't work. I try "yum clean all" as in other cases but it doesn't work. You can see the problem at this screenshot. ![Yum doesn't work and this is the problem](http://i.stack.imgur.com/4tRUc.png) So can anybody helps me? I'm using CentOS 6.5 x86_64. Best regards, George!


title: How to edit /etc/inittab?

text: I want to edit `/etc/inittab` in order to get a login prompt on the serial console once the system boots. By default, inittab file complains to be `ro`. I tried both `gksudo gedit /etc/inittab` and `sudo vi /etc/inittab` and seemed to be properly configured. However, when I opened file after that with gedit, I saw no difference. Any ideas?


title: Open to specific gvim tabs

text: I have a working environment that I'd like to save via a script.   -EDIT: I don't need to save it's state, I just want my script to define it. Though saving state would work too I guess. Currently it passes a list of file names to `gvim` via `gvim "${files[@]}" -c ":tab all"`. Each file gets it's own tab (except that last few since there are more than 10). What I want is an easy way to map which files end up in which tabs and how they are split. Preferably with a default of `go to new tab` for the files that don't need split?


title: Unbootable system, uneditable boot options

text: My distro (Trisquel, a modified version of Ubuntu 12.04) comes with a 3.2.0-38 kernel. I recently reinstalled it, and after installing a bunch of updates I found that boot would hang on the splash screen. Heading into GRUB, I found that there was now a 3.2.0-57 kernel set as the default. I removed the "quiet splash" boot parameters and found the reason boot was hanging: it was detecting two resume devices (named, IIRC, /dm-0 and a random bunch of hex digits and hyphens) and prompting me with "enter the full path name or press Enter to boot the system". But neither of those options worked. For a few days I was content to hold Shift after the BIOS and scroll to the still-bootable 3.2.0-38. Today I got fed up and removed all three non-working kernels I had installed. Big mistake. 3.2.0-38 now behaves just like the other kernels did. And if I try to edit the boot options, I am prompted for a username and password, after which nothing happens. I am simply returned to the initial GRUB screen. My home partition is encrypted, and I've tried entering both my password and the encryption password, but neither has any effect. Is there a way to fix this without reinstalling the system? And if not, how can I recover my data (my last backup is a little out of date, and I'm not sure how to recover from an encrypted partition)?


title: Thousands separator in printf in zsh

text: I have been trying to define a thousands separator in `printf` for a while now and I have discovered that zsh has some problems with it. In bash I can use something like:               $ printf "%'d\n" 1234567890     1,234,567,890      but in zsh it won't work :               $ printf "%'d\n" 1234567890     printf: %': invalid directive      I have just found out that coreutils `printf` will do it just fine:               $/usr/bin/printf "%'d\n" 1234567890     1,234,567,890      How can I use thousands separator in zsh?               $ zsh --version     zsh 5.0.2 (x86_64-pc-linux-gnu)


title: Debugging a "brutal" system hang (no longer responds to Alt+SysRq+B)

text: I've had a series of system hangs where I hoped to get a crash dump to at least get some clues but the normal "magic sysrq" functionality is broken too; not even the immediate reboot key works. The keyboard state LEDs (Caps Lock, etc) no longer toggle. The only thing that works is holding down the power button on the PC. Some more background below, but my generic question is what the next steps for debugging such a hang would be, i.e. how can I get at least a callstack (presuming the culprit is still running) and preferably a working (mini) debugger against such an unresponsive state? Details: it's a desktop PC (Dell OptiPlex 7010) running a fairly recent OS [stock LinuxMint 16, kernel 3.11.0-12-generic], with a PS/2 keyboard. It has a serial port, but unfortunately I don't have another machine + null modem cable handy to try to use for a kernel console. I (naively) suspect that if Alt- SysRq isn't working then attempts to switch desktops, use netconsole, etc, will be futile. Also as supplementary info (probably not relevant), the hangs were from using fscache against an overloaded CIFS network mount. Caching was working (/proc/fs/fscache/stats showed hits happening, so the config wasn't completely wrong) but with this periodic "brutal hang". The kernel log does have the suggestive entry:               FS-Cache: Cookie type CIFS.uniqueid marked page 0 multiple times for at least some of the hangs. Memory tests ok and the correlation between the hangs and using fscache is very solid, so I doubt it's a generic hardware issue (RAM, temperature, cosmic rays...)


title: Strip // Comments From Files

text: What's the best way to strip all code **comments** in a given directory? I'd like to strip out all `// ... EOL` **comments** , and `/* blah \\*/` (or `/** ... \\*/`) **comments** as well. This is a PHP project, and I'd like to go a little further than what is outlined below, yet for security purposes rather than efficiency.   * Zend Frameword: Documentation Class Loading - Strip require_once calls with find and set. Any help would be greatly appreciated.


title: Is "export" needed when setting HISTIGNORE in bashrc files?

text: As I understand it, `export`ing an environment variable makes it available to any processes spawned from the current one. But the only processes that will be interested in the `HISTIGNORE` variable (and some related variables) are other instances of bash, which will read ~/.bashrc and pick up the value anyway. So should I use:               export HISTIGNORE="&"      or just:               HISTIGNORE="&"      in my .bashrc file?


title: A commad to change between activities

text: Is there a command to swtich between activities in KDE plasma-desktop?


title: Changing the Java Runtime in NetBean 8 on Ubuntu 14.04

text: _(Not sure if this is the right site for this question - if not please migrate.)_ I am using Netbeans for C++ on Ubuntu 14.04. Ubuntu comes with the Open JDK Runtime, which is what Netbeans is currently using - see below:               Product Version: NetBeans IDE 8.0 (Build 201403101706)     Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 2     Java: 1.7.0_55; OpenJDK Client VM 24.51-b03     Runtime: OpenJDK Runtime Environment 1.7.0_55-b14     System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)     User directory: /home/u111/.netbeans/8.0     Cache directory: /home/u111/.cache/netbeans/8.0      But there are some problems in FireFox with the JDK Runtime that comes with this version of Ubuntu, so I installed the Sun Java runtime, which fixed my FireFox problems. Now I would like to configure NetBeans to also use the Sun runtime instead of OpenJDK. How do I do this?


title: Make terminal text color different when in ssh session

text: Is there a way to make my terminal (konsole) display different text colors when I'm in an ssh session WITHOUT modifying the remote host's color configuration? Like, maybe automatically switching to a different profile? Konsole can use these different "profiles" ![alt text](http://i.stack.imgur.com/svW9v.png) I want to basically change to a different profile when in an ssh session. So that instead of the default being green on black, change to black on white or something. It doesn't necessarily have to use this profile setting. But if xterm or something has a setting to do this that would work too. The idea is to work on ANY ssh session, not just particular sessions with particular machines.


title: Alternatives to HUD

text: Are there alternatives to HUD (from unity) which work together with different window managers (especially with tiling WM's)?


title: How do I edit the terminal launch command in Linux Mint?

text: In Linux Mint (Debian-based) how can I edit what the shortcut `Ctrl`+`Alt`+`t` launches? For example, I would like to issue `gnome-terminal` with the `\--maximize` option, and to have it launch tmux instantly.


title: only output when first columns are the same

text: INPUT:               [USER@NOTEBOOK ~/proba] find . -type f | xargs -I "{}" md5sum "{}" | sort     18b17ef2e55f6fd2deb044943a8a769d  ./yes     2b00042f7481c7b056c4b410d28f33cf  ./tt.txt     2b00042f7481c7b056c4b410d28f33cf  ./tx.txt     698458eb994fafdf56c1f63295c942ad  ./laksjdasdff.txt     764efa883dda1e11db47671c4a3bbd9e  ./ize2.txt     764efa883dda1e11db47671c4a3bbd9e  ./ize3.txt     764efa883dda1e11db47671c4a3bbd9e  ./ize.txt     a787d6f5ce5deb6e2e4b004f95da5655  ./laksjdf.txt     [USER@NOTEBOOK ~/proba]       OUTPUT:               [USER@NOTEBOOK ~/proba] find . -type f | xargs -I "{}" md5sum "{}" | sort | SOMEMAGIC     tt.txt tx.txt     ize2.txt ize3.txt ize.txt     [USER@NOTEBOOK ~/proba]       So I need a "SOMEMAGIC" that only outputs filenames if the md5sum matches (one line per md5sum). (It will be a deduplication script.. )


title: How do I convert a kernel .config file from 32-bit to 64-bit?

text: At this page you can download a configuration file that lets you target a particular notebook architecture during the compilation of a new 32-bit Linux kernel. I need a 64 bit version. What do I have to do? I compiled a kernel 2-3 times in my life but I never touched a config file, I always have used an interactive menu.


title: Debian Squeeze: hide xorg start messages

text: I have setup up my box so that it I automatically login as root via the command line interface. in `bash.bashrc` I have these commands: `startx ./run.sh` in the command line. Right before it starts the xserver, it displays the following information:                       X.Org X Server 1.7.7             Release Date: 2010-05-04             X Protocol Version 11 Revision 0             Build Operating System: Linux 3.0.0-1-amd64 x86_64 Debian             Current Operating System: Linux debian 2.6.32-5-amd64 #1 SMP Fri Feb 15   15:39:52 UTC 2013             Kernel command  line: BOOT_IMAGE=/boot/vmlinuz-2.6.32-5-amd64 root=UUID=2c7e52a1-b10c-???????             Build Date: 29 October 2011 06:58:14PM             xorg-server 2:1.7.7.14 (Jaleo Christian jcristian@Debian.org)             Current version of pixman: 0.16.4             Before reporting problems, check http://wiki.x.org                 to make sure that you have the latest version.             Markers: (--) problem, (==) from config file, (**) default setting,                     (++) from command line, (!!) notice, (II) Informational,                     (WW) warning, (EE) Error, (NI) Not Implemented, (??) unknown             (==) Log file: "/var/log/Xorg.0.log", Time: Wed Aug 29 10:50:12 2012/             (==) Using config file: "/etc/X11/xorg.conf"             (==) Using system config directory "/usr/share/X11/xorg.conf.d"      Since I have my application running right afterwards, I don't want the intermediate text appearing. I've look in `/etc/X11/xorg.conf` to see if there is a setting that displays messages to the screen but nothing. Q: Where would I need to go to disable the above messages from being displayed?


title: Can you Chroot a program from an OpenVZ environment?

text: I just recently purchased a Virtual Private Server, and it is OpenVZ virtualization. I am setting up my LAMP stack, and in the past I have always just set up my BIND dns set up in a chrooted environment, with the bind-chroot RPM. I am running CentOS as well. Now I am just curious as to whether this is even possibly on OpenVZ, because OpenVZ is essentially chrooted itself already.. So I have never ran into a situation where I had I came across a chroot in a chroot type situation. Is this possible? My main worry is I dont want to do this, and have it corrupt something, and end up getting kicked from the server for something as simple as this you know? Whats your thoughts? Can I chroot BIND, or should I just go with the regular set up? Thanks


title: authenticate url with asked credentials

text: there is a URL                   http://server,       when I open this url it ask for username and password (.htaccess authentication), this URL works fine in browser. This is the webpage not the browser which ask for user/pass authentication. I want to pass commands using linux command line.               i.e.          http://server/userconfig.html?user=user1&action=enable or http://server/userconfig.html?user=user1&action=disable       above URL works fine in browser after authentication. I want to do this using bash. Kindly help in this regard.


title: Can't start Tomcat on Ubuntu

text: I installed Tomcat on Ubuntu. Then I created a new user. Then did:               liferay@web-svr:~/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin$ chmod +x *.sh      Afterwards, I added `JAVA_HOME` and `PATH` in bash like this:               JAVA_HOME=/etc/jdk1.7.0_07     export JAVA_HOME     PATH=$PATH:$JAVA_HOME/bin     export PATH      Then I started Tomcat:                liferay@web-svr:~/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin$ sh startup.sh      And I get this error:               liferay@web-svr:~/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin$ sh startup.sh     Using CATALINA_BASE:   /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27     Using CATALINA_HOME:   /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27     Using CATALINA_TMPDIR: /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp     Using JRE_HOME:        /usr/lib/jvm/java-6-openjdk-amd64     Using CLASSPATH:       /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin/bootstrap.jar:/home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin/tomcat-juli.jar     touch: cannot touch ‘/home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/logs/catalina.out’: Permission denied     ./catalina.sh: 389: ./catalina.sh: cannot create /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/logs/catalina.out: Permission denied      I did:               su admin     chmod 755  /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/logs/      But that doesn't help. What can be wrong? **UPDATE** OK I did:               sudo chmod 777 /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/logs/catalina.out      And now when I start Tomcat I get this error:               liferay@web-svr:~/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin$ sh startup.sh     Using CATALINA_BASE:   /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27     Using CATALINA_HOME:   /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27     Using CATALINA_TMPDIR: /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp     Using JRE_HOME:        /usr/lib/jvm/java-6-openjdk-amd64     Using CLASSPATH:       /home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin/bootstrap.jar:/home/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin/tomcat-juli.jar      **UPDATE2** I have a mistake in JAVA_HOME. Now i have it correct. But When i start a tomcat i still have same output and in catalina.out i have ~1000 lines of errors and line:               июл 17, 2013 8:48:45 AM org.apache.catalina.startup.Catalina start     INFO: Server startup in 24802 ms      And in myhost:80 i have a blank page and on myhost:8080 i have 404 in FireBug and blank page in browser.


title: Stay at same working directory when changing to sudo

text: When working on the command line, I often change to sudo using `sudo -i`. However, my working directory changes automatically to `/root`. I never want to go there; I want to stay where I was! How can I achieve this?


title: Console ScreenSaver without X11

text: I'm trying to setup a very slimmed down console only Debian system to act as a simple slideshow photo display. I know that it is possible to show graphics (I guess using the framebuffer) in the console without running X11 but I haven't been able to track down anything that I could use to display images. Has anyone actually ever made a console based picture screensaver? Or is there at least some package out there that would get me part of the way there? I know that there are options for Gnome, KDE, etc... but it would be great if I could keep this build as simple as possible.


title: How can I git diff markdown (.md) files

text: I have some markdown files but I can't git diff them. No result at the command line and not supported in `gitg` (visual git) Is that possible with the files as they are, without converting them to something else?


title: Learning about iptables: Is this Slicehost example any good?

text: In preparation to eventually launch my first website, I've been playing with Ubuntu Lucid Server in a VM on my WinXP machine. I've been alternating between the Linode and Slicehost tutorials/articles for guidance, and I'm trying to make sense of the section on iptables. Slicehost's example can be found here. It seems deceptively simple to me, though. It's just a matter of locking down everything and punching very specific holes. When all other articles seem confusing and make iptables sound like a huge PITA, this example seems very straightforward (or at least, it seems that way once you know what the commands mean). Is this example suitable for a production server? Do the really complicated bits of iptables only really come up later?


title: SSNiper SSN Scanner support

text: I work for a major university and we have a policy that requires annual scanning of all computers for social security numbers (SSNs). I started using a utility called SSNiper that was created at UIUC. Unfortunately, the person who supported the utility is no longer with that university and it seems to have been abandoned. Anyway, my actual problem is this: I am attempting to compile and build a new RPM for SSNiper for our CentOS 6.2 servers, and while the compile phase seems to work just fine, the "make rpm" portion is dying with an error.               rm -f magic_test.o dbase.o ssniper.o list.o validate.o scan_file.o config_file.o ssn_fsm.o extension_test.o logging.o get_line.o list_test.o  ssniper     darcs get . ssniper-`cat VERSION`-`cat RELEASE`     darcs failed:  Not a repository: /home/racooper/download/ssniper-0.9.7-2 (/home/racooper/download/ssniper-0.9.7-2/_darcs/inventory: openBinaryFile: does not exist (No such file or directory))     make: *** [tarball] Error 2      If anyone either has experience with SSNiper, or can suggest solutions to my problem above, I would be extremely grateful.


title: what is meant by multiprocessing and how it works?

text: what is difference between cores, CPU, threads and processor on linux system ? please explain the difference


title: Relationship among runlevels and virtual terminals (TTY)

text: When I switch from rulevel 5 to 3 (with `init` command) and I press `Ctrl``Alt``F1` up to `F7`, I realize that now I’m on TTY1 instead of TTY7 and when I switch back to runlevel 5 I return back to TTY7. Why? More generally, what’s the relationship among runlevels and virtual terminals (TTY)?


title: apt-get or aptitude

text: > **Possible Duplicate:**   >  What is the real difference between "apt-get" and "aptitude"? (How about > "wajig"?) I'm new in Linux (Ubuntu) world. When I need to install something I Google for it and frequently I found some command like apt-get install [package name] My friend told me that aptitude provides more functionality and it's better to use it instead. But as I know aptitude will be removed from next version of Ubuntu (yes, it will be possible to install it, but it will be excluded by default). What better to use: apt-get or aptitude?


title: How can I restore the changes to shell variable?

text: For the purpose of an experiment... Suppose I did this               bash="unset DISPLAY; export DISPLAY"      so I can make `DISPLAY` undefined. How can I restore the original value set? Or at least know what it was?


title: How to split the array in set of five files and download them in parallel?

text: I am trying to copy files from `testMachineB` and `testMachineC` into `testMachineA` as I am running my shell script on `testMachineA`. If the file is not there in `testMachineB`, then it should be there in `testMachineC` for sure. So I will try to copy file from `testMachineB` first, if it is not there in `testMachineB` then I will go to `testMachineC` to copy the same files. `PARTITIONS` is the file partition number which I need to copy in `testMachineA` in directory `FOLDER_LOCATION`.               #!/bin/bash          readonly FOLDER_LOCATION=/export/home/username/pooking/primary     readonly MACHINES=(testMachineB testMachineC)     PARTITIONS=(0 3 5 7 9 11 13 15 17 19 21 23 25 27 29) # this will have more file numbers around 400          dir1=/data/snapshot/20140317          # delete all the files first     find "$FOLDER_LOCATION" -mindepth 1 -delete     for el in "${PARTITIONS[@]}"     do         scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 username@${MACHINES[0]}:$dir1/s5_daily_1980_"$el"_200003_5.data $FOLDER_LOCATION/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 username@${MACHINES[1]}:$dir1/s5_daily_1980_"$el"_200003_5.data $FOLDER_LOCATION/.     done      **Problem Statement:-** Now what I am trying to do is - Split the `PARTITIONS` array which contains the partition number in set of five files. So I will copy first set which has 5 files in parallel. Once these five files are done, then I will move to next set which has another five files and download them in parallel again and keep on doing this until all the files are done. I don't want to download all the files in parallel, just five files at a time. Is this possible to do using bash shell scripting? **Update:-** Something like this you are suggesting?               echo $$          readonly FOLDER_LOCATION=/export/home/username/pooking/primary     readonly MACHINES=(testMachineB testMachineC)     ELEMENTS=(0 3 5 7 9 11 13 15 17 19 21 23 25 27 29)     LEN_ELEMENTS=${#ELEMENTS[@]}     X=0          dir1=/data/snapshot/20140317          function download() {         if [[ $X < $LEN_ELEMENTS ]]; then             (scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 username@${MACHINES[0]}:$dir1/s5_daily_1980_"${ELEMENTS[$X]}"_200003_5.data $FOLDER_LOCATION/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 username@${MACHINES[1]}:$dir1/s5_daily_1980_"${ELEMENTS[$X]}"_200003_5.data $FOLDER_LOCATION/.) && kill -SIGHUP $$ 2>/dev/null &         fi     }          trap 'X=$((X+1)); download' SIGHUP          # delete old files     find "$FOLDER_LOCATION" -mindepth 1 -delete          # initial loop     for x in {1..5}     do         download     done          # waiting loop     while [ $X -lt $LEN_ELEMENTS ]     do         sleep 1     done      Does above looks right? And also, now where do I put my delete command?


title: How do I make PHP securely load files from the server root home folder on CentOS?

text: So I built what I thought would be this awesome reporting page in PHP that loads data from some CSV text files and creates nice Google charts and tables for our clients. I then thought it would be awesome if the text files lived in a shared Dropbox folder so that my staff can update the text files and then see their updates online without hacking any code or dealing with databases. It all works great on my local dev, but when I upload the code to my production server I run into problems. I think it's a Unix permissions problem, here is the PHP error:               [Sun Apr 07 11:27:58 2013] [warn] [client 208.69.41.10] mod_fcgid: stderr: PHP Warning:  file(/root/Dropbox/Reports/client-report.csv): failed to open stream: Operation not permitted in /var/www/vhosts/mydomain.com/httpdocs/my-awesome-report-page.php on line 49, referer: http://www.mydomain.com/my-awesome-report-page.php      What's the best way to allow PHP to grab the CSV files from `/root/Dropbox` ? Production is running CentOS 5.8. The files in site's httpdocs folder all seem to belong to mydomain:psacln, whereas the files in root ~ are root:root. As discussed in the comments, I would like to find a secure solution. The report page HTML is hidden behind a login.


title: How can I zip the contents of current directory minus all hidden files?

text: How can I zip up the contents (excluding hidden files and folders) of the folder I am currently in?               zip -r extension.xpi . -x "*/.*"      This is what I have so far, but I am still getting hidden files.


title: Storing Okular PDF annotations and metadata in the PDF itself

text: The PDF viewer Okular (part of KDE desktop) has lots of nice features and supports lots of file formats. One of the things I like about it is the comments and annotations. Unfortunately, all of the comments and metadata (like last viewed page) get stored locally in: **~/.kde/share/apps/okular/docdata** Is there any way to make Okular store them in the PDF itself?


title: How can I display octal notation of permissions with ls - and can octal represent all permissions?

text: After looking at the `man` page for `ls` on my system and searching Google, I see there **IS a hack of way to use`awk` or `perl` to show octal permissions** when using `ls`, but with `bash` is there anything more native? ### Standard output of ls -alh               $ ll     total 0     drwxr-xr-x   5 user  group   170B May 20 20:03 .     drwxr-xr-x  17 user  group   578B May 20 20:03 ..     -rw-r--r--   1 user  group     0B May 20 20:03 example     -rw-r--r--   1 user  group     0B May 20 20:03 example-1     -rw-r--r--   1 user  group     0B May 20 20:03 example-3      ### Desired output including octal representation of permissions               $ ll     total 0     drwxr-xr-x 1775  5 user  group   170B May 20 20:03 .     drwxr-xr-x 1775 17 user  group   578B May 20 20:03 ..     -rw-r--r-- 1644  1 user  group     0B May 20 20:03 example     -rw-r--r-- 1644  1 user  group     0B May 20 20:03 example-1     -rw-r--r-- 1644  1 user  group     0B May 20 20:03 example-3      (disclaimer: not sure if those octals are _exactly_ right) ### Reasoning I am more familiar with the `drwxr-xr-x` notation for permissions but sometimes when the dashes fall in odd places I might mis-read it at a quick glance. I'd like to see the octal equivalent as well. ### Conversion Ability (question part 2) I think a long time ago octal permissions might have been limited to `000` - `777` but in recent times there are some things like `set-group-ID` and `sticky` that have given us octals with 4 places like `1775`. Is it possible to represent every possible permission in octal format? If it is not then I'd better understand why bash's `ls` command doesn't seem to have this format.


title: Convert the permissions in `ls -l` output to octal

text: I want to convert the output of `ls` to octal permission bits. I think of the shortest and clearest way to implement that excerise: Let's say that we have as input:               total 1     drwxr----x 1 user2 workers 1024 May 26 22:22 dir     -rwx-wxrw- 2 user2 workers 1024 May 26 22:22 file.txt      our output should be:               741 dir     736 file.txt


title: Moving /dev/shm/ to /run/shm in Arch?

text: Dolphin (The KDE4 FM) would not receive file change notifications for `/dev/shm`, but for `/run/shm`. So now I would like to migrate `/dev/shm/` to `/run/shm`, but I couldn't find the corresponding part in systemd that handles it. All I want is to simulate what Ubuntu does. Mount shm to `/run/shm`, and symlink it to `/dev/shm`. Or was it possible with `udev` rules? I'm not sure if it's suitable here.


title: Restrict the times a user is allowed to log in

text: We have several Backbox 3.13 systems built on Ubuntu 12.04. One of my teenagers does not understand the concept of this thing called "sleep" and tends to get up to play on the computer. I'm trying to limit that action. We did try Nanny which worked for a few days. Then, even though the settings were still in place, it was still allowing said teen to gain access to her user account and Internet. After some research, I decided to try modifying `/etc/security/time.conf`. Apparently, I am not doing it correctly because, no matter which commands I enter into to the file, we can still log in to her user account. We do not want her to have access from 9 PM to 6 AM. We do still need for me to have access to the computer all of the time. Here are several syntaxes that I have tried:               1. login;*;username;A12100-0600     2. login;*;username;!A12100-0600     3. login;*;username;!A12100-0600        login;*;my username;A10000-2400     4. login;*;!username;A12100-0600      I'm going nuts over here with trying to figure out how to do this. I'm sure that it's something simple that I am missing, or that I am entering incorrectly. Any assistance would be appreciated.


title: Rsync daemon intrepreting parameters as command in rsync.conf

text: I meshed up with my rsync on linux. When I am restating it, its showing me following error:               sudo /etc/init.d/rsync restart          /etc/rsyncd.conf: line 13: [ftp]: command not found     /etc/rsyncd.conf: line 15: comment: command not found     /etc/rsyncd.conf: line 16: path: command not found     /etc/rsyncd.conf: line 17: use: command not found     /etc/rsyncd.conf: line 19: lock: command not found          /etc/rsyncd.conf: line 21: read: `=': not a valid identifier     /etc/rsyncd.conf: line 22: list: command not found     /etc/rsyncd.conf: line 23: uid: command not found     /etc/rsyncd.conf: line 24: gid: command not found     /etc/rsyncd.conf: line 31: strict: command not found     /etc/rsyncd.conf: line 34: ignore: command not found     /etc/rsyncd.conf: line 35: ignore: command not found     /etc/rsyncd.conf: line 36: transfer: command not found     timeout: invalid time interval `='     Try `timeout --help' for more information.     /etc/rsyncd.conf: line 39: refuse: command not found     /etc/rsyncd.conf: line 40: dont: command not found      I know it should consider taking echo parameter in `/etc/rsync.conf` file but its interpreting them as command. **update**               vim /etc/rsyncd.conf          # for pid file, do not use /var/run/rsync.pid if     # you are going to run rsync out of the init.d script.     # pid file=/var/run/rsyncd.pid     #syslog facility=daemon     #socket options=          # MODULE OPTIONS          [ftp]                  comment = public archive             path = /var/www/pub             use chroot = yes     #       max connections=10             lock file = /var/lock/rsyncd     # the default for read only is yes...             read only = yes             list = yes             uid = nobody             gid = nogroup     #       exclude =      #       exclude from =      #       include =     #       include from =     #       auth users =      #       secrets file = /etc/rsyncd.secrets             strict modes = yes     #       hosts allow =     #       hosts deny =             ignore errors = no             ignore nonreadable = yes             transfer logging = no     #       log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.             timeout = 600             refuse options = checksum dry-run             dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz      **Update2** The vim /etc/init.d/rsync .


title: Is it better to partition one drive or use separate drives?

text: I am a system admin with limited Linux experience, and have been tasked with setting up Cent OS 5.8 64bit install, and creating a template once complete. My main client base will be developers, and I would like to be able use a separate partition for their application installs, logs, etc., so if the logs partition fills up it won't take down the system. All new systems will be created using VMware. Would it be best to create one drive, and just partition it off? Or should I create a second disk and mount that as their application partition, then just add it to fstab?


title: Temporary restore LVM snapshot of root

text: I have a snapshot of the root filesystem that I want to boot with - bring the machine into a state it was a few days ago, run some tests and then go back to where I am right now. I tried editing fstab and just setting the snapshot to boot as root, but it seems that nothing happened - the snapshot was mounted, but the state of the filesystem didn't change, I'm still at the current state. Edit: There are no other partitions except root. The snapshot is RHEL 6.2, the current state is RHEL 6.3 (so there is a new kernel). I edited intrd by following this blog article and it seems now that the lvms don't get activated at boot. Dracut writes that all of them are inactive by inherit and freezes.


title: How to send ntp request?

text: I would like to get local time of server. Is there command/way to get time of server. Operating system is solaris


title: with sed, how can I replace word within a matching line?

text: I am trying to write a sed expression to detect lines similer to this: `s0:12345:respawn:/sbin/agetty -8 -s 115200 ttyS0 linux` and replace the "ttys0" with "something_else" I do not want to detect commented out lines (beginning with #) I can replace the whole line, but how to I just replace the substring, leaving the rest of the line intact ?


title: RAID 10 can not be started

text: I have a RAID 10 array managed with `mdadm` which has failed . The symptom was that X has crashed and I was unable to logon from the terminal. I have restarted the computer and `/dev/md1` did not start. I've gathered the following information - some incomplete as I've manually copied it to another computer:               $ cat /proc/mdstat          ....          md1 :   inactive sdb3[1](S) sdd1[3](S) sdc2[2](S) sda1[0](S)             1250273760 blocks super 1.0      Mounting has failed               $ mount /dev/md1         EXT4-fs (md1): unable to read superblock      Scanning did find the metadata               $ mdadm --examine --scan     ...     ARRAY /dev/md/1 metadata=1.0 UUID=2c... name=linux:1      Running has failed due to lack of operational mirrors               $ mdadm --run /dev/md1     md/raid0:md1: not enough operational mirrors.     md: pers->run() failed...     mdadm:failed to run array /dev/md1: Input/output error      After the run attempt only two disks were still in the array               $ cat /proc/mdstat     ....     md1  : inactive sdd1[3] sdc2[2]            62513638 blocks super 1.0      Trying to re-add one disk has failed               $ mdadm /dev/md1 --add /dev/sda1     mdadm: /dev/sda1 reports being an active member for /dev/md1, but --re-add fails     mdadm: not performing --add as that would convert /dev/sda1 in to a spare     mdadm: To make this a spare, use "mdadm --zero-superblock /dev/sda1" first      I've recorded some metadata in order to try recreating the array               $ mdadm --examine /dev/sdb3 /dev/sdd1 /dev/sdc2 /dev/sda1 | grep -E 'dev|Update|Role|State|Chunk Size'     /dev/sdb3:       State: active       Update time:  Mon May 14 21:51:41 2012       Chunk Size: 256K       Device Role: Active device 1       Array State : AAAA     /dev/sdd1:       State: active       Update time:  Mon May 14 22:11:11 2012       Chunk Size: 256K       Device Role: Active device 3       Array State : ..AA     /dev/sdc2:       State: active       Update time:  Mon May 14 22:11:11 2012       Chunk Size: 256K       Device Role: Active device 2       Array State : ..AA     /dev/sda1:       State: active       Update time:  Mon May 14 21:51:41 2012       Chunk Size: 256K       Device Role: Active device 0       Array State : AAAA      I've tried manually recreating the array based on the previously recorded information               $ mdadm --create --metadata=1.0 --assume-clean --level=10 --raid-devices=4 --chunk=256K /dev/md1 /dev/sda1 /dev/sdb3 /dev/sdc2 /dev/sdd1     mdadm: /dev/sda1 appears to contain an ext2fs file system     mdadm: /dev/sda1 appears to be part of a raid array     mdadm: /dev/sdb3 appears to contain an ext2fs file system     mdadm: /dev/sdb3 appears to be part of a raid array     mdadmin: /dev/sdc2 appears to be part of a raid aray     mdadmin: /dev/sdd1 appears to be part of a raid aray      Mounting fails again which probably means that the raid is not properly created $ mount /dev/md1 /mnt               EXT4-fs (md1): ext4_check_descriptors: Checksum forgroup 0 failed (54076!=0)     EXT4-fs (md1): group descriptors corrupted!      Running a fsck yielded too many errors to take into account seriously so I did not let it run. I've tried recreating the array with 'missing' devices and just a two disks, but no combination was successful. I'm not sure if I tried them all, but I did try many. * * * Some details:   * `mdadm` is version 2.3.2, running on OpenSUSE 12.1, kernel 3.1.10, x86_64   * all hard disks have completed `smartctl -t short` without any errors How can I rebuild the RAID array without losing the information _or_ just extract the information and copy it somewhere else? I'm also curious to know if there is anything that I did wrong above when trying to recreate the array.


title: How to define a symbolic link that I can use in all of my directories

text: Is it possible to write a symbolic link such that no matter where am I on the file system, I can use for example `project` to point the directory `home/me/project`? I would like to use commands like `cd project`, `nano project/file1.tex` and so on. Do I have to write a symbolic link to all of my directories?


title: How to reset the password on a Kurobox PRO NAS appliance

text: I've had this old _Kurobox PRO_ demo unit (Precursor to the _Buffalo LinkStation_ series of NAS appliances) kicking around for quite some time now, I decided to fire it up and see if I could install NetBSD and use it as a low power (23 watts!) server, the problem is that a long time ago I had changed the default password from `kuroadmin` to something else, and I couldn't remember it. Along with an auto-sensing gigabit ethernet port, a couple USB ports, and fan exhaust, there's this little red rubber button labelled _reset_ , so with the box on, I pushed and held the reset button and it beeped five times. I've tried rebooting while holding the reset button, same thing it beeps five times, the password is still not reset. After opening the box, zipping out a baker's dozen screws (and voiding my warranty, ha ha), I find a surface-mount CMOS battery, i.e., non-removable. I'm not about to start desoldering connections. This means I must follow a procedure of some kind. I've looked around and discovered that this Kurobox seems to be an obscure piece of hardware, and poorly documented (in english anyway). Does anyone know the procedure for this? Some Defaults:               Default username: root     Default password: kuroadmin      Default IP: 192.168.11.150      Accessing the Kurobox PRO:               bash-4.2$ sudo /sbin/route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface loopback             *               255.0.0.0       U     0      0        0 lo     169.254.0.0     *               255.255.0.0     U     202    0        0 eth0     169.254.83.147  localhost       255.255.255.255 UGH   202    0        0 lo     bash-4.2$ sudo /sbin/route add -host 192.168.11.150 eth0     bash-4.2$ sudo /sbin/route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     loopback        *               255.0.0.0       U     0      0        0 lo     169.254.0.0     *               255.255.0.0     U     202    0        0 eth0     169.254.83.147  localhost       255.255.255.255 UGH   202    0        0 lo     kurobox.example *               255.255.255.255 UH    0      0        0 eth0     bash-4.2$ cat /etc/hosts     #     # hosts     This file describes a number of hostname-to-address     #       mappings for the TCP/IP subsystem.  It is mostly     #       used at boot time, when no name servers are running.     #       On small systems, this file can be used instead of a     #       "named" name server.  Just add the names, addresses     #       and any aliases to this file...     #     # By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1     # should NEVER be named with the name of the machine.  It causes problems     # for some (stupid) programs, irc and reputedly talk. :^)     #          # For loopbacking.     127.0.0.1   localhost     # This next entry is technically wrong, but good enough to get TCP/IP apps     # to quit complaining that they can't verify the hostname on a loopback-only     # Linux box.     127.0.0.1   darkstar.example.net darkstar          # End of hosts.     192.168.11.150 kurobox.example.net kurobox     bash-4.2$ telnet kurobox     Trying 192.168.11.150...     Connected to kurobox.     Escape character is '^]'.          KUROUTOSHIKOU KUROBOX Series KUROBOX/PRO(KOSHO)     DEMO-2 login: root     Password:      Login incorrect      Boot packet:               20:31:00.019086 IP (tos 0x0, ttl 64, id 3137, offset 0, flags [none], proto UDP (17), length 576)     0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 00:16:01:a4:ed:84 (oui Unknown), length 548, xid 0xe03e940, secs 10, Flags [none] (0x0000)       Client-Ethernet-Address 00:16:01:a4:ed:84 (oui Unknown)       Vendor-rfc1048 Extensions         Magic Cookie 0x63825363         DHCP-Message Option 53, length 1: Request         MSZ Option 57, length 2: 548         Requested-IP Option 50, length 4: 192.168.1.108         Lease-Time Option 51, length 4: 4294967295         Parameter-Request Option 55, length 14:            Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname           Domain-Name, RP, TTL, BR           MD, Router-Discovery, Static-Route, YD           YS, NTP         Hostname Option 12, length 7: "DEMO-2^@"         Vendor-Class Option 60, length 29: "Linux 2.6.12.6-arm1 armv5tejl"         Client-ID Option 61, length 7: ether 00:16:01:a4:ed:84         END Option 255, length 0         PAD Option 0, length 0, occurs 223


title: Errors in Syslog

text: Im getting this error on one of the server               May 21 16:45:42 ERPSSO gconfd (root-24528): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 21 16:45:42 ERPSSO gconfd (root-24528): Failed to sync one or more sources: Failed to write some configuration data to disk      May 21 17:45:42 ERPSSO gconfd (root-24528): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 21 17:45:42 ERPSSO gconfd (root-24528): Failed to sync one or more sources: Failed to write some configuration data to disk      May 21 19:45:42 ERPSSO gconfd (root-24528): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 21 19:45:42 ERPSSO gconfd (root-24528): Failed to sync one or more sources: Failed to write some configuration data to disk      May 21 20:45:43 ERPSSO gconfd (root-24528): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 21 20:45:43 ERPSSO gconfd (root-24528): Failed to sync one or more sources: Failed to write some configuration data to disk      May 21 22:45:42 ERPSSO gconfd (root-24528): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 21 22:45:42 ERPSSO gconfd (root-24528): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 00:45:43 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 00:45:43 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 02:45:42 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 02:45:42 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 04:45:43 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 04:45:43 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 05:45:42 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 05:45:42 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 06:45:42 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 06:45:42 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 07:45:43 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 07:45:43 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 09:45:43 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 09:45:43 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 10:45:43 ERPSSO gconfd (root-23938): Failed to write "/root/.gconf/apps/puplet/%gconf.xml": Failed to move temporary file "/root/.gconf/apps/puplet/%gconf.xml.new" to final location "/root/.gconf/apps/puplet/%gconf.xml": No such file or directory      May 22 10:45:43 ERPSSO gconfd (root-23938): Failed to sync one or more sources: Failed to write some configuration data to disk      May 22 11:37:05 ERPSSO gconfd (root-7876): starting (version 2.14.0), pid 7876 user 'root'     May 22 11:37:05 ERPSSO gconfd (root-7876): Resolved address "xml:readonly:/etc/gconf/gconf.xml.mandatory" to a read-only configuration source at position 0     May 22 11:37:05 ERPSSO gconfd (root-7876): Resolved address "xml:readwrite:/root/.gconf" to a writable configuration source at position 1     May 22 11:37:05 ERPSSO gconfd (root-7876): Resolved address "xml:readonly:/etc/gconf/gconf.xml.defaults" to a read-only configuration source at position 2      There is enough space on root /boot/and other partitions


title: how to sort access log efficiently in blocks

text: Access logs are more or less sorted by time, but to aggregate connections by time (`uniq -c`), you need to sort them a bit more. For a huge access log sort is very inefficient, because it buffers and sorts the whole file before printing out anything. Do you know any option for sort or version of sort, that could sort only given ammount of lines at once, the print that block? I have searched for the following keywords: "streaming sort", "block sort", "approximate sort". I have read the whole manual through, without use. Setting the buffer size (-S) did not influenced this.


title: how to solve ports dependencies conflict

text: What is the best approach to avoid conflict among the dependencies from two or more unrelated ports? I'm facing the following problem. A script that I'm using has the follow approach to try to install all dependencies of a port: assuming $PORTA is pointing for a specific port (/usr/ports/lang/php5 for example)               # Complete dependency chain first     BUILDLIST=`cd $PORTA && make build-depends-list 2>/dev/null`     for BUILD in $BUILDLIST; do         # Check to see if item is already built     local _PKGNAME=`make -C $PORTA -V PKGNAME`     if [ `grep -c "$_PKGNAME" /tmp/pfPort_alreadybuilt` -gt 0 ]; then        echo "    Dependency $BUILD of $PORTA already built on this run.  Skipping."     else        echo "    Building dependency $BUILD of $PORTA"        clean_build_install_clean $BUILD     fi     done      after it tried to install the whole dependencies, then it wll try to install the port. Is it any better than go through your ports and do a `make depends install clean`? With the approach listed, I'm having lot of trouble with minor versions conflicts like perl 5.12.4 is needed, but perl.14.2 is installed and I have the feeling that make depends make handle it better.


title: Is grandchild process also child process?

text: In Unix/Linux terminology, do child processes of a process include grandchild processes of the process?


title: How to remove a locally installed library?

text: I had just compiled and installed `libc` locally into my home directory. Sadly, after this, virtually every basic utility like `ls` and `xz` failed to function. The error message prompted up when executing `ls`:   `ls: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument` After doing some research on Google, it appeared to me that I have to recompile and relink these basic tools to solve the problem, which seems a bit too tricky. Therefore, I decided to simply removed the `libc` library just installed. **How do I remove the locally install version of`libc` from `~/lib` and `~/include`?** I had already installed numerous libraries into `~/lib` before installing `libc`, which added another tons of files. As a result, it's all mixed up now. **Edit:**   I think I could probably solve this by conditionally removing the files based on the last modified time. Is there any cleaner solution?


title: OpenLDAP replication between client and server of different versions

text: I want to upgrade an OpenLDAP infrastructure : one master server + many slaves.   * What should I upgrade first (in which order)?   * How can I know what version of an OpenLDAP slave is compatible with what version of the master server for replication?


title: vi: move a line by 4 bytes

text: I want to move a line by 4 bytes using vi editor. What command should I use? I tried ">>" and it does move but it moves by 8 bytes..


title: Suspending the global KDE&X-Windows keyboard shortcuts while specific application is running

text: I'm running KDE on Arch-Linux 64b. I've been a Vim user for two years now, and I want to try learning Emacs - just so I can have a justification when I diss Emacs users. So far, my main problem with Emacs is that it many of it's shortcuts use ctrl+alt and ctrl+shift - so they collide with my global shortcuts. I have no desire to change my global shortcuts(to what? Emacs leaves no key combination unbound...), but I can afford to disable them while the Emacs window has the focus. So - can it be done? Can I disable the global shortcuts only when a specific application is running?