title: Which media to use for backing up data of my laptop?

text: I work at home on my laptop installed with Windows 7 & Ubuntu 13.04. I have stopped working on Windows since much time & would continue to work on Linux only. I have all my important data in the laptop. I haven't yet used any external media for backup but now I feel the need for the same. Now, what media should I use? I have the below considerations:   1. I have my own data like webpages, text docs, videos, audios etc.   2. I have videos & photos of my child which will obviously go on increasing with time. I was thinking to save these in DVDs but since a few months the DVDs I had been purchasing aren't getting burned. I yesterday got Verbatim DVDs from eBay.in but they also didn't work. Also how much trustworthy are DVDs !! I burned gparted on a Amkette DVD 4 months back & now it isn't working properly. I think DVDs aren't good options as the number of DVDs will go on increasing to keep backup of my baby's videos & much care needs to be taken to keep it safely. In contrast external hdd is more safe & in 1 hdd only I can keep all these data along with my own. Also external hdd is more reliable than DVDs. HDDs will last for many many years but not DVDs.   3. DVDs are getting extinct; future devices may not have DVD drivers. So DVDs don't seem to be a good choice.   4. I think external HDDs can be used with any laptop or computer like flash drive (no external power required). It can be used irrespective of the OS whether Windows or Linux. I should be able to format it, create partitions of any filesystem type... In a nutshell, I can treat it in the same way as internal HDD & flash drive; i.e. external HDDs are only an extension of my laptops internal memory space. I'm looking for this 'general' external device & not one that works with any specific s/w or h/w. Please throw some light on these. I feel external HDDs are the best choice of backup media.


title: How to stream audio from /dev/dsp?

text: What is the best way to stream audio from `/dev/dsp` (I'm using OSS on Debian). I would prefer HTTP streaming, but if there is a way on another protocol, I can deal with that.


title: What Linux kernel features does os-prober require to find a Windows 8 installation?

text: I built a new custom Linux kernel using `make localmodconfig` and after booting the new kernel, `update-grub` doesn't detect my Windows 8 installation. My distro kernel (with tons of modules I don't need) found the Windows 8 installation and added it to the grub2 menu without any problems, so I must be missing some kernel features/modules. What kernel features are required for the Windows 8 boot loader to be detected & added to the grub boot menu?


title: Unable to preserve ownership in a copy but able with a move?

text: I have noticed that I am unable to preserve ownership if I `rsync -o` files. However, I am when I move them. This is all without admin privileges. What is the rationale of this? Several threads e.g. (1) seem to echo the need for admin privileges


title: Ignore all matches to negated extglob pattern in recursive ls

text: I would like to recursively list all files in a directory which match a given input pattern **using ls**. (Oh, and this is in Bash). The only way I can think of to do this using ls is to `shopt -s extglob` and then use the `ls --ignore=pattern` option with the extended glob negate pattern `!( pattern-list )`. Seems kind of roundabout to negate in an ignore but otherwise wildcards don't recurse. Assuming I already have the directory to look in as `dir` and the pattern to match against as `file`, this is my current attempt: `ls -AR --ignore='!('"${file}"')' ${dir}` However, this does not seem to have the desired effect, for example in a test case where the directory structure gives this output for `ls -AR`:                   .:         a  a.c  b  b.c  c  c.h  s              ./s:         a  a.c  b  b.c  c  c.h      My command with `file = *.c` and `dir = s` (full command: `ls -AR --ignore=!(*.c) s`) gives this output:                   ./s:         a  a.c  b  b.c  c  c.h      I know I could pipe it into grep quite easily, and do something like `ls -AR s | grep -v '.*.c'` and get output like:                   s:         a         b         c         c.h      but I am looking for a way to do this just through `ls`. Sorry if I was unclear at all, this is my first time on a StackExchange site. Thanks in advance!


title: Editors Nano/VIM not using resources

text: Does anyone here know the resources it takes for editors to search and replace in a large file? The reason I am asking, is I have a 32 core server that `HTOP` is only showing **one** core at 100% when search/replace on a 3GB file with an editor. I am wondering if my editor search/replace is a single threaded, and if so is there a way to delegate more resources so that these tasks don't take so long? I have to say, it is frustrating to see 31 idle cores and 1 at 100% when a task is taking 25 to 30 minutes. Oh and if it makes a difference, the RAM is 32GB sitting at 19GB used including cache.


title: How to get past grub rescue?

text: So this weekend when my Windows install crashed I decided to create a partition for Ubuntu for my application development instead of running Ubuntu on a VM. But I didn't install Ubuntu with the right file system I wanted, so I formatted that partition while I was in my install of Windows. Now I am getting this when I am trying to boot into Windows.               error: unknown filesystem     grub rescue >      What do I need to do to get past this so I can boot into Windows? And where would Ubuntu install the extra files for something to run like this? I know basic Unix/Linux commands, but not enough to figure out how to get past this.


title: sftp script to get a file from remote machine

text: I use a script, which contains the line:               sftp    $FTP_USER@phcsftp.pearsoned.com:/dir/file.txt      When I run the script, it asks for my password:               user@phcsftp.pearsoned.com's password:      However, I don't want to be prompted to type my password. I want my script automate the password entry and download the files Guys, I don't want to do it. All I want to catch that prompt inside the script and put password. Is it possible? sshpass belong to bash? this is not working at all


title: Fail to log in HPC nodes (Permission denied)

text: We have four login nodes in our HPC system, namely al1, al2, c1 and c2. I could log in all the four nodes previously. But recently I suddenly cannot log in al1 and al2 while I still can log in c1 and c2. I didn't change any settings on my Mac and desktop PC (I tried on these two computers and encountered the same situation). The interactive login process was as follows: > username@login.node's password: > > Permission denied, please try again. > > username@login.node's password: > > Permission denied, please try again. > > username@login.node's password: > > Permission denied (publickey,gssapi-with-mic,password). It seems to me that someone changed something on al1 and al2 that led to my failure to pass the verification. I have reported to the HPC administrators but received no reply yet. The error message complained about permission (permission denied). What could be the reason for my failure to log in al1 and al2 nodes? What can be done to help me get the access permission? Any ideas? Thanks!


title: Killed `rm` and `cp` on nfs share

text: I am just testing an `rsnapshot` installation on my laptop which should backup to a NAS mounted via `nfs` on my laptop. On one test `rsnapshot` died with a `cp -al` problem (i.e. a problem with hard links) when moving `daily.0` to `daily.1`, I think the problem was when it tried to copy the `../etc/alternatives/` part... During debugging I tried to remove the directory `daily.0` on the `nfs` manually on command line, however `rm` exited with the message `killed`. A similar problem occured with `cp` a few days ago though I cannot reproduce it (`cp` between two `nfs` subdirectories exited also with the message `killed`). So is there any way to get more informative error messages from `rm` and `cp` to find out what's the actual problem is? **Edit** After reading kyle-jones anwer I watched my RAM usage during several operations and confirmed that when I do something on my `nfs` mount on large directories, my memory fills up very fast up to 4GB (that's my physical memory on my laptop) and then the process is killed. This happend for: `cp`, `rm`, `du` and even for `ls`. As mount options for my `nfs` mount I used: `-o rw,hard,intr,tcp,actimeo=3` (and specified `nfs` via `-t nfs`).


title: Is there a difference between ./script and bash script?

text: Given a shell script file that begins as               #!/bin/bash          # (bash script here),      and has been `chmod +x`ed, is there any difference in running `./script` and `bash script` from the command-line?


title: Tab auto completion doesn't work with apt-get install (kubuntu)

text: I've noticed a strange behavior of my shell on Kubuntu. Auto completion doesn't work well when I try to install new software. It works only for default commands (when I type "apt-get inst" and I press tab, "install" is autocompleted) but doesn't work when I type a portion of name of software I want to install. I've tried to uncomment `/etc/bash.bashrc` lines for auto completion, but nothing changed. What's wrong?


title: DEC ANSI command sequence questions; cursor movement

text: So I'm writing a terminal emulation (I know, I should just compile putty, etc.) and am at the stage of plodding through vttest to make sure it's right. I'm basing it on the VT102 for now but will add later terminal features such as color when the basics are working right. The command set is mostly ANSI. DEC had their own command set but supported the ANSI commands from about 1973. Those ANSI standards are apparently not available now but the ECMA equivalents are, I have them (ECMA-48 seems most relevant) but does not answer this question as far as I can see. Most ANSI command sequences start with ESC. Many commands start with the command sequence identifier shown here as CSI and represented in the data as 0x1c 0x5b (ESC `[`), or 0xdb if 8-bit communication was possible. Then followed a sequence identifying the command. Some commands affect cursor position, some the screen, some provoke a response to the host and so on. Some terminal commands include a numeric argument. Example `CSI 10 ; 5 H` means make the cursor position row 10, column 5. When the numeric argument is missing there is a default value to use: `CSI 10 ; H` means make the cursor position row 10, column 1 because 1 is the default value when an argument is not given. I have the vt102 manual from vt100.net (great resource) and about a dozen pages giving partial information on these command sequences. Apparently the complete gospel DEC terminal spec never made it out of DEC. What is clear is that `CSI C` is move cursor right and that the default value is 1. What isn't clear is what is the meaning of `CSI 0 C`. Why have a zero there, it would seem to make the command do nothing? If it means "use default value" then it could have been sent as 1 instead, but the shorter string would have no argument and rely on the default value being interpreted as 1 anyway. These actual physical VT terminals were often used at 300 baud and below so the one character did matter! I'm not so advanced with vttest that I can just try it both ways and see which makes everything perfect but I'm far enough that little questions like this are starting to matter.


title: How to prevent cron emailing on termination

text: Whenever one of my cron scripts finishes, I get an email saying `/bin/bash: line 1: 19653 Terminated <command>`. How do I prevent this email being sent? I suspect it might only happen when the script is interrupted by a signal rather than finishing normally, but I haven't been able to confirm this. Either way, I don't need to be receiving those emails, although I do still want to receive emails from other scripts, or if this one produces any output. So, how do I make cron send an email only if the script produces output, rather than whenever a script finishes?


title: change column with awk scriting

