title: At the root level (/) directory, why is that .. refers to itself?

text: > **Possible Duplicate:**   >  Why does '/' have an '..' entry? I understand that in the filesystem hierarchy starting with / as top-level directory, under which all the other sub directories or files are stored. In each subdirectory, we see two special directories referred as `.` and `..` which are special because they are hardlinks pointing to the current directory inode and the parent directory inode respectively. They are common for every sub directory in the filesystem. However, when I look at `/`, those two special directories behaviour changes. They refer to the `/` again. For example:               [root@centos /]# pwd     /     [root@centos /]# ls -ldi . ..     2 drwxr-xr-x 26 root root 4096 Dec  3 16:53 .     2 drwxr-xr-x 26 root root 4096 Dec  3 16:53 ..     [root@centos /]# cd root     [root@centos ~]# ls -ldi . ..     195265 drwxr-x--- 10 root root 4096 Dec  3 20:33 .          2 drwxr-xr-x 26 root root 4096 Dec  3 16:53 ..     [root@centos ~]#       I want to understand what part of the filesystem controls this? But how is this done in detail. Can someone please explain this behaviour? (Let me guess, this is part of the kernel's filesystem management routines). I have my own theory about this but would like to listen more from the experts here. Cheers.


title: Why iptables does not fetch information from /etc/sysconfig/iptables on centOs?

text: I'm new in Linux and encountered with problem with iptables. Here is content of /etc/sysconfig/iptables file               # Generated by iptables-save v1.4.7 on Tue Nov 27 21:41:04 2012     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [40672:2356787]     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT      -A INPUT -p icmp -j ACCEPT      -A INPUT -i lo -j ACCEPT      -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT      -A INPUT -j REJECT --reject-with icmp-host-prohibited      -A FORWARD -j REJECT --reject-with icmp-host-prohibited      COMMIT     # Completed on Tue Nov 27 21:41:04 2012      But when I try "sudo iptables -L -n -v -x" I have following output:               Chain INPUT (policy ACCEPT 261172 packets, 1040204290 bytes)         pkts      bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)         pkts      bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 522761 packets, 2080465034 bytes)         pkts      bytes target     prot opt in     out     source               destination        Why doesn't the rules from /etc/sysconfig/iptables displayed in output?


title: Bash: logical operators precedence &&, ||

text: I am trying to understand how the logical operator precedence works in bash. For example, I would have expected, that the following command does not echo anything.               true || echo aaa && echo bbb      However, contrary to my expectation, `bbb` gets printed. Can somebody please explain, how can I make sense of compounded `&&` and `||` operators in bash?


title: grub on floppy to rescue CD boot chain

text: I am having trouble figuring out how to have grub installed on a floppy in a way that it automatically boots a modified Ubuntu 12.04 CD on startup. I will settle for knowing some commands at the grub prompt if automation is asking for the impossible. The CD is bootable, but the system this is made for doesn't have a BIOS option to boot from CD (or USB), it can only boot from floppy or hard drive. * * * Background: This is a system located remotely, and I would like to have something where I can tell the owner if there are problems: insert floppy and CD and reboot. The modifications to the CDs are such that openssh-server is installed, my public ssh key in /root/.ssh/authorized_keys2, ssh is listening on an additional port number as those < 1024 are blocked by the local provider and the system retrieves a page on my server (so I can find the IP address to connect to for remote maintenance). The CD works fine when testing in a VirtualMachine. There is a keyboard and monitor and I can ask the owner to type in a few commands. I first looked at using grub2 but there are many incorrect how-to about them and the command-line options for grub2 seem to have been changed a lot of times (`\--diet` and `\--overlay`, often mentioned, are no longer there). There is a bug report about grub2 output not fitting on floppy and that was closed recently. So I build grub2 from the repository (version 2.0) including the required new version of xorriso. The result of               grub-mkrescue --compress=xz -o grub-rescue.vfd      is a 4.4Mb Image, which of course does not fit on a floppy at all, so I dropped that as a viable path to explore. I have tried a grub legacy on floppy (0.97), but cannot use `find` from the grub prompt to find anything on the CD, nor use something `chainloader (hd1)`. The grub (0.9x) manual has nothing to say about booting an iso image. I rather not install something on the hard drive and go the boot route FD -> HD -> CD as this whole setup is needed in the first place if the hard drive has problems.


title: Non-administrative network-related tools

text: I know there are tools to inspect packets (e.g. wireshark) or to simulate latency/packet loss (e.g. netem), but they all seem to require administrative permissions to inspect/modify packets. I'm looking for something which could intercept packets for a single application and be usable by a standard (non-root) user. I'd like some kind of `valgrind` tool for network, where you use it to wrap your application and it intercepts network requests to inspect/modify them. My main use case is to enable students to use such tools on university computers in a simple way (i.e. without needing virtual machines or support from the administrators). Do such tools exist? Otherwise, what prevents them from actually existing in the first place? Note: tools such as `setcap`, which need to be configured by system administrators and may grant too many powers to the users (e.g. inspecting every packet, and not just the ones generated by their applications) aren't suitable. **Edit** : OK, so after some research, I found out about the LD_PRELOAD trick, which could be used as a poor man's wrapper to intercept specific library functions (e.g. `connect`, `sendto`, etc.) and count/modify packets. Apparently the reason why there are not so many non-root tools based on this is because:   * it's not useful for security purposes (it can be easily circumvented), and   * most people during useful things with network already need root access anyway, so outside very specific applications tailored for learning, there is no real demand. But this is technically feasible, in case any curious students are willing to develop such applications themselves. Another technique would be to code a valgrind plug-in to deal with this and use valgrind to run the program. But it seems way overkill, so no sane people have done it. Could someone more knowledgeable than me just confirm if my previous statements are correct?


title: How to estimate server's network connection quality with traceroute?

