Memory display using md in u-boot

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.


How to set metadata for music files?

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)_


Switch User won't work in Xfce

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


interpretation of coninfo in uboot

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 ?


grepping with "shopt -s globstar extglob"

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?


Move GRUB from USB to HD

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.


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

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?


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

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


New source install over existing one

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.


different shell for root and non-root user

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?


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

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.


Standard command line syntax ambigiuty in interpretation rules?

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?


Editing Conky configuration variables from Lua

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?


Failing on apt-get update

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.


Benchmark performance of NIC IC 82574L on Debian 7.0

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?


inotify does not work with linux kernel 3.4.11

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?


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

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.


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

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.


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

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?


Uniformity of Linux files

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.)


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

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?


Spurious "command not found"

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?


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

> **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?


Slow keyboard response in some Distros

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/


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

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?


Linux Kernel logical address space organisation

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,


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

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.


Auto mount cd or dvd on CLI based ubuntu server

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.


Network goes down when LAN cable plugged in

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.


Corrupted gnu-screen session not displaying UTF-8 correctly

(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`.


Prevent a command from being executed after another command

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.


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

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?


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

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?


unzip to a specific folder

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?


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

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


Meaning and commands for Ctrl+Alt+Del

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?


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

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`?


Bad to own a directory outside of your home directory?

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?


Backtrack 5 installation: StartX error

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.


Can malware run itself after user enters sudo mode?

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?


ubuntu linux - security between applications

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.


Determine the size of a block device

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


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

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...?


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

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?


Wifi working after running Live Cd

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.


Linux distribution for the AMD Geode LX 800 (i586)

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.


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

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?


Download and Install 32-bit Haskell GHC on CentOS

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?


Where should I mount my external harddrive?

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.


CalDAV command line client?

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?


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

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 :-)


rsync: how to exclude the topmost directory

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.


Check if the command exists in bash

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.


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

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?


Gnome: how to close all applications?

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.


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

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?


Session terminates immediately after authentication

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?


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

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.


Sort command not working as expected

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?


Correct diacritics in a mysql dump on CentOS

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.


How to properly escape exclamation points in bash?

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?**


NetworkManager: disabled network when sending system to sleep

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.


emacs change point color to current foreground

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.


Linux cache evictions

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?


/media, /mnt, /run and automounting

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?**


Using xdg-open odt files

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


Terminator won't open with default profile

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]


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

