title: Can I "export" functions in bash?

text: source some_file      some_file:               doit ()     {       echo doit $1     }     export TEST=true      If I source **some_file** the function "doit" and the variable TEST are available on the command line. But running this script: script.sh:               #/bin/sh     echo $TEST     doit test2      Will return the value of TEST, but will generate an error about the unknown function "doit". Can I "export" the function, too, or do I have to source some_file in script.sh to use the function there?


title: kvm doesn't load Windows 8

text: I'm launching kvm with the following parameter: `kvm -m 2g -smp ncores=2 -hda disk.img -cdrom win8.iso` My CPU has VT support and enabled, ![enter image description here](http://i.stack.imgur.com/02vFI.png) **EDIT** I seems to have limited emulate type:               pc                   Standard PC (alias of pc-1.1)     pc-1.1               Standard PC (default)     pc-1.0               Standard PC     pc-0.15              Standard PC     pc-0.14              Standard PC     pc-0.13              Standard PC     pc-0.12              Standard PC     pc-0.11              Standard PC, qemu 0.11     pc-0.10              Standard PC, qemu 0.10     isapc                ISA-only PC


title: How to increase the link count for a directory, link count went to 0?

text: I have made myself land in this situation, it is a chrooted workspace on my system where I virtualize the entire file system ( so its not actual /var/log ) Is there a way that I can either delete this file completely or increase the link count ? When I delete it, it says, Device or resource busy, but I can't find this inode number 91849100 in lsof. I am not able to figure out what to do next. Please help               stat /var/log stat /var/log   File: `/var/log'   Size: 0               Blocks: 8          IO Block: 4096   directory Device: 97fh/2431d      Inode: 91849100    Links: 0 Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root) Access: 2013-08-07 04:26:47.231703346     -0700 Modify: 2013-08-07 04:26:47.231703346 -0700 Change: 2013-08-07 04:26:47.231703346 -0700


title: Linux Kernel limit access to root with a button?

text: Is it possible to limit the access to a root account from within the kernel? I mean that if I press a button then the system detects the button being pressed and then allows access to the root account at boot. To me this could be useful to prevent a hacking attack from a bug of one of my programs that have an open port and maybe are vulnerable to attacks! If I can limit the attacker's movement maybe I can restrict the information it can have access to not compromising sensitive data. Is there a special way of doing this? Permissions like how android manage access, a boot parameter or another kernel? It is possible?


title: netstat shows an ESTABLISHED connection with no process

text: I am debugging some problems with postfix. When I establish a connection nothing happens and `netstat` shows:               $ netstat -anp     ...     tcp        0      0 129.132.202.106:25          129.132.179.232:60154       ESTABLISHED -                         Why is the process missing? `lsof` does not show the established connection               $ lsof -n -i :25     COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME     master   6139    root   11u  IPv4 472858      0t0  TCP 127.0.0.1:smtp (LISTEN)     master  20033    root   11u  IPv4 523921      0t0  TCP 129.132.202.106:smtp (LISTEN)     smtpd   20042 postfix    6u  IPv4 523921      0t0  TCP 129.132.202.106:smtp (LISTEN)      Traffic:               11:26:44.182443 IP 129.132.179.232.59517 > 129.132.202.106.25: S 3522488764:3522488764(0) win 65535 <mss 1460,nop,wscale 5,nop,nop,timestamp 73851028 0,sackOK,eol>     11:26:44.182831 IP 129.132.202.106.25 > 129.132.179.232.59517: S 3950923498:3950923498(0) ack 3522488765 win 5792 <mss 1460,sackOK,timestamp 18832449 73851028,nop,wscale 7>     11:26:44.183150 IP 129.132.179.232.59517 > 129.132.202.106.25: . ack 1 win 4117 <nop,nop,timestamp 73851029 18832449>      and then nothing more How do I find out why the listening process is not there? If I attach `strace` to `master` nothing is shown. No activity whatsoever during the attempted connection.


title: How to prevent ELinks from staying in scrollback buffer?

text: After quitting `elinks`, the browser page history is lingering in my scrollback buffer, and therefore not returning to whatever was buffered on screen when I launched `elinks`. Inside a GNU screen with `altscreen` enabled, this does _not_ happen. But in any normal terminal session elinks stays in the buffer. I note that other terminal programs like Vim and lynx _do not_ stay in the scrollback buffer, and instead return the buffer to its state at the time they were launched. I am not finding a configuration option in ELinks to ensure it switches to the alternate terminal, however.               $TERM=xterm-256color        Is there a configuration option to prevent ELinks sticking around in the scrollback buffer? ### Update: On a little further investigation, the scrollback problem occurs only in iTerm2 and Terminal.app on OSX. In an XTerm, ELinks does not modify the scrollback buffer.


title: Write to error stream in while loop

text: I’ve got approximately the following code:               cat infile | while read line; do         echo 2> 'log ' $line         echo $line     done > outfile      `outfile` is created correctly. However, the STDERR output just vanished: it’s neither displayed on the terminal nor in `outfile`. If I replace the last line above with `done > outfile 2> errfile` then `errfile` is created, but empty. Can I capture the error output from within the loop, preferably by streaming it directly into the parent STDERR (the above is part of a larger script whose standard error stream is captured by yet another process)?


title: Headless use of open office or libreoffice in Ubuntu 14.04

text: I want to install openoffice headless in Ubuntu 14.10, but when I try to install it, it says there is no package for that name. I installed `libreoffice-common` using `apt-get`, but I can't find headless. How can I install Openoffice headless?


title: awk + gsub + how to work with all kind of characters