text: I am trying to make a script B that uses another script A to change a specific column in a specific line. The problem is that when I run the script A alone it runs perfectly but when I try to use the script B (allowing me to run script A in other directories) it changes the entire line and not the specific column. What is the problem? script A (`0.MOF.run`):               #!bin/sh     echo $pot     mkdir u$pot       cp u6000/towhee_input u$pot      cd u$pot     mv towhee_input 1     awk < 1 -v k="-$pot.0" 'NR==12 {$2=k}{print}' > towhee_input        cd ..      script B:               #!bin/sh     echo -n "Please Incert the Number of Potencials: "     read c     declare -i b     b=$c+1     rm pot_pid     a=1          while [ $a -lt $b ]     do        pot=$(awk < data -v k="$a" 'NR==k ')             . 0.MOF.mkdir        . 1.MOF.run             a=`expr $a + 1`        done


title: A VNC server is already running - howcome?

text: [root@localhost ~]# service vncserver restart     Shutting down VNC server: 11:SXYZ 12:DXYZ 13:FXYZ  [FAILED]     Starting VNC server: 11:SXYZ A VNC server is already running as :11                                                            [FAILED]     [root@localhost ~]# vncserver -list          TigerVNC server sessions:          X DISPLAY #     PROCESS ID     [root@localhost ~]# vncserver :11     A VNC server is already running as :11     [root@localhost ~]# vncserver -kill :11          Can't find file /root/.vnc/localhost.localdomain:11.pid     You'll have to kill the Xvnc process manually      I have Centos 6.4, I'm accessing it through its xrdp (Version 0.5.0) and Xvnc TigerVNC 1.1.0 services. I can connect without any problem with user SXYZ, only that I don't understand why is this, and it isn't nice looking... The :11 is not used that is for sure, as I just modified vncserver file to go for displays 11,12,13 instead of 1,2,3. Any ideas?


title: Sed: Replace N first occurrences of a character

text: I am looking to replace the 5 first occurences of the whitespace character per line inside a sed script. Here's what I have so far `sed -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" myfile` Is there any nicer way of doing it? For the record, I am using the Solaris sed. I don't know if it makes any difference.


title: Interrupt sequence CTRL+C does not work for user

text: In any terminal operating under GNOME, if I press `Ctrl`+`C`, I only see a question mark. Same goes for `Ctrl`+`Z`. The output of `stty -a | grep intr` is:               intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;      I can use the sequence under all other tty's (outside X), and can also use it for another user; only one user is affected. How can I fix this?


title: Errors at startup on my Wheezy system

text: I noticed that I got some error when my Debian Wheezy was starting today, but then I couldn't find anywhere to look into it in more detail. There was nothing interesting in `dmesg` or `syslog`. Where can I find these messages?


title: Reverse yrange without shifting histogram in the downward direction