text: I need to estimate network connectivity of various dedicated server hosting providers, e.g. how fast and uniform will my services perform when hosted there. I use `traceroute` command on my home computer to check the servers that are hosted by the provider; if I don't know any, then I `traceroute` their homepage (I know it might not be on the same network; it's a guess) Intuitively I aim for:   1. minimum number of hops,   2. minimum roundtrip time both for the target and intermediate nodes,   3. and lack of _stars_ : ![*stars*: traceroute soyoustart.com](http://i.stack.imgur.com/B070Q.png) Are all these metrics relevant for general web service hosting? What do _stars_ mean and should I really avoid them?


title: What could cause my bash history to be cleared unexpectedly?

text: Today I noticed that my bash history is cleared completely. I have neither executed `history -c` nor deleted the `.bash_history` file. Apart from deleting the `.bash_history` file and `history -c`, how can bash history be cleared?


title: Do applications usually use dynamic linked libraries?

text: If I want to compile an application which needs packages that are not provided by distribution's package manager and I want to generate a distribution package from it, do users who use this distribution package need all those extra libraries installed or will these libraries packed into the binary? I know that it could depend from application to application but how can I recognize if a package needs dynamic linked libraries?


title: AppArmor profiles in Docker/LXC

text: I have a Docker container (LXC) which runs MySQL. Since the idea behind Docker is generally "one running process per container," if I define AppArmor profiles targeting the MySQL binary, will they be enforced? Is there a way for me to test for this?


title: What role does krb5.conf actually play when joining a Linux machine to AD via Samba/winbind?

text: I'm working on a project for a standardized Linux image for our organization. This image will be domain joined, and I've written a script to fire on boot that will guide the IST person doing the Linux machine setup through the join. Pretty much every guide I have seen states that you must edit krb5.conf to reflect your AD domain's structure. However, there's not much information as to _why_ this is necessary, and I've found that I am able to perform domain joins via net ads (instead of net rpc) without altering krb5.conf at all, in both Ubuntu 12.04/14.04 and CentOS 6.5. This has been true in both Samba 3 and Samba 4; our AD backend I believe is now entirely Server 2k8 and has been since before I started this project. Further, I'm able to set pam_winbind with the krb5auth option, and it properly creates the kerberos ticket in /tmp; wbinfo -K also works fine and creates a Kerberos ticket. So, my question really is - what does krb5.conf do that I'm missing? What impact will there be if it's not configured? Is it just going to be that programs using Kerberos to authenticate will not be able to do so, or is there some other subtler point that I'm not aware of (such as winbind falling back to an insecure RPC based auth method if krb5.conf is not correct?)


title: nmap ipv6 os scan fails

text: When scanning a ubuntu machine with nmap using ipv6 address, nmap cannot determine the os type and only print the os fingerprint. Although when scanning the same host with ipv4 address it correctly detects it as being linux machine. Does anybody know why?


title: Cannot locate libncurses.so location when running a file

text: I'm trying to run a file name remote build which is to build a package on a target server. My target server is HP-UX-itanium 64 bit. When I run the remote build, somehow it cannot find `libncurses.so` or maybe it looks for the `libncurses.so` at some other location. This only happens on HP-UX itanium, while other server like Solaris, HP-UX-mp 32 bit, and other Unix platform can run the file smoothly. This is the error code:               libtool: link: gcc -g -O2 -o test_setpwnam test_setpwnam.o setpwnam.o  -L/usr/local/lib/hpux32 -lncurses -lsec -ldl -lpam -lpthread -Wl,+b -Wl,/usr/local/lib     /usr/bin/make  check-TESTS     /usr/lib/hpux32/dld.so: Unable to find library 'libncurses.so'.      I don't know why it keep looking into `_/usr/lib/hpux32_` when I think I have the code look into `/usr/local/lib/hpux32"_` (the `libncurses.so` is located in that directory). This is part of the remote build code which I think is related.               #!/usr/bin/perl          my $remote_uname = `ssh $USER\@$host uname -a`;     chomp($remote_uname);     my $local_uname = `uname -a`;     chomp($local_uname);     my $homepath = "/home";     my $build = "";     my $configure_param = " --with-ncurses --disable-openssl --disable-thread-support --disable-shared --disable-protoc";     my $gzip = "gzip";     my $configure_env = "PATH=\$PATH:/usr/local/bin:/usr/local/lib/hpux32 CPPFLAGS=-I/usr/local/include libevent_cv_getaddrinfo=no";     my $make_env = "PATH=\$PATH:/usr/local/bin";     my $whoami = "whoami";          } elsif ($remote_uname =~ /^HP-UX/) {         $build = "cd mypackage-$version/package/hpux && sh ./build.sh";         $gzip = "/usr/contrib/bin/gzip";         $configure_param .= " --with-ncurses";         $configure_env .= " LDFLAGS=\"-L/usr/local/lib/hpux32\""; //aint this the part where I'm suppose to specify the search?         die "Unknown remote uname [$remote_uname]";     }          rmake "rm -rf mypackage-${version}*";     make "scp mypackage-$version.tar.gz $USER\@$host:$homepath/$USER";     rmake "$gzip -dc mypackage-$version.tar.gz | tar xvf -";     rmake "cd mypackage-$version && $configure_env ./configure $configure_param && $make_env make && $make_env make check";     rmake $build;      This is my first time doing debug on perl code, so please excuse me if what I conclude is wrong.


title: Given a kernel ATA exception, how to determine which physical disk is affected?

text: I woke up this morning to a notification email with some rather disturbing system log entries.               Dec  2 04:27:01 yeono kernel: [459438.816058] ata2.00: exception Emask 0x0 SAct 0xf SErr 0x0 action 0x6 frozen     Dec  2 04:27:01 yeono kernel: [459438.816071] ata2.00: failed command: WRITE FPDMA QUEUED     Dec  2 04:27:01 yeono kernel: [459438.816085] ata2.00: cmd 61/08:00:70:0d:ca/00:00:08:00:00/40 tag 0 ncq 4096 out     Dec  2 04:27:01 yeono kernel: [459438.816088]          res 40/00:00:00:4f:c2/00:00:00:00:00/40 Emask 0x4 (timeout)     Dec  2 04:27:01 yeono kernel: [459438.816095] ata2.00: status: { DRDY }       (the above five lines were repeated a few times at a short interval)     Dec  2 04:27:01 yeono kernel: [459438.816181] ata2: hard resetting link     Dec  2 04:27:02 yeono kernel: [459439.920055] ata2: SATA link down (SStatus 0 SControl 300)     Dec  2 04:27:02 yeono kernel: [459439.932977] ata2: hard resetting link     Dec  2 04:27:09 yeono kernel: [459446.100050] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)     Dec  2 04:27:09 yeono kernel: [459446.314509] ata2.00: configured for UDMA/133     Dec  2 04:27:09 yeono kernel: [459446.328037] ata2.00: device reported invalid CHS sector 0       ("reported invalid CHS sector 0" repeated a few times at a short interval)      I make full nightly backups of my entire system to an external (USB-connected) drive, and the above happened right in the middle of that backup run. (The backup starts at 04:00 through cron, and tonight's logged completion just before 04:56.) The backup process itself claims to have completed without any errors. There are two internally connected SATA drives and two externally (USB) connected drives on my system; one of the external drives is currently dormant. I don't recall off the top of my head which physical SATA ports are used for which of the internal drives. When googling I found the AskUbuntu question Is this drive failure or something else? which indicates that a very similar error occured after 8-10 GB had been copied to a drive, but the actual failure mode was different as the drive switched to a read-only state. The only real similarity is that I did add on the order of 7-8 GB of data to my main storage last night, which would have been backed up around the time that the error occured. `smartd` is not reporting anything out of the ordinary on either of the internal drives. Unfortunately smartctl doesn't speak the language of the external backup drive's USB bridge, and simply complains about `Unknown USB bridge [0x0bc2:0x3320 (0x100)]`. Googling for that specific error was distinctly unhelpful. My main data storage as well as the backup is on ZFS and `zpool status` reports 0 errors and no known data errors. Nevertheless I have initiated a full scrub on both the internal and external drives. It is currently slated to complete in about six hours for the internal drive (main storage pool) and 13-14 hours for the backup drive. It seems that the next step should be to determine which drive was having trouble, and possibly replace it. The `ata2.00` part _probably_ tells me which drive was having problems, but **how do I map that identifier to a physical drive?**


title: Kernel 3.12 or 3.10? which one has more features, newer and better?

text: Based on https://www.kernel.org/ kernel 3.12 is released in 2014-04-23 and kernel 3.10 is released in 2014-04-27. Based on release date, 3.12 is older and based on version number 3.10 is older. Which one is newer? Which one has more features? **Does 3.12 have 3.10 features?**


title: How to use fslint (in particular findnl) on the command line to actually mimic the behavior of the fslint-gui?

text: So I am trying the `fslint` tools. However, the help included in those tools as well as the `man` page don't indicate that the cleanup actions offered by the `fslint-gui` are also available through `fslint` (CLI) or the individual tools. I am trying to use `findnl` in particular, and there is no indication of it being able to automatically rename files:               $ /usr/share/fslint/fslint/findnl --help     find Name (directory or file) Lint.     Usage: findnl [-1] [-2] [-3] [-p] [[-r] [-f] paths(s) ...]          These options are mutually exclusive (i.e. only the last one takes effect).     -1 is least checking, -3 is most. The default is 2.          -p is most stringent and applies POSIX.1 filename portability testing.     I.E. characters are limited to [A-Za-z0-9_.-] and max name length = 14 and     max path length = 255.          If no path(s) specified then the currrent directory is assumed.      It seems to exist for `findup` though (the `-d` for example):               $ /usr/share/fslint/fslint/findup --help     find dUPlicate files.     Usage: findup [[[-t [-m|-d]] | [--summary]] [-r] [-f] paths(s) ...]          If no path(s) specified then the currrent directory is assumed.               When -m is specified any found duplicates will be merged (using hardlinks).     When -d is specified any found duplicates will be deleted (leaving just 1).     When -t is specfied, only report what -m or -d would do.          [...]      Does anyone know how to use those tools (emphasis on the plural!) on the command line? I've searched before writing up this question and all I came up with was - depending on the tool - no answer at all (or not better than the vague and brief help) or something tailored to a specific use case that didn't apply and also didn't allow me to generalize the example in any way. I realize that maybe I overlooked it, but then it probably means it's not mentioned prominently enough and this question (and subsequent answers) will help other internauts in the future.


title: Memory display using md in u-boot

text: U-Boot-PetaLinux> md 0xc     0000000c: 2201c2a0 1a8441c5 90031018 52011010    ...".A.........R     0000001c: 0045c903 022c19ae 01077620 ca173dc0    ..E...,. v...=..     0000002c: 0804e426 15dd0c12 201092c1 2a405554    &.......... TU@*     U-Boot-PetaLinux>      Here the right most column is address. In middle I can see values `32 bit 32 bit 32 bit 32 bit`   At the left it is the ASCII representation of the values in middles (total 128 bit ). Am I right? Also why is it printing 0000001c, I did not ask for this? Can some one explain me if my understanding is wrong.


title: How to set metadata for music files?

text: In windows music files have metadata like artist name, album name associated with them. How is this metadata stored. Is it stored in file system like other file attributes or is it part of MP3 data that Windows Explorer extracts using a MP3 reader plugin? Is it possible to read/change this information in Linux? Is it possible with commandline? _(I know these attributes can be set using Rhythymbox or some music player but I'm curious if these could also be set directly. Like in Windows the windows itself shows you artist information if you right click the file and open properties dialog)_


title: Switch User won't work in Xfce

text: I'm trying to do Switch User in action buttons but gets me following error : > **Unable to start new display** > > GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name > org.gnome.DisplayManager was not provided by any .service files


title: interpretation of coninfo in uboot

text: U-Boot-PetaLinux> con     List of available devices:     serial   80000003 SIO stdin stdout stderr     ttyPS0   00000003 .IO      how is the serial and ttyPS0 different ? And how do I interpret the complete output ?


title: grepping with "shopt -s globstar extglob"

text: I have `shopt -s globstar extglob` in my `./bashrc`. I'm searching for files that refer to string `Foo` in the following command:               grep -Fwn Foo /**/src/**/*.@(h|cpp)      Now I want to except all refers from files `Foo.h` and `Foo.cpp`. The following is the command that gain this goal               grep -Fwn Foo /**/src/**/*.@(h|cpp) | grep -v Foo.h | grep -v Foo.cpp      I'd like to make it without piping command using `!` and `&` in location pattern. I mean something like the following               grep -Fwn Foo /**/src/**/@(*.@(h|cpp)&(!(Foo.*)))      Why the command from above do not work and how to fix it?


title: Move GRUB from USB to HD

text: When I installed _Linux debian 2.6_ and _GRUB_ I managed to install it, the boot loader, on a usb flash drive. Right now, If the USB drive is plugged into the computer, the _GRUB_ and the _OS_ starts, otherwise, if the usb is out, nothing happens. There are some grub files in `/boot/grub/` and `/usr/lib/grub/i386-pc/` but there's no e.g. `menu.lst` in these directories, but a lot of other files. To be honest, I don't know if I actually installed GRUB on the flash drive or not, but I can't start the OS without having the Flash drive inserted. Well, what I would like to do is to be able to start the OS without having the USB plugged-in.


title: SCTP support for Linux kernel 3.3.4-5.fc17.x86_64

text: I'm using Fedora 17 64-bit version, with Linux kernel version 3.3.4-5.fc17.x86_64. I installed `lksctp` using `yum`.               sudo yum install lksctp-tools.x86_64      When I try to run               sctp_status -H 127.0.0.1 -P 10 -l      I'm getting this result:               Starting tests...                       *** socket: failed to create socket:  Protocol not supported ***      How can I resolve this problem? Why can't I start an SCTP server this way?


title: What are the dangers of setting a high limit to max File Descriptors per process?

text: I'm working on an old legacy application, and I commonly come across certain settings that no one around cam explain. Apparently at some point, some processes in the application were hitting the max number of files descriptors allowed per process, and the then team decided to increase the limit by adding the following to the init files of their shells (.kshrc):               ((nfd=16#$(/etc/sysdef | grep "file descriptor" | awk '{ print $1 }' | cut -f3 -d "x")))          ulimit -n $nfd      This increases the output of `ulimit -n` from 256 to 65536. Virtually every process on our machines runs with this high soft limit. Are there any risks to having this brute approach? What is the proper way to calibrate `ulimit`? Side question: How can I know the number of FD currently in use by a running process? * * * **Environment**   * OS: SunOS .... 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-V215   * Shell: KsH Version M-11/16/ **88** i


title: New source install over existing one

text: I have Slackware installed on my computer, and I install a lot of software from source. Now I want to install `ffmpeg` from source just to recompile it with some more options. But I already have `ffmpeg` installed on my computer, so what's gonna happen? Is it going to overwrite my old install or is it going to create new files, and if so how can I differentiate between the two installed versions. Also if there is a better way to recompile a programs on Slack let me know, because i'm very interested.


title: different shell for root and non-root user

text: When I ssh as root, my shell is `bash`, but when it's a non-root user it is `sh`. How can I make them both to use `bash`? This actually goes against the logic in this question: Why root's default shell is configured differently with other normal user account's default shell?


title: How to disallow different automake versions from overwriting each other's binary files

text: I was using `automake` **1.11** without trouble, until some package required `automake` **1.10**. When installing it, I found that it actually wants to overwrite `/usr/bin/{aclocal,automake}` (which were installed by **1.11** ). Here's my `./configure` command:               ./configure --prefix=/usr      I would prefer the solution to involve the build files, as opposed to modifying the filesystem directly.


title: Standard command line syntax ambigiuty in interpretation rules?

text: This question is somewhat similar to this: Unix/Linux command syntax Suppose I have a program foo that takes arguments -a and -b. If both a and b take a string argument what is the meaning of this               foo -b -a bar      If multiple b:s are allowed               foo -b -a -b      ?? Is there a true specification of the command line syntax somewhere?


title: Editing Conky configuration variables from Lua

text: I've been messing around with Conky for a while now and I recently started dabbling in Lua scripting. One of the things that used to bug me about a "flat" `conkyrc` approach (as opposed to a combined `conkyrc` and `lua` script) was that you had to set the position for everything using trial and error. Using `lua` and `cairo` I was hoping to avoid that: I get the screen resolution from `xdpyinfo` and make all my dimensions relative to the screen resolution. The problem with this approach is that I still need to adjust the Conky window position from within the `conkyrc` file and (as far as I know) it can't be done programmatically. So my question is, can I use the results from my `lua` script to set Conky configuration variables like `gap_x` and `gap_y`? Or is there maybe another way to set these variables programmatically?


title: Failing on apt-get update

text: Very recently when I have been attempting to check for updates on my laptop (Ubuntu 12.04), the check fails. `sudo apt-get update`:               W: GPG error: http://us.archive.ubuntu.com precise Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>     W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Index     W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Index     W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_restricted_i18n_Index     W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_universe_i18n_Index     E: Some index files failed to download. They have been ignored, or old ones used instead.      `/etc/apt/sources.list` (comments removed):               deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted     deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted          deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted     deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted          deb http://us.archive.ubuntu.com/ubuntu/ precise universe     deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe     deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe     deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates universe          deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse     deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse     deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse     deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse          deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse     deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu precise-security main restricted     deb-src http://security.ubuntu.com/ubuntu precise-security main restricted     deb http://security.ubuntu.com/ubuntu precise-security universe     deb-src http://security.ubuntu.com/ubuntu precise-security universe     deb http://security.ubuntu.com/ubuntu precise-security multiverse     deb-src http://security.ubuntu.com/ubuntu precise-security multiverse          deb http://archive.canonical.com/ubuntu precise partner     deb-src http://archive.canonical.com/ubuntu precise partner          deb http://extras.ubuntu.com/ubuntu precise main     deb-src http://extras.ubuntu.com/ubuntu precise main     deb http://archive.canonical.com/ precise partner     deb-src http://archive.canonical.com/ precise partner      I'm not sure how to solve the issue and appreciate any input.


title: Benchmark performance of NIC IC 82574L on Debian 7.0

text: I figured out my NIC is an IC 82574L 1Gbit/s through ethernet by running `lshw -class network`. Theoretically, this should allow me to transmit and receive packets at a rate of ~125MB/s (I don't need this for network reasons, but rather to transmit at 100MB/s through the Ethernet cable to another hardware piece). My question is if there is a way to benchmark the highest, lowest and average **actual** rates at which my NIC at `eth1` is operating. **Edit** : I've been able to show what I assume is the average rate with the following command               iperf -u -fM -t10 -c <my_devices_IP_address> -b 1G      The question now is it there another way to do a more detailed benchmark with minimums and maximums?


title: inotify does not work with linux kernel 3.4.11

text: I have a Linux running with kernel 3.4.11. I tried to run `inotify-tools`, but it does not work (in fact it does not detect the file changes). I checked the `.config` file of Linux kernel and I found the following lines:               CONFIG_FSNOTIFY=y     # CONFIG_DNOTIFY is not set     CONFIG_INOTIFY_USER=y      Should I set the:               CONFIG_DNOTIFY=y      In order to get the `inotifyd` working?


title: How to determine eth0 gateway address when it is not the default gateway?

text: In my system I have eth0 (which may or may not be connected) and a modem on ppp0 (which always may be up or down). The the case where both interfaces are up and ppp0 is the default route, I'd like to find a way to determine the gateway IP actual address of eth0. I tried "netstat -rn" but in this configuration the output is:               Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     xx.xx.xxx.xxx   0.0.0.0         255.255.255.255 UH        0 0          0 ppp0     192.168.98.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0     127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo     0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0      So how do I determine eth0's gateway address? In the above case the actual gateway address is 192.168.98.1.


title: Is it possible to get file list, byte range from the head of a tar+bzip2 file?

text: Essentially, I'm hoping someone with an advanced knowledge of tar/bz2 can answer whether this is possible. The situation is that we have a periodic 24GB feed of data from a vendor, as a .tbz file. (tar+bzip2). This is downloaded from the vendor via curl. To dramatically speed up this slow process, I'd like to obtain:   * A **list of files** contained in the .tbz file   * the **byte ranges** of the specific files that we care about (a small subset of the whole archive). Curl has the ability specify a byte range for downloading a file, so my hope is that if we download the first x bytes of a file, it might have an index of where we need to seek those relevant files from. From what I understand, tar itself has this information, but I'm not sure if the bzip2 compression allows for this in addition.


title: Where are command line arguments (e.g. 'some.text') actually passed to?

text: From what I know, parameters you pass to a command, goes to it's STDIN stream. so this: `cut -d. -f2 'some.text'` should be perfectly identical to this: `echo 'some.text' | cut -d. -f2` as we send `some.text` to STDIN. In first case through a paramter, in second case via pipe. Where do parameter `some.text` from the first sample go, if not to STDIN?


title: Uniformity of Linux files

text: How is it that, if you are in a folder with various files --- pictures, binary executables, scripts, even directories, zip files, just about everything --- how it is that when you hit `ls -l`, you get output that is similar (to the form) for all files? It is like the files are themselves placed in super files that are uniform, and has meta data attached, sort of like the control block structure of processes. And how come files that you expect would have nothing to do with Unix or Linux pose no problem? Is there like a file system preprocessor to deal with files from the Windows world? Or are files that cross-platform that it is not necessary? (That would be something!) Is there a way you could **see** this hidden (?) layer? (Even HTML (not to mention Lisp etc.) is difficult to understand just reading about it. But when you see it, you understand immediately.)


title: "No such file or directory" lies on Optware installed binaries

text: I've been using Optware to install packages on my ARM-based NAS for a while - the usual stuff like Transmission, Samba and others. However, I'd been having problems with Transmission hanging not long after starting up. I looked around for a solution for a while and finally discovered that the Optware feed I was using wasn't the one that had been set up for my NAS box. I switched the feeds and reinstalled all the packages but now I'm getting the following error when I try and run anything that was reinstalled:               $ smbd     -bash: /opt/sbin/smbd: No such file or directory     $ transmission-daemon     -bash: /opt/bin/transmission-daemon: No such file or directory     $ unrar     -bash: /opt/bin/unrar: No such file or directory      I checked `/opt/bin` and `/opt/sbin` and the executables are definitely there - so what's the real problem?               $ ldd /opt/bin/transmission-daemon     /usr/bin/ldd: line 116: /opt/bin/transmission-daemon: No such file or directory          $ file /opt/bin/transmission-daemon     /opt/bin/transmission-daemon: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped          $ readelf - l /opt/sbin/smbd     readelf: error while loading shared libraries: libc.so.0: cannot open shared object file: No such file or directory          $ cat /proc/$$/maps     …     40084000-4019e000 r-xp 00000000 09:01 112594 /lib/libc-2.7.so     …      I'm not sure what any of that means but it proves the file _is_ there, right? Or is this something to do with the shared libs?


title: Spurious "command not found"

text: I am in the process of trying to build and install pjsua on my embedded board running linux with a kernel which is a variant of 2.6.18.. The board is booted via nfs from my filesystem. I have built the program with my cross compiler, moved it to the directory which represents the filesystem booted to by the board, then tried to run it.               # ./pjsua-arm-unknown-linux-gnu     sh: ./pjsua-arm-unknown-linux-gnu: not found          # ls -lrt pjsua*     -rwxrwxr-x    1 1001     1001      1627777 May 31 10:14 pjsua     -rwxrwxr-x    1 1001     1001      1627777 May 31 12:00 pjsua-arm-unknown-linux-gnu      So, I made hello world using the same compiler, moved it in exactly the same way, and tried to run it;               # ./hello     Hello Everyone!      Here's my PATH               #echo $PATH      /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/local/sbin:/usr/sbin:/sbin:/opt/:.      The executable is in /opt, so fullpath!               /opt/pjsua-arm-unknown-linux-gnu     sh: /opt/pjsua-arm-unknown-linux-gnu: not found      I am completely perplexed. Has anyone got any idea what could be wrong?


title: Why does sh say "not found" when it's definitely there?

text: > **Possible Duplicate:**   >  "No such file or directory" lies on Optware installed binaries I'm trying to add ebtables to a little router box. I went and got a binary compiled for the correct architecture, and put it on the box in `/sbin/`. When I do `/sbin/ebtables`, the shell says `/bin/sh: /sbin/ebtables: not found`, but I can do `ls -l /sbin/ebtables` and it shows up perfectly:               -rwxr-xr-x    1 admin    admin        4808 Aug  4 10:36 /sbin/ebtables      Any ideas about what's going on here?


title: Slow keyboard response in some Distros

text: I will be quick and clear. My keyboard is very slow in Gentoo, Debian, Ubuntu, Arch, PCLinuxOS and LinuxMint. It works fine in Mandriva, Fedora and Sabayon (Gentoo Based) It is slow even in Gentoo installation; without the Xs, with KDE; Gnome, Fluxbox... I just want to use Arch Linux, but I can't even install it ! Help please. EDIT: Can this be the problem ? http://lwn.net/Articles/404712/


title: What is the `less` command line option to page to the next file at the end of the current one?

text: I'm sure there used to be an option in `less` which allowed you to page onto the next file after you reached the end of the current file, so you could just keep *space*ing through a bunch of short files without having to keep `:n`ing to get to the next one. Could someone remind me what it is?


title: Linux Kernel logical address space organisation

text: According to "Write Great Code" in almost all OS run time memory is organized into following regions: > OS | Stack | Heap | Text | Static | Storage/BSS > > [In increasing address fashion] User space process uses higher memory region for its different types of data objects. Kernel space process also have different types of data objects. Do these objects share the user space memory regions (stack, heap etc) or do they have there own separate sub-sections(heap, stack etc) located in OS region.And, if so, what is the order in which they are arranged. Thanks,


title: how to configure mutt as email client in linux for a remote microsoft exchange server?

text: I have a windows xp laptop that has ms-outlook 2007. i didnt have to do anything to set it up. i connected my laptop to office network and it picked up all settings by itself. Now i want to dump this laptop and start replying on my linux(RHEL) desktop. Now i want to use mutt as the email client to my remote exchange mail server. I have got the mail server hostname and it does support IMAP. i don't want to use GUI mail client in Linux. I see that outlook uses exchange proxy to connect and it uses NTLM authentication. I have the username and password for the emails. I did extensive search on internet ont hsi topic and i now come to understand that mutt wont do all client jobs like fetching mails, sending mails, etc. So i haev to use   * sendmail as simple SMTP client, not as mail server.   * procmail   * fetchmail   * and ofcourse configure mutt to use all the above services. The most difficult part is configuring sendmail to send mails. sendmail has far too many options which is scary and all documentation on this subject is very old . Mostly before 2007. can somebody explain what are the steps involved in configuring mutt to recive and send email on my linux machine. These are the few things that i cant compromise on   * it is a must that sendmail be used and not any ther software. b'cos it is already there and it has lots of documentation so if in trouble there will be help   * it should be mutt and none other.   * password should not be available as a plain text in any text file. it should be encrypted if it needs to be stored in a file.   * it should not prompt me for password every now and then.    * Preferably the interval for checking for new mails should be 2 mins.   * All the filters in exchnage that i have already placed should be exported in mutt as well. It will be better if new filters i create in mutt be exported to exchnage. (This is OPTIONAL)   * email should be available both on the server as well as in mutt. This is a absoulte must. Please help me.


title: Auto mount cd or dvd on CLI based ubuntu server

text: I am using Ubuntu server as a samba server. The solution I am looking for is whenever the disks are inserted (cd or dvd) they should get auto-mounted to `/cdrom` directory. Are there any tools for achieving this? I installed ivman, and it is running as a daemon. But it is doing nothing. EDIT 1: Tried autofs, and it doesn't work as well. There is a bug report on launchpad which suggests that autofs for lucid is broken.


title: Network goes down when LAN cable plugged in

text: As per subject, I have a Zimbra mail server on Centos 5.5. and the problem is there that when I plug the LAN cable in to the server port all Internet and network services go down. This means the network is not working and ping also does not work. When I unplug the cable from the server's LAN port everything is OK. Can anybody guide me as to what I could do in this situation.


title: Corrupted gnu-screen session not displaying UTF-8 correctly

text: (Edited to clarify the role of Emacs in the problem with the display.) My current `gnu-screen` session has gotten corrupted somehow, and Emacs fails to display UTF-8 characters properly. I've confirmed that in freshly-started `gnu-screen` processes, Emacs displays UTF-8 characters properly, but at the moment it would be very disruptive to replace the corrupted `gnu-screen` session with a new one, and instead > I'm looking for ways to further troubleshoot the problem with this corrupted > `gnu-screen` session, and hopefully fix it. * * * FWIW, I give more background below, including a description of what I've done so far to diagnose the problem. I started this `gnu-screen` session several days ago at my **OS X** workstation at work with               % screen -U      ...(as I always do). Since then I have re-attached this session from several machines (possibly after first `ssh`-ing to my workstation at work) using               % screen -U -dR      (again, this is what I always do). I did precisely this this morning at my workstation at work (the machine where the `gnu-screen` process is actually running). Today, for the first time since I created this `gnu-screen` session, I needed to work with files that contain a lot of non-ascii UTF-8 characters. It was then that I discovered that this `gnu-screen` session must have gotten corrupted somehow, because it displays all these characters as `?`, resulting in an unusable display. (As I already alluded to, these UTF-8-rich files are displayed correctly by freshly-started `gnu-screen` sessions, so I'm pretty sure that the display problem is with the particular `gnu-screen` session that here I'm calling "corrupted". Also, I confirmed that the "`???` display" shows up in every terminal that I have attached the `gnu-screen` session from, so the problem is not with the terminal program hosting the `gnu-screen` session. Lastly, I _also_ confirmed that the problem is not with one particular Emacs session: in the corrupted `gnu-screen` session, _every_ new Emacs sessions displays the UTF-8 characters as `?`, which argues against the problem being with a particular Emacs session.) I've confirmed that `utf8` is `on` by running               :utf8 on on      The output of `:info` is               (1,5)/(210,52)+10000 +(-)flow app log UTF-8 0(zsh)      And, FWIW:               % /usr/local/bin/screen --version     Screen version 4.00.03 (FAU) 23-Oct-06      Also, I should point out that _new_ What else can I do to troubleshoot this problem? * * * **UPDATE:** Drav Sloan and Stephane Chazelas both asked about my locale settings:               % locale     LANG=     LC_COLLATE="C"     LC_CTYPE="C"     LC_MESSAGES="C"     LC_MONETARY="C"     LC_NUMERIC="C"     LC_TIME="C"     LC_ALL=      Currently, for OS X I don't set any locale-related variables. On Linux systems, my `.zshenv` does set               export LANG=en_US.utf8     export LC_ALL=en_US.utf8      ...but if I put the same lines in my .zshenv on Darwin, I get error messages to the effect that "setting locale failed." I vaguely remember bashing my skull for several hours over the problem of finding the right locale settings for Darwin/Lion. It may have been that "setting nothing" emerged as the "least awful" solution to the problem and, after all, at least fresh `gnu-screen` sessions do display UTF-8 characters correctly, even in the absence of an explicit locale setting. But clearly I need to figure out how to properly set locale in Darwin/Lion... **UPDATE2:** OK, I think I figured out the reason for the errors I mentioned above: in Darwin/Lion, the string `en_US.utf8` is invalid; instead it should be `en_US.UTF-8`.


title: Prevent a command from being executed after another command

text: I would like the shell to warn me for potential errors I'm about to make. How can I prevent a command `cmd2` from being executed after `cmd1`. For example:               $ tar tf file.tar     $ rm !$      Here, I just forgot that I listed the file instead of extracting its content. I'm looking for a generic solution, that makes a choice based on the name and return value of the previous command, and on the current command.


title: How do I recover/use Powerpoint speaker notes after import to LibreOffice Impress?

text: I have several MS Office Powerpoints that I would like to view in LibreOffice Impress. The slides import without any problems, but the speaker notes appear to be missing. How do I recover/access the notes and view them in Impress?


title: Will I be able to build LFS using dash and mawk?

text: I decided that I want to learn more about Linux and try building LFS. I'm using Ubuntu 11.04 as host system and Ubuntu uses dash and mawk by default. I've changed mawk to gawk, but considering that mawk is much faster than gawk I'm thinking that I might want to use mawk anyway. Since making bash the default shell will have a negative effect on the system's performance, especially boot times I'm hesitant to make the change. In the LFS book you can read the following: > Symlinks that point to other software (such as dash, mawk, etc.) may work, > but are not tested or supported by the LFS development team, and may require > either deviation from the instructions or additional patches to some > packages. So I'm basically on my own if something fails, but it might work. So I was hoping that someone with more experience could tell me if it will work and if not what would be required to make it work?


title: unzip to a specific folder

text: I want to unzip the contents of a zipfile called mine.zip into /yours/ but when I do it using the -d flag it keeps going into /your/crap/ etc which is not I want Is there a way to do this?


title: How to transform text such that each output line starts with the block's title?

text: I need to make a script to transform the following:               Name = x:y     Z =  a:b.c     Z1 = a1:b1.c1     End     Name=x1:y1     Z2 = a2:b2.c2     Z3 = a3:b3.c3     Z4 = a4:b4.c4     End     Name = l:k     s = w:e.v     End      into:               x:y Z    a:b.c     x:y Z1   a1:b1.c1     x1:y1   Z2   a2:b2.c2     x1:y1   Z3   a3:b3.c3     x1:y1   Z4   a4:b4.c4     l:k s    w:e.v


title: Meaning and commands for Ctrl+Alt+Del

text: In my gnome GUI desktop of Ubuntu 12.04, `Ctrl`+`Alt`+`Delete` will log out instead of rebooting. But I was told that > Switching to a text-based virtual console and pressing Ctrl+Alt+Delete will > reboot the machine. It will shut down cleanly and reboot, which is much > better than Alt+SysRq+REISUB. So I wonder if the above two different meanings of `Ctrl`+`Alt`+`Delete` are right? What commands `Ctrl`+`Alt`+`Delete` is binded to in these two cases?


title: Is halt the same as "shutdown -H" and poweroff the same as "shutdown -P"?

text: I haven't found a clear answer to the differences between the two options to the command `shutdown`. Is `halt` the same as `shutdown -H` and `poweroff` the same as `shutdown -P`?


title: Bad to own a directory outside of your home directory?

text: Some how, can't remember why, I got into the habit of downloading source to the directory `/opt`, which I `chown` to my user/group. I have this feeling that it is not a good thing to do. Is there anything wrong with owning a directory that is outside of your own home directory?


title: Backtrack 5 installation: StartX error

text: I am trying to install BT5 using USB drive. When I type `startx` command, its not showing the screen, instead its showing:               ddxSigGiveUp: Closing log giving up.     Xinit : No Such file or directory (errno2):unable to connect to X server     Xinit : No such process (errno 3) : server error.


title: Can malware run itself after user enters sudo mode?

text: As far as I know malware is very uncommon in Linux systems, because majority of important commands require root access. So my question is, can malware just wait until I enter `sudo` mode (for example by doing `sudo apt-get update`) and then execute malicious commands in that timeframe while `sudo` mode is active, without user's knowledge?


title: ubuntu linux - security between applications

text: When I run a Ubuntu Linux on my machine, and if using only 1 user account, most of the applications executed are using the same uid. I want to know what risks do applications face in this environment? If all apps run with same uid, the files they create can be read by any of the other processes; I do understand there is process isolation.


title: Determine the size of a block device

text: How can I find out the size of a block device, such as `/dev/sda`? Running `ls -l` gives no useful information.


title: Are there any Linux Distro that features a Tiling Window Manager as main WM?

text: I'm a great fan of Tiling Window Managers, but It's odd that I couldn't find any Linux Distro that features one as main WM. For example, Crunchbang features OpenBox, Bodhi features E17, so... wich one features Xmonad/Awesome/I3/DWM...?


title: How many entries are created when you make a new directory in *nix?

text: As per the question, I am thinking `mkdir ~/a` is either two or three:   * 1 entry for the dir it sits in (`~/a`)   * 1 entry for itself (`cd a && ls .`)   * and/or 1 entry for itself again (`cd a && ls ..`) Could someone clarify if this is two or three?


title: Wifi working after running Live Cd

text: I have been using Ubuntu 10.10, and the major problem was the wifi, which was not working at all. It worked in Ubuntu 9.10. So after many futile attempts I decided run a Live CD of Ubuntu 9.10, and then wifi worked. Then after restarting I was amazed to see that the wifi was now working in ubuntu 10.10. What could be the reason? I tried lot of things, like blacklisting ath5k, but nothing worked out. Now after doing the Live CD, it's working.


title: Linux distribution for the AMD Geode LX 800 (i586)

text: The manufacturer recommendfs RH9 (ugh) and many of the google search hits come up with comments from 2006/7 which detail xorg problems with the AMD video driver and I'm hoping someone here has had recent experience. I have two questions:   1. Which Linux distribution (I'm going use gtk/boost/wxwidgets/cairo)     * My project is going to be a GUI which is moderately performance oriented, so is there any value in going minimal with the entire distro, given that the CPU is 500mhz? I'm thinking that if I can use some manifestation of Ubuntu or some other popular distro with rich repositories, that would probably work out the best for me.   2. Is there a way to simulate the CPU & chipset in a virtual environment (VMWare/VBox etc) so that I don't have to cross compile? I know its x86, so I'm assuming simply compiling on any < i686 arch will work, but I'm sure there are some performance optimizations done per architecture.


title: Linux Mint 13 can't detect SSD &/or Windows 7

text: I'm a newcomer to Linux OSes in general. I'm trying to install Linux Mint 13 Cinnamon alongside Windows 7. Linux Mint can't seem to see/detect either of my SSDs and because of that, it can't read/detect Windows 7. So how do I get Linux to read my SSDs without installing Linux first? And if that doesn't happen, how can I install Linux so that it appears in that "choose OS" list in the boot menu?


title: Download and Install 32-bit Haskell GHC on CentOS

text: I need to install Haskell GHC 32 bit from the command line and I can't find this anywhere. I need to install it because I need `libgmp.so.3` for the 32-bit and i have read somewhere that I can find it when I install the Haskell GHC. Any ideas how can I install it?


title: Where should I mount my external harddrive?

text: I've got an external harddrive that I'd like to auto-mount. It will be present most times when my laptop boots. Where is the "correct" place to mount it?   * `/media/my-hd`: Will litter `/media` with an empty folder when the hard-drive was not mounted.   * `/mnt/my-hd`: I've heard that `/mnt` itself is supposed to be used as a temporary mount point. This happens, for example, during the Arch installation process.


title: CalDAV command line client?

text: I'd like to do my CalDAV from the CLI just as I do my IMAP from `mutt`, what is my best bet as far as clients are concerned?


title: Redirecting the content of a file to the command "echo"

text: I have a file named `my_file.txt` whose content is just the string `Hello`. How could I redirect its content to the command `echo`? I know I have the commands `less`, `cat`, `more`... but I need to do it with `echo`. I tried this:               $ cat my_file.txt | echo      and also this:               $ echo < my_file.txt      But in both cases it appears only a blank in the stdout, not the content of my_file.txt. How could I do that? Thanks in advance :-)


title: rsync: how to exclude the topmost directory

text: So, I have a seemingly simple issue, but so far I haven't found a solution: I want to exclude the topmost directory from an rsync, while still syncing all its children. The particular issue is that I don't have permission to modify the times of the topmost directory, but want all the children to have properly sync'd times. The rsync command I'm using is as follows:               rsync --exclude ./ -rlptDu ./ server.example.com:/usr/local/directory/      and `server.example.com:/usr/local/directory/` looks like this:               drwxrws---  5 root   staff 24576 Jul  9 15:00 .      (my local user is a member of `staff`) When I run rsync, I get the following error:               rsync: failed to set times on "/usr/local/directory/.": Operation not permitted (1)     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]     make: *** [pub_to_mel_internal] Error 23      This is version 3.0.9 on the local machine and 3.0.7 on the remote, both machines running Debian.