text: The following `awk` command target is remove spaces and unnecessary quotes from CSV file and only from single words between separators               awk 'gsub(/("[ ]+|[ ]+")/,"\""){$0=gensub(/"([[:alnum:]]+)"/,"\\1","g")}1' file.csv      example: ( before )               1,"1.0348    54 35.5",""45356",""4"""""35,"578 "      example: ( after )               1,"1.0348    54 35.5","45356,"4""""35,578      the problem is that `awk` can’t handle when characters are non alpha numeric example               1,"  jde7@&^%  "," &^!@  ",)(*&^," (*^%%^&*( "      my target is to work with all kind of characters non alpha numeric and alpha numeric as               (  A-Z , !@#$%^&&**( , 1-9 , etc )      I guess I need to replace the **[[:alnum:]]** with some other syntax. What do I need to change in my `awk` syntax in order to support all kind of characters?


title: Can I create override dns similar to writing in /etc/hosts without root access

text: I want to set a dns record that my browser will use, but I don't have root access, so I can't modify `/etc/hosts`. I need to do this for testing vhosts with apache, whose dns hasn't yet been set up. I have access to firefox, and chrome, so if there's a plugin that could facilitate it; or other options are helpful. **update:** the alternative to overriding the dns is probably modifying the HTTP headers, if the correct ones are sent to apache, the correct content should be returned.


title: Add files to an iso image and auto run a script post installation

text: I'd like to add a tar archive in the standard Red Hat installation CD image and untar the same at a desired location using some post install scripts. Can you kindly suggest me how to proceed? In particular:   1. How do I add the tar in the iso image.   2. Where should I place the script.   3. How to link the script so that it is executed at the end of the installation process.


title: USB HDD Enclosure works with Ubuntu, but not Raspbian

text: SOLVED: Even though the enclosure came with its own power supply, it required a powered USB hub, probably for some internal components that don't draw power from the main supply. I have this dual HDD enclosure. http://www.raidsonic.de/data/products/icybox/IB-3620/E_IB-3620_Series_manual_v1.1.pdf Basic model IB-3620U3. The enclosure implements JBOD(single) so the installed drives are seen separately by the OS. I have no problems when I plug the device into my Ubuntu 14.04 laptop, I can see both HDDs and the "usb" LED(that shows it is connected by USB) lights up on the device. However, when I plug the device into my Raspberry Pi, running Raspbian, the HDDs are not seen and even the "usb" LED on the front of the device does not light. ## Outputs (pastebin urls) ### Raspbian: `lsusb` `dmesg` `uname -a` `fdisk -l` (just SD card) ### Ubuntu(laptop): `lsusb` `dmesg` `uname -a` `fdisk -l` **Note:** If I power up the device, while already plugged into my raspberry pi, the device's "usb" LED lights up, but there is no difference. **Note2:** I know the device doesn't officially support Linux, but hardly anything does on the box. I have 2 of these USB HDD docks which work perfectly with Raspbian. http://www.amazon.co.uk/Optimized-Inateck-Including-Comaptible-Tool- Free/dp/B00GIDNLI6/ref=sr_1_1?s=computers&ie=UTF8&qid=1403606340&sr=1-1&keywords=inateck+dock **Note3:** One drive is ext4, and the other is NTFS. Thank you for any help getting this thing working in Raspbian ### Edit: As requested, here is `lsmod(unplugged)` `lsmod(plugged-in)` on the Ubuntu laptop. And, `lsmod(unplugged)`, for raspbian. Doesn't change after plugging the device in. At a glance, it looks like the top modules `usb-storage`, `ccm`, and `ctr`, are the only ones to change on the laptop when plugging the device in. Where do I got from here ?


title: How do I make a multi-threaded app use all the cores on Ubuntu under VMWare?

text: I have a multi-threaded C++ app (using pThreads) that processes a massive flat file that works great on Windows - uses all four cores on my puny CPU. Client wants to run the same code on Red Hat on a fire-breathing 64 Xeon CPU machine. So I compile it here (g++), ran it on Ubuntu on VMWare, and code only used one of the four cores. So I'm thinking that is a VMWare problem, and I send code to client - where it does the same thing (as far as I can tell remotely - mpstat -P ALL shows the CPUs barely loaded). Do I need to do something to force Red Hat to spread out the threads? Is there something I'm missing - I'm trying to get the "nice" priority changed next - but I feel like I'm missing something. I can post code - but like I said, works great on Windows, uses pThreads, etc.


title: Errors dual booting Ubuntu Studio 13.10 and Windows XP Pro x64 using GRUB 2

text: Getting the following errors when I try to boot Windows XP Professional x64 Edition (on /dev/sda1) using GRUB 2: error: no such device: A8542EOA542DDC36. error: invalid signature. I originally had XP Pro x64 installed, then I installed Ubuntu Studio 13.10 to a second hard drive sda0. Unfortunately, there is no option in the BIOS to select which hard drive to boot from, so I had to physically swap the hard drive cables to get the hard drive with Ubuntu Studio to boot. But I get the errors listed above when I select Windows XP Professional x64 Edition (on /dev/sda1) from the GRUB 2 menu. UbuntuStudio GNU/Linux (lowlatency) boots with no issues, I just also need to boot to XP x64 without swapping cables every time. Could this have something to do with the XP PRO x64 hard drive being EFI? I tried to install rEFInd but got errors during installation? Am I getting these errors because XP PRO x64 is installed on a secondary drive ( /dev/sda1) as opposed to trying to boot off the same drive ( /dev/sda0)? Any help appreciated!


title: mutt: bind CTRL+c to abort (CTRL+g)

text: In mutt, when I use the key combination `Ctrl`+`C`, I want it to behave as if I had pressed `Ctrl`+`G`. I understand that simple `bind`, such as the following, will not work:               bind    index   \Cc             <abort>      but there must be some way how to do it (perhaps some macro?). My question is similar to this question, but the accepted answer is not acceptable for me. I need some way how to solve this problem in mutt (and not in the terminal).


title: xmonad: default workspaces

text: I'm using xmonad with a dual monitor setup. Here is a stipped down version of my config:               import XMonad          main = do       xmonad $ defaultConfig {          workspaces  = ["1:db", "2:mail", "3:web", "4:dev", "5", "6", "7", "8:chat", "9", "10"]       }      Is there a way to configure it so that my left screen defaults to workspace `2:mail` and right screen to workspace `3:web` ?


title: Right button drag with synaptics

text: I thought it would be useful to tap-and-drag with two fingers, which would represent dragging with right mouse button. But after reviewing synaptic man options I can't see any option close to this. Is it possible?


title: Simple problem with netcat tool

text: Can anybody tell me why I am getting `bad request` while executing this command               echo -e "GET http://www.yellowpages.com.eg/Mjg3NF9VUkxfMTEwX2h0dHA6Ly93d3cubG90dXMtYWlyLmNvbV8=/Lotus-Air/profile.html HTTP/1.1\n\n" | nc www.yellowpages.com 80       The same web site opens fine in the browser.


title: purpose of run-parts(8) utility

text: At least under Debian-based systems, there is a `run-parts` utility in **debianutils** package which is used in various scripts. For example in /etc/X11/Xsession. It will run all the executable files found in a directory. Why is run-parts needed while one could use `find` with `-perm` option or `test` utility? In addition, what does `run-parts` consider as an executable file? Looks like it does not simply check the file permissions:               # run-parts --list --lsbsysinit /etc/X11/Xsession.d | tail -1     /etc/X11/Xsession.d/90x11-common_ssh-agent     # ls -l /etc/X11/Xsession.d/90x11-common_ssh-agent     -rw-r--r-- 1 root root 629 2010-11-02 23:17 /etc/X11/Xsession.d/90x11-common_ssh-agent     # head /etc/X11/Xsession.d/90x11-common_ssh-agent     # $Id: 90x11-common_ssh-agent 305 2005-07-03 18:51:43Z dnusinow $          # This file is sourced by Xsession(5), not executed.          STARTSSH=     SSHAGENT=/usr/bin/ssh-agent     SSHAGENTARGS=          if has_option use-ssh-agent; then       if [ -x "$SSHAGENT" ] && [ -z "$SSH_AUTH_SOCK" ] \     #


title: Can someone clarify this Bash script

text: I'm learning something about Bash scripting, and I came across this example: The task is to write a Bash script that reads a file, given with the first argument, pulls out those records that have the same ID which is given with the second argument and live in the place given with the third argument. So, the file is a list of users, with info about one user per line, and it looks something like this (ID, name, father's name, location, phone)               43  John  Mike  Smith  Boston  +3 685 123456      After the "filtering", I have to write the found data to standard output, with the following modifications : first letter of the location should be concatenated with the ID, and then the name should only contain the first letter of the father's name and a phone without any prefixes. The output for the given example would look like this:               B43 John M Smith 123456      The solution is:               #!/bin/bash     cat $1|grep "^$2[0-9]*.*$3  +[0-9]*\ [0-9]*\ [0-9]*"|     sed "s/\([0-9]*\)\t\(.*\)\t\(.\).*\t\(.*\)\t\(.\).*\t+[0-9]*\ [0-9]*\     \([0-9]*\)/\5\1 \2 \3 \4 \6/"      I don't understand what's the point of `|` vertical lines - I understand they are pipes, and the output data from one 'query' serves as a input data for another 'query'. By query I mean a shell command. I get the part with the `grep` command. I don't get the `sed` command. How exactly does this work? How does it 'know' to put the first letter of the location at the beginning of the line?


title: Why can't I add any iptables rule?

text: Why can't I add any iptables rule?               root@ROUTER:~# iptables -L INPUT -v     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)     pkts bytes target prot opt in out source destination     6934 685K ACCEPT 0 -- any any anywhere anywhere state RELATED,ESTABLISHED     0 0 DROP udp -- ppp0 any anywhere anywhere udp dpt:route     0 0 DROP udp -- br0 any anywhere anywhere udp dpt:route     0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:route     2 120 logaccept tcp -- any any anywhere ROUTER tcp dpt:22     0 0 DROP icmp -- ppp0 any anywhere anywhere     0 0 DROP igmp -- any any anywhere anywhere     5 350 ACCEPT 0 -- lo any anywhere anywhere state NEW     568 35947 logaccept 0 -- br0 any anywhere anywhere state NEW     339 38020 DROP 0 -- any any anywhere anywhere      Then I try to add a rule:               root@ROUTER:~# /usr/sbin/iptables -I INPUT -i ppp0 -m multiport --dport 21,22,23,53,67,80,443 -j DROP      But it didn't got added to the list:               root@ROUTER:~# iptables -L INPUT -v     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)     pkts bytes target prot opt in out source destination     6992 690K ACCEPT 0 -- any any anywhere anywhere state RELATED,ESTABLISHED     0 0 DROP udp -- ppp0 any anywhere anywhere udp dpt:route     0 0 DROP udp -- br0 any anywhere anywhere udp dpt:route     0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:route     2 120 logaccept tcp -- any any anywhere ROUTER tcp dpt:22     0 0 DROP icmp -- ppp0 any anywhere anywhere     0 0 DROP igmp -- any any anywhere anywhere     5 350 ACCEPT 0 -- lo any anywhere anywhere state NEW     569 36007 logaccept 0 -- br0 any anywhere anywhere state NEW     343 38428 DROP 0 -- any any anywhere anywhere      I try to add a rule again:               root@ROUTER:~# /usr/sbin/iptables -I INPUT -i ppp0 --dport 21 -j DROP      And see if there is any changes:               root@ROUTER:~# iptables -L INPUT -v     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)     pkts bytes target prot opt in out source destination     7142 704K ACCEPT 0 -- any any anywhere anywhere state RELATED,ESTABLISHED     0 0 DROP udp -- ppp0 any anywhere anywhere udp dpt:route     0 0 DROP udp -- br0 any anywhere anywhere udp dpt:route     0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:route     2 120 logaccept tcp -- any any anywhere ROUTER tcp dpt:22     0 0 DROP icmp -- ppp0 any anywhere anywhere     0 0 DROP igmp -- any any anywhere anywhere     5 350 ACCEPT 0 -- lo any anywhere anywhere state NEW     574 36309 logaccept 0 -- br0 any anywhere anywhere state NEW     346 38780 DROP 0 -- any any anywhere anywhere      But there isn't.. :D Version information:               root@ROUTER:~# iptables -V     iptables v1.3.7      WHY? Firmware: DD-WRT v24-sp2 (08/07/10) std


title: How to upgrade SSHD without the change of the server key?

text: So... we need to upgrade the SSHD. How can we do this without having that issue that the people (who are signing in through ssh) would see the message:               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@     @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@     IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!     Someone could be eavesdropping on you right now (man-in-the-middle attack)!     It is also possible that the RSA host key has just been changed.     The fingerprint for the RSA key sent by the remote host is     0e:a1:b1:40:85:a2:a7:03:17:1b:52:8f:10:c7:b3:d0.     Please contact your system administrator.     Add correct host key in /home/USERNAME/.ssh/known_hosts to get rid of this message.     Offending key in /home/USERNAME/.ssh/known_hosts:13     RSA host key for [192.168.1.1]:22 has changed and you have requested strict checking.     Host key verification failed.


title: Run Sys V Init daemon as certain user?

text: When I installed `dansguardian` from the repos a long time ago, it set itself up such that in `iptables`I could refer to it as `\--uid-owner dansguardian`, which allows me to allow/deny it access to certain ports, very handy. Now I've installed a more current version from source, I need reproduce this by hand. So far, I have found the lowest `uid` and `gid` available (below 1000) from `/etc/passwd` and `/etc/group`, then done the following (where 122 is first uid and 129 is first free gid):               groupadd -g 129 dansguardian      useradd -c 'DansGuardian web content filter' -u 122 -g dansguardian -s /bin/false -d '/var/log/dansguardian' dansguardian      chown -R dansguardian:dasnguardian /var/log/dansguardian      Now how to I ensure that dansguardian actually runs as the _user_ dansguardian?


title: netctl start PROFILE fails

text: Upon login to serial console I run a command via `/etc/profile`   `netctl start wlan0-ROUTENZUG`   However it fails, yielding this output `Job for netctl@wlan0\x2ROUTENZUG.service failed. See ´sytemctl status netctl@wlan0\x2ROUTENZUG.service´ and ´journalctl -xn for details.´` The latter contains nothing about that job, the first just tells me the job is dead.   I just tested: The command fails as well when given manually.


title: Have network always wait for a network connection?

text: Just as the title says, is there a way to tell Ubuntu Server to constantly wait for an ethernet connection after it gets disconnected? Use case: Ethernet cable gets unplugged (intentionally) for a long period of time, cable gets plugged back in, computer must be forcefully restarted to get on the network again


title: Why real time can be lower than user time

text: I have a script converting video files and I run it at server on test data and measure its time by `time`. In result I saw:               real    2m48.326s     user    6m57.498s     sys     0m3.120s      Why real time is that much lower than user time? Does this have any connection with multithreading? Or what else? **Edit:** And I think that script was running circa 2m48s


title: Trying to create tunnel to mysql through SSH

text: Im in a bit of a bind here. I have a client that want's me to set up his website, but he runs the server w/ SSH and CentOS 6.2 as it's OS. Now, I'm trying to add the sql server on Mysql Workbench for easy handling, but I cant connect to Mysql. The SSH connection works fine, and I get privileges with sudo, so to speak. The server guy said (and I use PuTTY by the way ): Open a tunnel on port 3306 (source) to dest: 127.0.0.1:3306 which is the mysql port. I have the user as "root" and have tried with the password I use to log on to my local sql (phpmyadmin) as root, and I've tried with no password. He also mentioned that the mysql server only responds to loopback. After this I havent gotten a hold of him, and have very limited time. If you have pointers / suggestions or help I'd be very glad. Thank you. **Edit:** After countless hours of failure, I noticed I had used the wrong username for the Mysql connection inside Workbench. I used the same as my SSH login, which was wrong in my case. I had to use my dedicated Mysql username (obviously). Thanks for the help, anyways!


title: How can I make bash not match `.` and `..` with `.*`

text: When I try to match all dot files in a directory with `.*` it seems to have a nasty side-effect: besides matching all (real) files and directories, it matches `.` and `..`.               bash-3.2$ mv test/.* dest/     mv: rename test/. to dest/.: Invalid argument     mv: test/.. and dest/.. are identical      This seems really weird, since they are basically 'fake' directories, just there to make relative paths easy. They are not part of the contents of a directory, and I don't ever want them matched when I try to move the contents of one directory to another directory. I can't think of any scenario where I would want them matched by `.*`. So how can I turn this off? (Besides using Z shell, which is not always available, and which may not be the shell in use by someone running a function I've written.)


title: Process substitution with tee and paste

text: I'm trying to pipe a command through the output of two other commands and then merge the results of the two process substitutions. An example that gets me close is:               command | tee >(sed -rn 's/.*foo (bar).*/1/p') >(awk '{print $3}')      However, I would like to achieve the following:   * I don't need to see the input stream of the original command   * I would like to use 'paste' to merge the results I suppose one option is to run two separate commands and put them into files, but that isn't as elegant as I would like. What is the most elegant (single liner, clearly understood) way to do this in bash?


title: how to select, copy columns of different file to form new files

text: I have four files each contain daily station data.   * file 1: prec   * file 2: minT   * file 3: maxT   * file 4: wind Here prec, minT, maxT and wind are files that store values of prec, minT, maxT and wind for stations 1 through n. I want to store the data for each station like:               for station 1: prec minT maxT wind          station 2: prec minT maxT wind         .         .         .         .         station n: prec minT maxT wind      ### EDIT #1 My four data fies look like as follows: _Prec_               1        2        3        4        5        6        7        8     0        0        0        0        0        0        0        0     0.254        0.254        0.254        0.254        0.254        0.254        0.254        0.254     0        0        0        0        0        0        0        0      _Tmin_               1          2          3          4          5          6          7          8     -23.349        -23.339        -23.327        -23.316        -23.303        -23.291        -23.278        -23.266     -23.682        -23.683        -23.685        -23.687        -23.689        -23.692        -23.695        -23.698     -24.302        -24.301        -24.3        -24.299        -24.299        -24.299        -24.3        -24.302      _Tmax_                1         2         3         4         5         6         7         8     -17.087        -17.082        -17.077        -17.072        -17.066        -17.06        -17.053        -17.046     -20.082        -20.095        -20.109        -20.124        -20.14        -20.157        -20.174        -20.191     -20.48        -20.481        -20.483        -20.485        -20.486        -20.488        -20.489        -20.49      _wind_               1        2        3        4        5        6        7        8     0        0        0        0        0        0        0        0     1.778        1.778        1.778        1.778        1.778        1.778        1.778        1.778     1.652        1.653        1.654        1.654        1.655        1.656        1.657        1.658      I want to format the data file for each point it's named with (that is for points 1 to 8) as below: _1_               0        -23.349        -17.087        0     0.254        -23.682        -20.082        0     0        -24.302        -20.48        1.778      _2_               0        -23.339        -17.082        0     0.254      -23.683        -20.095        0     0        -24.301        -20.481        1.778      ...and so on... to `n`. Where the columns in each file would be: `nprec`, `nTmin`, `nTmax`, and `nwind`.


title: Apache - Dynamic Subfolders

text: How does YouTube make folders dynamic? For example you can access people's channels in the root directory, like: > http://youtube.com/PewDiePie Making a new folder for each channel is most obviously not how they do it, and they also have links like: > http://youtube.com/PewDiePie/about Is this done with htaccess, Apache, or is it something with PHP that I should ask on StackOverflow?


title: gnuclad does not change starting date

text: I'm using `gnuclad` to create a tree. The problem is that I'm not able to change the starting date. I'm using the data below, from the default example.               #,Nodes,,,,,,,,,,,,,     #,Name,Color,Parent,Start,Stop,Icon,Description,[Namechange,When,Description,[Namechange,When,Description,". . . ]]"     N,Name here,#f00,,2002/12/01,2007/08/20,,,,,,,,,      As you can see on the image, the node starts always at January. ![enter image description here](http://i.stack.imgur.com/pBd4C.png) Also, is it possible to turn off the title box without editing the `conf` file? The config file `example.conf` is the default one:               # gnuclad example config file     # gnuclad has more than 50 configuration options, of     # which only a few are listed here.     # For a detailed explanation, consult the included manual.     # You can always generate a full configuration file by     # specifying CONF as gnuclad's output.               # If you comment or delete an option,     # gnuclad will use the built-in defaults.     # Allowed syntax is:     #   option=value     #   option = value     #   option= 'value'     #   option ="value"     #   option = three word value     #   option = "three word value"     #   ...               infoBoxTitle = Title     infoBoxText = Lorem ipsum dolor sit amet,     infoBoxText = consectetuer adipiscing elit     infoBoxX = 10     infoBoxY = 45     infoBoxWidth = 166     infoBoxHeight = 60          # use ascii string width heuristics     asciiStrings = 1          # orientation goes from 0 to 3     orientation = 0          #treemode goes from 0 to 2     treeMode = 0          mainBackground = #fff     rulerWidth = 2     rulerColor = #ddd     rulerMonthWidth = 1     rulerMonthColor = #eaeaea          lineWidth = 4     offsetPX = 20     yearPX = 100          labelFontColor = #000     labelBGOpacity = 50          #nameChangeType can be 0 or 1     nameChangeType = 0          #derivType can be 0 or 1     derivType = 0     dotRadius = 10     smallDotRadius = 5          descriptionType = 1


title: axelget, yum and crccheck failed

text: I want to increase my download speed with yum and finally found a solution (axelget) that works fine at the beginning. But after one time work, I get an error and I cannot use it any more because of "crc" problem!               [root@dhcppc0 ali]# yum update -y     Loaded plugins: axelget, fastestmirror, langpacks, presto, refresh-packagekit     No metadata available for fedora     No metadata available for google-chrome     No metadata available for rpmfusion-free     No metadata available for rpmfusion-free-updates     No metadata available for rpmfusion-nonfree     No metadata available for rpmfusion-nonfree-updates     No metadata available for updates     Finish Download MetaData of Enabled Repo     Loading mirror speeds from cached hostfile      * fedora: www.ftp.ne.jp      * rpmfusion-free: mirror.nexcess.net      * rpmfusion-free-updates: mirror.nexcess.net      * rpmfusion-nonfree: mirror.nexcess.net      * rpmfusion-nonfree-updates: mirror.nexcess.net      * updates: www.ftp.ne.jp     Resolving Dependencies     ...     Upgrade  11 Packages     Total download size: 6.8 M     Downloading Packages:          CRC check failed 0x84dd7640 != 0xbf02314L      Here is another log :               [root@dhcppc0 ali]# yum install axel     Loaded plugins: axelget, fastestmirror, langpacks, presto, refresh-packagekit     fedora/18/x86_64/metalink                                                             | 9.7 kB  00:00:00          google-chrome                                                                         |  951 B  00:00:00          rpmfusion-free                                                                        | 3.3 kB  00:00:00          rpmfusion-free-updates                                                                | 3.3 kB  00:00:00          rpmfusion-nonfree                                                                     | 3.3 kB  00:00:00          rpmfusion-nonfree-updates                                                             | 3.3 kB  00:00:00          updates/18/x86_64/metalink                                                            | 5.7 kB  00:00:00          (1/2): rpmfusion-nonfree-updates/primary_db                                           | 133 kB  00:00:04          (2/2): rpmfusion-free-updates/primary_db                                              | 329 kB  00:00:12          repomd.xml                                                                            | 4.2 kB  00:00:00          Initializing download: tp://ftp.riken.jp/Linux/fedora/releases/18/Everything/x86_64/os/repodata/7606e9d3ed634ddab6e4f2317fe2b647f7f20f00cc183613338d3929e2c4ccc0-prestodelta.xml.gz     File size: 1574148 bytes     Opening output file /var/cache/yum/x86_64/18/fedora/7606e9d3ed634ddab6e4f2317fe2b647f7f20f00cc183613338d3929e2c4ccc0-prestodelta.xml.gz     Starting download          Connection 0 finished                                                          ]     Connection 3 finished                                                          ]     Connection 1 finished                                                          ]     Connection 2 finished                                                          ]     [100%] [..................................................] [  43.5KB/s] [00:00]          Downloaded 1537.3 kilobytes in 35 seconds. (43.54 KB/s)     update fedora metadata sucessfully     repomd.xml                                                                            |  951 B  00:00:00          update google-chrome metadata sucessfully     repomd.xml                                                                            | 3.3 kB  00:00:00          update rpmfusion-free metadata sucessfully     repomd.xml                                                                            | 3.3 kB  00:00:00          update rpmfusion-free-updates metadata sucessfully     repomd.xml                                                                            | 3.3 kB  00:00:00          update rpmfusion-nonfree metadata sucessfully     repomd.xml                                                                            | 3.3 kB  00:00:00          update rpmfusion-nonfree-updates metadata sucessfully     repomd.xml                                                                            | 4.7 kB  00:00:00          Initializing download: tp://ftp.riken.jp/Linux/fedora/updates/18/x86_64/repodata/1767a570ae94a2e780bc276e5e0afb66788e1ac1e296d93e8292c593ccc39856-prestodelta.xml.gz     File size: 2301411 bytes     Opening output file /var/cache/yum/x86_64/18/updates/1767a570ae94a2e780bc276e5e0afb66788e1ac1e296d93e8292c593ccc39856-prestodelta.xml.gz     Starting download          Connection 3 finished                                                          ]     Connection 2 finished                                                          ]     Connection 1 finished                                                          ]     Connection 0 finished                                                          ]     [100%] [..................................................] [  37.2KB/s] [00:00]          Downloaded 2247.5 kilobytes in 1:00 seconds. (37.19 KB/s)     update updates metadata sucessfully     Finish Download MetaData of Enabled Repo     Loading mirror speeds from cached hostfile      * fedora: ftp.riken.jp      * rpmfusion-free: mirror.liberty.edu      * rpmfusion-free-updates: mirror.liberty.edu      * rpmfusion-nonfree: mirror.liberty.edu      * rpmfusion-nonfree-updates: mirror.liberty.edu      * updates: ftp.riken.jp     Package axel-2.4-7.fc18.x86_64 already installed and latest version     Nothing to do     [root@dhcppc0 ali]# yum update -y     Loaded plugins: axelget, fastestmirror, langpacks, presto, refresh-packagekit     No metadata available for fedora     No metadata available for google-chrome     No metadata available for rpmfusion-free     No metadata available for rpmfusion-free-updates     No metadata available for rpmfusion-nonfree     No metadata available for rpmfusion-nonfree-updates     No metadata available for updates     Finish Download MetaData of Enabled Repo     Loading mirror speeds from cached hostfile      * fedora: ftp.kddilabs.jp      * rpmfusion-free: mirror.nexcess.net      * rpmfusion-free-updates: mirror.nexcess.net      * rpmfusion-nonfree: mirror.nexcess.net      * rpmfusion-nonfree-updates: mirror.nexcess.net      * updates: ftp.kddilabs.jp     Resolving Dependencies     --> Running transaction check     ...     Upgrade  11 Packages          Total download size: 6.8 M     Downloading Packages:               CRC check failed 0x84dd7640 != 0xbf02314L      What is "crc" and how can this problem be solved? Installed Packages:               Name : axel     Arch : x86_64     Version : 2.4     Release : 7.fc18      This is on Fedora 18 **Edit (My solution) :** run this commands :               yum clean expire-cache     yum clean dbcache      then disable fastestmirror plugin and update your cache(yum update). now install some package and see if use axelget for downloading, active fastestmirror .


title: Making a directory protected from 'rm -rf'

text: I just lost some data in folder A which was inside folder B after doing `rm -rf B`. Before I could realize what have I done, it was all over. Now a lesson is learnt, I wish to make some of my folder idiot-proof to avoid a next time when I do something similar and want to kill myself. One way I can think of is to write a bash function and alias it to `rm`. This function will look into each sub-folder for a hidden file such as `.dontdelete`. When found, it would ask if I really want to continue. I can not make is write-protected since there is a process which constantly write to this folder. Is there any better way to do it?


title: Redirecting output of program reading from stdin

text: When I want to redirect an output of _a.out_ program I will use               ./a.out > output.txt      This doesn't work when the program reads something from _stdin_. How would you redirect output in this case? I can do it only with               ./a.out < inputs.txt > output.txt      Can I do the same but reading inputs from _stdin_? EDIT: I realized that it works, but I can't see prompts because everything goes to file _output.txt_. So, the only problem is to see prompts on _stdin_ and preserve redirection at the same time.


title: Message after sudden shutdown

text: After the computer shuts down suddenly unexpectedly without notification, is there a way to know the reason (read messages) the next time when I boot? My computer frequently shuts down, and I don't even know if it is a software problem, a hardware problem, or a firmware problem.


I use               myscript > my.log 2>&1 &      to run a script and collect it's output - so that when I logout - the script will still be running. It I were to start it with `myscript &` - it will be terminated right after logout. But that's a strange effect: all that `> my.log 2>&1 &` does is redirect stderr to stdout... Why `> my.log 2>&1 &` causes the job to sustain log out?


title: Translating user id when creating image

text: I want to create an image (for example ext3 image) from a given directory hierarchy. This directory hierarchy is owned by a given user. But on the final image, I want the files to be owned by superuser. Is there a solution for tranlating the user uid / gid to 0 ? Here is a pseudo workflow :   1. Create file hierarchy, as user in `/home/user/rootfs`   2. Create an ext3 img on a file   3. loop mount the empty img (as user or root) in `/somewhere/loopmount`   4. `cp -R --magic_uid_options 500=0 /home/user/rootfs /somewhere/loopmount` Or step 4 could be a normal copy and step 5 a clever find that would `chown` and `chgrp` recursively. Is there well known solution to this kind of problem ?


title: Ctrl + c will not kill process

text: I have looked for answers and so far have found nothing to answer my question. I am currently logging in to my Ubuntu server and upon running a process I can not run any of the interrupts on it. Here is my stty -a:               user@Ubuntu1:~$ stty -a     speed 38400 baud; rows 93; columns 200; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;     swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;     flush = ^O; min = 1; time = 0;      I have nothing in my .bashrc that changes the interrupts. This is the same for all the users including root. I have also tried logging in from different locations using different terminals and every time this same result appears. I have used both ssh and ssh -X to log in. Edit: Locally all my interrupts work fine. Update: I am still looking for an answer. My friend has exactly the same problem. The issue seems very much to be that when logging in (from PC, Mac, Linux) the keyboard is not picking up these keys (even though correctly mapped).


title: I want to set up a basic cron job that sends an email

text: I am running OS X 10.7 and I am learning unix commands. I would like to set up a very basic cron job that sends me an email with a certain message. How would I go about this. From what I have read, I should receive an email automatically unless I specify otherwise. I don't seem to have the crontab file in the /etc directory. Any help is more than appreciated.


title: Ubuntu 11.10 Server: create user, home directory, sudo privileges: command line only

text: I have a rackspace server and I'm having problems with configuration. I need to lock it down and throw away the key, because right now I can only login with root to do anything substantial. I also am set up on MySQL with my root username and password and would like to change this. I have created a new user and given him a home directory for /var/www so I can administer my website through FTP. However, I can't run any sudo commands as that user (it returns an error, and tells me the action would be logged) I want to create a catch-all account that starts in a typical home directory like /Users/justin but with sudo privileges to escalate to install and update software packages. I also want to fix MySQL so it has its very own login/pass (because right now it's root/rootpass) This is on Rackspace so I can only access the server through SSH. OS is Ubuntu 11.10. Thanks for your time.


title: How can I set a bash alias that evaluates $() when run?

text: I set up an alias:               alias gpgagentexport="eval $(cat ~/.gpg-agent-info) ; export GPG_AGENT_INFO"      However when I source my `.bashrc` the `$(cat ...)` is evaluated at that point. But I want to evaluate it when I run the alias `gpgagentexport` (after the contents of `~/.gpg-agent-info` has changed). So is there some sort of escaping, quoting or syntax to achieve that?


title: Enable kernel module for VPN

text: I'm trying to turn on modules for VPN so I followed this tutorial to compile new ubuntu kernel 3.8.6 .   But the features I've turned on using `make menuconfig` seem not to be enabled. (the features I want : `net_key`, `inet_esp`, `crypto_hmac`, etc..)   I've tried to make `gre` tunnel which modules are not loaded automatically by editing /etc/rc.local and adding `modprobe ip_gre` so it would start after reboot. My questions are:   1. How to check the VPN features I've enabled using `menuconfig` are truly enabled?   2. Is it possilbe to enable the modules manually (like `ip_gre`) by editing `rc.local`? I'm using ubuntu server 12.04 on VBOX 4.2.10


title: Seagate external drive freeze problem

text: I've recently bought a Seagate STBU1000200 1TB external usb hard drive. The first thing I did was to delete the NTFS partition and create an ext4 one with Gparted. Ever since, I'm facing strange freeze issues; usually during reading or copying to the drive. The hard drive will freeze (or crash) and will automatically unmount. `dmesg` output follows:               [15051.558012] sd 8:0:0:0: [sdb] Unhandled error code     [15051.558017] sd 8:0:0:0: [sdb]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     [15051.558024] sd 8:0:0:0: [sdb] CDB: Read(10): 28 00 00 36 ae f0 00 00 f0 00     [15051.558036] end_request: I/O error, dev sdb, sector 3583728     [15051.558089] sd 8:0:0:0: [sdb] Unhandled error code     [15051.558094] sd 8:0:0:0: [sdb]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     [15051.558102] sd 8:0:0:0: [sdb] CDB: Read(10): 28 00 00 36 af e0 00 00 10 00     [15051.558114] end_request: I/O error, dev sdb, sector 3583968     [15051.722298] sd 8:0:0:0: [sdb] Synchronizing SCSI cache     [15051.722338] sd 8:0:0:0: [sdb]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     [15056.558280] Aborting journal on device sdb1-8.     [15056.558287] Buffer I/O error on device sdb1, logical block 121667584     [15056.558289] lost page write due to I/O error on sdb1     [15056.558291] JBD2: I/O error detected when updating journal superblock for sdb1-8.      Any ideas? I'm running Debian 6.0 64bit.


title: Comparing Indices of two strings

text: I have two double quoted strings of same length, that look like this: `"$con"` - (consists of spaces and *'s):                                       *   ******       *** ** *                  **               and `"$prot"` - (consists of letters and -'s):               M-ASDFRMKAWRGMLMI----WSGRCYYYYHQFLIMASDFRMKAMKAWWSGRCYNSHPPAAQVFYWLGLLSDVAGSALEAQ      How do I extract the string of letters at the same position in `$prot` corresponding to the position of *'s in `$con`.


title: Execute command supplied by function parameters

text: I'm trying to create a function method in a bash script that executes a command which is supplied to the method by the paramters. Meaning somethings like this:               special_execute()     {         # Some code              # Here's the point where the command gets executed         $@              # More code     }          special_execute echo "abc"      I already tried I `$@`, `"$@"`, `$*`, `"$*"` how could I do that?


title: Dial up interface query

text: I am using Fedora 13. I have three NIC's in my device, and I have configured dial up on third interface (`eth2`). After network restart, when I fire `ifconfig`, I can see entries as `eth0`, `eth1`, `eth2` and `ppp0`. My questions are:   1. Why can't I see dial up in `eth2` itself? Why there is a separate entry for `ppp0`, although I have configured dial up in `eth2`?   2. How to determine the actual dial up interface (here `eth2`) just by looking at `ifconfig` output? (How to determine that `ppp0`'s configuration is in `eth2`?) The following is my `ifcfg-eth2`:               # Interface Settings: eth2 (PPPoE/ Dialup)     TYPE=xDSL       DEVICE=eth2       BOOTPROTO=dialup       USERCTL=yes       IPV6INIT=no       PEERDNS=no       PIDFILE=/var/run/pppoe-adsl-eth2.pid       FIREWALL=NONE       PING=.       PPPOE_TIMEOUT=80       LCP_FAILURE=3       LCP_INTERVAL=20       CLAMPMSS=1412       CONNECT_POLL=6       CONNECT_TIMEOUT=60       PERSIST=yes       SYNCHRONOUS=no       DEFROUTE=no       USER=user       ETH=eth2       PROVIDER=eth2       DEMAND=no       ONBOOT=yes       LIVE_IP=Yes       PPP_PASSWORD=password       SERVICENAME=       ISP_Name=EXT-2


title: Is there any mitigation against touch date/time forgery?

text: I have been using `touch -t` to change time of a file when I started using Linux, is there any mitigation against `touch` date/time forgery? Like, echoing original created date and time, even after using touch.


title: Possible to dual boot Linux Mint on any Windows 8 laptop?

text: I'm searching for a new laptop, and I'm currently considering getting an ASUS N56VZRH71. Everything spec-wise looks good (except for the absence of an SSD), but **I want to know if I'll be able to dual boot Linux Mint and Windows 8 on it**. I use Windows for most gaming, but I use Mint for work, and I'm confused about how Secure Boot affects computers. Also, if I find another laptop I'm interested in, how can I tell whether or not I'll be able to dual boot Linux and Windows on that?


title: Problem with find and variables

text: I have tried different variations of the following but nothing seems to work Basically when `find` gets executed nothing appears to happen. Below I present my bash function code and my output when I run it. I am interested in understanding what happens with the code below and why it doesn't behave as when I type the command explicitly. Also I got told I will not have access to rgrep in some boxes I will be working on and thus I try this approach for a generic solution to grepping for code etc.               function findin() {                                                                                if [ -z $1 ] ; then                                                                                echo "Usage: findin <file pattern> <<grep arguments>>"                                              return 1                                                                                fi                                                                                fIn[1]=$1                                                                                shift                                                                                fIn[2]="$@"                                                                                echo -- "${fIn[1]}"                                                                                echo -- "'${fIn[2]}'"                                                                                find -type f -name "'${fIn[1]}'" -print0 | xargs -0 grep --color=auto ${fIn[2]}                               }           And the output is:               $ ls     Server.tcl  Server.tcl~  test.cfg  vimLearning.txt     $ find -type f -name '*.txt' -print0 | xargs -0 grep --color=auto char     x      deletes char under cursor. NNx deletes NN chars to RHS of cursor.     r      type r and the next char you type will replace the char under the cursor.      $ findin '*.txt' char       -- *.txt     -- 'char'     $


title: Calibrate LCD display in laptop?

text: I installed Crunchbang Linux. I successfully installed the ATI drivers, and all works well. Except that the colors are bit weird. Hard to say what _exactly_ is wrong, it is the notion that on another laptop (or windows on the same laptop) everything looks _better_. It's probably some combination of brightness/contrast/gamma settings. Is there any comfortable way to adjust the display settings under Crunchbang, or Linux in general? Some nice calibration tool? I don't need a photography- quality display. I used `aticonfig` to djust brigtness and contrast, and `xgamma` for gamma. but they are not very handy.


title: soundblaster live 5.1: both output connectors to work?

text: I have an soundblaster live 5.1. wit emu10k1 chipset. I got my soundcard working now in Linux Mint 13 xfce. that is for 1 output port. I also want the other to work. How can I get my system to have both ports have the same output? I have to output connectors for speakers for 5.1 surround. In Pulse audio there are several ways to configure my card but none of them is giving sound through both ports. I have configured my card in Kmix as `analog surround 5.0 output' and I can hear the 'rear left' and 'rear right' but I do not want a rear left/rear right. I want this port to have the same as the other, so in this case: I would like to hear 'front left' 'front right'. I have numerous options to choose from: https://www.dropbox.com/s/l49xrg3vyt7mu5b/soundblaster%20opties.png Can I achieve this? I guess it should be possible somehow....


title: If NM_CONTROLLED not set what is the default value?

text: If /etc/sysconfig/network-scripts/eth0 does not include any NM_CONTROLLED setting, what's the default behaviour?


title: Is it possible to determine what is inside Debian package without installing it?

text: I need a markdown library for development - based on package names I could not understand which one I should install...               den@playground:~$ sudo aptitude search markdown     p   html2markdown                                                          - convert HTML page into ascii markdown format     p   libhtml-wikiconverter-markdown-perl                                    - HTML to wiki markup converter - MoinMoin dialect     p   liblua5.1-markdown0                                                    - A pure lua5.1 implementation of the Markdown text-to-html markup     p   libmarkdown-php                                                        - PHP library for rendering Markdown data     p   libpod-markdown-perl                                                   - module to convert POD to the Markdown file format     p   libtext-markdown-perl                                                  - Markdown and MultiMarkdown markup languages library     p   libtext-multimarkdown-perl                                             - Perl module to convert MultiMarkdown syntax to (X)HTML     p   markdown                                                               - Text-to-HTML conversion tool     p   python-markdown                                                        - text-to-HTML conversion library/tool


title: Redistributable completion for my bash scripts

text: Is there a simple way to embed the completion features inside a script, for bash ? I have a script that I want to redistribute, but I can't ask the people to add something inside their `/etc/bash_completion.d` in order for them to get the completion working fot my script...


title: How do I navigate to sabnzbd.ini in Debian?

text: I need to locate this file, and apparently it's in ~/.sabnzbd/. Total Linux newcomer here, how do I access that file?


title: Passing Command Line Arguments to java From JPackage Script

text: I installed Rachota -- a time tracking program written in Java -- from the Fedora repo, and yum installed the `rachota.jar` file to `/usr/share/java`, but it also created a script at `/usr/bin/rachota`. That script is used to launch Rachota, instead of calling `java` directly. I'm trying to figure out if there's a way to pass command line arguments to the `/usr/bin/rachota` script and get them passed to `java`. The script is part of the JPackage project and looks like this:               #!/bin/sh     #     # rachota script     # JPackage Project <http://www.jpackage.org/>          # Source functions library     _prefer_jre="true"     . /usr/share/java-utils/java-functions          # Source system prefs     if [ -f /etc/java/rachota.conf ] ; then       . /etc/java/rachota.conf     fi          # Source user prefs     if [ -f $HOME/.rachotarc ] ; then       . $HOME/.rachotarc     fi          # Configuration     MAIN_CLASS=org.cesilko.rachota.gui.MainWindow     BASE_FLAGS=""     BASE_OPTIONS=""     BASE_JARS="rachota"          # Set parameters     set_jvm     set_classpath $BASE_JARS     set_flags $BASE_FLAGS     set_options $BASE_OPTIONS          # Let's start     run "$@"      Obviously it's parsing `/etc/java/rachota.conf` and `$HOME/rachotarc`, but my shell scripting experience is pretty limited, and I can't figure out what to put in the `$HOME/.rachotarc` file to pass the arguments. This is the java command I want to eventually run: `java -Duser.language=en -Duser.country=GB -jar /usr/share/java/rachota.jar` The `jar` parameter is passed automatically, but I want to pass the `Duser.language` and `Duser.country` parameters too.


title: Is there a way to get "top" to run exactly once and exit?

text: I find the output of the shell command `top` to be a simple and familiar way to get a rough idea of the health of a machine. I'd like to serve `top`'s output (or something very similar to it) from a tiny web server on a machine for crude monitoring purposes. Is there a way to get top to write its textual output exactly _once_ , without formatting characters? I've tried this:               (sleep 1; echo 'q') | top > output.txt      This seems to be _close_ to what I want, except that (1) there's no guarantee that I won't get more or less than one screenful of info and (2) I have to strip out all the terminal formatting characters. Or is there some other `top`-like command that lists both machine-wide and process-level memory/CPU usage/uptime info? (Ideally, I'd love a strategy that's portable to both Linux and Mac OS X, since our devs use Macs and our prod environment is Linux.)


title: Where is the system profile that gets sourced at login on CentOS 5.8?

text: In CentOS release 5.8 (Final), where is the bash system profile? Is it /etc/profile ? I've added the following to source my ~/.bashrc file but haven't had any luck as it fails. I know it fails because I've changed the $PS1. I also think it may be caused because I have WHM setup.


title: How do I wait on a program started in another shell

text: I have a program that does a large a amount of work (takes about 4-5 hours) that gets started by cron when all the data it works with becomes available. Sometimes, when I am waiting for it to finish, I would like to be able to have another (interactive) program start when it finishes. the wait call looks promising but will only wait for children.


title: 'is a directory' error when trying to pass directory name into function

text: **Note: I am a newbie to bash scripting** In my bash script, I use find to get the folder names by wildcard:               for i in $(find ${directory} -mindepth 1 -type d -name ${wildcard});     do       stuff=doStuff ${i}     done          doStuff() {       echo ${1}       return ${1}'/hello';     }      The problem is that when I do this, I get the following error (lets say that ${i} correspond to 'home/me/my_directory'):               line 111: '/home/me/my_directory': is a directory.       (line 111 is the line with 'doStuff') I've tried doing this, to no avail:               for i in $(find ${directory} -mindepth 1 -type d -name ${wildcard});     do       stuff=doStuff "${i}"     done      Apparently it is because the program is trying to execute the directory, but I just want it as a string that I can manipulate.


title: Shebang: History and Purpose

text: I have few questions about the magic number `#!`, the shebang.   I read that it was introduced by Dennis Ritchie in the 70s as a way to see a script as an executable file.   I don't understand, why it was introduced. What brought him to introduce it? What did he like?   The second think I don't understand is: why do I need to declare the script as an executable? I mean why do I have to do `chmod +x myscript`?   I think in the following way, once I put the string `#! myinterpter` then when I will make `./myscript` the OS will take this file, it will see that it contains the shebang and then it will call the appropriate interpreter. So why do I need to use `chmod +x`? Why do the OS (unix, linux) needs me to put my script as an executable?


title: How can I add a still image inside a video with avconv or opensource software

text: I would like to add a still image inside a **h264** video following an `in` and `out` point in time. I would like to use only opensource/free Linux/Debian packages. I tried a lot of things with `avconv` like overlay filter and multiple inputs but not able to accomplish what am trying to do. **EDIT :** I've been sucessful with the MLT framework. http://www.mltframework.org/bin/view/MLT/MltMelt


title: What is the difference between path and directory?

text: I don't understand the difference between path and directory. Could someone explain to me with examples?


title: Can an entire ext3 filesystem be corrupted if the system loses power?

text: I understand that any files being written to during power loss can get corrupted, but is it possible for an entire ext3 filesystem to become corrupted during a power loss event? If so, how? Thanks!


title: Is this kernel warning a major problem that needs my attention?

text: Our Linux based Thecus N12000 NAS recently experienced this message in its `dmesg` log.               [2014-05-21 11:34:56]  ------------[ cut here ]------------     [2014-05-21 11:34:56]  WARNING: at net/ipv4/tcp_input.c:2966 tcp_ack+0xd88/0x1a1c()     [2014-05-21 11:34:56]  Hardware name: IRONLAKE & IBEX PEAK Chipset     [2014-05-21 11:34:56]  Modules linked in: nfsd lockd nfs_acl auth_rpcgss sunrpc iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ntfs ses enclosure usblp usb_storage usbhid xhci_hcd uhci_hcd ehci_hcd usbcore sg be2net tehuti igb ixgbe dca e1000e drm_kms_helper drm video backlight sata_sil24 mpt2sas ahci libahci ata_piix     [2014-05-21 11:34:56]  Pid: 1710, comm: smbd Not tainted 2.6.38 #1     [2014-05-21 11:34:56]  Call Trace:     [2014-05-21 11:34:56]   [<ffffffff8103118e>] ? warn_slowpath_common+0x78/0x8c     [2014-05-21 11:34:56]   [<ffffffff81391339>] ? tcp_ack+0xd88/0x1a1c     [2014-05-21 11:34:56]   [<ffffffff81392ca5>] ? tcp_rcv_established+0x780/0x9d1     [2014-05-21 11:34:56]   [<ffffffff81392d42>] ? tcp_rcv_established+0x81d/0x9d1     [2014-05-21 11:34:56]   [<ffffffff8139a52d>] ? tcp_v4_do_rcv+0x1a1/0x377     [2014-05-21 11:34:56]   [<ffffffff8139a52d>] ? tcp_v4_do_rcv+0x1a1/0x377     [2014-05-21 11:34:56]   [<ffffffff81413149>] ? _raw_spin_lock_bh+0x9/0x1f     [2014-05-21 11:34:56]   [<ffffffff8135374c>] ? release_sock+0x19/0x103     [2014-05-21 11:34:56]   [<ffffffff81413149>] ? _raw_spin_lock_bh+0x9/0x1f     [2014-05-21 11:34:56]   [<ffffffff813537cd>] ? release_sock+0x9a/0x103     [2014-05-21 11:34:56]   [<ffffffff8138a89a>] ? tcp_recvmsg+0x48f/0x9f5     [2014-05-21 11:34:56]   [<ffffffff8138c24d>] ? tcp_sendpage+0x595/0x5a7     [2014-05-21 11:34:56]   [<ffffffff81350048>] ? sock_sendmsg+0xc3/0xe0     [2014-05-21 11:34:56]   [<ffffffff813a5f60>] ? inet_recvmsg+0x64/0x75     [2014-05-21 11:34:56]   [<ffffffff8134f84e>] ? sock_sendpage+0x36/0x3d     [2014-05-21 11:34:56]   [<ffffffff8134f7aa>] ? sock_aio_read+0x126/0x13a     [2014-05-21 11:34:56]   [<ffffffff810a0f4d>] ? do_sync_read+0xb1/0xea     [2014-05-21 11:34:56]   [<ffffffff810a1921>] ? vfs_read+0xbd/0x12d     [2014-05-21 11:34:56]   [<ffffffff810a1a47>] ? sys_read+0x45/0x6e     [2014-05-21 11:34:56]   [<ffffffff810027fb>] ? system_call_fastpath+0x16/0x1b     [2014-05-21 11:34:56]  ---[ end trace cdaf61db513385a1 ]---      In researching this error message I've only found the following info:               if (WARN_ON(!tp->sacked_out && tp->fackets_out))         tp->fackets_out = 0;      I also found this similar error on the oops.kernel.org site, WARNING: at net/ipv4/tcp_input.c:2966 tcp_ack+0xdbe/0x1f80. Is this just a non-issue warning that we can ignore is is symptomatic of something else that I should be concerned with? ### Isn't this an appliance? **NOTE:** Though this is a Linux appliance, of sorts, it's actually based on CentOS. I've brought binaries built on CentOS 5 onto the box from time to time and they've run without issues. Tools such as `df` for example.               $ uname -a     Linux tank 2.6.38 #1 SMP Fri Oct 26 14:35:05 CST 2012 x86_64 GNU/Linux      ### References   * User's Manual for N12000   * N12000 product pages


title: GVim compiled from source opened via SSH -X does not copy paste on selection

text: I'm using SSH (with -X specified) from a Ubuntu box to a RHEL4 box and running GVim. It opens as expected in my local X, but the copy and paste via select doesn't work. I cannot select text in GVim and paste in a local window, nor can I select text from a local window and paste in GVim. This works, however, when I SSH (with -X specified) to a different RHEL4 box. Is there something I need to install on the remote machine? _**EDIT_** : I'm suspecting that it has something to do with the compile flags I used, but I don't have a clue which one. I've tried `\--enable-gnome-check` and `\--enable-gtk2-check`, since I'm running gnome on my local machine, but that did not resolve the issue. _**EDIT_** : Running `vim --version` on both versions of vim shows many differences, the most notable being that the machine which has no issue is for the _GTK_ GUI and the machine which does have an issue is for the _X11-Motif_ GUI. I can't configure the problem box to use _GTK_ though since I don't have everything I need installed. **EDIT**   * Thanks for the help so far, guys.   * To clarify, copy/paste via select works on a GVim window spawned from box A, but not on a GVim window spawned from box B. Both box A and box B are RHEL4 U8.    * When I select some text in the GVim window, I can paste it via right-click within that window, but I cannot paste it into anything running locally. When I select something locally, I can paste it locally but when I paste into the GVim window, it pastes the last thing selected in the GVim window, not the last thing selected locally.   * Just to make it a bit freakier, _sometimes_ I open a second GVim window from the same box, I can paste into that second window (though still not the first), but I still cannot select something in that window and paste it locally.   * I get the same behaviour using Ctrl-Shift-C. Holding shift while selecting with the mouse prevents selecting. Ctrl-Shift-V starts block selection in vim, not pasting.   * I am running Parcellite 0.9.2 on the local box, but closing it doesn't make the problem go away, and it is not interfering with the other box. **EDIT**   * The machine that is presenting the problem is a vitual machine running on VM Player. **EDIT**   * A co-worker that is also SSHing to a virtual RHES4 U8 box does not have the same issue but he used the **stock vim install** on the VM whereas myself and another co-worker with the problem **compiled vim from source**. Could there be a compile flag we need?   * I tried installing VM tools on one of the VMs, but it had no effect on this issue. **EDIT**   * The .vimrc between my two boxes is the same, scp'ed over.


title: umask base permissions on usb drive

text: On linux, the base permission for a file is 666 and for directories, it is 777. With a umask=022, new files and directories have permissions 644 and 755 respectively. When I mount a usb drive with umask=022, new files and directories both have permissions 755. Why is that so?


title: Cannot delete a file - permission denied - why?

text: [db2inst1][testing ~/sqllib/db2dump] rm db2diag.log      rm: cannot remove `db2diag.log': Permission denied     [db2inst1][testing ~/sqllib/db2dump] id     uid=1002(db2inst1) gid=107(db2iadm1) groups=16(dialout),33(video),107(db2iadm1),108(db2fadm1),1001(eduserver)     [db2inst1][testing ~/sqllib/db2dump] ll     total 1381172     -rw-rw-rw- 1 root db2iadm1 1412931954 Oct  2 10:24 db2diag.log      Currently logged user (db2inst1) is part of db2iadm1 group that has w permission to the file I want to delete. But I am not able. Any idea why? ## update - permission for parent directory drwxr-sr-x 2 root db2iadm1 4096 Aug 22 14:39 db2dump


title: I can't seem to remove a file even after changing ownership and permissions

text: Haven't been here much. Mostly Stackoverflow. Anyway, I have a file that I can't remove. I tried `sudo rm files.db` and got               Operation not permitted      Did `sudo chown me: files.db` Then `sudo chmod 777 files.db` Tried `sudo rm files.db` again and got same result. `ls -l` produces:               -rwx------  1 me  staff  34177024 Jun  6 23:58 files.db      I had hoped to see:               -rwxrwxrwx  1 me  staff  34177024 Jun  6 23:58 files.db      Tried `sudo chflags noschg files.db` Then `sudo chmod 777 files.db` and then still got:               -rwx------  1 me  staff  34177024 Jun  6 23:58 files.db      What am I missing? UPDATE: Tried `su user rm -rf files.db` put in my password and got:               su: Sorry      I used this drive for Time Machine backups. Isn't there some way to force a removal? ANOTHER UPDATE: Not sure how this works but tried `ls -i` and got:               5482053549 files.db      Then `find . -inum 5482053549 -delete` and got:               find: -delete: unlink(./files.db): Operation not permitted      Also tried `find . -inum 5482053549 -exec rm {} \;` and got:               rm: ./files.db: Operation not permitted      Ugh. LAST UPDATE: This morning I did the following: 'chown me: folder' and then 'chmod 777 folder'. I was then was able to delete the file.


title: Not able to remove a file

text: **file name** : abc **permissions** : -rwxrwxrwx **shell** : ksh I am logged with the user which is the owner of this file. **Contents of file**               AccessTime = 20130424-161120   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 4:30,-3--users   UptimeSecs = 16253.96     AccessTime = 20130424-170309   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 5:22,-3--users   UptimeSecs = 19362.82     AccessTime = 20130424-173741   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 5:57,-2--users   UptimeSecs = 21434.49     AccessTime = 20130424-180537   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 6:25,-1--users   UptimeSecs = 23111.03     AccessTime = 20130424-191315   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 7:32,-1--users   UptimeSecs = 27168.95     AccessTime = 20130425-101909   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 22:38,-2--users   UptimeSecs = 81522.99     AccessTime = 20130425-124617   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 1-day--1:05   UptimeSecs = 90350.71     AccessTime = 20130430-161311   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-28--06:01   UptimeMins = 2-days--10:12   UptimeSecs = 209527.13      Now when I try to delete this file..I get this error.               rm: cannot remove `abc': Permission denied      Any reason why I cannot remove this file ?


title: Resource needed to manage cert.db7 files for AIX

text: On AIX to get LDAP authentication working it has wanted to store the LDAP SSL certificate's trusted root in a cert.db7 file. Mozilla stopped supporting it in NSS (Netscape Security Services) a while back. Cognos (also from IBM) used to use cert.db7 but in the latest versions switched to cert.db8 which is easy to make just using Firefox. Anyone have good resources for making a cert.db7 file? Converters?


title: What are the benefits and downsides to use FuseFS filesystems?

text: I know some filesystems present themselves through Fuse and I was wondering about the pros and cons to this approach.


title: Markdown Viewer

text: I found a file formatted with Markdown. Could you guys suggest what viewer that I could use to view this type of files? Hopefully one without gui (if it's possible) **Update** I was actually looking for a viewer that could parse markdown file format that does not need any conversion. But something close to that should be ok.


title: Diagnosing a freezing system, or renderer

text: Some quick background, I am running Fedora 19 x86_64 on a Dell Latitude with a 2nd gen i7 and discrete nvidia graphics card. I have some rather obnoxious problems where the screen doesn't seem to render consistently. The freezes are irregular and short, but frequent. The system has behaved like that since install, and initially I noticed it in a certain online multiplayer 3D Java game. I thought it was lag, but single player and other games behave similarly. Then I realized it actually consistently happens in the Desktop Environment (Gnome 3) and at times is almost unusable. I had to wait for about 30 seconds typing a sentence in this question. So what do I do to diagnose this problem? Who is most likely at fault? X? OpenGL? Graphics driver? Gnome 3? Kernel? Hardware? I am not even sure how to check what driver is being used or whether the discrete card is being taken advantage of. Also, the cursor retains the ability to move during the freezes which even further confuses me. Why might I be able to wiggle the cursor, but nothing else (like text) will render?


title: Error Installinig Kernel on Centos (from Source)

text: I am running GNU/Linux (Centos 6) on kernel 2.6.32-431.17.1.el6.x86_64. I am trying to update the kernel to 3.2.61. I performed the following steps inside the 3.2.61 folder structure:   1. make menuconfig (took defaults- didn't add anything)   2. make    3. make modules   4. make modules_install   5. make install On step 5, I received the following error:               ERROR: modinfo: could not find module lpc_ich      I tried `yum install lpc_ich`, but that did not exist. This is my first time trying to install a new kernel. I am not really sure if I am doing this correctly. Could someone please help point me in the right direction?


title: External hard drive fails to mount

text: I have an external 2.5" 1TB Samsung hard drive, and it fails mount. Here's what palimpsest says about it: ![enter image description here](http://i.stack.imgur.com/X9v6f.png) It's even able to do a benchmark on it: ![enter image description here](http://i.stack.imgur.com/HIr8G.png) When I try to mount it normally, it fails:               $ sudo mount /dev/sdb3 temp     mount: you must specify the filesystem type      So I specified the filesystem type:               $ sudo mount -t vfat /dev/sdb3 temp     mount: wrong fs type, bad option, bad superblock on /dev/sdb3,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      Specifying **ext2** , **ext3** , and **ext4** fails with the same error. Specifying **ntfs** fails with a different error:               $ sudo mount -t ntfs /dev/sdb3 temp     NTFS signature is missing.     Failed to mount '/dev/sdb3': Invalid argument     The device '/dev/sdb3' doesn't seem to have a valid NTFS.     Maybe the wrong device is used? Or the whole disk instead of a     partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?      I'm pretty sure that the filesystem type is either **vfat** or **ntfs**. I checked the other types just to make sure, especially because that's what palimpsest claimed. ( **update** : I later discovered that this GUI tool says Partition Type is `Linux (0x83)` even if there is no filesystem on the partition) Here's what the beginning of the partition looks like:               # head -c 1024 < /dev/sdb3 | hd     00000000  d1 f5 9f 3b 5b ca 7e 8f  d7 8b be f8 b8 39 cc 1d  |...;[.~......9..|     00000010  e2 48 4f a3 e7 8e 64 68  34 6e 92 3c 5f 6e 59 e7  |.HO...dh4n.<_nY.|     00000020  a6 d0 7b f1 f9 2a 13 3d  43 61 f9 90 eb bd 0e ec  |..{..*.=Ca......|     00000030  ed 81 86 bb 09 64 8f c7  7f ea 01 dd a9 bf 49 7f  |.....d........I.|     00000040  f9 9b 76 cc bf 94 a4 50  fe f5 d1 cd 14 d4 cd e7  |..v....P........|     00000050  cf c7 e3 62 25 0c cb 78  3c 1b b5 31 18 8d bb 79  |...b%..x<..1...y|     00000060  7e 65 da 54 17 74 15 f2  0f 99 a3 82 61 b2 ab 27  |~e.T.t......a..'|     00000070  7f d6 fd 60 10 14 2f ea  09 1f 15 b6 66 78 fc b8  |...`../.....fx..|     00000080  b7 14 60 bb 7e 9f bb 25  b0 5c e2 fc 90 93 5b a2  |..`.~..%.\....[.|     00000090  01 47 3b 49 c6 23 fd d7  56 42 fb 05 cf 77 27 fa  |.G;I.#..VB...w'.|     000000a0  06 c1 fa f4 16 34 b6 cf  3f f1 68 8a 73 42 ff fb  |.....4..?.h.sB..|     000000b0  b9 6e 2c 7e a9 6e 22 bd  6f 7b fd 7a 17 27 18 d3  |.n,~.n".o{.z.'..|     000000c0  05 fb d3 37 0e aa 49 9c  8f b1 d3 b7 15 34 9d f3  |...7..I......4..|     000000d0  29 7f f4 34 c1 1f ea 89  3c 9f bb ae cc 0b df 0b  |)..4....<.......|     000000e0  7a ee d7 26 b2 f3 e8 ca  fb 5d dd 54 d5 b0 1a f8  |z..&.....].T....|     000000f0  fe f8 62 8a 0a a6 4a 2f  da cf 2b 8e 46 c2 fc ee  |..b...J/..+.F...|     00000100  4b c8 fd 17 33 2b 58 3c  fe ae 10 4f ff d1 0c 9d  |K...3+X<...O....|     00000110  4e 73 7d 91 ad 7f d9 41  79 ee 21 ed 87 2d c3 52  |Ns}....Ay.!..-.R|     00000120  60 cc f4 a0 7c de 88 68  86 c7 53 f8 bc 98 50 af  |`...|..h..S...P.|     00000130  44 58 cf 39 93 3e cb f7  cb 98 ff 72 35 92 7d 97  |DX.9.>.....r5.}.|     00000140  1e 30 ff 79 3c 89 fa 0f  33 36 44 01 f1 af df e6  |.0.y<...36D.....|     00000150  01 df f2 c1 9b 85 e3 13  41 5f ba ed 97 5e 40 1b  |........A_...^@.|     00000160  de 5f 72 ae 24 1a 5a c1  5e e6 8d 64 fe e3 1a f7  |._r.$.Z.^..d....|     00000170  1f 93 7f 29 85 3e 32 4d  aa 96 fd c5 f6 30 58 17  |...).>2M.....0X.|     00000180  3d 84 3c 1f 3b e7 88 3d  fa 7a 70 7d 8a df 13 dc  |=.<.;..=.zp}....|     00000190  60 fa ea 10 cd f7 db 9a  c4 ec 95 97 17 f9 e7 9d  |`...............|     000001a0  1b 54 30 7e e3 45 f5 5c  fd 9e 66 e8 25 d4 17 7a  |.T0~.E.\..f.%..z|     000001b0  0d b3 83 21 6b 3b 1e c8  fd b2 75 4a 28 ff f7 9c  |...!k;....uJ(...|     000001c0  ec c1 1f ad 1c 61 4a d9  45 f9 bb 7d cc 3f d4 0b  |.....aJ.E..}.?..|     000001d0  fe e1 f9 40 16 f9 3c 7a  4c f3 d3 23 d6 05 63 bf  |...@..<zL..#..c.|     000001e0  b0 9f d3 e7 b4 84 c9 9c  4d fd 6f 4b d7 56 43 e3  |........M.oK.VC.|     000001f0  cb eb 59 13 f7 15 41 e9  19 4d f9 b0 51 57 6b 60  |..Y...A..M..QWk`|     00000200  38 5c 4a 7c c7 bd 3b 1c  b1 51 d0 13 39 76 36 12  |8\J|..;..Q..9v6.|     00000210  d6 9f 5e c2 51 9e 17 7a  80 c5 df 2e b1 a4 47 ff  |..^.Q..z......G.|     00000220  ad 27 b3 e9 a6 9b 74 1e  4f bd 39 18 67 ff a5 eb  |.'....t.O.9.g...|     00000230  2b 78 c6 fc e5 cc 4c 9a  af 19 78 30 0b 9a a1 bc  |+x....L...x0....|     00000240  9f 2b 7b 95 1f 16 09 f3  29 b7 79 24 63 90 a0 3f  |.+{.....).y$c..?|     00000250  75 bb 7b 1c ac e3 78 7f  e5 e6 03 61 d0 1d 79 08  |u.{...x....a..y.|     00000260  d9 9e ec f9 a6 39 94 df  c7 51 3e a7 cb c4 0a a8  |.....9...Q>.....|     00000270  03 79 fd f7 f5 bb 8e 68  28 d9 45 f5 08 fb e3 21  |.y.....h(.E....!|     00000280  50 0c 7c cc e7 89 dc 65  31 d6 bb 2f a8 ff fd 66  |P.|....e1../...f|     00000290  3b 4f 28 1e 9e 20 fc ed  52 a8 86 b6 67 a2 d4 ce  |;O(.. ..R...g...|     000002a0  d5 b6 9f ff 0e c5 e0 e1  c2 79 6a 15 04 e3 c9 db  |.........yj.....|     000002b0  a4 87 12 73 cf 17 da 4b  d3 c8 9e 05 2b b3 a0 3c  |...s...K....+..<|     000002c0  ec 47 f6 49 1d a1 c4 ee  7f 79 7e 70 4d 84 37 8c  |.G.I.....y~pM.7.|     000002d0  ce 67 b1 c0 16 df f4 7d  c4 f0 d3 82 16 64 2f 86  |.g.....}.....d/.|     000002e0  be 1f 0b dd 64 9e 7f 70  aa 4b 82 65 93 2b e5 bb  |....d..p.K.e.+..|     000002f0  ff d7 43 09 d3 b6 67 d8  29 e7 73 87 b7 82 6e 60  |..C...g.).s...n`|     00000300  01 f5 7f cd e9 fa a6 7e  ba 13 32 ff bf e3 b0 22  |.......~..2...."|     00000310  a8 eb 78 7c 35 e7 7f 0c  af 77 3f c8 f9 d5 93 12  |..x|5....w?.....|     00000320  a0 18 e1 4c f3 93 5f 85  c7 42 d1 85 d7 cf 37 d7  |...L.._..B....7.|     00000330  7a e0 71 b9 30 df de 2e  1e ea f7 96 52 be 3c 30  |z.q.0.......R.<0|     00000340  3c 15 0d 31 41 92 1c 9f  f7 9e c5 ec 81 e6 00 cd  |<..1A...........|     00000350  bf ea 77 af 06 96 b3 7c  5e e1 b4 0f 5b c1 94 58  |..w....|^...[..X|     00000360  20 39 ca f9 4e f7 54 68  ad bf 49 45 8e 36 fe c0  | 9..N.Th..IE.6..|     00000370  88 02 e8 d7 71 fe 4d f2  cf 2e 18 26 d8 eb 65 c9  |....q.M....&..e.|     00000380  ee a8 2d 13 e6 bf 06 db  43 7f b8 0e b2 3d d9 d0  |..-.....C....=..|     00000390  d0 14 e6 fd 97 f1 95 6d  ff 3a 97 b6 c6 35 81 6f  |.......m.:...5.o|     000003a0  3e 95 ad 5c 9b f0 8c ad  c3 e6 af 8d f6 2c 1e e6  |>..\.........,..|     000003b0  7c fc 63 11 2c fe be 7c  9c e2 91 38 ef 30 98 17  ||.c.,..|...8.0..|     000003c0  3e 20 fb b6 bc 3b fb fc  e6 67 34 0f 35 f9 69 30  |> ...;...g4.5.i0|     000003d0  14 ed eb 29 fe 39 7d ce  01 fa a3 fc fb 3a 0c 4b  |...).9}......:.K|     000003e0  83 e5 0c 9f 3f 33 79 8b  12 d6 77 78 fd ba 74 3d  |....?3y...wx..t=|     000003f0  c3 67 cb 39 de cf e9 52  08 ed 6b a5 74 c1 76 7d  |.g.9...R..k.t.v}|     00000400


title: How do I find out what font my X server is using?

text: I want to know what font my X server is currently using. I'm running Xorg on Arch linux.


title: Static IP for 2 PCs on crossover cable in interfaces(5) file?

text: I've got 2 PCs connected on an Ethernet crossover cable. On _PC1_ I run:               sudo ip addr add 192.168.2.1 peer 192.168.2.2 dev eth0     sudo ip link set dev eth0 up      On _PC2_ I run:               sudo ip addr add 192.168.2.2 peer 192.168.2.1 dev eth0     sudo ip link set dev eth0 up     sudo ip route add default via 192.168.2.1      What's the cleanest way to replicate this set up in the _interfaces(5)_ config file, so I can run _ifup(8)_ instead of configuring each interface manually? I'm on Linux Mint 15, if it matters, but I'd think it'd be the same in any Debian-based distro.


title: nacl crypto installation on arch

text: I am trying to install nacl crypto on my system:               % uname -a     Linux (none) 2.6.39-ARCH #1 SMP PREEMPT Mon Jun 6 22:37:55 CEST 2011 x86_64 Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz GenuineIntel GNU/Linux      But the build process didn't succeed:               ~/nacl-20110221 % ./do     ./do: line 9: hostname: command not found      Did I forget something? **[update]**               % cat /etc/hosts     #     # /etc/hosts: static lookup table for host names     #          #<ip-address>   <hostname.domain.org>   <hostname>     127.0.0.1   localhost.localdomain   localhost     ::1     localhost.localdomain   localhost     # End of file


title: Security support time for OpenBSD?

text: If I install OpenBSD 4.9, when will I have to upgrade to 5.0? When will the 4.9 release no longer be supported by the OBSD teams?


title: SED misbehaving with input file

text: Simply put I have a small `sed` command that is supposed to trim `"` and wrap the input between the `<id>` tag. It goes well single line and multiple line input, but badly misbehaves on an input file (via `cat` or as a `sed` parameter) Sample outputs (and as the final command a `head` on the file).               ~> echo 200 | sed 's/"//g;s/^/<id>/g;s/$/<\/id>/g'                                                                                <id>200</id>          ~> sed 's/"//g;s/^/<id>/g;s/$/<\/id>/g' <<EO                                                                                heredoc> 2301930     heredoc> 1230910293     heredoc> 102391093     heredoc>      heredoc> EO     <id>2301930</id>     <id>1230910293</id>     <id>102391093</id>     <id></id>          ~> cat job.csv | sed 's/"//g;s/^/<id>/g;s/$/<\/id>/g' | head                                                                                </id>79116     </id>79125     </id>79126     </id>78327     </id>78284     </id>78288     </id>78291     </id>78304     </id>78311     </id>78335          ~> head job.csv                                                                                "179116"     "179125"     "179126"     "178327"     "178284"     "178288"     "178291"     "178304"     "178311"     "178335"      What do you guys think can be the issue?


title: How can I permanently remove a web browser's SSL warning for HTTPS sites that fail to identify themselves correctly?

text: I'm using Firefox and Google Chrome under Ubuntu 10.04, and get these warnings: ![firefox](http://i.imgur.com/DD7Gq.png) ![chrome](http://i.imgur.com/uRt6X.png) I want to add the site's certificate to "somewhere", so that the browser doesn't show SSL cert errors when visiting that given site. p.s.: a command-line solution would be the best.


title: Ubuntu 12.04: updating package message

text: When ever I updated packages, (they update) I receive the following message about TeXLive:               dpkg: warning: parsing file '/var/lib/dpkg/status' near line 2888 package 'texlive-local':      missing maintainer      This doesn't mess up the packages downloading or upgrading. I would like to have this stop though. How can I do this?


title: Incorrect Directory Index

text: I am attempting to load as the default DirectoryIndex home.html, but the site keeps jumping to index.php. Website is built on WordPress. **httpd.conf**               DirectoryIndex index.html home.html index.php index.html.var      **.htaccess**               <IfModule mod_rewrite.c>         RewriteEngine On         RewriteBase /         RewriteRule ^home\.html$ - [L]         RewriteCond %{REQUEST_FILENAME} !-f         RewriteCond %{REQUEST_FILENAME} !-d         RewriteRule . /index.php [L]     </IfModule>      Any help on this matter would be greatly appreciated.


title: Core files when the symbols are stripped

text: I am building an application using g++ 4.3. I am using the with maximum possible optimization level, not using the `-g` option, and I am stripping symbols after it builds. If I do NOT strip symbols from my application and libraries, are the core files still useful? (When they are generated when the application crashes.) Will the core files be useful if I compile my application with maximum possible optimization? (Without `-g` option and without stripping symbols.)


title: Numbered Musical Notation Writing Software

text: Is there any numbered musical notation writing tool in Linux? I want to write something like this:                Do = C           1   1     2   1   |  4  3 . . |        Hap-py Birth-day     To You      Numbered musical notation: http://en.wikipedia.org/wiki/Numbered_musical_notation Preferably a free and cross platform one.


title: Get colors in less command with ccze: Shift + g doesn't go to the end of file?

text: In all the tools to get colors with `less` command: `-R`, Pygments, GNU Source-highlight, vless, ... ccze make me sastified with below command:               ccze -A < /path/to/log/file | less -R      but `Shift`+`g` doesn't work as expected:   * I must press `Ctrl`+`c` first   * follow by `Shift`+`g`, but it doesn't go to the end of file Did I miss something?


libpng warning: Application was compiled with png.h from libpng-1.2.39     libpng warning: Application  is  running with png.c from libpng-1.4.0     libpng warning: Incompatible libpng version in application and library      * * * `Rgooglemaps` depends on `png`: http://cran.r-project.org/web/packages/RgoogleMaps/index.html   Attempting to run the `RgoogleMaps` code through `Qt` resulted in the above errors. * * *               linux-y3pi: # zypper what-provides libpng          Loading repository data...     Warning: Repository 'Updates for openSUSE 11.3 11.3-1.82' appears to outdated. Consider using a different mirror or server.     Reading installed packages...     S | Name        | Type    | Version      | Arch   | Repository                              --+-------------+---------+--------------+--------+------------------------------------     v | libpng12-0  | package | 1.2.46-7.3.1 | x86_64 | Updates for openSUSE 11.3 11.3-1.82     i | libpng12-0  | package | 1.2.44-2.1   | x86_64 | openSUSE-11.3-Oss                       i | libpng12-0  | package | 1.2.44-2.1   | x86_64 | openSUSE-11.3 11.3-1.82                 v | libpng12-0  | package | 1.2.46-7.3.1 | i586   | Updates for openSUSE 11.3 11.3-1.82     v | libpng12-0  | package | 1.2.44-2.1   | i586   | openSUSE-11.3-Oss                       v | libpng14-14 | package | 1.4.3-3.3.1  | x86_64 | Updates for openSUSE 11.3 11.3-1.82     i | libpng14-14 | package | 1.4.3-2.1    | x86_64 | openSUSE-11.3-Oss                       i | libpng14-14 | package | 1.4.3-2.1    | x86_64 | openSUSE-11.3 11.3-1.82                 v | libpng14-14 | package | 1.4.3-3.3.1  | i586   | Updates for openSUSE 11.3 11.3-1.82     v | libpng14-14 | package | 1.4.3-2.1    | i586   | openSUSE-11.3-Oss                        Running the `Qt` executable with `ldd` results in: * * *               anisha@linux-y3pi:~/Desktop/abc/qtR> ldd qtR                  linux-vdso.so.1 =>  (0x00007fff5312c000)             libR.so => /usr/lib64/R/lib/libR.so (0x00007f1cf838b000)             libRblas.so => /usr/lib64/R/lib/libRblas.so (0x00007f1cf815f000)             libRlapack.so => /usr/lib64/R/lib/libRlapack.so (0x00007f1cf7de5000)             libRcpp.so => /usr/lib64/R/library/Rcpp/lib/libRcpp.so (0x00007f1cf7b94000)             libRInside.so => /usr/lib64/R/library/RInside/lib/libRInside.so (0x00007f1cf797f000)             libQtWebKit.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libQtWebKit.so.4 (0x00007f1cf61ab000)             libQtSvg.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libQtSvg.so.4 (0x00007f1cf5f4b000)             libQtXml.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libQtXml.so.4 (0x00007f1cf5cff000)             libQtGui.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libQtGui.so.4 (0x00007f1cf4f82000)             libQtNetwork.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libQtNetwork.so.4 (0x00007f1cf4c44000)             libQtCore.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libQtCore.so.4 (0x00007f1cf4761000)             libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1cf4544000)             libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f1cf423a000)             libm.so.6 => /lib64/libm.so.6 (0x00007f1cf3fe3000)             libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f1cf3dcd000)             libc.so.6 => /lib64/libc.so.6 (0x00007f1cf3a6d000)             libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f1cf3826000)             librt.so.1 => /lib64/librt.so.1 (0x00007f1cf361d000)             libdl.so.2 => /lib64/libdl.so.2 (0x00007f1cf3419000)             libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007f1cf320b000)             /lib64/ld-linux-x86-64.so.2 (0x00007f1cf899a000)             libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00007f1cf2f25000)             libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007f1cf2d1a000)             libphonon.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libphonon.so.4 (0x00007f1cf2aba000)             libQtDBus.so.4 => /home/anisha/qtsdk-2010.05/qt/lib/libQtDBus.so.4 (0x00007f1cf2832000)             libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f1cf25fb000)             libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f1cf2372000)             libz.so.1 => /lib64/libz.so.1 (0x00007f1cf215c000)             libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f1cf1f49000)             libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f1cf1c09000)             libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f1cf1a04000)             libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f1cf1720000)             libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007f1cf1517000)             libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007f1cf12fa000)             libncurses.so.5 => /lib64/libncurses.so.5 (0x00007f1cf10a5000)             libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f1cf0e7b000)             libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f1cf0c5e000)             libpcre.so.0 => /lib64/libpcre.so.0 (0x00007f1cf0a30000)             libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f1cf082b000)             libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f1cf0627000)      * * * R info:               > sessionInfo ()     R version 2.15.1 (2012-06-22)     Platform: x86_64-unknown-linux-gnu (64-bit)          locale:      [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C                    [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8          [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8         [7] LC_PAPER=C                 LC_NAME=C                       [9] LC_ADDRESS=C               LC_TELEPHONE=C                 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C                 attached base packages:     [1] stats     graphics  grDevices utils     datasets  methods   base          >       * * * uname -a               anisha@linux-y3pi:~> uname -a && cat /etc/issue     Linux linux-y3pi 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 x86_64 x86_64 x86_64 GNU/Linux     Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).      ![enter image description here](http://i.stack.imgur.com/J5dXr.png) **The deinstallation of libpng12 says that'll have to install a 32 bit version of`R-patched`!** **What to do?**


title: Gnome saving dialogues keyboard shortcuts

text: For example when I try to save the destination of a link in `firefox` or save a copy of a pdf file in `evince` I get the following dialogue. ![enter image description here](http://i.stack.imgur.com/441g4.png) I find it annoying that I have to do some clicks (for example the tmp button and that to its left in my example) to select the folder. So is there a way to do this with _keyboard only_ with some kind of tab completion? Perhaps it's just changing a key in `gconf` perhaps it is possible to replace the saving dialogues by something better.


title: CPU or RAM better in old machine?

text: I'm planning to use one of two old computers as a low-volume backup server. The machine will be online and files will be backed up over ssh/rsync. I will do a minimal install of Ubuntu or Debian server. The specifications of the machines are as follows:   * Pentium3 1GHz _Coppermine_ CPU with two 168-pin SDRAM DIMM slots with 320MB RAM (256MB and 64MB)    * Pentium3 450MHz _Katmai_ CPU with three 168-pin SDRAM DIMM slots with 384MB RAM (256MB and two 64MB). The motherboard in this machine seems to be a little more reliable. I only have 384MB of 168-pin SDRAM DIMMs available in total. For the task of low-volume backup server, does it really matter which one I use? The difference in RAM is small and a previous minimal install of Ubuntu 8.04 server used <20MB RAM anyway. However, the Coppermine CPU is more than double the speed if the Katmai, so I should use that one?