![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?


ksh - map Ctrl-D to exit shell

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?


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

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


How does RSyslog receive log messages automatically?

_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?**


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

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.


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

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.


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

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!


PHP+FastCGI+nginx on Debian

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?


How to start a program in the background

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


How to Use Encrypted password in shell script AIX

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 ?


Fastest way to get an Euro symbol at a prompt?

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?


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

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.


Place job in background without freeze

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?


Purpose and typical usage of /etc/rc.local

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"?)


Help w/ Minimal Notifications? (Pipes?)

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.


Average rows with same first column

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?


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

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?


help installing checkinstall locally

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.


Are there any drawbacks from using mount --bind as a substitute for symbolic links?

Symlinks have limitations in how functions like `ls`, `mv`, and `cp` can operate on them because unlike shell initiated commands like `cd`, these functions do not have information about how the user accessed the directory with respect to the logical path (see related post). It seems like using the `mount --bind` option instead can get an around this, offering increased functionality and compatibility with samba and other file servers because the mounted directory will then have two independent physical paths, instead of a link. I would like to replace all of my symbolic links with references using the `mount --bind` option but this would mean mounting over 150 points in fstab. Are there any performance issues that could potentially arise from this or any other drawbacks that I should consider? Thanks for any advice.


bash: dynamic environment control

I have an application which modifies environment variables. The intent is to launch a bash shell with a modified context-specific environment. When my application modifies the environment, and exec()s "bash --noprofile --norc" with the modified environment then I almost get the behavior I want, except that aliases are dropped. If I log in and open a shell directly from the OS, I get the "normal" aliases, but if my application launches a bash, then I don't get any aliases because the initialization files are skipped. Is there any way to have bash initialize from a dynamic source? In other words, it would be helpful if I could have my application launch "bash" with all its various user/facility settings (including aliases) and then at the end of that, source the differences that my application needs to apply. Ideally, this would leave open a shell prepped and ready to go for my users. I'm not finding this (or perhaps understanding it) from the man page. In an ideal world, we could refactor the user/factory settings to be more reentrant (aware of the application, and skip reinitialization steps that don't need to happen again); but in practice this is turning out to be a little bit of a hassle. Any suggestions? Thanks.


X11 blank vs dpms off

I've been playing around with the dpms/blanking settings on a version of Linux built via yocto. Something odd I've noticed is that "blank" and "dpms off" both put the monitor to sleep. I had thought blanking would just, well, blank the screen, and not actually power off the monitor. Am I mistaken? Blanking test:               $ xset s blank     $ xset s activate      DPMS test               $ xset dpms force off      What I'd like is to just blank the screen on a short interval and then actually power off the monitor after a longer interval. Perhaps I should look at a minimal black screensaver instead of using the built in blank.


vmstat IO stats: why the high bo during a download?

On my RHEL 4 machine, I was downloading a huge file (2.5GB)..I was checking the output of vmstat and was especially curious about seeing the disk IO using bi and bo. I know iostat is a better tool suited for this but didn't have it installed on this machine. Anyways, I was expecting bi (bytes in) to be high during the download but found the exact opposite...bo (bytes out) was very high during the download where as bi was mostly 0 with occasional numbers?? Also, without iostat, is there a better tool than vmstat that is available Out of the Box in a Red Hat machine?


How can I chroot into a filesystem with a different architechture?

I'm trying to `chroot` into a Arch Linux `ARM` filesystem from `x86_64`. I've seen that it's possible to do using static `qemu` by copying the binary into the chroot system:               $ cp /usr/bin/qemu-arm archarm-chroot/usr/bin          But despite this I always get the following error:               chroot: failed to run command ‘/bin/bash’: Exec format error      I know this means that the architectures differ. Am I doing something wrong?


How can I get the GNU screen command to automatically start with every BusyBox ash session?

On an embedded device with BusyBox installed I want to set it up so that the gnu screen command is automatically started when any BusyBox session is started. I have seen that I can add the screen command into the `/etc/profile` file but are there any other ways of doing this?


Can Safecopy Help Me Recover Data from a Drive that I can not Mount?

I have an old hard drive that I put data on, but it died when I tried to retrieve it, and it tells me I have to format it under Windows. Running on Linux now, can Safecopy help me even though I can not mount it? This is the error I get when I try to mount it:               Error mounting: mount exited with exit code 13: ntfs_attr_pread_i: ntfs_pread failed: Input/output error     Failed to read vcn 0x0: Input/output error     Failed to mount '/dev/sdb1': Input/output error     NTFS is either inconsistent, or there is a hardware fault, or it's a     SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows     then reboot into Windows twice. The usage of the /f parameter is very     important! If the device is a SoftRAID/FakeRAID then first activate     it and mount a different device under the /dev/mapper/ directory, (e.g.     /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation     for more details. It says input output error... but I thought that was why Safecopy was made? Any info would be great.


Ran out of inodes on NFS

I have a RHEL 6 box with an NFS mount, mounted using autofs. I copied a big folder, with a lot of small files there, and used up all of my inodes, but I still have 80% of my storage space left, this is a real pain! What is the easiest way out of this? I'd prefer not to have to remove anything from the NFS mount, and resizing isn't really an option right now. Is there some mount options or some other trick to be able use this NFS mount?


Redirect stderr from an already running script

I've been running a script for several days now. I redirected stdout to `$HOME/mylog`, but didn't redirect stderr since I thought there would be nothing on it. Suddenly thousands of lines started coming out on stderr, so I suspended the job. Is there a way I can redirect stderr to `$HOME/myerr` from now on, without needing to restart the script? I have sudo access on the box and it's OS X. Perhaps something using dtools trapping? I cannot lose the work the script has done so far and restart it from scratch. Is there a way to "dump the in-memory objects" on disk, freeze the program, edit the variables (e.g. the file descriptors) and _resume_ with the new context?


DHCP and WiFi Connectivity

If WiFi Dongle is associated successfully to Access-Point then is there any way to get notification ? I want to run some script (dhclient), if and only if, association is successful. Only way, that I know, is to record the log of `wpa_supplicant` with verbose mode, and search for the keyword `EAPO authentication completed successfully`. But, I guess, there must be some other way to do so. command-line solution is required as I normally work in CUI. I'm using Ubuntu-13.10.


vim - open file and goto line number using <filename>:<line nbr>:

Several tools such as `grep`, `py.test`, etc ... use the pattern `<FileName>:<line number>:` to point to errors. For example:               ; grep -Hn Common setup.cfg     setup.cfg:11:    Common      How can I modify vim and gvim so that I can invoke them like so:               gvim setup.cfg:11:      instead of               gvim setup.cfg +11      I know that I can write a small shell script that would parse things but I wonder if there is an easier way.


Learning the Unix/Linux Kernel

I've been reading The Design of the UNIX OS by Maurice J Bach. It's good overall. However, I learn better with audio/visual aids so does anyone know some good video lecture series or tutorials for either Unix or the Linux kernel? I would also like to walk through the kernel code after I've learnt the basics of the kernel. So any suggestions are welcome.


Login to super user for running script

I have `sample.sh` script in `/u01/dump` location. I'm running it from root. My requirement is while running the `sample.sh` script it has to be login as oracle1 user using SU (super user) and display all files in `/u02/dba/` directory.


How can I view files in zip using putty?

I want to view file list in zip archive using putty without unzip the archive. Is it possible?


Another account with same uid as root gets prompted to set new password for root, not itself

After upgrading the os from 5300-06 to 5300-11, this weird behaviour happened. My system had another unix account, let's call it " **abc** ", purposely configured its uid to **0** for working as a **root** with all its authorities. It has been run like this for years and worked completely fine. However after the upgrade, when abc's password expires, rather than prompting immediately after its successful login for a new password, it is now asking to change " **root** "'s password, and it really is changing root's password not abc's. If I change **abc** 's uid to another unique id, it will successfully says to change **abc** 's password when prompted. There are a lot of reasons why I cannot change **abc** 's uid. So what I'm trying to find out is, why is this happening and how can I " _fix_ " it? Is it really caused by the OS upgrade?


Open signed PDFs in Linux

We have some PDF files which are secured by a **.pfx** certificate. On Windows we can use Adobe Reader to read these PDF files (with previously imported certificate). I've googled for a long time but I can't find a PDF reader which can open this.


Is killing processes created on startup safe?

I've just got a vserver running debian 7 and whenever I start the server and call the `top` command, there are very many processes that were started automatically on startup. Can I kill them or are they critical for general functionality of the vserver?


Populate an entire pre-configured workspace in i3wm

Is it possible with I3Wm to populate an entire workspace with determined size, position and commands for each window? I know I can do `i3-msg "exec xterm -e 'ls; bash'"` to create a new window, but I can't specify his position and size. Maybe there is also an alternative by declaring via JSON the layout or something like that?


How to flash firmware under Linux in practice?

Well, I am feeling too old for jumping through several burning hoops to upgrade several firmwares via the usual vendor-specific way: Download some DOS tools, waste some time creating a (Free-)DOS boot medium and wasting more time to make the BIOS actually boot from that and finally flash the firmware upgrade. This is so 1980-ies. I come across some linux flash tool from the Coreboot project. It seems to support various FLASH-chips. But how does it work in practice? I guess there are some pitfalls converting vendor supplied firmware upgrades into the right format. Or what about indentifying the right destination chip? Currently I probably have to upgrade for example:   * the firmware of some Seagate 1.5 TB disks   * the firmware of an old Abit Athlon 64 board (Award bios)   * Bios/Embedded-Controller-Bios of a Thinkpad How do you upgrade your devices firmware at a Linux system?


External tablet input devices for Linux (Inkscape/Gimp)?

What are good external tablet input devices for Linux? It should be used for more convenient use of Inkscape and Gimp. Some characteristics that are useful, I guess:   * connected via USB   * included pen with some buttons   * tablet should only be sensitive to pen touches   * Open-source drivers (a must)   * some OS engagement by the vendor Open questions:   * What are good sizes of such tablets in practice?   * Is there is some good guide how to setup it under Linux/X?   * What are other great programs that are really easier to use with a tablet?


Start X as a user other than root

I know some distro's (Moblin? ) have X starting as a user other than root already... What is required to do this? What steps need to be taken? _I don't think it matters but I think X is started by KDM on my system and I'm running Arch Linux_


How to create an upstart process in Ubuntu?

I am trying to create a process to be automatically started and maintained by Ubuntu's upstart (Ubuntu 12.04). I have been looking at this page as well as on this page and I am aware of the upstart cookbook and upstart stanzas. Using especially the information from the first two likes, I did the following to incorporate such a process. First, I created a file `/etc/init/testservice.conf` with the following content:               # myservice - myservice job file          description "my service description"     author "Me <myself@i.com>"          # Stanzas     #     # Stanzas control when and how a process is started and stopped     # See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn          # When to start the service     start on runlevel [2345]          # When to stop the service     stop on runlevel [016]          # Automatically restart process if crashed     respawn          # Essentially lets upstart know the process will detach itself to the background     #expect fork          chdir /home/user/testcode          # Start the process     exec python mycommand.py      with some simple dummy python code `mycommand.py` residing in the directory `/home/user/testcode`. Checking with `initctl list` or `ps` I see that the command is not yet running. Therefore, I tried to start it 'manually' according to this page with               start testservice      which produced the following output               start: Rejected send message, 1 matched rules; type="method_call", sender=":1.88" (uid=1000 pid=9103 comm="start testservice ) interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" estination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")      but did not start the process `mycommand.py`. What am I doing wrong? How to tell `ubuntu` and/or `upstart` to run the command?


Linux + replace STRING/WORD in file according to rule

My target is to replace any word/string/Any characters in file with new word/string according to the following rules:   1. If numeric characters on the left side of word/string then we not replace the word   2. If numeric characters on the right side of word/string then we not replace the word remark - numeric means any number or [a-z] or [A-Z] The following Example described file before , and file after: I want to replace the word "$$OLD_WORD$$" with "&&NEW_WORD&&" example 1 - file Before replacement                 more file             ABC$$OLD_WORD$$ABC       $$OLD_WORD$$GG       $$OLD_WORD$$       1$$OLD_WORD$$      example 2 - file after replacement                 more file            ABC$$OLD_WORD$$ABC       $$OLD_WORD$$       &&NEW_WORD&&       1$$OLD_WORD$$      So in order to replace the word regarding the rules (1,2) that I mentioned I write the following syntax (this Perl command exists in my ksh script)                    perl -pe 'next if /^#/; s/(\Q|[[:^alnum:]])$ENV{OLD_TEXT}(\E|[[:^alnum:]])/$1$ENV{NEW_TEXT}$2/g' file      But this perl command not does the replacement as example 2 !!! The following Example described what I get from my Solaris/linux machine:                   export OLD_TEXT='$$OLD_WORD$$'         export NEW_TEXT='&&NEW_WORD&&'               perl -pe 'next if /^#/; s/(\Q|[[:^alnum:]])$ENV{OLD_TEXT}(\E|[[:^alnum:]])/$1$ENV{NEW_TEXT}$2/g' file                               &&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&                  &&NEW_WORD&&ABC$&&NEW_WORD&&$&&NEW_WORD&&OLD_&&NEW_WORD&&WORD$&&NC               &&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&    &&NEW_WORD&&$&&NEW_WORD&&$&&NEW_WORD&&OLD_&&NEW_WORD&&           &&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&&&NEW_WORD&&     &&NEW_WORD&&1$&&NEW_WORD&&$&&NEW_WORD&&OLD_&&NEW_WORD&      **Please advice what I need to fix in my perl syntax in order to get results as example 2?** .


How can one provide colour to tab completion in tcsh?

(Crossposted from StackOverflow.com) This question and the answer teach us how to introduce colour into tcsh prompts. This webpage explains nicely how to get colour into any output of the `echo` command:               > echo \\e[1\;30mBLACK\\e[0m     BLACK     > echo '\e[1;30mBLACK\e[0m'     BLACK      The word 'BLACK' in the example above is printed with a black (or darkgrey) foreground colour (depending on the overall color scheme). Now I'd like to introduce this into the `[TAB]` command autocompletion feature of `tcsh`. I tried:               complete testcmd 'p/*/`echo '"'"'\e[1;30mf834fef\e[0m'"'"'`/'      And I get:               > testcmd [TAB]     > testcmd ^[\[1\;30mf834fef^[\[0m      Obviously the characters lose their special meaning. Hopefully I just did not get the escaping right. But I tried several other ways. So any help is appreciated. The real use case is that I've got a command completion that offers three different types of completions and I'd like to visually distinguish the types. Also the alternatives are computed by an external command. That is why I need the completion to use the backticks with an external command, such as `echo`. I don't care about the details of this command. If you make it work in any way with the `tcsh`'s `complete` command I'll probably be able to adapt (thinking `perl -pe` wrappers and such). The reason why I believe this _has_ to work somehow is that the tcsh itself offers coloured command completion if you e.g. type `ls [TAB]`. That works correctly in my setup. Also you can use `ls -1F` inside the autocompletion and the colours that `ls` outputs are also piped through. An example would be:               complete testcmd 'p/*/`ls -1F`/'      Update: As user mavin points out on stackoverflow, the colourization of `ls` in this example is indeed not piped through. The colours of `ls` are lost, but the auto completion can reapply colours according to LS_COLOURS variable based on hints such as the `/` and `*` marker endings as added by the ls. This can be verified by doing               complete testcmd 'p/*/`ls --color -1`/'      which fails to provide colour, and only provides garbled output. (Literally pipes through the escape character sequences) I'm on `tcsh` version 6.13.00 Any ideas? Pointers?


What is the equivalent for 'www-data' for CentOs?

CentOs doesn't recognise www-data but want to change ownership on my files folder. All my folders are owned by root at the moment. Confused as to what should be owned by apache and what she be owned by me the root user? Also when it says root root does that mean root user me and group apache root?


Does Android's implementation of SELinux's M.A.C. inhibit root apps with root privileges from accessing app data?

**Starting with Android 4.4 SELinux's MAC is enforced. Does this mean that if an app somehow can get installed and exploit the kernel to get root privileges, that MAC will still prevent that app with root privileges from accessing private app data?** Android Documentation says: SELinux can be used to label these devices so the process assigned the root privilege can write to only those specified in the associated policy. In this way, the process cannot overwrite data and system settings outside of the specific raw block device. - http://source.android.com/devices/tech/security/se-linux.html#use-cases As a reference I am implementing a Mobile Device Management system and in the process I have to determine how secure Android OS is itself. That is why I need to know how secure corporate data stored on a device is to root-kits, spyware, and other malware.