title: Check if the command exists in bash

text: I want to check if a given command exists in `bash` and I care only about the native commands of the bash and not the scripts written by the user. When I refer to `native commands` I mean all those commands that are generally available to a user. There are two commands               command -v     type      that can be used to check if the command exists. But it also returns a true for user written scripts whereas I want to restrict myself just to the inbuilt commands. **Note:** I am not just trying to distinguish between a `bash builtin` and other commands because type -t touch gives `file` as the type, but this is a command available to the user by default. But if the user writes a script and then tries to run it then I would like to filter that. Any help is appreciated.


title: About GNOME .gconf, .gnome2 etc. directories in $HOME

text: In users $HOME we know that GNOME keeps various of directories to store user specific configs. I know that `.gconf` is used to store user preferences (keybindings, and other settings) I know that `.config` is used to store application specific preferences Do you know what `.gnome2` and `.gnome2_private` `.gconf.path.defaults` and files`.gconf.path.mandatory` `.gconf.xml.defaults` `.gconf.xml.mandatory` for?


title: Gnome: how to close all applications?

text: I've configured the Debian system on my netbook to shut down whenever the battery runs too low. Problem is, shutting down kills all running applications without giving them any chance to save any document I may be working on. I'd like to write a script to "gently" close all open applications before shutdown kicks in, but I can't find a way to broadcast a "Close" message to all running applications in Gnome. Is there a way? Thanks. EDIT: Hibernating does not work on my netbook, so I can't use it as an alternative solution.