text: i want to draw the given image in gnuplot. ![real graph](http://i.stack.imgur.com/LSqGr.png) I tried it in gnuplot, but i am stucked with reversing of y axis (below the graph which i currently obtained). ![currently obtained image](http://i.stack.imgur.com/4OAvb.png) i want to represent yrange from 2300 to 0. But the histogram should plot from x axis in the upward direction as show in the first graph. also need to give labels on each histogram as in the first graph. please tell gnuplot script for doing this...... Thanks in advance.....


title: mkfifo - Does disk I/O actually occur?

text: I have 2 applications:   * Producer (N instances)   * Consumer (1 instance) I currently write out **_intermediate_** results from the producers, and then the consumer reads these files from disk and produces a **_final_** result. I would like to minimize this I/O by "streaming" the outputs from the producers directly to the consumer. I came across named pipes (mkfifo) and a subsequent example here. This looks great, but what I can't determine is how this is actually implemented? Is the FIFO queue just being buffered through a file? If so, that probably wouldn't help me. I would like for the contents to stream "through memory" entirely without utilizing the disk. Maybe this isn't possible across processes?


title: Hex codes for input key combinations

text: In `iTerm2` one can setup keyboard shortcuts so that for a given input sequence, iTerm2 sends a specific hex code to the terminal. **What** exactly are these **hex codes**? And how can I identify a hex code for a given input key sequence? In my case I am specifically interested in looking up the `hex code` associated with `Control + Alt + <char>` with char being `u`,`i`,`j`,`k` and `l`. I found this article that shows some examples of these conversions, but it doesn't list any `Control + Alt + <char>` combinations. The hope is that ultimately this will help me solve this other question in AskDifferent.


title: the n key does't work anymore but N does

text: I've been playig around xmodmap to create a custom keyboard (see Get the keycode of a key, from a custom made keyboard) But now, I can't use the n key anymore, but the Shift+n still work. I think I messed up something, so I reseted to defaults my keyboard (in the Ubuntu system settings), everything seems to work ok, execpt that damn `n` key! Do you have any idea??


title: How can I schedule a python program to run from another python program?

text: I'm running a Python program on my Linux server, and depending on some external data it has to run again at `xx` minutes or hours from now. So let's say it runs at 6 AM, and then it has to run again at 7 AM. Then, at 7AM, it checks some things and it has to run again at 15:45, and then the next day at 2.05AM, and then the next day at 4.05AM etc. As you can see there is no predefined logic in the times it has to run, it has to be defined at the time it runs. The only task schedule mechanism I know is `crontab`, bu I'm not sure how to add tasks to it without running `crontab -e` and besides that `crontab` seems more for recurring tasks and in my case I would add a `crontab` job and after running it once remove it again and add a new one. The only thing I could come up with was to set the next rundate in a textfile, and let a `crontab` job check it every minute to see if it is time to run the program.


title: C Preprocessor (cpp) and cc1 issue

text: I've been trying to fix a problem related with cross (kernel) compilation which as given the following message: `gcc: error trying to exec 'cc1': execvp: No such file or directory` I found that this was an issue as discussed here. Also, when defining `GCC_EXEC_PREFIX` variable with `/usr/lib/gcc/i486-linux- gnu/4.7/` I noticed that `whereis cc1` only shows `cc1:`. Could this be the problem since cc1 has not a path associated to it? Also, how can I define the path to cc1? **PS:** Sorry for the (almost) duplicated post. But I just think that this might really be the issue.


title: Bash-completion and grep

text: I installed a program (`iftop`) on Debian Squeeze but some days ago I forgot it's name. I had only this information about the program: 1) It was called `*top` 2) I could find it using `bash-completions`. I wanted to `grep` all the options of `bash-completion`. Do you have any idea on how can I do it?


title: How do I debug Alsa configuration file errors?

text: I've got an embedded device with ALSA support, and I'm trying to figure out how to get dsnoop working. The reason is that I want two applications to share the microphone input. But the problem is that ALSA seems to ignore `/etc/asound.conf` entirely. E.g. `arecord --list-pcms` does not list the pcm's defined there. How can I check the results of `/etc/asound.conf` parsing? There is a mysterious line in `/usr/share/alsa/alsa.conf`, "errors false". Does this do anything?


title: Do LVM snapshots ultimately cause fragmentation?

text: I'm planning on using LVM in order to be able to take atomic snapshots of large files and rsync them to a remote site. What I'd like to know is whether there is any long-term impact on the main (non-snapshot) volume: if I typically keep the snapshots for 24h before dropping and creating a new snapshot, does the main volume get progressively more fragmented?


title: Running scp when .bashrc of remote machine includes source command

text: I cannot copy a file over scp when the remote machine .bashrc file includes **source** command to update paths and some variables. Why does it happen?


title: Where is using @ before a date string for seconds since the epoch documented?

text: GNU `date` and `touch` commands (and presumably others) use `@date` to define a date string as seconds since the epoch. For example:               $ TZ=UTC date -d@10     Thu Jan  1 00:00:10 UTC 1970      I was answering a question and wanted to point the OP to where this particular feature was documented but I can't find it. Neither `man date` not `man touch` explain it. The closest is this from the "Examples" section of the `date` man page:                  Convert seconds since the epoch (1970-01-01 UTC) to a date                    $ date --date='@2147483647'      The `info` page for `date` states that this was introduced in `coreutils` 5.3.0, but does not really explain it further either:                Or if you do not mind depending on the `@' feature present since      coreutils 5.3.0, you could shorten this to:                date -d @946684800 +"%F %T %z"           1999-12-31 19:00:00 -0500      So, where is `@seconds` documented? Where am I supposed to learn about it and where can I point someone who does not? Is that off-hand mention in `man date` really the best we have?


title: CLFS: Building GCC cross compiler

text: Currently I try to build a embedded Linux from scratch with the instructions from Cross Linux from Scratch. Everything worked fine until I tried to compile the GCC Cross-Compiler. I want to build the Linux for the Beagleboard-xM... So I choosed the following settings:               export CLFS_ABI="aapcs-linux"     export CLFS_HOST="x86_64-cross-linux-gnu"     export CLFS_TARGET="armv7a-unknown-linux-uclibceabi"     export CLFS_ARCH="arm"     export CLFS_ENDIAN="little"     export CLFS_ARM_ARCH="armv7"     export CLFS_ARM_MODE="arm"     export CLFS_FLOAT="hard"     export CLFS_FPU="neon"      No as soon as I try to run the instructions on this page the command `make all-gcc all-target-libgcc` runs into an error.               checking for armv7a-unknown-linux-uclibceabi-gcc...  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include        checking for suffix of object files... configure: error: in `/mnt/clfs/sources/gcc-build/armv7a-unknown-linux-uclibceabi/libgcc':     configure: error: cannot compute suffix of object files: cannot compile     See `config.log' for more details.     make: *** [configure-target-libgcc] Error 1      and the `/mnt/clfs/sources/gcc-build/armv7a-unknown-linux- uclibceabi/libgcc/config.log` looks like this:               This file contains any messages produced by compilers while     running configure, to aid debugging if configure makes a mistake.          It was created by GNU C Runtime Library configure 1.0, which was     generated by GNU Autoconf 2.64.  Invocation command line was            $ /mnt/clfs/sources/gcc-4.6.0/libgcc/configure --cache-file=./config.cache --with-cross-host=x86_64-cross-linux-gnu --prefix=/mnt/clfs/cross-tools --with-sysroot=/mnt/clfs --disable-nls --disable-shared --without-headers --with-newlib --disable-decimal-float --disable-libgomp --disable-libmudflap --disable-libssp --disable-threads --disable-multilib --with-abi=aapcs-linux --with-arch=armv7 --with-mode=arm --with-float=hard --with-fpu=neon --enable-languages=c,lto --program-transform-name=s&^&armv7a-unknown-linux-uclibceabi-& --disable-option-checking --with-target-subdir=armv7a-unknown-linux-uclibceabi --build=x86_64-cross-linux-gnu --host=armv7a-unknown-linux-uclibceabi --target=armv7a-unknown-linux-uclibceabi --srcdir=../../../gcc-4.6.0/libgcc          ## --------- ##     ## Platform. ##     ## --------- ##          hostname = virtualUbuntu     uname -m = x86_64     uname -r = 3.2.0-31-generic     uname -s = Linux     uname -v = #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012          /usr/bin/uname -p = unknown     /bin/uname -X     = unknown          /bin/arch              = unknown     /usr/bin/arch -k       = unknown     /usr/convex/getsysinfo = unknown     /usr/bin/hostinfo      = unknown     /bin/machine           = unknown     /usr/bin/oslevel       = unknown     /bin/universe          = unknown          PATH: /mnt/clfs/cross-tools/bin     PATH: /bin     PATH: /usr/bin               ## ----------- ##     ## Core tests. ##     ## ----------- ##          configure:1742: creating cache ./config.cache     configure:1903: checking for --enable-version-specific-runtime-libs     configure:1916: result: no     configure:1964: checking for a BSD-compatible install     configure:2032: result: /usr/bin/install -c     configure:2048: checking for gawk     configure:2075: result: gawk     configure:2095: checking build system type     configure:2109: result: x86_64-cross-linux-gnu     configure:2129: checking host system type     configure:2142: result: armv7a-unknown-linux-uclibceabi     configure:2245: checking for armv7a-unknown-linux-uclibceabi-ar     configure:2272: result: /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ar     configure:2337: checking for armv7a-unknown-linux-uclibceabi-lipo     configure:2364: result: armv7a-unknown-linux-uclibceabi-lipo     configure:2429: checking for armv7a-unknown-linux-uclibceabi-nm     configure:2456: result: /mnt/clfs/sources/gcc-build/./gcc/nm     configure:2521: checking for armv7a-unknown-linux-uclibceabi-ranlib     configure:2548: result: /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ranlib     configure:2613: checking for armv7a-unknown-linux-uclibceabi-strip     configure:2640: result: /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/strip     configure:2702: checking whether ln -s works     configure:2706: result: yes     configure:2723: checking for armv7a-unknown-linux-uclibceabi-gcc     configure:2750: result:  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include        configure:3019: checking for C compiler version     configure:3028:  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include    --version >&5     xgcc (GCC) 4.6.0     Copyright (C) 2011 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          configure:3039: $? = 0     configure:3028:  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include    -v >&5     Reading specs from /mnt/clfs/sources/gcc-build/./gcc/specs     COLLECT_GCC=/mnt/clfs/sources/gcc-build/./gcc/xgcc     COLLECT_LTO_WRAPPER=/mnt/clfs/sources/gcc-build/./gcc/lto-wrapper     Target: armv7a-unknown-linux-uclibceabi     Configured with: ../gcc-4.6.0/configure --prefix=/mnt/clfs/cross-tools --build=x86_64-cross-linux-gnu --host=x86_64-cross-linux-gnu --target=armv7a-unknown-linux-uclibceabi --with-sysroot=/mnt/clfs --disable-nls --disable-shared --with-mpfr=/mnt/clfs/cross-tools --with-gmp=/mnt/clfs/cross-tools --with-mpc=/mnt/clfs/cross-tools --without-headers --with-newlib --disable-decimal-float --disable-libgomp --disable-libmudflap --disable-libssp --disable-threads --enable-languages=c --disable-multilib --with-abi=aapcs-linux --with-arch=armv7 --with-mode=arm --with-float=hard --with-fpu=neon     Thread model: single     gcc version 4.6.0 (GCC)      configure:3039: $? = 0     configure:3028:  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include    -V >&5     xgcc: error: unrecognized option '-V'     xgcc: fatal error: no input files     compilation terminated.     configure:3039: $? = 1     configure:3028:  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include    -qversion >&5     xgcc: error: unrecognized option '-qversion'     xgcc: fatal error: no input files     compilation terminated.     configure:3039: $? = 1     configure:3055:  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include    -o conftest -g -O2   conftest.c  >&5     conftest.c:1:0: error: target CPU does not support ARM mode     configure:3058: $? = 1     configure:3246: checking for suffix of object files     configure:3268:  /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include    -c -g -O2  conftest.c >&5     conftest.c:1:0: error: target CPU does not support ARM mode     configure:3272: $? = 1     configure: failed program was:     | /* confdefs.h */     | #define PACKAGE_NAME "GNU C Runtime Library"     | #define PACKAGE_TARNAME "libgcc"     | #define PACKAGE_VERSION "1.0"     | #define PACKAGE_STRING "GNU C Runtime Library 1.0"     | #define PACKAGE_BUGREPORT ""     | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"     | /* end confdefs.h.  */     |      | int     | main ()     | {     |      |   ;     |   return 0;     | }     configure:3286: error: in `/mnt/clfs/sources/gcc-build/armv7a-unknown-linux-uclibceabi/libgcc':     configure:3289: error: cannot compute suffix of object files: cannot compile     See `config.log' for more details.          ## ---------------- ##     ## Cache variables. ##     ## ---------------- ##          ac_cv_build=x86_64-cross-linux-gnu     ac_cv_env_CC_set=set     ac_cv_env_CC_value=' /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include   '     ac_cv_env_CFLAGS_set=set     ac_cv_env_CFLAGS_value='-g -O2'     ac_cv_env_CPPFLAGS_set=set     ac_cv_env_CPPFLAGS_value=     ac_cv_env_CPP_set=     ac_cv_env_CPP_value=     ac_cv_env_LDFLAGS_set=set     ac_cv_env_LDFLAGS_value=     ac_cv_env_LIBS_set=     ac_cv_env_LIBS_value=     ac_cv_env_build_alias_set=set     ac_cv_env_build_alias_value=x86_64-cross-linux-gnu     ac_cv_env_host_alias_set=set     ac_cv_env_host_alias_value=armv7a-unknown-linux-uclibceabi     ac_cv_env_target_alias_set=set     ac_cv_env_target_alias_value=armv7a-unknown-linux-uclibceabi     ac_cv_host=armv7a-unknown-linux-uclibceabi     ac_cv_path_install='/usr/bin/install -c'     ac_cv_prog_AR=/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ar     ac_cv_prog_AWK=gawk     ac_cv_prog_CC=' /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include   '     ac_cv_prog_LIPO=armv7a-unknown-linux-uclibceabi-lipo     ac_cv_prog_NM=/mnt/clfs/sources/gcc-build/./gcc/nm     ac_cv_prog_RANLIB=/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ranlib     ac_cv_prog_STRIP=/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/strip          ## ----------------- ##     ## Output variables. ##     ## ----------------- ##          AR='/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ar'     AWK='gawk'     CC=' /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include   '     CFLAGS='-g -O2'     CPP=''     CPPFLAGS=''     DEFS=''     ECHO_C=''     ECHO_N='-n'     ECHO_T=''     EXEEXT=''     INSTALL_DATA='${INSTALL} -m 644'     INSTALL_PROGRAM='${INSTALL}'     INSTALL_SCRIPT='${INSTALL}'     LDFLAGS=''     LIBOBJS=''     LIBS=''     LIPO='armv7a-unknown-linux-uclibceabi-lipo'     LN_S='ln -s'     LTLIBOBJS=''     MAINT='#'     NM='/mnt/clfs/sources/gcc-build/./gcc/nm'     OBJEXT=''     PACKAGE_BUGREPORT=''     PACKAGE_NAME='GNU C Runtime Library'     PACKAGE_STRING='GNU C Runtime Library 1.0'     PACKAGE_TARNAME='libgcc'     PACKAGE_URL='http://www.gnu.org/software/libgcc/'     PACKAGE_VERSION='1.0'     PATH_SEPARATOR=':'     RANLIB='/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ranlib'     SHELL='/bin/bash'     STRIP='/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/strip'     ac_ct_CC=''     asm_hidden_op=''     bindir='${exec_prefix}/bin'     build='x86_64-cross-linux-gnu'     build_alias='x86_64-cross-linux-gnu'     build_cpu='x86_64'     build_libsubdir='build-x86_64-cross-linux-gnu'     build_os='linux-gnu'     build_subdir='build-x86_64-cross-linux-gnu'     build_vendor='cross'     datadir='${datarootdir}'     datarootdir='${prefix}/share'     decimal_float=''     docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'     dvidir='${docdir}'     enable_decimal_float='no'     enable_shared='no'     exec_prefix='NONE'     extra_parts=''     fixed_point=''     host='armv7a-unknown-linux-uclibceabi'     host_alias='armv7a-unknown-linux-uclibceabi'     host_cpu='armv7a'     host_noncanonical='armv7a-unknown-linux-uclibceabi'     host_os='linux-uclibceabi'     host_subdir='.'     host_vendor='unknown'     htmldir='${docdir}'     includedir='${prefix}/include'     infodir='${datarootdir}/info'     libdir='${exec_prefix}/lib'     libexecdir='${exec_prefix}/libexec'     libgcc_topdir='../../../gcc-4.6.0/libgcc/..'     localedir='${datarootdir}/locale'     localstatedir='${prefix}/var'     mandir='${datarootdir}/man'     oldincludedir='/usr/include'     pdfdir='${docdir}'     prefix='/mnt/clfs/cross-tools'     program_transform_name='s&^&armv7a-unknown-linux-uclibceabi-&'     psdir='${docdir}'     sbindir='${exec_prefix}/sbin'     set_have_cc_tls=''     set_use_emutls=''     sharedstatedir='${prefix}/com'     slibdir='$(exec_prefix)/$(host_noncanonical)/lib'     sysconfdir='${prefix}/etc'     target_alias='armv7a-unknown-linux-uclibceabi'     target_noncanonical='armv7a-unknown-linux-uclibceabi'     target_subdir='armv7a-unknown-linux-uclibceabi'     tmake_file=''     toolexecdir='$(exec_prefix)/$(target_noncanonical)'     toolexeclibdir='$(toolexecdir)/lib'     vis_hide=''          ## ----------- ##     ## confdefs.h. ##     ## ----------- ##          /* confdefs.h */     #define PACKAGE_NAME "GNU C Runtime Library"     #define PACKAGE_TARNAME "libgcc"     #define PACKAGE_VERSION "1.0"     #define PACKAGE_STRING "GNU C Runtime Library 1.0"     #define PACKAGE_BUGREPORT ""     #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"          configure: exit 1      What am I missing?


title: Adding badblocks on mounted partition

text: I tried to move some files to my NAS (ShareCenter DNS-320), but something shows up, when using file managers:               Input/Output error      or when using rsync on mounted cifs/smb share               rsync: close failed on "/mnt/nas1/_am-unordered/.long-file-name.mkv.PI2rPM": Input/output error (5)     rsync error: error in file IO (code 11) at receiver.c(856) [receiver=3.1.0]          # mount | grep mnt/nas1          //192.168.x.y/backup on /mnt/nas1 type cifs (rw,relatime,vers=1.0,cache=strict,username=admin,domain=BACKUP,uid=1000,forceuid,gid=0,noforcegid,addr=192.168.x.y,file_mode=0755,dir_mode=0755,nounix,serverino,rsize=61440,wsize=65536,actimeo=1)      I assume that there are bad sectors inside the NAS, I need to run `fsck` to check if there are broken disk inside my RAID-0 NAS. I have installed `fun_plug` using this tutorial, now I could ssh into the NAS successfully. Normally I would use `fsck -yvckfC -E fragcheck /dev/sdX` to check bad sectors on single unmounted disk. The question is, how to run badblocks and insert it to the bad block list on mounted RAID0 partition? since the ssh service are running on mounted partition on the NAS:               # umount /mnt/HD/HD_a2/       umount: /mnt/HD/HD_a2: device is busy.         (In some cases useful info about processes that use          the device is found by lsof(8) or fuser(1))          # lsof /mnt/HD/HD_a2/     COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF      NODE NAME     sh        1963 root    1w   REG    9,1     5191        12 /mnt/HD/HD_a2/ffp.log     sh        1963 root    2w   REG    9,1     5191        12 /mnt/HD/HD_a2/ffp.log     sh        1963 root   10r   REG    9,1     1942 246939802 /mnt/HD/HD_a2/fun_plug     rc        1986 root  txt    REG    9,1   587316 141426950 /mnt/HD/HD_a2/ffp/bin/bash     rc        1986 root  mem    REG    9,1    28892 139854377 /mnt/HD/HD_a2/ffp/lib/ld-uClibc-0.9.33-git.so     rc        1986 root  mem    REG    9,1   260898 139853932 /mnt/HD/HD_a2/ffp/lib/libreadline.so.6.2      **snip**     sshd      5519 root  mem    REG    9,1    60546 139854375 /mnt/HD/HD_a2/ffp/lib/libgcc_s.so.1     sshd      5519 root  mem    REG    9,1   359940 139854378 /mnt/HD/HD_a2/ffp/lib/libuClibc-0.9.33-git.so      Current NAS' RAID configuration are:               # cat /proc/mdstat     Personalities : [linear] [raid0] [raid1]      md1 : active raid0 sda2[0] sdb2[1]           7808789888 blocks 64k chunks          md0 : active raid1 sdb1[1] sda1[0]           524224 blocks [2/2] [UU]          unused devices: <none>


title: How to adjust brightness in Fedora 17 on Sony Vaio

text: I have a Sony E Series laptop with Fedora 17 and Windows 8 in dual boot. The brightness adjusts just fine on my Windows8 but not in Fedora. If I change it with the brightness slider in the power settings nothing happens. The brightness stays maximum even if I adjust the slider to minimum. Blinded by my screen and frustrated by the draining battery I tried everything on the net. I tried things like -   1. Reinstall bash. `yum reinstall bash`   2. Add this to kernel parameters in grub2.cfg - `acpi_backlight=vendor`   3. Add this line to xorg.conf - `Option "RegistryDwords" "EnableBrightnessControl=1"`   4. Add this line to grub.cfg - `"video.brightness_switch_enabled=1"`   5. Update the drivers for your video card.   6. Install some utility. Example - `xbacklight utility` from freedesktop.org None of these suggestions worked for me. I finally found the solution that worked and am sharing it in Q/A format for the benefit of others.


title: How to rename files using sed?

text: This is an sed expression that was created by a contributor here. More specifically by @craig-sanders. $FileToMove is set to "2012-09-01 Home insurance quote_zz20.pdf"               # use sed to extract folder number from filename.     FolderNo=$(echo "$FileToMove" | sed -r -e 's/.*zz([0-9]+)\.pdf/\1/')     # On my Mac, I figured that this command needs to be FolderNo=$(echo "$FileToMove" | sed -E -e 's/.*zz([0-9]+)\.pdf/\1/')      The above command is used to extract "20" from the name of the file. Now I want to replace zz20 with null. Been trying to do it. Will learn sed and before that need to learn regular expressions. In the meantime, I am sure it is super easy to replace it with null. Any tips?


title: Fluxbox time is wrong?

text: I'm using fluxbox on Arch, and the time is displayed incorrectly in the panel. The time works in XFCE, so I'm not sure why it isn't working in fluxbox. Is there a way to set the time in fluxbox from the internet?


title: Unable to connect to serial device; no /dev/ttySx

text: I wrote a Java application that connects to the serial port of the GSM modem. On Windows the serial ports have names like COM3, but in Linux Redhat 6.0 I had to switch to something like ttySx (X is number that came after S in `/dev/` directory). When I plug my modem in to Linux there are no serial entries in `/dev` (just ttyUSBx), but on Windows it works fine. What am I doing wrong?


title: Need to install VirtualBox Guest Additions 4.3.8 in CentOS 6.3

text: My host system is OSX 10.9.2 and I'm running VirtualBox 4.3.8. In a Hadoop class I took recently, we were provided with a VM disk image preloaded with CentOS 6.3 and a lot of Hadoop-related software. This is what I have to work with. As it stands, I don't have bidirectional cut/paste or any of the other goodies that VBOX Guest Additions provide. I recently posted in this forum a question about upgrading/updating (sorry, I don't understand the distinction, although I understand that there _is_ one) from CentOS 6.3 to 6.5. The only reason that I think I succeeded is that CentOS would no longer boot to the desktop. _(It seems possible that it was no longer compatible with the Hadoop software that was on the disk.)_ So apparently that wasn't the solution to my problem. **I know that it is possible get VBGA working for this disk image: someone else in my class had OSX and VirtualBox, and was able to get past the problem I'm about to describe.** Here's what I've done so far:   * DL’ed and installed VBOX 4.3.8 for OSX from https://www.virtualbox.org/wiki/Downloads   * DL’ed http://download.virtualbox.org/virtualbox/4.3.8/Oracle_VM_VirtualBox_Extension_Pack-4.3.8-92456.vbox-extpack   * Doubleclicked the file, the VB Manager said “The extension pack is already installed with the same version, would you like reinstall it?” I reinstalled, just for grins.   * Booted, ran `yum info kernel`, saw that V2.6.32r279.el6 was “installed”, and that V2.6.32r431.5.1.el6 was “available”. I don't know enough about Linux to know if that means CentOS 6.3 and 6.5, or if it's something else entirely.   * Also noted that Guest Additions functionality was not there.   * Used **VirtualBox VM > Devices > Insert Guest Additions CD Image…** to mount the CD (it appeared on the desktop)   * Ran **VBoxLinuxAdditions.run**   * Building the main Guest Additions module … FAILED   * /var/log/vboxadd-install.log: “Unable to find sources of current Linux kernel. Specify KERN_DIR= and run make again.” Off to Google. This post most closely resembled my problem. However, it differs enough (Windows, i686, VBOX 4.3.6) to make me afraid I’ll just wander off into another morass. Could someone provide baby-step guidance from here?


title: Using setkeycodes to map pressed and released to different "keys"

text: I have a keyboard that has a scroll wheel, but it doesn't work on Ubuntu and `xev` command doesn't show anything when moving it. But with the `dmesg` command I found this: When moving the scroll wheel up:               atkbd serio0: Unknown key pressed (translated set 2, code 0x8b on isa0060/serio0).     atkbd serio0: Use 'setkeycodes e00b <keycode>' to make it known.      When moving the scroll wheel down:               atkbd serio0: Unknown key released (translated set 2, code 0x8b on isa0060/serio0).     atkbd serio0: Use 'setkeycodes e00b <keycode>' to make it known.      It seems to be the same key but the pressed/released change if moving it up/down. `xmodmap -pke | grep croll` shows:               keycode  78 = Scroll_Lock NoSymbol Scroll_Lock     keycode 185 = XF86ScrollUp NoSymbol XF86ScrollUp     keycode 186 = XF86ScrollDown NoSymbol XF86ScrollDown      **How do I configure it so when "pressed" is keycode 185 and when "released" is keycode 186?**


title: ssh-add on an intermediate ssh hop node

text: I am on machine A, hopping onto machine B to finally reach machine C.               A --ssh--> B --ssh--> C      When I ssh-add my private key on A, all works fine and I can hop onto B as many times as I want without supplying any passwords. When I ssh-add _on **B**_ , I get this error message:               Could not open a connection to your authentication agent.      The objective is to ssh-add on B too and from there to reach many different C's... I know how to set up "pass-through" using .ssh/config but that's not what I am trying to do.


title: Why does a graphical install show my boot option, but a textual install not?

text: I have a system to install SLES 11 on, via a serial console. As this procedure is likely to be executed across multiple systems, I want to automate the whole process. As such, I first did a manual installation and created an autoyast profile of the installed system. Next, I added the autoyast profile to the installation DVD and edited isolinux.cfg to offer the option of autoyast. When I try out the DVD in a virtual machine (see screenshots below), I get a graphical boot loader that displays my autoyast option perfectly fine. ![Graphical install](http://i.stack.imgur.com/9RPdC.png) But when I switch to the textual boot loader, the option isn't there anymore. ![Textual install](http://i.stack.imgur.com/xlvOz.png) Instead, if I wish to use the autoyast profile for the installation, I need to specify the `autoyast=file:///<path-to-file>` kernel option to make it work. My question thus revolves around this: does the textual boot loader use the same configuration file for the menu? Or do I have to edit another file on the DVD.


title: Dropbear SSH on Cygwin won't allow passwordless login

text: I am using Dropbear SSH running on Cygwin, on Windows 7, on a VMware virtual machine, on Windows 8.1. On my physical OS I have Cygwin and I am trying to get passwordless login using openssh on Cygywin. To build it I had to pass `LIBS="-lcrypt -lz"` to make in order to get it to pick up libcrypt and zlib. After building and installing it, I generated my client's key pair on my physical OS with `ssh-keygen` and copied it into `~/.ssh/authorized_keys` per Dropbear's manpage, and then I started Dropbear with `dropbear -EF`. After certifying that the Dropbear daemon on the VM started fine and showed up on the Windows Task Manager, I tried to connect to the VM and get a message saying `Permission denied (publickey)`. I tried disabling all login options except for public key login, recompiled Dropbear, and it still won't work. Running the client with the verbose option gives me this:               Huachimichu@rootrockshooter ~     $ ssh -v -l povrch -x 192.168.91.128     OpenSSH_6.5, OpenSSL 1.0.1f 6 Jan 2014     debug1: Connecting to 192.168.91.128 [192.168.91.128] port 22.     debug1: Connection established.     debug1: identity file /home/Huachimichu/.ssh/id_rsa type 1     debug1: identity file /home/Huachimichu/.ssh/id_rsa-cert type -1     debug1: identity file /home/Huachimichu/.ssh/id_dsa type -1     debug1: identity file /home/Huachimichu/.ssh/id_dsa-cert type -1     debug1: identity file /home/Huachimichu/.ssh/id_ecdsa type -1     debug1: identity file /home/Huachimichu/.ssh/id_ecdsa-cert type -1     debug1: identity file /home/Huachimichu/.ssh/id_ed25519 type -1     debug1: identity file /home/Huachimichu/.ssh/id_ed25519-cert type -1     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_6.5     debug1: Remote protocol version 2.0, remote software version dropbear_2014.63     debug1: no match: dropbear_2014.63     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-ctr hmac-md5 none     debug1: kex: client->server aes128-ctr hmac-md5 none         debug1: sending SSH2_MSG_KEX_ECDH_INIT     debug1: expecting SSH2_MSG_KEX_ECDH_REPLY     debug1: Server host key: RSA cc:62:15:b3:5a:4b:07:2c:e2:ef:03:ef:91:b6:9e:23     debug1: Host '192.168.91.128' is known and matches the RSA host key.     debug1: Found key in /home/Huachimichu/.ssh/known_hosts:2     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /home/Huachimichu/.ssh/id_rsa         debug1: Authentications that can continue: publickey     debug1: Trying private key: /home/Huachimichu/.ssh/id_dsa     debug1: Trying private key: /home/Huachimichu/.ssh/id_ecdsa     debug1: Trying private key: /home/Huachimichu/.ssh/id_ed25519     debug1: No more authentication methods to try.     Permission denied (publickey).


title: How do you compile dependencies manually? Cygwin

text: I installed cygwin on windows and the setup.exe doesnt include all the dependencies. in the folder however, there are many dependencies that arent included in the setup.exe. when i type in a dependency in the search bar at the top left corner, it doesnt appear, but it IS in the cygwin folder. ![enter image description here](http://i.stack.imgur.com/Qp4sv.jpg) ![enter image description here](http://i.stack.imgur.com/s3R5f.jpg) is there a way to ammend/add/update dependencies manually, after cygwin has been installed? how would i do this?


title: Trying to record from the default audio source

text: I am trying to record the sound output, but this looks more complicated than expected. I expected that                arecord -f cd -t wav --max-file-time 3600 --use-strftime %Y/%m/%d/listen-%H-%M-%v.wav      would record 1 file every hour, putting the resulting file in a directory structure with year, month, day and name (hour).wav file. It actually records the sound output through the microphone (adding to it every imaginable environment noise, specially typing in the keyboard). `ffmpeg -f x11grab -r 25 -s 800x600 -i :0.0 -f alsa -ac 2 -i pulse -acodec libmp3lame -ab 128k /tmp/outputFile.mpg` manages to record the video and sound, but suffers from the same problem as the previous command. Is there a way of pipping to a file the sound that's being generated? The output of `record -l` is: > _**_List of CAPTURE Hardware Devices **** card 0: MID [HDA Intel MID], > device 0: ALC269VB Analog [ALC269VB Analog] Subdevices: 1/1   >  Subdevice #0: subdevice #0 If I don't find a solution, I'd go with the inelegant solution of buying a loopback cable to connect the output of the loudspeakers to the input of the microphone.


title: Why is this random password is too simplistic/systematic?

text: How is the random string `M1uG*xgRCthKWwjIjWc*010iSthY9buc` being detected as too simplistic/systematic for a password according to passwd and cracklib- check? Try it on your machine and see               echo "M1uG*xgRCthKWwjIjWc*010iSthY9buc" | cracklib-check      Note that this is not my password, but another randomly generated string from the same random password generator that produces the same result.


title: Behavior of mmap'd memory on memory pressure

text: I have a large tar file (60GB) containing image files. I'm using `mmap()` on this entire file to read in these images, which are accessed randomly. I'm using `mmap()` for the following reasons:   1. Thread safety -- I cannot seek an ifstream from multiple threads.   2. I can avoid extra buffering.   3. I get some caching (in the form of a requested page already being resident.) The question is what happens when I've read every image in that 60GB file? Certainly not all of the images are being used at once -- they're read, displayed, and then discarded. My `mmap()` call is:               mmap(0, totalSize, PROT_READ, MAP_SHARED | MAP_NORESERVE, fd, 0);       **Here's the question: does the kernel see that I've mapped read-only pages backed by a file and simply purges the unused pages on memory pressure?** I'm not sure if this case is recognized. Man pages indicate that `MAP_NORESERVE` will not require backing swap space, but there doesn't seem to be any guarantee of what happens to the pages under memory pressure. Is there any guarantee that the kernel will purge my unneeded pages before it, say, purges the filesystem cache or OOM's another process? Thanks!


title: How do I play an HTTP music stream over SSH?

text: I know I can just do `mplayer <stream>` to _open_ and _play_ a stream on the local machine. However, I'm behind a firewall. Instead, I'd like to _open_ the stream on a _remote machine_ , but still _play_ it on _this one_. Remote connections are what SSH is for, but doing `ssh "mplayer <stream>"` both opens _and_ plays the stream on the remote. SSH's `-x` flag enables X11 display forwarding. Do I need that?


title: Looking for a windows 7 / vista like xfwm4 theme

text: Anyone know where I can find a window 7 like xfwm4 theme, that will work with my Windows like icon theme and GTK styles ?


title: loading python when the linux kernel boots

text: I was reading This and I was wondering if I could write an API in python or have python load in an init script. If this were to be possible would I need to edit the kernel's makefile?


title: handling right click with single button mouse (tablet)

text: I'm currently trying to put together a config to facilitate accessing a Linux machine over VNC from a tablet. But I've got a problem with how to deal with right clicks (although I haven't actually _tried_ touching the screen with my other hand ;). While I could amend the vncclient to (temporarily) switch the left and right mouse buttons, this then requires a user-interface running outside the view port, using up valuable screen space. I believe it's possible to remap the behaviour at the server end using xmodmap or xinput, and I could add a button on the taskbar/panel to run a script for this (already planning such for switching between windows and running xrandr to rotate screen) the downside is that the image will be static (i'd like some visual feedback on the state) and I'm not sure if it will handle the right click to restore the settings. (currently the plan is to use Openbox as the WM and most likely fbpanel, but this is not set in stone) Anybody come up with a better solution?


title: ubuntu usb sound card sometimes recognized and sometimes not at boot

text: I have a linux ubuntu 12.04 server machine which works with an usb sound card. When rebooting the machine, sometimes the usb sound card is recognized and sometimes not, I cannot figure out a reason for this. I understand when the sound card is recognized because when I issue the command:               cat /proc/asound/modules      I can see listed or not the line snd_usb_audio. Analyzing the /var/log/kernel.log I can see sometimes (when it works)               kernel: [    6.236564] usbcore: registered new interface driver snd-usb-audio      and other times (when it is not recognized and listed):               kernel: [    7.126855] snd-usb-audio: probe of 2-1.2:1.0 failed with error -5     kernel: [    7.126876] usbcore: registered new interface driver snd-usb-audio      Does anybody know how to ensure that the usb sound card is always recognized?


title: How to assign special folder icons in XFCE?

text: I inadvertently deleted my _Pictures_ folder on my linux box running XFCE / Thunar and, after restoring from the trash bin, the folder icon is plain with no _camera_ on it. **How do I get the folder icon back?** In folder properties I just find how to add emblems to the bottom left corner of the icon but it's not the same thing. Thanks in advance for any advice.


title: Nagios not running notify command

text: I am in the process of creating a notify command for our Nagios server to notify us via our Kannel SMS sender. This is what I got so far:               /usr/local/bin/curl -v -G -d 'username=user' -d 'password=pass' -d 'to='$CONTACTPAGER$'' --data-urlencode 'text=***** centreon *****\nType: '$NOTIFICATIONTYPE$'\nHost: '$HOSTNAME$'\nState: '$HOSTSTATE$'\nAddress: '$HOSTADDRESS$'\nInfo: '$HOSTOUTPUT$'\nDate/Time: '$DATE$'' 'http://192.168.11.248:13013/cgi-bin/sendsms' >> /tmp/nagios.notify      However, this won't work.. I never receive the text. If I echo the whole command, like this:               echo "/usr/local/bin/curl -v -G -d 'username=user' -d 'password=pass' -d 'to='$CONTACTPAGER$'' --data-urlencode 'text=***** centreon *****\nType: '$NOTIFICATIONTYPE$'\nHost: '$HOSTNAME$'\nState: '$HOSTSTATE$'\nAddress: '$HOSTADDRESS$'\nInfo: '$HOSTOUTPUT$'\nDate/Time: '$DATE$'' 'http://192.168.11.248:13013/cgi-bin/sendsms'" >> /tmp/nagios.notify.debug      when checking the `/tmp/nagios.notify.debug` file, everything seems fine. Do you have any idea why it won't work? Perhaps some troubleshooting steps I could make? Also, running the command manually via SSH works just fine. So it is just when Nagios has to run it that it goes wrong.


title: How to checkout Tomcat by SVN?

text: I try:                svn co http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/      But received error:               svn: E170000: Unrecognized URL scheme for      'http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk'      Is it mean that my svn doesn't work correct? Thanks.


title: running multiple commands for su in bash

text: I would like to use `su -c` to run as root multiple commands altogether. I don't want to use an extra script for this. I tried the following                   su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & " -c "ls -lh"      but it executes only the `ls` not the first one. I tried the following                   su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ; ls -lh;"      but it says that there is an error with the semicolon `;`. Do you know how to do that?


title: My awk program to change spaces into tabs doesn't work

text: How to write a shell script which uses awk to read in the data file `students.txt` and output the data in the tabbed format as shown:               Surname Forename MSc Stream Date of Birth     Smith John IT 15.01.1986     Taylor Susan IT 04.05.1987     Thomas Steve MIT 19.04.1986        * Do not worry if tabbed columns don’t line up.   * The distance between each of (Surname, Forename, MSc Stream and Date of Birth) column is one tab. Question: Why this code bellow doesn't work for me?               awk 'BEGIN {IFS=" "} {OFS="\t"} {print $1,$2,$3,$4}' students.txt


title: How to cd into a directory with the name "-"?

text: I tried to `cd` into a directory named `-` that I created for experimenting. I could not from Bash. How do I cd into it? With Nautilus on Ubuntu 13.10 I could easily do this, and even create files inside it effortlessly. I did a Google search and here is what I got. That covers the case when directories _begin_ with a `-`, like `-test`, but not the case when the entire name is one single `-`. Even `rm` does not work, although I was able to delete it from Nautilus. `cat test.txt >-` copies text from `test.txt` into a file named `-`, but `cat - >test2.txt` does what it would do in normal circumstances, that is, copy input from `stdin` into `test2.txt`, not from the file `-`. Why does Nautilus have no problem with this but bash does?


title: How can I concatenate a single column of output into a list?

text: I'm using:               ls /proc | grep -v "^[0-9].*"      to get a list of all the files and directories in /proc that don't begin with numbers. The output is a single column list, i.e.:               acpi     asound     buddyinfo     bus      How can I make this a multi-column or item list, i.e.:               acpi asound buddyinfo bus      or               acpi,asound,buddyinfo,bus      I tried:               $ ls /proc | grep -v "^[0-9].*" | column -c5      but still got 1 column.


title: 'd' Key on VNC Viewer Minimises All Windows

text: I'm running vnc4server on an Ubuntu 10.10 box, and connecting to it from an Ubuntu 8.04 machine using TightVNC Viewer 1.3.9. I'm unable to type anything with the character `d` within the VNC session, as the `d` causes all windows to be minimised. Following reports of a successful solution on many online fora, I disabled the keyboard shortcut for hiding all windows, but the problem persists. Output of `xev` is given below. It includes two presses of `d` because the first press minimised all windows. I didn't know what to keep and what to remove, so this output includes everything from the first key-press to when the windows came back up on the second key-press:               FocusOut event, serial 29, synthetic NO, window 0xa00001,         mode NotifyGrab, detail NotifyAncestor                         FocusOut event, serial 29, synthetic NO, window 0xa00001,         mode NotifyWhileGrabbed, detail NotifyNonlinear                FocusIn event, serial 29, synthetic NO, window 0xa00001,         mode NotifyWhileGrabbed, detail NotifyPointer                 KeymapNotify event, serial 29, synthetic NO, window 0x0,         keys:  0   0   0   0   0   1   0   0   0   0   0   0   0   0   0   0                   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0             LeaveNotify event, serial 29, synthetic NO, window 0xa00001,         root 0x2e, subw 0x0, time 581275388, (100,64), root:(111,572),         mode NotifyNormal, detail NotifyAncestor, same_screen YES,             focus YES, state 0                                                      UnmapNotify event, serial 29, synthetic NO, window 0xa00001,         event 0xa00001, window 0xa00001, from_configure NO                PropertyNotify event, serial 29, synthetic NO, window 0xa00001,         atom 0xc7 (WM_STATE), time 581275388, state PropertyNewValue          PropertyNotify event, serial 29, synthetic NO, window 0xa00001,         atom 0xae (_NET_WM_STATE), time 581275388, state PropertyNewValue          MapNotify event, serial 29, synthetic NO, window 0xa00001,         event 0xa00001, window 0xa00001, override NO                    VisibilityNotify event, serial 29, synthetic NO, window 0xa00001,         state VisibilityUnobscured                                             Expose event, serial 29, synthetic NO, window 0xa00001,         (0,0), width 178, height 10, count 3                         Expose event, serial 29, synthetic NO, window 0xa00001,         (0,10), width 10, height 58, count 2                         Expose event, serial 29, synthetic NO, window 0xa00001,         (68,10), width 110, height 58, count 1                       Expose event, serial 29, synthetic NO, window 0xa00001,         (0,68), width 178, height 110, count 0                       EnterNotify event, serial 29, synthetic NO, window 0xa00001,         root 0x2e, subw 0x0, time 581276874, (100,64), root:(111,572),         mode NotifyNormal, detail NotifyAncestor, same_screen YES,         focus NO, state 0          KeymapNotify event, serial 29, synthetic NO, window 0x0,         keys:  4294967283 0   0   0   0   1   0   0   0   0   0   0   0   0   0  0                0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0          PropertyNotify event, serial 29, synthetic NO, window 0xa00001,         atom 0xc7 (WM_STATE), time 581276874, state PropertyNewValue          PropertyNotify event, serial 29, synthetic NO, window 0xa00001,         atom 0xae (_NET_WM_STATE), time 581276874, state PropertyNewValue          FocusIn event, serial 29, synthetic NO, window 0xa00001,         mode NotifyWhileGrabbed, detail NotifyNonlinear          KeymapNotify event, serial 29, synthetic NO, window 0x0,         keys:  68  0   0   0   0   1   0   0   0   0   0   0   0   0   0   0                0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0          FocusOut event, serial 29, synthetic NO, window 0xa00001,         mode NotifyUngrab, detail NotifyPointer          FocusIn event, serial 29, synthetic NO, window 0xa00001,         mode NotifyUngrab, detail NotifyAncestor          KeymapNotify event, serial 29, synthetic NO, window 0x0,         keys:  4294967214 0   0   0   0   0   0   0   0   0   0   0   0   0   0  0                0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0


title: Need data after Last comma in field1 from the Text in Unix

text: $ cat sample.txt     414d51204d5150525447575648415050529a6af298e,,,002330618820140707134048 ,+0657,45675 414d51204d514e55533732355051543051696344201645c6,002330618820140707134048 ,+0657,tgre,ghty      Need all fields after the last `,` in field 1. As you can see there are lots of (`414d51204d5150525447575648415050529a6af298e,,,`) The output has to be like the following:               002330618820140707134048 ,+0657,45675 002330618820140707134048 ,+0657,tgre,ghty


title: FreeBSD pf firewall, new connections severly delayed when nating

text: I have a newly setup fbsd 9.1 with pf, which itself doesn't experience any slowness when for example downloading a debian iso from my local debian repo (ftp.se.debian.org). Any machine behind it, which the freebsd firewall routes and nats for, experiences about 10-12 seconds before getting any data back after the initial tcp handshake is formed. Speed after the initial delay is fine, about 10-12 MB/s constantly. I suspect I am doing something wrong, see rules and tcpdump below. It might be worth adding that freebsd is running in a XenServer (6.0) VM, with the xenhvm devices compiled in a custom kernel.               # pf.conf     wanif = "xn0"     dmzif = "xn2"     dmznet  = "10.64.1.0/24"          scrub on $wanif reassemble tcp no-df random-id          nat on $wanif from $dmzif:network to any -> ($wanif)          block log     block in all     pass quick on lo0 all     pass out all keep state          pass in quick on $dmzif inet from $dmznet to ! $intnets keep state          pass out on $wanif proto tcp all modulate state flags S/SA     pass out on $wanif all keep state                             # tcpdump -ni xn0              12:09:04.389635 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [S], seq 2077316563, win 5840, options [mss 1460,sackOK,TS val 478788359 ecr 0,nop,wscale 4], length 0         12:09:04.401362 IP 194.71.11.69.80 > 71.72.73.74.51953: Flags [S.], seq 93082952, ack 2077316564, win 5792, options [mss 1460,sackOK,TS val 2817201177 ecr 478788359,nop,wscale 7], length 0         12:09:04.401851 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [.], ack 1, win 365, options [nop,nop,TS val 478788362 ecr 2817201177], length 0         12:09:04.402126 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [P.], seq 1:195, ack 1, win 365, options [nop,nop,TS val 478788362 ecr 2817201177], length 194         12:09:04.611851 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [P.], seq 1:195, ack 1, win 365, options [nop,nop,TS val 478788415 ecr 2817201177], length 194         12:09:05.035855 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [P.], seq 1:195, ack 1, win 365, options [nop,nop,TS val 478788521 ecr 2817201177], length 194         12:09:05.884041 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [P.], seq 1:195, ack 1, win 365, options [nop,nop,TS val 478788733 ecr 2817201177], length 194         12:09:07.580009 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [P.], seq 1:195, ack 1, win 365, options [nop,nop,TS val 478789157 ecr 2817201177], length 194         12:09:07.944140 IP 194.71.11.69.80 > 71.72.73.74.51953: Flags [S.], seq 93082952, ack 2077316564, win 5792, options [mss 1460,sackOK,TS val 2817204720 ecr 478788362,nop,wscale 7], length 0         12:09:07.944908 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [.], ack 1, win 365, options [nop,nop,TS val 478789248 ecr 2817204720,nop,nop,sack 1 {0:1}], length 0         12:09:10.972026 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [P.], seq 1:195, ack 1, win 365, options [nop,nop,TS val 478790005 ecr 2817204720], length 194         12:09:17.756060 IP 71.72.73.74.51953 > 194.71.11.69.80: Flags [P.], seq 1:195, ack 1, win 365, options [nop,nop,TS val 478791701 ecr 2817204720], length 194         12:09:17.767744 IP 194.71.11.69.80 > 71.72.73.74.51953: Flags [.], ack 195, win 54, options [nop,nop,TS val 2817214544 ecr 478791701], length 0         12:09:17.895263 IP 194.71.11.69.80 > 71.72.73.74.51953: Flags [.], seq 1:1449, ack 195, win 54, options [nop,nop,TS val 2817214672 ecr 478791701], length 1448         12:09:17.895326 IP 194.71.11.69.80 > 71.72.73.74.51953: Flags [.], seq 1449:2897, ack 195, win 54, options [nop,nop,TS val 2817214672 ecr 478791701], length 1448              # tcpdump -ni xn2 port 80         tcpdump: verbose output suppressed, use -v or -vv for full protocol decode         listening on xn2, link-type EN10MB (Ethernet), capture size 65535 bytes         12:03:18.248115 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [P.], seq 827084948:827085121, ack 856345816, win 365, options [nop,nop,TS val 4294916027 ecr 3651988161], length 173         12:03:18.269060 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], ack 173, win 122, options [nop,nop,TS val 3651991631 ecr 4294916027], length 0          12:03:18.269309 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 1:1449, ack 173, win 122, options [nop,nop,TS val 3651991631 ecr 4294916027], length 1448         12:03:18.269364 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 1449:2897, ack 173, win 122, options [nop,nop,TS val 3651991631 ecr 4294916027], length 1448         12:03:18.269397 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 2897:4345, ack 173, win 122, options [nop,nop,TS val 3651991631 ecr 4294916027], length 1448         12:03:18.269427 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [P.], seq 4345:5793, ack 173, win 122, options [nop,nop,TS val 3651991631 ecr 4294916027], length 1448         12:03:18.269744 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 1449, win 546, options [nop,nop,TS val 4294916032 ecr 3651991631], length 0          12:03:18.269797 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 2897, win 727, options [nop,nop,TS val 4294916032 ecr 3651991631], length 0          12:03:18.269818 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 4345, win 908, options [nop,nop,TS val 4294916032 ecr 3651991631], length 0          12:03:18.269837 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 5793, win 1089, options [nop,nop,TS val 4294916032 ecr 3651991631], length 0          12:03:18.269861 IP 10.64.1.2.53888 > 130.239.18.173.80: Flags [F.], seq 1457436047, ack 1959872378, win 452, options [nop,nop,TS val 4294916032 ecr 1986976335], length 0         12:03:18.290194 IP 130.239.18.173.80 > 10.64.1.2.53888: Flags [.], ack 1, win 122, options [nop,nop,TS val 1986977333 ecr 4294916032], length 0         12:03:18.290227 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 5793:7241, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290247 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 7241:8689, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290266 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 8689:10137, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290292 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [P.], seq 10137:11585, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290312 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 11585:13033, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290332 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 13033:14481, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290357 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 14481:15929, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290382 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [P.], seq 15929:17377, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290420 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 17377:18825, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290444 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 18825:20273, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290469 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 20273:21721, ack 173, win 122, options [nop,nop,TS val 3651991637 ecr 4294916032], length 1448         12:03:18.290553 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 7241, win 1270, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290599 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 8689, win 1451, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290621 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 10137, win 1632, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290640 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 11585, win 1813, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290665 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 13033, win 1994, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290684 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 14481, win 2175, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290705 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 15929, win 2356, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290729 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 17377, win 2537, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290755 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 18825, win 2718, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290774 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 20273, win 2899, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.290798 IP 10.64.1.2.34774 > 194.71.11.69.80: Flags [.], ack 21721, win 3080, options [nop,nop,TS val 4294916037 ecr 3651991637], length 0          12:03:18.311156 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 21721:23169, ack 173, win 122, options [nop,nop,TS val 3651991642 ecr 4294916037], length 1448         12:03:18.311190 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 23169:24617, ack 173, win 122, options [nop,nop,TS val 3651991642 ecr 4294916037], length 1448         12:03:18.311208 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 24617:26065, ack 173, win 122, options [nop,nop,TS val 3651991642 ecr 4294916037], length 1448         12:03:18.311228 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 26065:27513, ack 173, win 122, options [nop,nop,TS val 3651991642 ecr 4294916037], length 1448         12:03:18.311247 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [.], seq 27513:28961, ack 173, win 122, options [nop,nop,TS val 3651991642 ecr 4294916037], length 1448         12:03:18.311266 IP 194.71.11.69.80 > 10.64.1.2.34774: Flags [P.], seq 28961:30409, ack 173, win 122, options [nop,nop,TS val 3651991642 ecr 4294916037], length 1448


title: Output of one command is piped to another one; how to close both?

text: I call Qt Assistant like suggested on stackoverflow:               nc -lkU ~/.assistantfifo | assistant -enableRemoteControl &      Qt Assistant window is opened, and if I call `jobs`, it returns:               [1]  + running    nc -lkU ~/.assistantfifo | assistant -enableRemoteControl      Then, I close Qt Assistant (just by clicking at "x"). Now, `jobs` returns:               [1]  + running    nc -lkU ~/.assistantfifo |             done       assistant -enableRemoteControl      So, `nc` continues working, and I have to type `killall nc`. How to make `nc` finish too, when I close Qt Assistant? Or, probably I should do this somehow different?


title: why csv is consuming more file size in my unix script?

text: I'm using this unix script which it is fetching records in the form of csv. I have a SQL query used for this purpose. It contains below information               SET PAGESIZE 5000     SET COLSEP ","     SET LINESIZE 2000     SET FEEDBACK OFF     SET NEWPAGE NONE     SET UNDERLINE OFF      Is it due to `PAGESIZE` it is consuming more space? The script returns 4MB of CSV(`OBTM.csv`) file whereas if I'm converting the same to (`OBTM.xlsx`) it is 48KB. Kindly clarify my query


title: How to find out which (not installed) package a file belongs to?

text: On Debian systems (and derivatives):               $ dpkg --search /bin/ls     coreutils: /bin/ls      That is, the file **`/bin/ls`** belongs to the Debian package named **`coreutils`**. But this only works if the package is installed. What if it's not?


title: Where is avisplit?

text: > **Possible Duplicate:**   >  How to find out which (not installed) package a file belongs to? I usually used `avisplit` command to split avi files. I noticed that I should install the package `transcode`. `$ man transcode` shows               SEE ALSO            transcode_export(1) , transcode_filter(1) , transcode_import(1) , avifix(1) , avisync(1) , avimerge(1) , avisplit(1) , tcprobe(1) , tcscan(1) ,            tccat(1) , tcdemux(1) , tcextract(1) , tcdecode(1) , tcmodinfo(1) , tcxmlcheck(1) , transcode(1)      though the command `avisplit` does not work. my OS: Ubuntu 12.04 LTS Do you know where is the problem?


title: How do I find out which package contains an executable?

text: Suppose I want to use the command eg. from the project `info2html` and it's not available on my system. Some distro's sometimes suggest packages for some missing commands that are expected (ie. considered common), but not for all commands (and not all distros). How do I find out if there is a package for the desired program in my distribution, and if yes, which package do I need to install? Is there, what is the 'right way' to do this? Some examples with specific distros like Debian are welcome. :) It may depend on the package management software. Useful terminology is also welcome, so I can find this functionality in a given package ecosystem.


title: How can I find the default (font) resource XTerm is using?

text: If I launch `xterm` with its default bitmap fonts and then select the 'Large' font from the 'VT Fonts' menu (via `ctrl+right mouse`), I get a very usable bitmap font with apparently good Japanese character support. **I'd like to know what this font is** so that I can use it elsewhere. Unfortunately, I've found no information on what default settings XTerm uses (i.e. when none are explicitly specified). Lots of sites show how to use X resources to specify new settings (e.g. particular fonts), but none I've seen say what defaults are used if I do nothing. I've tried eyeballing the font, and it looks similar to and is the same width as `9x15`, but it uses more vertical space. It appears not to be `9x15` with different line spacing, though, as specifying this font directly fails to display some Japanese characters that 'Large' can handle just fine. Although I'll be happy to know what this specific font is, I really want to know where to find **what defaults XTerm uses for its resources** more generally. If it makes any difference, I'm running Ubuntu 12.04 LTS, 64-bit. [I have seen this question on the subject already, which is why I'm specifically asking about defaults rather than trying to get live values from a running XTerm.]


title: Obtaining remote host name in bash script

text: Sorry my knowledge of Linux bash commands is pretty basic, I've been searching for a while but I'm not 100% sure what I need to search for. I was wondering if there's a way to grab the current logged in users remote host name in a Linux bash script? I have a script in which I need to log each time a user runs it. I'm obtaining the date like so:               cdat=`/bin/date +%a' '%d' '%h' '%Y', '%H':'%M`;      I now need to add the users remote host (not the username they logged in with). I'm not 100% sure I'm using the right terminology here either, just to clarify; by 'remote host name' I mean the same output that prints on the screen on most servers I've logged into over ssh, for example:               Last login: Mon Jul 22 16:35:09 2013 from win7-i7-stuart.my.domain.com      I'm looking for the `win7-i7-stuart.my.domain.com` bit.


title: Determining archive / suite from `deb` line

text: Is there an easy way to determine the "Archive", "Suite", "origin" (or whatever else APT uses) just from the deb line? For example, someone (trusted, of course) gives me this deb line:               deb http://myrepo.example.org/debian/ wheezy main contrib non-free whatever      I add it to sources.list, resolve GPG issue, update, install the packages and I'm almost good to go. Almost, because I'd like to achieve unattended upgrades as well. So I open /etc/apt/apt.conf.d/50unattended-upgrades, and behold:               // Automatically upgrade packages from these origin patterns     Unattended-Upgrade::Origins-Pattern {             // Archive or Suite based matching:             // Note that this will silently match a different release after             // migration to the specified archive (e.g. testing becomes the             // new stable).     //      "o=Debian,a=stable";     //      "o=Debian,a=stable-updates";     //      "o=Debian,a=proposed-updates";             "origin=Debian,archive=stable,label=Debian-Security";     };      they want me to use "Archive or Suite based matching". So,   * how can I compose/retrieve the necessary information for the pattern?   * And can I do it prior to adding the line to sources.list (just out of curiosity)?   * What about `deb ftp://` (not sure if it's used) or deb-src?   * Is there a "plumbing" utility for that? Note that I'm looking for general explanation of repo structure and the way deb line is read, rather than just URI for _current official_ Debian repo.


title: xfce swap command and control keys

text: What is the equivalent of this in Debian XFCE?: > Go into System -> Preferences -> Keyboard > > Click on the "Layouts" tab and then click the "Layout Options" button. > > Click on "Alt/Win key behavior" > > Select "Control is mapped to Win keys (and the usual ctrl key). > > This will make your Apple command keys act like control, and keep your ctrl > key as control as well. However, this will leave you without a Super key. I > haven't found this a problem. I hope that's what you're looking for! I have tried the .Xmodmap method, but that doesn't work either. Also, would I be able to use the ctrl key to right click again like it does on mac?


title: How can I print half of a page to a pdf file?

text: I have a one page PDF file with scanned documents. I need to send only top half of this document to someone. How can I generate a new PDF document with only the top half of the original page, without losing details?


title: Hiding work in account with multiple users

text: I'm currently working on an assignment in a cluster programming class. The class has been given an account on the cluster, so we can ssh in and do our work. The problem is that the one account is shared among everyone in the class. Each student just makes their own directory and works within it. Obviously a problem is that students can just look at each others work and plagiarize. I don't want people to see my work until after the assignments have been submitted. There are no version control systems on the cluster, so I can't just pull a repository from my own machine and work on the assignment, then push it and remove what's on the cluster each time I work. What is the best way to prevent others from seeing my work? Ordinarily I'd just work on my own machine and then upload to the server when it is due. But because I don't have my own cluster, we all need to actually use the one account. Yes, believe it or not this is actually a real world problem I am facing - not a hypothetical.


title: Network configuration from within a program

text: Are there any program accessible equivalents to network configuration tools such as 'ifconfig', 'iwconfig' e.t.c.? I am looking for an elegant method of accessing the functionality and information these provide from within a program.


title: make a log file

text: Is there any way to make a log file for maintaining some data in /var/log/ with the help of some library function or system call in c language in linux. And I also want to know the standards that we should follow to write and process log. Thanks


title: Create a test file with lots of zero bytes

text: I know how to create an empty file:               touch /var/tmp/nullbytes      but how can I create a 1MB file that only contains nullbytes on the commandline with bash?


title: OpenLDAP error while adding an ACL

text: I'm trying to add an ACL to my DIT and I get the following:               Enter LDAP Password:      modifying entry "olcDatabase={0}bdb,cn=config"     ldap_modify: No such object (32)             matched DN: cn=config      This is the content of the acl.ldif file:               dn: olcDatabase={0}bdb,cn=config     changetype: modify     add: olcAccess     olcAccess: to attrs=userPassword by dn="cn=Manager,dc=site,dc=com" write by anonymous auth by self write by * none     olcAccess: to dn.base="" by * read     olcAccess: to * by dn="cn=Manager,dc=site,dc=com" write by * read


title: Help understanding cut command in script

text: In a bash script, there are the following 2 lines:               ipaddr=$0     segments=`echo $ipaddr | cut --delimiter=. --fields=2-3 --output-delimiter=/`      I do not know how to interpret the second line where the variable `$segments` is created. How does this part work?


title: Remove Aptana Studio 3 in ubuntu 12.04 LTS

text: I have actually two questions.   1. I was using Eclipse in ubuntu 12.04LTS, it was working fine. Then I install Aptana Studio 3 and after installing Aptana Studio 3 Eclipse stop working. Any thoughts about this ?   2. I install Aptana Studio 3 in /opt/Aptana_Studio_3. How can I remove Aptana Studio 3 so I can install again Eclipse, actually I want to switch back to Eclipse.


title: Can a user brute-force a directory listing without having read permission on the directory?

text: I noticed that when a user is working in a directory to which he does _not_ have read permission that using cd produces different error messages, depending on whether or not a subdirectory exists:               $ ls     ls: cannot open directory .: Permission denied     $ cd nonexistentdirectory     -bash: cd: nonexistentdirectory: No such file or directory     $ cd existingdirectory     -bash: cd: username: Permission denied      It raises the question: Is the fact that a user can brute-force a directory listing this way without read permission a security flaw? If so, is it a flaw of UNIX or Bash?


title: Lightdm does not start after using webkit greeter

text: I am using lightdm. And I compiled the lightdm-webkit-greeter from source. Here are my /etc/lightdmlightdm.conf settings:               [LightDM]     [SeatDefaults]     xserver-allow-tcp=false     greeter-session=lightdm-webkit-greeter     greeter-hide-users=true     user-session=i3     session-wrapper=/etc/X11/Xsession     [XDMCPServer]     [VNCServer]      (All the other values are commented out and I have skipped them here) Here is my /etc/lightdm/lightdm-webkit-greeter.conf:               [greeter]     background=/home/neo1691/Pictures/debian.jpg     theme-name=Elegant_revisited     font-name=Inconsolata bold 10     webkit-theme=Bevel     xft-antialias=true     xft-dpi=96     xft-hintstyle=slight     xft-rgba=rgb      When I start my laptop, it just goes to a black screen with a small cursor blinking instead of starting lightdm. Here are the log files: /var/log/lightdm.log               [+0.04s] DEBUG: Logging to /var/log/lightdm/lightdm.log     [+0.04s] DEBUG: Starting Light Display Manager 1.2.2, UID=0 PID=2761     [+0.04s] DEBUG: Loaded configuration from /etc/lightdm/lightdm.conf     [+0.04s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager     [+0.10s] DEBUG: Registered seat module xlocal     [+0.10s] DEBUG: Registered seat module xremote     [+0.10s] DEBUG: Adding default seat     [+0.10s] DEBUG: Starting seat     [+0.10s] DEBUG: Starting new display for greeter     [+0.10s] DEBUG: Starting local X display     [+0.10s] DEBUG: Using VT 7     [+0.10s] DEBUG: Activating VT 7     [+0.10s] DEBUG: Logging to /var/log/lightdm/x-0.log     [+0.36s] DEBUG: Writing X server authority to /var/run/lightdm/root/:0     [+0.36s] DEBUG: Launching X Server     [+0.36s] DEBUG: Launching process 3251: /usr/bin/X :0 -auth     /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch     [+0.36s] DEBUG: Waiting for ready signal from X server :0     [+0.36s] DEBUG: Acquired bus name org.freedesktop.DisplayManager     [+0.36s] DEBUG: Registering seat with bus path     /org/freedesktop/DisplayManager/Seat0     [+3.45s] DEBUG: Got signal 10 from process 3251     [+3.45s] DEBUG: Got signal from X server :0     [+3.45s] DEBUG: Connecting to XServer :0     [+3.45s] DEBUG: Starting greeter     [+3.45s] DEBUG: Started session 3368 with service 'lightdm', username 'lightdm'     [+3.56s] DEBUG: Session 3368 authentication complete with return value     0: Success     [+3.56s] DEBUG: Greeter authorized     [+3.56s] DEBUG: Logging to /var/log/lightdm/x-0-greeter.log     [+3.60s] DEBUG: Session 3368 running command lightdm-webkit-greeter     [+3.60s] DEBUG: org.freedesktop.Accounts does not exist, falling back     to passwd file     [+4.14s] DEBUG: Greeter closed communication channel     [+4.14s] DEBUG: Session 3368 exited with return value 0     [+4.14s] DEBUG: Greeter quit     [+4.14s] DEBUG: Failed to start greeter     [+4.14s] DEBUG: Stopping display     [+4.14s] DEBUG: Sending signal 15 to process 3251     [+4.54s] DEBUG: Process 3251 exited with return value 0     [+4.54s] DEBUG: X server stopped     [+4.54s] DEBUG: Removing X server authority /var/run/lightdm/root/:0     [+4.54s] DEBUG: Releasing VT 7     [+4.54s] DEBUG: Display server stopped     [+4.54s] DEBUG: Display stopped     [+4.54s] DEBUG: Stopping X local seat, failed to start a display     [+4.54s] DEBUG: Stopping seat     [+4.54s] DEBUG: Seat stopped     [+4.54s] DEBUG: Required seat has stopped     [+4.54s] DEBUG: Stopping display manager     [+4.54s] DEBUG: Display manager stopped     [+4.54s] DEBUG: Stopping daemon     [+4.54s] DEBUG: Exiting with return value 1      Here is the output of /var/log/lightdm/x-0-greeter.log               Failed to run command: No such file or directory      Now the output of x-0.log               X.Org X Server 1.12.4     Release Date: 2012-08-27     X Protocol Version 11, Revision 0     Build Operating System: Linux 3.11-2-amd64 x86_64 Debian     Current Operating System: Linux Innovator 3.2.0-4-amd64 #1 SMP Debian     3.2.54-2 x86_64     Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64     root=/dev/mapper/Debian-Root ro quiet     Build Date: 17 December 2013  07:37:58PM     xorg-server 2:1.12.4-6+deb7u2 (Julien Cristau <jcristau@debian.org>)     Current version of pixman: 0.26.0             Before reporting problems, check http://wiki.x.org             to make sure that you have the latest version.     Markers: (--) probed, (**) 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: Fri Mar 21 21:46:37 2014     (==) Using system config directory "/usr/share/X11/xorg.conf.d"     Server terminated successfully (0). Closing log file.      If I run the lightdm-webkit-greeter command from cli, it opens up the sweet interface in a gtk window with some warnings on the terminal. I also installed plymouth package, just to let you all know, after finding an error relating to this in the lightdm.log file. If you have reached till here, I appreciate you for your time and effort for reading such a long post! Any help would be really appreciated. Cheers!


title: How can I search for packages depending on a exact package?

text: I'm experimenting a bit with aptitude search terms and finally discovered how to do search on dependencies, which is:               aptitude search '?depends("searchterm")'      The only problem that I've found is... that the "searchterm" uses expansions. If I use `aptitude search '?depends("vim")'` it will look for any packages that depends on a package that contains the word `vim` in the start, middle or end. Is there a way that I can match the exact package called `vim` and no other expansion?


title: AsciiDoc syntax highlighting plugin for Kate?

text: I'm looking for a way to add AsciiDoc syntax highlighting to the Kate editor. I haven't found anything yet, but I feel sure some solution exists because AsciiDoc appears to be very popular (and is even used by O'Reilly publishing). There are AsciiDoc syntax highlighters for Vim, GEdit, Emacs, TextMate, Geany and others. Surely Kate has one...


title: How to know what will execute at startup/bootup?

text: I would like what scripts will run at start, without needing to "restart and see what happens", is there any way to know what 'services' are ready to run? Shoud I check every single file in               ls /etc/rc0.d     ...     and so on?      or just               reboot      Missing DOS autoexec.bat....... **EDIT** I am using Debian


title: Please explain this output of ps -ef command?

text: A part of the output from the `ps -ef` command is given below :               UID        PID  PPID  C STIME TTY          TIME CMD     root         1     0  0  2012 ?        00:00:01 init [3]              root         2     1  0  2012 ?        00:00:01 [migration/0]     root         3     1  0  2012 ?        00:00:00 [ksoftirqd/0]     root         4     1  0  2012 ?        00:00:00 [watchdog/0]     root         5     1  0  2012 ?        00:00:00 [events/0]     root         6     1  0  2012 ?        00:00:00 [khelper]     root         7     1  0  2012 ?        00:00:00 [kthread]     root         9     7  0  2012 ?        00:00:00 [xenwatch]     root        10     7  0  2012 ?        00:00:00 [xenbus]     root        18     7  0  2012 ?        00:00:01 [migration/1]     root        19     7  0  2012 ?        00:00:00 [ksoftirqd/1]      What does the `"?"` for all the rows in the TTY column mean? Also what does `C` and `CMD` column stand for?