title: What is the difference between ping -w and ping -W?

text: What is the `-w` (deadline) flag in `ping` for? I cannot find a description of it in the `ping` man page; only for `-W`, which takes seconds as a parameter. What is the difference between them, and how can I set a ping timeout (if host is not responding) to 200ms?


title: Session terminates immediately after authentication

text: I have a RedHat 5.3 server with several regular users created. Since last Friday the user "xpto" is getting "Authentication failed" error messages.   * Tha account isn't locked out.   * I have reset the user's password.   * I have deleted and recreated the user "xpto" but the problem persists. Using PuTTY, if the wrong password is entered I get prompted for the correct password. If I insert the correct password the session is immediately terminated. What's wrong?


title: Red Hat Enterprise Linux 6: /boot/grub/menu.lst or /boot/grub/grub.conf?

text: I have a brand new Scientific Linux 6 system, but this same question should apply to CentOS 6, RHEL6 or any RHEL6-derivative. I see that `/boot/grub` contains a `menu.lst` as well as a `grub.conf` file. There is also a symlink from `/etc/grub.conf` to `/boot/grub/grub.conf` which suggests that I should use `grub.conf`.               # cd /boot/grub     # ls -ld grub.conf menu.lst     -rw-------  1 root root 845 Aug 29 13:00 grub.conf     -rw-------. 1 root root 847 Aug 29 13:00 menu.lst     # ls -l /etc/grub.conf     lrwxrwxrwx. 1 root root 22 Aug 29 13:00 /etc/grub.conf -> ../boot/grub/grub.conf      These files aren't provided by an RPM, which makes it difficult to find a changelog describing this change:               # rpm -qa --whatprovides /etc/grub.conf /boot/grub/menu.lst /boot/grub/grub.conf      no package triggers /etc/grub.conf     no package triggers /boot/grub/menu.lst     no package triggers /boot/grub/grub.conf      Which file should I use? Why are there two files? Can you point me at any authoritative documentation? **Update** Interestingly, on a RHEL5.6/5.7 system, `menu.lst` is typically a symlink to `./grub.conf`. The symlink from `/etc/grub.conf` is also there:               # ls -l /boot/grub/menu.lst /boot/grub/grub.conf /etc/grub.conf     -rw------- 1 root root 1036 Aug  2 11:34 /boot/grub/grub.conf     lrwxrwxrwx 1 root root   11 Apr  5 00:42 /boot/grub/menu.lst -> ./grub.conf     lrwxrwxrwx 1 root root 22 Aug  3  2009 /etc/grub.conf -> ../boot/grub/grub.conf      But, this symlink is no longer present in RHEL6. I cannot find any documented reason why this would be.


title: Sort command not working as expected

text: I have got a dataset like this               tack2@domain.com,2009-11-27          overflow@domain2.com,2009-11-27          overflow@domain2.com,2009-11-27      When I am running command to delete all of the same entries of column2               sort -t ',' -k2 stars.txt -u      It is deleting the entry of column1. In order to delete the duplicate entries of column2, I am having to enter `-k3` flag               sort -t ',' -k3 stars.txt -u      Can anyone explain to me why it is happening? Why I have to enter +1 to the column in the file to delete the column?


title: Correct diacritics in a mysql dump on CentOS

text: On my CentOS server, I have got a dump file of a mysql table which contains special czech characters in it (e.g. á, é, č, ž). When I view the file using cat, the special characters are broken (e.g. ĂĄ instead of á). I need to correct those characters in the dump and then import it back to the database. I have tried a few different ways already, but non of them worked, including:   * substitute the characters using sed with the following expression - `cat c_schools | sed 's/ĂĄ/á/g' > c_schools` - but I get an `unterminated s command` error,   * open the file in VIM and fix it manually, but VIM won't let me type the check characters,   * open the file in NANO and fix it manually, but NANO seems to be unable to work with the file at all (the text changes even as I move with the cursor). * * * As suggested in a comment, I opened the file in VIM again and try the following commands:   * `set encoding=utf-8` (this one had no effect at all),   * `set termencoding=iso8859-2` (the output is much better after this one but some characters are still incorrectly displayed, such as ? instead of č, ě or š),   * `:set fileencoding` (outputs `fileencoding=utf-8`) * * * When I copy the file to my Windows machine over FTP and open it in my standard text editor (Notepad++), it is displayed correctly and the encoding used is UTF-8, without BOM.


title: How to properly escape exclamation points in bash?

text: Today, I was caught redhanded while attempting to code golf a password generator for Twitter.               import string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))      90 chars. Since that is a lot of spare space, I decided to raise the bar and make it executable too.               echo -e "#!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg      139 chars. Nice, except obviously bash chokes on the exclamation point.               badp@delta:~$ echo -e "#!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg     bash: !/usr/bin/python\nimport: event not found      Pesky exclamation point. "Let's escape it," I thought! I do have one spare character after all.               echo -e "#\!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg      Obviously...               badp@delta:~$ echo -e "#\!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg     ./pg: line 2: syntax error near unexpected token `('     ./pg: line 2: `import string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))'     badp@delta:~$ cat pg     #\!/usr/bin/python     import string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))      Leaving my asinine code golfing aside -- I can't explain this. With `\\!`, the exclamation point was escaped, except it really wasn't, because the `\\!` was left as-is for `echo` to pick up. One solution could have been using `\x21` instead, but I'm not convinced that's the proper way of escaping an exclamation point in a bash command. tl;dr: **How do you properly escape an exclamation point in a bash command?**


title: NetworkManager: disabled network when sending system to sleep

text: When I suspend my notebook, `NetworkManager` disables the wireless network (in `nm-manager.c:do_sleep_wake`). However, I'd love to still use the network for a very short time (to unmount `cifs` mounts, that otherwise make my system unusable when resuming). How can I make `NetworkManager` _not_ disable my network? Is it possible to wait a few seconds (or until something is triggered; or a lock is released)? Related: pm-utils: No network in suspend scripts? debug log:               Feb  8 10:03:23 zenbook NetworkManager[3606]: <debug> [1360314203.373226] [nm-manager.c:3391] upower_sleeping_cb(): Received UPower sleeping signal     Feb  8 10:03:23 zenbook NetworkManager[3606]: <info> sleep requested (sleeping: no  enabled: yes)     Feb  8 10:03:23 zenbook NetworkManager[3606]: <info> sleeping or disabling...     Feb  8 10:03:23 zenbook NetworkManager[3606]: <info> (wlan0): now unmanaged      EDIT: To make it clear, having scripts in `/etc/pm/sleep.d` does not help as the network already is disabled as soon as a script is executed.


title: emacs change point color to current foreground

text: I'm trying to customize my emacs so that the point color is the same as the foreground on of the character I'm standing on. I have this now:               (defun fixpoint ()       "awesome stuff happening to point"       (interactive)       (set-cursor-color (eyedrop-foreground-at-point)))          (add-hook 'post-command-hook 'fixpoint)      I'm using http://www.emacswiki.org/eyedropper.el for eyedropper. There are 2 problems with this I'm trying to fix. First, the hook is ran after each command which seems a bit overkill. Isn't there a hook for point motion? Second, when highlighting matching braces, the point does not change color. I have to move forward to the next matching brace and jump back to see the actual change in point color.


title: Linux cache evictions

text: Looking at how the VFS cache on my Linux machine behaves, I can see that even when effectively idle (crond and most other daemons stopped, interfaces down) the amount of free memory gradually increases implying that items are being evicted from the cache. I did a lot of googling but can't find any reference to how this is controlled (unless it's a side effect of vm_swappiness). Can anyone put me on the right path to understanding why items are being evicted from the cache when there is no demand for new memory allocation?


title: /media, /mnt, /run and automounting

text: As of Fedora15, a new directory under root was introduced. A couple of quotes: > i.e. /var is "persistant runtime data" and /run is "volatile runtime data", > and /etc is "persistant system config data", and so on.   >  ...   >  only early boot stuff should use /run, for now I am running F18 with the default Gnome desktop and am very new to it. This morning I noticed that automounting defaults to /var/media. Why is that? **When are /mount, /mnt and /run/mount used?**


title: Using xdg-open odt files

text: I am writing a document database using perlTk. Upon double clicking the selected file on my GUI I use xdg-open to use the default application to open the file. I am having some issues opening .odt files (openoffice I think) `xdg-open Add_new_user.odt` returns the error `gvfs-open: file:///misc/croc_common/computing/notes/Add_new_user.odt: error launching application: Failed to execute child process "openoffice.org3" (No such file or directory)` The command openoffice.org (no 3) on my system will open libreoffice. When I enter `xdg-mime query filetype Add_new_user.odt` on the command line I get the following message which I do not understand `application/vnd.oasis.opendocument.text` How do I fix this issue? I am using redhat 6.4


title: Terminator won't open with default profile

text: The below is my Terminator profile. I want it to always open any shell and window with the light profile. If I'm not mistaken, with the configuration below it should open with the "light" profile by default, but it does not. **How do I make it use the "light" profile by default?**               [global_config]     [keybindings]       new_tab = <Ctrl>n       next_tab = <Ctrl>Right       split_vert = <Ctrl>v       split_horiz = <Ctrl>h       prev_tab = <Ctrl>Left     [profiles]       [[light]]         palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#dc322f:#2aa198:#93a1a1"         use_system_font = False         cursor_color = "#002b36"         foreground_color = "#002b36"         show_titlebar = False         background_color = "#eee8d5"       [[dark]]         palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#dc322f:#2aa198:#93a1a1"         use_system_font = False         cursor_color = "#eee8d5"         foreground_color = "#eee8d5"         show_titlebar = False         background_color = "#002b36"     [layouts]         [[default]]         [[[child1]]]           type = Terminal           parent = window0           profile = light         [[[window0]]]           profile = light           type = Window           parent = ""     [plugins]


title: How do I configure my gnome pannel if it does not respond to right-click?

text: ![enter image description here](http://i.stack.imgur.com/8hTzm.png) > $ gnome-session --version   >  gnome-session 3.6.2 > > $ cat /etc/*-release   >  Fedora release 18 (Spherical Cow) I want to customize my gnome-pannel - the bar at the top of the screen. However, right-clicking on an empty area of the bar produces no result (my mouse works fine, mkay). How should I proceed?


title: ksh - map Ctrl-D to exit shell

text: I would like to know how we can map the keys `Ctrl`-`D` in ksh to exit the shell as it does in bash shell. Not much familiar with key binding in ksh. ### Edit My comments are after the `<!--` string below.               $ echo $0     bash     $ exit    <--- I pressed Ctrl-D here, 'exit' string was placed and the shell exited          $> echo $0     ksh     $> Use `exit' to leave ksh  <!-- I pressed Ctrl-D here, Got this message and returned to the ksh prompt     $> echo $0     ksh     $> cat >> somefile     Some text     $>   <!-- I pressed Ctrl-D here. So this key combination is taken as eof char for file, but not for exit.      So, it's needs Ctrl-D to be mapped to exit the shell? How do I do that?


title: Network Simulator ns-2: Modeling of fragmentation in the network with different MTU on routers

text: There is a simple network model. Transfer a file between hosts. There are several routers with different `MTU`. Here is the complete `OTcL` code:               ####################################################################     #                                                                  #     #                               PRESETS                            #     #                                                                  #     ####################################################################          # new simulator object     set ns [new Simulator]          # trace file     set allchan [open /ns2/examples/data.tr w]     $ns trace-all $allchan          # for nam     set visio [open /ns2/examples/data.nam w]     $ns namtrace-all $visio          #procedure triggered at finish time     proc finish {} {         global ns visio allchan              $ns flush-trace              close $visio         close $allchan              exec nam /ns2/examples/data.nam &            exit 0     }          ####################################################################     #                                                                  #     #                               LINKS &NODES                       #     #                                                                  #     ####################################################################     set god [create-god 6]     for {set i 0} {$i < 6} {incr i} {         set node_($i) [$ns node]         }     for {set i 0} {$i < 5} {incr i} {         $ns duplex-link $node_($i) $node_([expr $i+1]) 2Mb 10ms DropTail     }          #============================= hosts ===============================     $node_(0) color Blue     $node_(5) color Blue     #============================ routers ==============================     $node_(1) color Red     $node_(2) color Red     $node_(3) color Red     $node_(4) color Red          ####################################################################     #                                                                  #     #                            AGENTS                                #      #                                                                  #     ####################################################################     set host1 [new Agent/TCP]     $ns attach-agent $node_(0) $host1     $host1 set fid_ 0     $host1 set mtu_ 1500          set router1 [new Agent/TCP]     $ns attach-agent $node_(1) $router1     $router1 set fid_ 1     $router1 set mtu_ 1000          set router2 [new Agent/TCP]     $ns attach-agent $node_(2) $router2     $router2 set fid_ 2     $router2 set mtu_ 800          set router3 [new Agent/TCP]     $ns attach-agent $node_(3) $router3     $router3 set fid_ 3     $router3 set mtu_ 700          set router4 [new Agent/TCP]     $ns attach-agent $node_(4) $router4     $router4 set fid_ 4     $router4 set mtu_ 600          set host2 [new Agent/TCPSink]     $ns attach-agent $node_(5) $host2     $host2 set mtu_ 1500     $ns connect $host1 $host2          ####################################################################     #                                                                  #     #                          APPLICATIONS                            #     #                                                                  #     ####################################################################     set ftp [new Application/FTP]     $ftp attach-agent $host1     $ftp set type FTP          ####################################################################     #                                                                  #     #                           START SIM                              #     #                                                                  #     ####################################################################     $ns at 0.1 "$ftp start"     $ns at 10.0 "$ftp stop"          $ns at 11.0 "finish"     $ns run      ![enter image description here](http://i.stack.imgur.com/lDqzg.png) I want to see the fragmentation of packets, but it is not. What this could be the reason? I suspect that i can not set the `MTU`. It says here that - > Default value of MTU(MaximumTransmission Unit) in ns2 is generally 1500.Now > to change this value according to your research, just go to file > "mac-802.3.h" and change the value of "IEEE_8023_MAXFRAME" and compile it > once again. You can find this file in > > /home/username/ns-allinone-2.xx/ns-2.xx/mac Part of **data.tr** -               + 0.1 0 1 tcp 40 ------- 0 0.0 5.0 0 0     - 0.1 0 1 tcp 40 ------- 0 0.0 5.0 0 0     r 0.11016 0 1 tcp 40 ------- 0 0.0 5.0 0 0     + 0.11016 1 2 tcp 40 ------- 0 0.0 5.0 0 0     - 0.11016 1 2 tcp 40 ------- 0 0.0 5.0 0 0     r 0.12032 1 2 tcp 40 ------- 0 0.0 5.0 0 0     + 0.12032 2 3 tcp 40 ------- 0 0.0 5.0 0 0     - 0.12032 2 3 tcp 40 ------- 0 0.0 5.0 0 0     r 0.13048 2 3 tcp 40 ------- 0 0.0 5.0 0 0     + 0.13048 3 4 tcp 40 ------- 0 0.0 5.0 0 0     - 0.13048 3 4 tcp 40 ------- 0 0.0 5.0 0 0     r 0.14064 3 4 tcp 40 ------- 0 0.0 5.0 0 0     + 0.14064 4 5 tcp 40 ------- 0 0.0 5.0 0 0     - 0.14064 4 5 tcp 40 ------- 0 0.0 5.0 0 0     r 0.1508 4 5 tcp 40 ------- 0 0.0 5.0 0 0     + 0.1508 5 4 ack 40 ------- 0 5.0 0.0 0 1     - 0.1508 5 4 ack 40 ------- 0 5.0 0.0 0 1     r 0.16096 5 4 ack 40 ------- 0 5.0 0.0 0 1     + 0.16096 4 3 ack 40 ------- 0 5.0 0.0 0 1     - 0.16096 4 3 ack 40 ------- 0 5.0 0.0 0 1     r 0.17112 4 3 ack 40 ------- 0 5.0 0.0 0 1     + 0.17112 3 2 ack 40 ------- 0 5.0 0.0 0 1     - 0.17112 3 2 ack 40 ------- 0 5.0 0.0 0 1     r 0.18128 3 2 ack 40 ------- 0 5.0 0.0 0 1     + 0.18128 2 1 ack 40 ------- 0 5.0 0.0 0 1     - 0.18128 2 1 ack 40 ------- 0 5.0 0.0 0 1     r 0.19144 2 1 ack 40 ------- 0 5.0 0.0 0 1     + 0.19144 1 0 ack 40 ------- 0 5.0 0.0 0 1     - 0.19144 1 0 ack 40 ------- 0 5.0 0.0 0 1     r 0.2016 1 0 ack 40 ------- 0 5.0 0.0 0 1     + 0.2016 0 1 tcp 1040 ------- 0 0.0 5.0 1 2     - 0.2016 0 1 tcp 1040 ------- 0 0.0 5.0 1 2     + 0.2016 0 1 tcp 1040 ------- 0 0.0 5.0 2 3     - 0.20576 0 1 tcp 1040 ------- 0 0.0 5.0 2 3     r 0.21576 0 1 tcp 1040 ------- 0 0.0 5.0 1 2     + 0.21576 1 2 tcp 1040 ------- 0 0.0 5.0 1 2     - 0.21576 1 2 tcp 1040 ------- 0 0.0 5.0 1 2     r 0.21992 0 1 tcp 1040 ------- 0 0.0 5.0 2 3     + 0.21992 1 2 tcp 1040 ------- 0 0.0 5.0 2 3     - 0.21992 1 2 tcp 1040 ------- 0 0.0 5.0 2 3     r 0.22992 1 2 tcp 1040 ------- 0 0.0 5.0 1 2     + 0.22992 2 3 tcp 1040 ------- 0 0.0 5.0 1 2     - 0.22992 2 3 tcp 1040 ------- 0 0.0 5.0 1 2     r 0.23408 1 2 tcp 1040 ------- 0 0.0 5.0 2 3     + 0.23408 2 3 tcp 1040 ------- 0 0.0 5.0 2 3     - 0.23408 2 3 tcp 1040 ------- 0 0.0 5.0 2 3     r 0.24408 2 3 tcp 1040 ------- 0 0.0 5.0 1 2     + 0.24408 3 4 tcp 1040 ------- 0 0.0 5.0 1 2     - 0.24408 3 4 tcp 1040 ------- 0 0.0 5.0 1 2     r 0.24824 2 3 tcp 1040 ------- 0 0.0 5.0 2 3     + 0.24824 3 4 tcp 1040 ------- 0 0.0 5.0 2 3     - 0.24824 3 4 tcp 1040 ------- 0 0.0 5.0 2 3     r 0.25824 3 4 tcp 1040 ------- 0 0.0 5.0 1 2     + 0.25824 4 5 tcp 1040 ------- 0 0.0 5.0 1 2     - 0.25824 4 5 tcp 1040 ------- 0 0.0 5.0 1 2     r 0.2624 3 4 tcp 1040 ------- 0 0.0 5.0 2 3     + 0.2624 4 5 tcp 1040 ------- 0 0.0 5.0 2 3     - 0.2624 4 5 tcp 1040 ------- 0 0.0 5.0 2 3     r 0.2724 4 5 tcp 1040 ------- 0 0.0 5.0 1 2     + 0.2724 5 4 ack 40 ------- 0 5.0 0.0 1 4     - 0.2724 5 4 ack 40 ------- 0 5.0 0.0 1 4     r 0.27656 4 5 tcp 1040 ------- 0 0.0 5.0 2 3         ...      In this article says, that ( _Comparison Study of NS-2 and NS-3 to Simulate the Hidden Terminal Problem_ ) - > The core packet data-structure is inappropriate for emulation and > fragmentation is unsupported. How to simulate the fragmentation? Can i model it in **ns-2**? If I use an `TCP`- agent where the `MTU`? part of _tcp.cc_               ...      TcpAgent::TcpAgent() : Agent(PT_TCP),               t_seqno_(0), t_rtt_(0), t_srtt_(0), t_rttvar_(0),              t_backoff_(0), ts_peer_(0),               rtx_timer_(this), delsnd_timer_(this),               burstsnd_timer_(this),               dupacks_(0), curseq_(0), highest_ack_(0), cwnd_(0), ssthresh_(0),               count_(0), fcnt_(0), rtt_active_(0), rtt_seq_(-1), rtt_ts_(0.0),               maxseq_(0), cong_action_(0), ecn_burst_(0), ecn_backoff_(0),              ect_(0), lastreset_(0.0),              restart_bugfix_(1), closed_(0), nrexmit_(0),              first_decrease_(1), qs_requested_(0), qs_approved_(0)      {      #ifdef TCP_DELAY_BIND_ALL      #else /* ! TCP_DELAY_BIND_ALL */              // not delay-bound because delay-bound tracevars aren't yet supported              bind("t_seqno_", &t_seqno_);              bind("rtt_", &t_rtt_);              bind("srtt_", &t_srtt_);              bind("rttvar_", &t_rttvar_);              bind("backoff_", &t_backoff_);              bind("dupacks_", &dupacks_);              bind("seqno_", &curseq_);              bind("ack_", &highest_ack_);              bind("cwnd_", &cwnd_);              bind("ssthresh_", &ssthresh_);              bind("maxseq_", &maxseq_);              bind("ndatapack_", &ndatapack_);              bind("ndatabytes_", &ndatabytes_);              bind("nackpack_", &nackpack_);              bind("nrexmit_", &nrexmit_);              bind("nrexmitpack_", &nrexmitpack_);              bind("nrexmitbytes_", &nrexmitbytes_);              bind("necnresponses_", &necnresponses_);              bind("ncwndcuts_", &ncwndcuts_);      #endif /* TCP_DELAY_BIND_ALL */           }     ...      If i use an `SCTP` agent, i can set different MTU - part of _sctp.cc_               ...     void SctpAgent::delay_bind_init_all()     {       delay_bind_init_one("debugMask_");       delay_bind_init_one("debugFileIndex_");       delay_bind_init_one("associationMaxRetrans_");       delay_bind_init_one("pathMaxRetrans_");       delay_bind_init_one("changePrimaryThresh_");       delay_bind_init_one("maxInitRetransmits_");       delay_bind_init_one("heartbeatInterval_");       delay_bind_init_one("mtu_");       delay_bind_init_one("initialRwnd_");       delay_bind_init_one("initialSsthresh_");       delay_bind_init_one("ipHeaderSize_");       delay_bind_init_one("dataChunkSize_");       delay_bind_init_one("numOutStreams_");       delay_bind_init_one("useDelayedSacks_");       delay_bind_init_one("sackDelay_");       delay_bind_init_one("useMaxBurst_");       delay_bind_init_one("initialCwnd_");       delay_bind_init_one("initialRto_");       delay_bind_init_one("minRto_");       delay_bind_init_one("maxRto_");       delay_bind_init_one("fastRtxTrigger_");       delay_bind_init_one("numUnrelStreams_");       delay_bind_init_one("reliability_");       delay_bind_init_one("unordered_");       delay_bind_init_one("rtxToAlt_");       delay_bind_init_one("dormantAction_");       delay_bind_init_one("routeCacheLifetime_");       delay_bind_init_one("routeCalcDelay_");            /* PN: 5/07. Simulate send window */       delay_bind_init_one("initialSwnd_");       /* PN: 5/07. NR-Sacks */       delay_bind_init_one("useNonRenegSacks_");            delay_bind_init_one("trace_all_");       delay_bind_init_one("cwnd_");       delay_bind_init_one("rwnd_");       delay_bind_init_one("rto_");       delay_bind_init_one("errorCount_");       delay_bind_init_one("frCount_");       delay_bind_init_one("timeoutCount_");       delay_bind_init_one("rcdCount_");            Agent::delay_bind_init_all();     }     ...      ..but fragmentation is still not get -               [root@localhost ...]# ns /ns2/examples/mathm2.tcl     num_nodes is set 6     SCTP ERROR: DATA chunk size (1468) too big!                 SCTP/IP header = 32                 Control chunk reservation = 0                 MTU = 600


title: How does RSyslog receive log messages automatically?

text: _Relevant part:_               anisha@linux-trra~> sudo cat /var/log/messages     Aug 29 13:04:22 linux kernel: imklog 5.6.3, log source = /proc/kmsg started.     Aug 29 13:04:22 linux rsyslogd: [origin software="rsyslogd" swVersion="5.6.3" x-pid="1879" x-info="http://www.rsyslog.com"] start     Aug 29 13:04:22 linux kernel: [7.585951] type=1400 audit(1346225659.436:4): apparmor="STATUS" operation="profile_load" name="/sbin/syslog-ng" pid=807 comm="apparmor_parser" Aug 29 13:04:22 linux kernel: [7.667712] type=1400 audit(1346225659.518:5): apparmor="STATUS" operation="profile_load" name="/sbin/syslogd" pid=830 comm="apparmor_parser"      I couldn't find these PIDs on my system through `ps -el`.   * How do the programs _automatically_ know that they have to send messages to RSyslog?   * Is it that all programs dump their messages at one place, and RSyslog picks up the relevant ones?   * Man page of Syslog says that Syslog reads its messages from a socket in /dev. **So, how does it correlate with the above two points?**


title: stuck at grub rescue on boot, no bios, no live cd, ls returns hd0

text: I have an external hard drive with elementary os on it, and when I took it out my preinstalled windows 8 laptop, it came up with the "error: no such device:'hex number' grub rescue>". I can't boot from the external hdd, no live usbs, can't get to bios, and when I type in ls, it comes back with only "(hd0)". I have found articles that tell how to fix either just the ls problem, or just the boot error problem, but none of them will let me fix all of them. Ask ubuntu is telling me that this is off topic on their site. At this point, I don't think that I really need the files on the computer, but just an operating system on it. Either the elementary, or some way to get back to windows 8. If anyone can help me just install any kind of os on it, I would be overjoyed. The computer is an Asus X502C. When I put in "find /boot/vmlinuz", it just says that "find" is an unknown command.


title: What does x option for sed do actually when exchanging data between hold and pattern buffer?

text: I dont understand what x does when it comes to exchanging the contents of hold and pattern buffer.Does it exchanges the data between hold and pattern so that any previous data in hold or pattern is deleted.what happens exactly.


title: RSA 2048 keypair generation: via openssl 0.5s via gpg 30s, why the difference?

text: RSA 2048 keypair generation: via openssl 0.5s via gpg 30s, why the difference There are several programs which can gerate RSA public/private keypairs GnuPG/OpenPGP for instance has a wizzard being envoked via               gpg --gen-key      OpenSSL can generate a keypair using theses command lines               openssl genrsa -out testkey.private 2048     openssl rsa -in testkey.private -pubout -out testkey.public      for the very same thing, that is generating a keypair RSA 2048 bit I can perceive -on the very same machine- very different times. `openssl` generates a keypair in about 0.5s   `gpg` takes about 30 and even adverts _"move mouse to generate randomness/ entropy"_ Can the difference be explained? I know that gpg does some littel more then just the RSA key creation, yet I do specifically choose option (4)               Please select what kind of key you want:        (1) RSA and RSA (default)        (2) DSA and Elgamal        (3) DSA (sign only)        (4) RSA (sign only)     Your selection?      Therefore really the only thing generated is a 2048bit RSA keypair. Yet the time difference is strinking 30 seconds? To me it seems that either gpg is wasting needlessly time or OpenSSL is not waiting enough time and hence creates insecure keys. My question is what could explain the difference? ### Update The RSA creating must take as an input some randomness. Hence to make certain that the speedy openssl is not simply the result of using some stored up randomness I batchrun it several time               time bash -c "for i in {1..50}; do  openssl genrsa -out /dev/null 2048 ;  done;"      which yields               real    0m16.577s     user    0m16.309s     sys 0m0.092s      which is that for 50 2048bits RSA keys (I assume need a lot of entropy/randomness) openssl still only needed 16 seconds. My assumption here would hence be the "answer" that openssl must be broken. After all I am distrustful my Linux (a 3.2.0-59 kernel) has become so great in generating randomness. Maybe the difference is simply that openssl uses `/dev/urandom` and gpg uses `/dev/random` which if true could explain the time difference my problem is that I do not know how I would find out about this, to verify this. ### update2 To test the source of openssl's random I used               strace -xe trace=file,read,write,close openssl genrsa -out testkey5.private 2048 2>&1 | grep random -A1      which yields               open("/dev/urandom", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 4     read(4, "\x21\xd8\xaa\xf1\x2b\x5f\x4a\x89\x5d\x6c\x58\x82\xc1\x88\x21\x04\xfa\x5b\x18\x98\x8a\x34\x2b\xe3\xf3\xc0\xb1\xef\xfb\x44\x15\x09", 32) = 32      so it seems that 32 bytes from `/dev/urandom` (not the "better" `/dev/random`) is enough for th 2048bit RSA keypair in openssl. Therefore it is so fast! ### Measurements 2048bit RSA keypair generation means   * 32 bytes of only `/dev/urandom` (using openssl)   * 300 bytes of `dev/random` (using openPGP GNU Privacy Guard) this explains of course the time difference!


title: PHP+FastCGI+nginx on Debian

text: I new with Debian. I want to use php on Debian. I do:               apt-get install php5-cli php5-cgi spawn-fcgi      Create file `/usr/bin/php-fastcgi`:               #! /bin/sh     PHP_FCGI_CHILDREN=3     PHP_FCGI_MAX_REQUESTS=1000     exec /usr/bin/php5-cgi      Create file `/etc/init.d/init-fastcgi`:               #!/bin/bash     PHP_SCRIPT="/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f     /usr/bin/php-fastcgi"     RETVAL=0     case "$1" in     start)     $PHP_SCRIPT     RETVAL=$?     ;;     stop)     killall -9 php5-cgi     RETVAL=$?     ;;     restart)     killall -9 php5-cgi     $PHP_SCRIPT     RETVAL=$?     ;;     *)     echo "Usage: sudo /etc/init.d/init-fastcgi {start|stop|restart}"     exit 1     ;;     esac     exit $RETVAL      Ater do:               chmod 755 /usr/bin/php-fastcgi     chmod 755 /etc/init.d/init-fastcgi       Into `/etc/nginx/sites-enabled/default` add:               location ~\.php$ {      root /srv/www/ekb.mydomain.com/public_html;      include /etc/nginx/fastcgi_params;      fastcgi_pass 127.0.0.1:9000;      fastcgi_index index.php;      fastcgi_param QUERY_STRING $query_string;      fastcgi_param SCRIPT_FILENAME /srv/www/ekb.mydomain.com/public_html$fastcgi_script_name;     }      Create directories:               /srv/www/ekb.mydomain.com/public_html     /srv/www/ekb.mydomain.com/logs      Create file `/srv/www/ekb.mydomain.com/public_html/test.php`               <?phpinfo();?>      Start serice:               /etc/init.d/init-fastcgi start     /etc/init.d/nginx start      In browser:                www.ekb.maydomain.com/test.php       but get 404 error. What i can do wrong?


title: How to start a program in the background

text: The program **Boblight** does not run in background. There is no noticeable difference between executing               sudo boblightd      and               sudo boblightd&       How can I solve this problem that the console will not block further inputs?               pi@raspberrypi ~/boblight/boblightd-for-raspberry-master $ sudo boblightd     Boblightd 2.0 (optimized version for raspberry) (c) 2013 Speedy1985 and Heven)     (InitLog)                       start of log /root/.boblight/boblightd.log     (PrintFlags)                    starting boblightd     (CConfig::LoadConfigFromFile)   opening /etc/boblight.conf     (CConfig::CheckConfig)          checking config lines     (CConfig::CheckConfig)          config lines valid     (CConfig::BuildConfig)          building config     (CConfig::BuildConfig)          built config successfully     (main)                          starting devices     (CClientsHandler::Process)      opening listening TcpSocket on *:19333     (CDevice::Process)              ambilight: starting with output "/dev/spidev0.0"     (CDevice::Process)              ambilight: setting up     (CDevice::Process)              ambilight: setup succeeded               pi@raspberrypi ~/boblight/boblightd-for-raspberry-master $ sudo boblightd&     [1] 2289     pi@raspberrypi ~/boblight/boblightd-for-raspberry-master $     Boblightd 2.0 (optimized version for raspberry) (c) 2013 Speedy1985 and Heven)     (InitLog)                       start of log /root/.boblight/boblightd.log     (PrintFlags)                    starting boblightd     (CConfig::LoadConfigFromFile)   opening /etc/boblight.conf     (CConfig::CheckConfig)          checking config lines     (CConfig::CheckConfig)          config lines valid     (CConfig::BuildConfig)          building config     (CConfig::BuildConfig)          built config successfully     (main)                          starting devices     (CClientsHandler::Process)      opening listening TcpSocket on *:19333     (CDevice::Process)              ambilight: starting with output "/dev/spidev0.0"     (CDevice::Process)              ambilight: setting up     (CDevice::Process)              ambilight: setup succeeded


title: How to Use Encrypted password in shell script AIX

text: I had written a shell script that will connect with the Database to perform some operations This is my sample code               #!/usr/bin/ksh     . /home/ram/.profile          sqlplus username/pwd@TNS<<EOF     select sysdate from dual;     exit;     EOF      I am using this code in `AIX` system , I want the **pwd** to be encrypted. Is there any command in shell , I heard `crypt` command is having some security problems _Programs for breaking crypt(1) encryption are widely available. Bob Baldwin's Crypt Breaker's Workbench,[2] which was written in 1984-1985, is an interactive tool that provides successive plaintext guesses that must be corrected by the user. Peter Selinger's unixcrypt-breaker[3] uses a simple statistical model to guess plausible plaintexts, and does not require user interaction._ (source- **wikipedia** ). Even though I tried crypt command in my AIX , but it throws error               [shell-ksh]$uname         AIX     [shell-ksh]$crypt     ksh: crypt: command not found     [shell-ksh]$echo $SHELL     /usr/bin/ksh      I like to know about any secure method to encrypt the password in shell ?


title: Fastest way to get an Euro symbol at a prompt?

text: First of all I'm working on a keyboard using a QWERTY layout. Now once in a while I need to get the Euro (€) symbol in my terminal (typically in a xterm). If I cut'n'paste the Euro symbol, it shows up fine in my xterms, which have their locale set like this:               $ echo $XTERM_LOCALE      en_US.UTF-8      How can I configure my Linux (Debian / X) so that I can easily (and fastly) output an Euro symbol, without messing my setup? (for example, I'm not switching to a non-QWERTY layout). I don't care if it only works in X / xterm, that would be good enough for me. Ideally I'd need a way to configure a shortcut that I can change to my will, to be sure it wouldn't interfere with my usual shortcuts. Say, if I want to have _ctrl+alt+e_ to output:€ in my xterm, how would I go about it?


title: How to add a horizontal split to tmux window that spans the whole width of the parent window?

text: When I have a tmux window vertically split into two panes, how can i spawn a new third horizontal pane that stretches over the full width? e.g. How do I get from this: `Ctr-b %`               +–––––––––+–––––––––+     |         |         |     |         |         |     |         |         |       |         |         |     |         |         |     +–––––––––+–––––––––+      * * * to this? `Ctr-b %`   `Ctr-b` ...now what?               +–––––––––+–––––––––+     |         |         |     |         |         |     |         |         |       |         |         |     |         |         |     +–––––––––+–––––––––+     |                   |     |                   |     +–––––––––––––––––––+      * * * instead of this? `Ctr-b %`   `Ctr-b "`               +––––––––+––––––––––+     |        |          |     |        |          |       |        |          |     |        |          |     |        |          |     |        +––––––––––+     |        |          |       |        |          |     +––––––––+––––––––––+      Note: I don't want to cycle through all possible layout combinations via `Ctr-b Space` to eventually get to the desired layout - it should be achieved with as much brevity as possible.


title: Place job in background without freeze

text: Say you start the job like this               foo      and then desire that you want to place it in background. Typing `Ctrl`+`Z` and then `b``g` does the trick but will freeze `foo` between `Ctrl`+`Z` and `b``g`. How can I place foo in the background without first freeze it?


title: Purpose and typical usage of /etc/rc.local

text: The header looks like this:               #!/bin/sh -e     #     # rc.local - executed at the end of each multiuser runlevel     #     # Make sure that the script will "exit 0" on success or any other     # value on error.      What is the reason for this file (it does not contain much), and what commands do you usually put in it? What is a "multiuser runlevel"? (I guess `rc` is "run commands"?)


title: Help w/ Minimal Notifications? (Pipes?)

text: I am trying to instate a more minimally-graphic notification scenario in Arch Linux. Specifically, I've taken interest with programs such as dzen2 or conky that allow for more text-based status bars. I was wondering if it was possible to pipe notifications (as in the libnotify, "notify-send" ones) to a status bar made from programs like dzen2 and conky. I currently use Openbox and like to switch WM's in a while, so advice that is more WM-agnostic is greatly appreciated. If this question is too opinionated, a more concrete alternative would be where I can read more about status bars, or whether or not there is an easier or more standard/documented approach I could try.


title: Average rows with same first column

text: Given a file with two columns:               Id  ht     510 69     510 67     510 65     5l0 62     510 59     601 29     601 26     601 21     601 20      I need a way to coalesce all rows with the same ID into one that has an average height. In this case, (69 + 67 + 65 + 62 + 59) / 5 = 64 and (29 + 26 + 21 + 20) / 4 = 24, so the output should be:               Id  Avg.ht      510 64      601 24      How can I do that using sed/awk/perl?


title: Reject SSH connections from unlisted countries, using hosts.allow/hosts.deny on CentOS

text: I was trying for few hours to make my custom script work when using `hosts.allow/hosts.deny`, to prevent connections to SSH and other services supporting _TCP wrappers_ from unlisted countries. Example with SSH:   1. **hosts.deny** file `sshd : ALL`   2. **hosts.allow** file `sshd: ALL: spawn /usr/local/bin/country_filter %h`   3. **country_filter** script: * * *               #!/bin/bash          # Specify the two-letter ISO Country Code(s) to accept     ALLOW_COUNTRIES="RU\|CY" # list of country codes in the exampled format ("RU\|GR\|CY")          COUNTRY=`/usr/bin/geoiplookup $1 | /bin/grep -w $ALLOW_COUNTRIES`          [[ $COUNTRY ]] && RESPONSE="ALLOW" || RESPONSE="DENY"          if [ $RESPONSE = "ALLOW" ]     then       echo "$RESPONSE"       exit 0     else       echo "$RESPONSE"       exit 1     fi      * * * The script above works great from console but I _could not_ make it work, when using **hosts.allow**. What am I missing here?


title: help installing checkinstall locally

text: I'm trying to install checkinstall locally in my home directory. Though, in the `INSTALL` file is only described how to do a system wide installation:               Simple enough:          make     su     make install     checkinstall      Instead I'd like to use the `configure` script this way:               ./configure --prefix=~/opt/     make     make install     checkinstall      but checkinstall distribution doesn't provide `configure`. I think it's possible to do what I want meddling with make files, but I'm not an expert and need your help on what to do.