How to trace process scheduling of certain process?

For a project at my university I am researching ways to trace, log and manipulate the process scheduling of certain processes. I would like to launch an number of applications, everyone in a single process. At first I would like to trace and log their scheduled execution. But at the next step I would like to manipulate their scheduled execution in order to prefer a single process in it's first `$n` execution. Does someone know an existing approach to realize this (for instance a modified sched.h)?


How does prelink work

I was wondering how prelinking works. If I prelink my whole system and than delete glibc, will the system 'get up' after restart?


How to make sure the shell builtin echo is invoked so that its not visible in process list?

Is this going to be visible in the process listing if the below line is executed from a command line or a shell script               bash -c "echo $password"      or i just need to do `echo $password` from within bash on a command line or inside bash shell script is there any test i can do to check such visiblity. i was just trying this but i wasn't able to see it in the process listing with `ps -ef | grep testscript` testscript:               i=0     while (( i < 100 ))     do     ((i=i+1))     sleep 1     echo $$     echo hello     uname     done


How many files is equal to 1 inode

I am quite confused about the i-nodes. They say delete files to reduce the i-nodes but I have deleted 100s of log files from different cpanels on my server but inode count is still the same.


Expect can not expect the output

I have problem with my simple code, the expect can not expect the output               set timeout 10     set user username     set password password     spawn  ssh $user@000.000.000.000     expect "Password:"     send "$password\r"     expect eof     send "cv mk ghassan-test-5\r"     sleep 45     expect "ok" { send "cv set ghassan-test-5\r" }     sleep 20     expect -gl "Ok" { send "cv rbset ghassan-test-5\r" }     expect eof     sleep 20     expect -gl "Ok" { send "cv ls\r" }     sleep 10     expect eof`     send "exit\r"      the script run and and enter to the remote server but after `send "cv mk ghassan-test-5\r"` the output is generated, ..... **_Please wait while database is writing to disk. Writing the database file can take minutes... ok_** , but when the script run the next line `expect "ok" { send "cv set ghassan-test-5\r" }` it did not run and did not expect the `ok` since the `ok` but if i expect **_minutes insted of ok_** it work fine (the `ok` appear after 1 minute)


Is there a way to 'authorize' a command typed in by a user?

is there a way we can authorize a command typed by a user before it takes effect? For example, when a user types `cp file1 file2`, the command will not be executed and a root / root-equivalent user would have to login to 'authorize' the command typed by the user. Is there such a tool / solution that can do this?


Split long output into two columns

Is there a simple utility or script to columnate the output from one of my scripts? I have data in some form:               A aldkhasdfljhaf     B klajsdfhalsdfh     C salkjsdjkladdag     D lseuiorlhisnflkc     E sdjklfhnslkdfhn     F kjhnakjshddnaskjdh      but if this becomes two long, write the data in the following form (where still vertically ordered):               A aldkhasdfljhaf    D lseuiorlhisnflkc     B klajsdfhalsdfh    E sdjklfhnslkdfhn     C salkjsdjkladdag   F kjhnakjshddnaskjdh      From reading the manpage, I don't think that this is something `column` would be appropriate for but I'm not sure. It's easy enough to split in the form:               A B      C D      E F      by only printing `\n` every second line (what my current script does). Any ideas? Thanks!


How do permissions work when moving directories?

Recently I tried to move a directory that I own to another directory (which I also own), but I couldn't. I then noticed that I don't own the parent directory. This made me wonder what are the rules for moving a directory in UNIX. Do you need to have read/write permissions to both it and its parent? Also what happens if it contains files or directories that you don't own?


Cat into fifo not running through bash

I want to script these few lines               mkfifo my.fifo     cat >my.fifo &     cat my.fifo | nc remotehost.tld 10000      But the line               cat >my.fifo &      When i run it manually it works, but not through bash shell. what could be the reason for it?


No manual page for regex in section 3 - where is it?

I found What do the numbers in a man page mean? which explains the sections for command/library documentation quite nicely, and I was looking at the output for `man regex` and noticed the See Also referred to `regex(3)`. I tried to run `man 3 regex`, but got the following message:               No manual page for regex in section 3      My question is - where is it? This is on Ubuntu 10.04 if that makes a difference.


RRDtool setup for 5 minutes intervals but with data delivered every 30 minutes?

Can I setup the RRDtool so that the data values have intervals of 5 minutes but the data is delivered to RRDtool every 30 minutes? I need the chart to be clocked with 5 minutes interval as well (X axis) but refreshed every 30 minutes. Use case: I have a DIY weather station that communicates with the world with GPRS. It collects the weather data every 5 minutes and stores it until 6 sessions like this are done and then sends the bulk of 6 measurement information via GPRS. Sending the data every 5 minutes is inefficient in terms of power usage and the data transfer tolls.


Is there a convenient small Unix virtual machine I can install as an Android app?

Ubuntu for Android seems to be missing in action. I'm travelling tomorrow and I need to take a basic Linux machine with me. I'd rather just take my tablet than a laptop. So is there a reasonable simple Linux virtual machine that I can install as an Android app. and which I can ssh into with Putty from any PC I find (ideally via the USB cable)? I'd like to be able to run at least emacs, git and rsync. And ideally Python.


Advanced NTFS partition file recovery techniques for damaged drives (IO errors)?

I've recently suffered a maddeningly small but quite important amount of damage to a hard drive on a ESXi host affecting a couple VMs. There's a file that I would very much like to recover, and of course it was somehow left off of my regular backup. The most recent copies are 6 months old. Turns out I need that... oops. Details: 1) I have used ddrescue (AWESOME tool) within a Parted Magic bootable ISO to recover 99.98% of the VM's drive in question. Unfortunately, the errors appear to be almost entirely of RECENT file writes... so of course they're exactly the sectors I need to recover most. 2) The drive gives IO errors on bad sector reads, but it occasionally SUCCEEDS in reading a previously bad sector! So, recovery is still possible. Slightly more often than that will have some kind of major malfunction and spin the drive down and back up. Oh, and about 1/4 of those spin downs won't come back up. (Hard power cycle required, shutdown won't function) Last, just about every bad sector read comes with a nice audible clicking sound. 3) The important VM disk is NTFS formatted. 4) I can (usually) mount the damaged NTFS volume read-only, and I can (slightly less often) navigate to the folder that contains the file I need. However, the file in question appears to always give an IO error when I do an 'ls' of the folder. The other files in the folder do not give an IO error. 5) I've tried using ntfsinfo/etc... which sounds like exactly what I need... but it won't open the partition at all. (Frustrating, since 'mount' usually will) 6) The file is a Excel 2003-era XLS file, so I'm not sure I can come up with any strings to search the raw disk image for. (Possibly parts of the 6 month old version?) I'd really like to use something like the facilities of debugfs. However, from the man pages it appears the ntfs tools could do the work if only they could be made to open the partition. In particular, I am wondering if the IO errors might be purely within the metadata for the file, and if the directory record could be restored well enough to copy the file contents off. As a last resort, whatever partial file contents I can retrieve would be great. I've written (relatively simple) kernel modules before, so I could compile a special NTFS module with more debug info enabled (or added). (The file is worth at least a few days of tinkering to try to recover... plus I'm learning cool stuff in the process) Any pointers? **EDIT:** More drive error information: The /var/log/messages is showing a lot of NTFS-fs errors of course... but I finally bothered to translate the unhandled sense code message I usually get: sense key 0x3, ASC=0x11, ASCQ=0x4. (which appears to translate to UNRECOVERED READ ERROR - AUTO REALLOCATE FAILED). When the drive spins down, I see a "scsi0: _*_ BusLogic BT-958 Initialized" message. I'm not sure if it's the Linux SCSI driver, the ESXi driver, or the drive itself that decides to spin the drive down. If it was the Linux driver, then perhaps I could modify the driver to avoid spinning down. This whole ddrescue thing is made massively more painful by these power-cycle-requiring spindowns. **EDIT2:** using the "end_request: I/O error, dev sda, sector 7238859" log message right after I 'ls' the directory containing the file in question, I've targetted my ddrescue operation to that sector. I currently plan to take my chances and WRITE that sector back to the live disk if this succeeds. Perhaps I can slowly rebuild my way to the file in question this way. Still, most recoverable bad sectors are recovered in under 20 retries... this one is over 150 so far... *sigh* **EDIT3:** The sector error from 'ls' on the file I need is entirely uncooperative (1000+ tries overnight and no luck). I'm hoping that's just metadata when you do an 'ls' ? :) I do have most of a ddrescue copy, but that doesn't mount (or mounts without files). The damaged drive mounts correctly most of the time... maybe IO errors on the damaged drive force 'mount' to fall back to the mirror that works? ** EDIT4:** I've given up for now, pending further suggestions. I've removed the drive and rebuilt the box. I'll keep the drive around in case something comes up.


How do I setup dual-head monitors with an Nvidia drivers and one monitor rotated?

I have an integrated ION GPU, which is supported by the proprietary drivers and I've never been able to get the open source drivers to work. I would like my left screen to be normal, but the right hand screen to be rotated. How do I achieve this?


Only output most recent 10 (or n) lines of a lengthy command output

I have currently worked alot with shell and bash on linux.   I have made tons of backups scripts and much more. In many cases I have a command that outputs thousands of lines. I actually need these lines in order to see the progress of the command. But I do not need to see more than the 10 most recent lines. How can I do that? I already tried using a `pipe` and `tail`. But it did not work. I just got the last ten lines after the original command finished:               whatever command that has too much output | tail -f      It is important that the console does not get cleared or something like this because there is some important infomation that gets printed right before the command with the lengthy output.   An example:               echo "Very important information. MUST BE VISIBLE!"          # This gives me about 10,000 lines of output pretty fast!     # This output should be shrinked down to the most recent 10     tar -cvf "Bckup.tar" "folder to backup/"          # More code      I hope this clears it up. **EDIT:** The problem with `multitail` is that it takes up the entire screen. So if I had more than just one output (which I have. Multiple commands with important information are run before this. And I need to use it multiple times). Something like running this in screen with just 10 lines to display would be perfect. (I know that does not work). You could imagine that like there is some output from other commands. Then I call the command with the lengthy output. This output stays in a screen that only can display something like 10 lines. After the command is finished more output goes to the console and this should be right beneth it like normal output.               Output     Important Information     Other commands output     ----------------------------------------     some lines for the tar command                              ----------------------------------------     More output     ....     ....      _(Just without the lines)_


How do I use pacman on a loop-mounted Arch image for a different architecture?

I would like to install some packages on an ARM image before flashing it to an SD card. So far, I have loop mounted the image               sudo mount -o loop,offset=99614720 archlinuxarm-13-06-2012.img /mnt      and added the ARM mirrors to my `/etc/pacman.d/mirrorlist`. I've then tried to run               sudo pacman --root /mnt --arch arm --conf /mnt/etc/pacman.conf -S curl      But it fails with the following output...               warning: curl-7.26.0-1 is up to date -- reinstalling     resolving dependencies...     looking for inter-conflicts...          Targets (1): curl-7.26.0-1          Total Download Size:    0.48 MiB     Total Installed Size:   1.50 MiB     Net Upgrade Size:       0.00 MiB          Proceed with installation? [Y/n] Y     :: Retrieving packages from core...     error: failed retrieving file 'curl-7.26.0-1-arm.pkg.tar.xz' from mirror.lividpenguin.com : The requested URL returned error: 404      curl-7.26.0-1-arm                   492.9 KiB   293K/s 00:02 [##################################] 100%     (1/1) checking package integrity                              [##################################] 100%     (1/1) loading package files                                   [##################################] 100%     (1/1) checking for file conflicts                             [##################################] 100%     (1/1) checking available disk space                           [##################################] 100%     (1/1) upgrading curl                                          [##################################] 100%     call to execv failed (Exec format error)     error: command failed to execute correctly      Any ideas on how to get this to work without emulation? Any idea what is being `execv`-d? ### Update I have discovered it is trying to run `ldconfig`, which is obviously failing. Luckily, I don't need that to be run!


Zsh completion, enabling shift-tab

When zsh shows you a menu of possible completions, I'd like it to let me use `shift-tab` to access previous completion entries--is there an option that controls what key is used to access previous completion entries? And if so, what would I need to add to my `~/.zshrc` file in order to set it up. If it makes any difference, I currently can navigate through a completion-menu using the arrow-keys, but I dislike doing this since the arrow-keys feel out of place and awkward to use.


Exception handling when using tail -f to monitor a log

I have a main script calling the script to do the monitoring. I am trying to catch the exception that the log is missing or not accessible anymore. `tail -f` is used instead of `-F` since the logs are named with the current date. `trap` may be working but I am not sure what signal `tail -f` would return if the log being monitored is no longer there. Otherwise, should I just do a loop checking in the main script checking for `[ -r $Log]`?


MasterPDFEditor use black theme for PDF pages

@Crunchbang/Debian x32 I've been using MasterPDFEditor for quite some time & I'm impressed by its PDF annotation capabilities. However I decided to start using a black GTK+ theme & after that I cannot use this application, simply because it started using black backgrounds for all of my PDF files, while `evince` works nicely. Is there something I can do about it? _`evince`_    ![using evince](http://i.stack.imgur.com/iqbJ6.png) _`MasterPDFEditor`_    ![using MPE](http://i.stack.imgur.com/SOdIV.png)


What is the solution for the error grub rescue/no file system found?

I am using DELL-INSPIRON 15R with a dual boot of Windows 8 and Linux Mint Olivia 15. It has been working properly since it was installed. Now, it is showing the error that "no file system found. grub rescue->" What should I do for this?


date modifiers explained

Again, I found some interesting I don't understand in an `info` page, in `info date`to be precisely: > An optional modifier can follow the optional flag and width specification. > The modifiers are: > > `E`   >       Use the locale's alternate representation for date and time. This > modifier applies to the `%c`, `%C`, `%x`, `%X`, `%y` and `%Y` conversion > specifiers. In a Japanese locale, for example, `%Ex` might yield a date > format based on the Japanese Emperors' reigns. > > `O`   >        Use the locale's alternate numeric symbols for numbers. This modifier > applies only to numeric conversion specifiers. > > If the format supports the modifier but no alternate representation is > available, it is ignored. Question: An[other] example, how this modifiers are used. The description sounds to me like » _Will do stuff, if other stuff was set, but don't expect too much_ «. Sometimes I wonder where things like this come from and what their purpose is/was.


Truncated result returned by JOIN

I'm using join command under linux, but the results vary between different machines. I have two simple files:               cat 1.txt       a aaa,0.2     b bbb,0.3     c ccc,0.5          cat 2.txt     a aaa,0.2     b bbb,0.3     c ccc,0.6      I'm running the following command               join -a 1 -1 1 -2 1 -t "," -o 1.1' '1.2' '2.2 <(cat 1.txt| sort -t ",") <(cat 2.txt| sort -t ",")       Result on machine 1:               ,0.2a,0.2     ,0.3b,0.3     ,0.6c,0.5          join --version     join (GNU coreutils) 8.13          locale     LANG=en_US.UTF-8     LANGUAGE=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=en_US.UTF-8      Result on machine 2:               a aaa,0.2,0.2     b bbb,0.3,0.3     c ccc,0.5,0.6          join --version     join (GNU coreutils) 5.97          locale     LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=      Clearly, the result on the first machine is wrong. It's been truncated. I've tried to use different locale settings but had no success.


how to change a complete line with sed c option

The sed command below is supposed to change the country for Sergio Oliva to Cuba from USA, but as you can see in the output that it's still USA. The book I'm using uses this example to illustrate using the `c` option to change a complete line. Can you explain why this example is not working as intended. command `sed '/\<Oliva\>/ c \ Sergio Oliva Cuba 1967 1968 1969' mrolympia.dat` output               Larry Scott USA 1965 1966      Sergio Oliva USA 1967 1968 1969      Arnold Schwarzenegger Osterreich 1970 1971 1972 1973 1974 1975      Franco Columu Argentinien 1976 1981      Chris Dickerson USA 1982      Samir Bannout Libanon 1984      Lee Haney USA 1984 1985 1986 1987 1988 1989 1990 1991      Dorian Yates Grossbritannien 1992 1993 1994 1995 1996 1997      Ronnie Coleman USA 1998 1999 2000 2001 2002 2003 2004


What applets are loaded in the gnome-panel?

**How can I list which applets are loaded on my gnome-panel?** What gnome-panel do I have? I use the Ubuntu “gnome-panel” package and I’m not entirely sure what that means (version 3.4.1; `ldd` shows it depends on gtk3). So far I’ve found that `gconf-editor` shows me some entries under `/apps/panel3-applets` E.g. `object_0_3`. It seems that those have something to do with the applets running and their configuration, but a) I have only five entries there (not enough) and b) they don’t reveal which files/packages those entries originate from. With `gsettings list-recursively` I found an interesting entry:               org.gnome.gnome-panel.layout object-id-list ['menu-bar', 'clock', 'notification-area', 'user-menu', 'object-0-0', 'object-0-1', 'object-0-2', 'object-0-3', 'object-0-4', 'object-0-5']      It lists the objects I found in `gconf-editor` and some more. But here I don’t even see configuration entries or anything better. From an applet I added myself I can say that the applet-chooser seems to be based on files found in `/usr/share/gnome-panel/4.0/applets/`, which contain a line telling the shared library to load by the panel (I guess). – **But after adding, where does the`gnome-panel` store which applets to load the next time??**


Thunderbird: hide tag notification in the message header

When message is tagged in Thunderbird, not only has it different color, but the tag also appears in the message header. ![enter image description here](http://i.stack.imgur.com/6QFK5.png) I find this completely useless. I can already see that the message is tagged, I don't need to be reminded twice. The message header is already to big, and now yet another line is wasted. Is it possible to remove the tag notification from the message header? I am looking for a solution that does not require to install some obscure addon. An ideall solution would be for example editing `about:config` or `userContent.css/userChrome.css` I am using Thunderbird (Icedove) 24.6.0 on Debian Wheezy


Shell : Сopy one directory to multiple directories

There is a directory `YYY` and a structure on the site:               site1.ru/wp-content/plugins/     site2.ru/wp-content/plugins/     ...     site10.ru/wp-content/plugins/      Task: `YYY` directory to copy all directories `plugins` which are available on the server.


/etc/init.d/nis missing on Ubuntu

I'm trying to setup NIS on a machine. All instructions always expect /etc/init/nis to exist as at the end of configuration one is expected to restart the service using that. For me it doesn't exist. I did try an `apt remove nis; apt install nis`, it made no difference.               root@vplab030:/var/log# lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 14.04.1 LTS     Release:    14.04     Codename:   trusty     root@vplab030:/var/log#                root@vplab030:/var/log# apt show nis     Package: nis     Priority: extra     Section: universe/net     Installed-Size: 638 kB     Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>     Original-Maintainer: Mark Brown <broonie@debian.org>     Version: 3.17-32ubuntu6     Depends: libc6 (>= 2.15), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.78), libgdbm3 (>= 1.8.3), libglib2.0-0 (>= 2.12.0), libslp1, netbase, make, rpcbind (>= 0.2.0-6ubuntu1), lsb-base (>= 3.0-6), hostname (>= 2.98), upstart (>= 0.9.7-2)     Pre-Depends: debconf (>= 0.5.00) | debconf-2.0     Suggests: nscd     Conflicts: netstd (<= 1.26)     Download-Size: 152 kB     Bugs: https://bugs.launchpad.net/ubuntu/+filebug     Origin: Ubuntu     APT-Manual-Installed: yes     APT-Sources: http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages     Description: clients and daemons for the Network Information Service (NIS)      This package provides tools for setting up and maintaining a NIS domain.      NIS, originally known as Yellow Pages (YP), is mostly used to let      several machines in a network share the same account information, such      as the password file.          root@vplab030:/var/log# ls -l /etc/init.d/ypbind /etc/init.d/nis     ls: cannot access /etc/init.d/ypbind: No such file or directory     ls: cannot access /etc/init.d/nis: No such file or directory     root@vplab030:/var/log#      if it helps:               root@vplab030:/var/log# cat /etc/yp.conf      #     # yp.conf   Configuration file for the ypbind process. You can define     #       NIS servers manually here if they can't be found by     #       broadcasting on the local net (which is the default).     #     #       See the manual page of ypbind for the syntax of this file.     #     # IMPORTANT:    For the "ypserver", use IP addresses, or make sure that     #       the host is in /etc/hosts. This file is only interpreted     #       once, and if DNS isn't reachable yet the ypserver cannot     #       be resolved and ypbind won't ever bind to the server.          # ypserver ypserver.network.com          domain dev.domname.com server ds4     domain dev.domname.com server ds2          root@vplab030:/var/log#           root@vplab030:/var/log# grep ypbind /var/log/syslog     Sep  9 12:49:30 vplab030 ypbind: Host name lookup failure     Sep  9 12:49:30 vplab030 kernel: [    5.630218] init: ypbind main process (830) terminated with status 1     Sep  9 12:49:30 vplab030 kernel: [    5.630240] init: ypbind main process ended, respawning     Sep  9 12:49:35 vplab030 kernel: [   10.700047] init: wait-for-state (autofsypbind) main process (1126) killed by TERM signal     Sep  9 12:49:35 vplab030 kernel: [   10.700660] init: wait-for-state (lightdmypbind) main process (1134) killed by TERM signal     root@vplab030:/var/log# date     Tue Sep  9 13:59:11 CDT 2014     root@vplab030:/var/log#           root@vplab030:/var/log# service --status-all      [ + ]  acpid      [ - ]  anacron      [ + ]  apparmor      [ ? ]  apport      [ + ]  autofs      [ + ]  avahi-daemon      [ + ]  bluetooth      [ - ]  brltty      [ ? ]  console-setup      [ + ]  cron      [ + ]  cups      [ + ]  cups-browsed      [ - ]  dbus      [ ? ]  dns-clean      [ + ]  friendly-recovery      [ - ]  grub-common      [ ? ]  irqbalance      [ + ]  kerneloops      [ ? ]  killprocs      [ ? ]  kmod      [ ? ]  lightdm      [ ? ]  networking      [ ? ]  nxserver      [ ? ]  ondemand      [ ? ]  pppd-dns      [ - ]  procps      [ - ]  pulseaudio      [ ? ]  rc.local      [ + ]  resolvconf      [ + ]  rpcbind      [ - ]  rsync      [ + ]  rsyslog      [ + ]  saned      [ ? ]  sendsigs      [ ? ]  speech-dispatcher      [ - ]  ssh      [ - ]  sudo      [ + ]  udev      [ ? ]  umountfs      [ ? ]  umountnfs.sh      [ ? ]  umountroot      [ - ]  unattended-upgrades      [ - ]  urandom      [ - ]  x11-common     root@vplab030:


"sudo service vsftpd" returns "Unknown job: vsftpd"

I installed vsftpd on ubuntu 14.04 and when I want to stop or restart vsftpd service this message showed and nothing happened in service status!               root@ali-lap:/home/ali# service vsftpd restart     stop: Unknown job: vsftpd     start: Unknown job: vsftpd      I purged vsftpd and reinstall that again according to this post and nothing changed. Install and delete log:               root@ali-lap:/home/ali# apt-get purge --remove vsftpd      Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages will be REMOVED:       vsftpd*     0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.     After this operation, 370 kB disk space will be freed.     Do you want to continue? [Y/n]      (Reading database ... 216263 files and directories currently installed.)     Removing vsftpd (3.0.2-1ubuntu2) ...     initctl: Unknown job: vsftpd     Purging configuration files for vsftpd (3.0.2-1ubuntu2) ...     Processing triggers for ureadahead (0.100.0-16) ...     Processing triggers for man-db (2.6.6-1) ...     root@ali-lap:/home/ali# ls -lpa /etc/vsftpd     vsftpd/           vsftpd.conf.orig       root@ali-lap:/home/ali# ls -lpa /etc/vsftpd.conf     ls: cannot access /etc/vsftpd.conf: No such file or directory     root@ali-lap:/home/ali# apt-get install vsftpd      Reading package lists... Done     Building dependency tree            Reading state information... Done     The following NEW packages will be installed:       vsftpd     0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/112 kB of archives.     After this operation, 370 kB of additional disk space will be used.     Preconfiguring packages ...     Selecting previously unselected package vsftpd.     (Reading database ... 216210 files and directories currently installed.)     Preparing to unpack .../vsftpd_3.0.2-1ubuntu2_amd64.deb ...     Unpacking vsftpd (3.0.2-1ubuntu2) ...     Processing triggers for man-db (2.6.6-1) ...     Processing triggers for ureadahead (0.100.0-16) ...     Setting up vsftpd (3.0.2-1ubuntu2) ...     initctl: Unknown job: vsftpd     Processing triggers for ureadahead (0.100.0-16) ...     root@ali-lap:/home/ali# ls -lpa /etc/vsftpd.conf     -rw-r--r-- 1 root root 5654 مه    16  2013 /etc/vsftpd.conf      vsftpd version:               root@ali-lap:/home/ali# apt-cache policy vsftpd      vsftpd:       Installed: 3.0.2-1ubuntu2       Candidate: 3.0.2-1ubuntu2       Version table:      *** 3.0.2-1ubuntu2 0             500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages      Any ideas?


rsync vs mtime and ctime

I've been using `rsync` for Android to backup my phone to a remote NTFS filesystem on a Linux system for a while. Recently, the HDD containing the NTFS filesystem has started to fail (or throw "I/O Errors") so I took the opportunity to copy all the files onto a new HDD and new NTFS filesystem. In this instance I used the "FastCopy v2.11" tool for Windows. My problem is that when I do an rsync "dry run" I can see that it wants to recopy files which already exist on the remote rsync folder. For example, when I run with "-iv" I get this kind of output: Which, as I understand it means that rsync wants to copy this file to the remote rsync because of a timestamp difference. The strange thing is that if I use "Astro" for Android to look at the local file properties, I can see that the file's size, modified time, and MD5 checksum are exactly the same as that of the remote file (using `ls -l` to check the modified time). Given that I recently copied the remote rsync files from an old NTFS filesystem, the remote file's ctime is different (using `ls -lc`). Does `rsync` look at the remote ctime, and if so is there any way I can use `rsync`, or `ntfs-3g` to get around this problem?


Find number of fans in a laptop

My laptop is always hot and CPU temp is about 80°C. I guess one of laptop fans is corrupted and another one spins in high RPM, because I hear the sound of fan speed which it is most of time is high. How can I find number of fans in my laptop (VAIO F13 HFX, Core i7) and each fan's speed? I am on fedora 18 , but i had same problem in ubuntu 12.10 and 12.04


Trying to improve a sync to a shared drive

Easy question right? Just bare with me here.. I usually use Git to work with files on my local machine. I like this method because I can later check the files out on the shared drive for other non-git users to use. It is great because I can delete files (clean up) in my local directory and that cleans up remotely. I can leave all the extra files in the remote directory alone. This behaviour is why I do not simply `rsync`... The only issue I'm having is in dealing with open files. Git stops the `pull` or `reset` when I encounter I locked file I need to change. Is this really a show-stopper? I may need to get a files out very quick and find it counter- productive to hunt down an unrelated open file blocking the process. Can you help improve this process? BTW: It is good enough to only update a file if the timestamp has changed. But I only want to update files that changed so that the incremental backups are not adversely effected. Apparently this is uncommon so I'm not promoting it. The benefits are good for me though. This gives me fast local access to local files independent of network failure and basically seamless publishing to the backup drive. I just need to check-in often and push to make sure changes are backed up. It plays nice with other non-git files and users on the shared drive. Rsync falls short only because of the 'clean-up.' I can't `--delete` clean up without removing other users files. It may sound minor to clean up manually, but it is really a deal killer as clean up is error prone and requires testing.


How to mount mdf image, iso9660 doens't work for it?

I have few `.mdf` images, that can be mounted with `Alcohol 120%`, but on Linux, is that possible? I've tried things similar to `mount -o loop -t iso9660 XX.mdf /mnt/iso`, but that doesn't work here, I got `ISOFS: Unable to identify CD-ROM format`.


LVM + LUKS + SSD + Gentoo -- making it all work together

I'm finding a lot of conflicting information out there, and as of yet haven't found anyone trying to pull together all of the components that I'm trying to do, so I'm hoping someone who understands SSD, encrypted LVMs and so on can stop by and help out. Basically, my system is a laptop with:   * /dev/sda: 32 GB SSD   * /dev/sdb: 256 GB SSD   * /dev/sdc: 1000 GB HD Generally my Linux installs consist of three partitions:   * ~50 mb /boot   * large /home   * ~30 gb "everything else" So effectively I'd like   * `/dev/sda1 -> /boot`   * `/dev/sda2 -> /`   * `/dev/sdb1 -> /home`   * `/dev/sdc1 -> /swap`   * `/dev/sdc2 -> /mnt/storage` The catch is I'd like to encrypt all of this (except for `/boot` and `/mnt/storage` which can stay unencrypted). I've read that when encrypting SSDs there can be issues with things like TRIM, and that ideally I'd want to use EXT4 with some particular options set, and that I must be very careful with partition alignment, and some just claim that encrypted LVMs really don't play well with SSDs and I should just use EncFS or eCryptfs (although people seem unclear and/or polarized on whether these should be used to encrypt "mount-at-boot" partitions like / and /home). Is there any canonical information on this?


make networkmanager not prompt for password after failed connection?

While it's only an intermittent annoyance, occasionally I'm on a flaky wifi network, and each time networkmanager reconnects, it asks for the wifi password. This wouldn't be a huge issue, but the password is not pre-filled- in, so I have to go lookup up the password elsewhere, then enter it. If I hit cancel, it won't try to reconnect, and if I just hit "ok", then it will store the blank password over what it already has! Is there any way to mark a connection as "I'm sure this is the right password!" so it will just try again (perhaps with exponential backoff) if the connection fails? Thanks!!


How to allow Page Up in GNU Screen?

I use Vim to edit text files on Linux. Commonly I connect to remote Linux machines using PuTTY from Windows. I use GNU Screen commonly as well. When using Vim inside Screen I am unable to use the `Page Up` key because Screen interprets it as a command to start copy mode. I would like to use `Page Up` for its regular up-paging functionality. How can I configure Screen to do this?


Using archlinux on vmware error 8000

I have been playing around with Linux a bit and I wanted to try using Arch Linux so I downlaoded the `.iso` and I set up vmware player saying that it was another Linux 2.6x kernel. As soon as I launched it, I got this error `EDD: Error 8000 reading sector 269058` does anyone know what is wrong and how I can fix this?   **My System Info:**   * OS:Windows 7 Home Premium<   * Processor: Intel(R) Core(TM) i5-2410m CPU @ 2.30GHz 2.30 GHz   * System Type: 64-bit Operating System   * Virtualization: Enabled _Feel free to ask anymore info if it helps_


If I dd a CDROM, then I always get the exact copy of the CDROM?

If I:               dd if=/dev/cdrom of=cdrom.iso      then I will always get the _exact_ same, bit-by-bitly same image that is the same as the original CDROM? Or are there any methods that prevents copying all the bits from the CDROM? Asking for archiving old games on old CDROMS


NFS to clients with different uid:s than on the server, where the client uid:s shall not show up in the server

I have a problem with a embedded Linux device that is mounting its root filesystem over NFS. But for different reason the embedded device is a single user device running as root (and later it will not even have a network connection). On the pc I would like that my normal user own all the files, so I can modify them with out being root (or using sudo) all the time. But right now as soon as the client create a new file on the nfs mount the user id is set to root and I get a problem on the server. So my question is if there is a flag I can set in the /etc/export solves this problem? So that when the client creates a file, the uid on the server is not root but that of the user (maybe 500 or 1000). This is my current /etc/export on the server               /opt/eldk/armVFP  *(rw,sync,no_root_squash)


facing issue while installing oracle Database 11g on rhel5 And SOA

While installing required rpms for both SOA and Oracle the below rpms are conflicting with each other glibc-devel-2.5-49.x86_64.rpm and glibc- devel-2.5-24.i386.rpm How can I fix it? one package gets installed successfully if I remove the other and vice-verse.


How to determine if file is just a permutation of another one?

Consider for example a source code file, where the functions are drastically shuffled around. Is there is a command to check if the reordering of lines is the only change? (that means no lines are added, removed or changed)


Display boot splash on ramdisk only system

I'm working on a kiosk system with the root file system loaded into RAM. One of the requirements is that the boot process output should be completely hidden from the user. I've already managed to set up the system to display a black screen during boot and just the login prompt for a short time when rebooting. Unfortunately this is not enough. The ideal solution would be some animated splash screen during boot and reboot/halt i.e. the system boots and the user sees an animation until the graphical system (nodm) is up and the same animation is shown when the graphical system is stopped and the machine is shutting down. The best solution for this seems to be Plymouth which does exactly what i need. But since my root file system resides in the initrd i do not see any way to include Plymouth in this initrd. I've found some clues about using two initrd images: http://blog.fpmurphy.com/2009/09/project-plymouth.html but was not able to achieve a booting system when trying it. Does anyone know a way to use plymouth like this or any other solution for displaying an animated splash screen during boot and reboot? The system specs are:   * AMD G-T56N processor   * ATI Radeon HD 6320 graphics   * 4 GB RAM   * System based on Debian 7.6 64 bit (minimal system with nodm and firefox)


Bash Script Detects Key Down At Boot

I want to customize my run level scripts based upon a key combo pressed at boot. How to I test for key presses as early as possible from boot? Do I need to do something special, like for example: lock the computer at run level 1 so I can prepare run level 5 scripts? How do I go about this?


Is there a way to express: `--link` or fall back to ordinary copy in cp (from GNU coreutils)?

Is there a way to tell `cp` to `--link` (i.e. create hard links), but fall back in the case where I am attempting inter-device hardlinks? Inter-device links aren't possible and would cause `cp` to fail. The reason I am asking is because I would like to use this in a `GNUmakefile` and would prefer a readable command line over some convoluted and lengthy one (or a function, for that matter). The question is for GNU coreutils (7.4 and 8.13). Note: right now the workaround would be something like (GNU make recipe syntax):               cp -fl $^ $@ || cp -f $^ $@      This will of course give spurious error messages in case of inter-device links, although succeeding on the second `cp` call then. Also, then this gets expanded (source form looks readable after all) it won't be too readable anymore.


Memory usage stays high after compilation jobs

I am operating a small Linux VM with 1Gb of RAM.   It is a fairly typical LAMP setup which takes about 16% of memory on normal usage      I used the box to compile stuff yesterday, the memory went up to 60% and didn't drop back.   A memory sorted "top" doesn't show anything else than Mysql and Apache:               top - 09:41:33 up 4 days,  6:41,  1 user,  load average: 0.00, 0.00, 0.00     Tasks:  41 total,   1 running,  40 sleeping,   0 stopped,   0 zombie     %Cpu(s):  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st     KiB Mem:   1048576 total,   640072 used,   408504 free,        0 buffers     KiB Swap:   131072 total,        0 used,   131072 free,   533872 cached            PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND      2042 mysql     20   0  385m  41m 7324 S   0.0  4.1   9:25.35 mysqld      1680 bind      20   0  117m  21m 2468 S   0.0  2.1   0:03.07 named      2155 root      20   0  191m  10m 4988 S   0.0  1.1   1:07.43 apache2     12507 www-data  20   0  192m 9740 3032 S   0.0  0.9   0:00.50 apache2     12505 www-data  20   0  192m 9728 3020 S   0.0  0.9   0:00.19 apache2     12481 www-data  20   0  192m 9652 2940 S   0.0  0.9   0:01.47 apache2     12508 www-data  20   0  192m 9648 2940 S   0.0  0.9   0:00.73 apache2     12499 www-data  20   0  192m 9640 2932 S   0.0  0.9   0:00.24 apache2     12509 www-data  20   0  192m 9636 2928 S   0.0  0.9   0:00.26 apache2     12564 www-data  20   0  192m 9624 2924 S   0.0  0.9   0:01.07 apache2     12563 www-data  20   0  192m 9600 2928 S   0.0  0.9   0:00.33 apache2     14624 www-data  20   0  191m 7492 1296 S   0.0  0.7   0:00.30 apache2     14629 www-data  20   0  191m 7352 1248 S   0.0  0.7   0:00.24 apache2      Where did the missing 400Megs go?   Is this something that I should worry about or just wait for my scheduled weekly reboot?      For clarity, the "stuff" was Google Protocol Buffer which doesn't use any daemon.


How can I write a driver for an asus trackpad on linux?

I bought a laptop and installed Linux on it and the trackpad is now not working but it was on Windows. There is no Linux driver for it and I thought this could be a good project to write one. I have read and implemented tutorials on device drivers for simple things (turning on an LED on a pandaboard) but I have no idea where to start here. Related questions pointed to commands like `modprobe -r psmouse` and it seems the trackpad is not seen at all. Any idea? The laptop is: Asus R409C.


Getting a digital signature from an eToken/smart card into LibreOffice

I successfully managed to make use of digital signatures in LibreOffice Writer by following flatmtn.com/creating-pkcs12-certificates But now I want to use a digital certificate from an eToken/smart card and not from the Mozilla keystore directory. How can I achieve this?


List all software installed from particular component (non-free, contrib)

Is there a way to list all `non-free` and `contrib` software installed in Debian via `apt`? `/etc/apt/sources.list` is as follows               deb http://ftp.us.debian.org/debian/ wheezy main non-free contrib     deb-src http://ftp.us.debian.org/debian/ wheezy main non-free contrib          deb http://security.debian.org/ wheezy/updates main non-free contrib     deb-src http://security.debian.org/ wheezy/updates main non-free contrib          # wheezy-updates, previously known as 'volatile'     deb http://ftp.us.debian.org/debian/ wheezy-updates main     deb-src http://ftp.us.debian.org/debian/ wheezy-updates main      I added `non-free` and `contrib` years ago because I needed a non-free driver for my video-card, which has now been replaced with a new one that doesn't require a non-free driver. I'd like to get rid of the non-free stuff, but I'm afraid I might have installed other non-free software over the years which I cannot afford to uninstall.


Filezilla is not showing hidden files

I am using   * Fedora 16 (client end)   * CentOS 6 (server end)   * I have no command line access to server   * FileZilla 3.5.2 I have enabled "Force showing hidden files" ![enter image description here](http://i.stack.imgur.com/cO4El.jpg) After enabling I have restarted filezilla and PC. But still not showing hidden files. System Admin ensured me the list of hidden files there exists. I can upload hidden files from my end (client) but i can't see at server end. I can't download hidden files from server. How to solve the issue?


Xubuntu Mouse sensitivity way too high

I am pretty new to Linux, this is my first real time using Xubuntu (used Ubuntu before, and raspbian on my RPI), and I have a mouse that is way too sensitive. If I move my mouse 1cm it's on the other side of the screen, that sensitive. I have turned all mouse sliders as far down as I can, and I don't even notice anything becoming less sensitive. For some reason the mouse settings menu also displays that I have two Razer Deathadder 2013's plugged in, even though I only have one. Sliders are down on both, tried some things with `xset m 5 1` but it only gets worse. How do I get a human level of mouse sensitivity?


X doesn't work after upgrading Slackware from 13.37 to 14.0

I upgraded the system, using instructions from file UPGRADE.txt on the disk. Everything works fine. But when I try to `startx`, it quits with an error: > ck-launch-session: error while loading shared libraries: libffi.so.5: cannot > open shared object file: no such file or directory In `/usr/lib` I found a file `libffi.so.6`. It seems, that the `ck-launch- session` wasn't upgraded and still tries to load the old library. What to do?


Possible to install PHP 5.2.17 on a new CentOS 6.4 system?

I'm trying to set up CentOS 6.4 (Linux 2.6.32-358.11.1.el6.x86_64) with a specific version of PHP (5.2.17) as it is required by an app I'm trying to install. I've downloaded the PHP version and dependencies. This version of PHP requires a downgraded php-common which then required an earlier libcurl. On trying to downgrade libcurl to the required version yum fails as it seems yum itself depends on this. Which makes sense really. The list of packages that would be affected (and erased) is huge. So it seems that this version of PHP is a bridge too far as libcurl is just too embedded. **Should I start again with an earlier version of CentOS? I'm new with Linux but might it be that PHP is el5 but CentOs is el6?** PHP package: php-5.2.17-1.el5.art.x86_64.rpm libcurl: curl-7.15.5-17.el5_9.x86_64.rpm


Non-persistent differencing file

I have a large file (5-10 GB) and want to access this file in a special file system with the following conditions/features:   1. There is a single process that reads and write on the file.   2. When the process writes to some position of the file and reads the same position afterwards, the new values are returned (the file seems changed).   3. When the file system receives a rollback signal, the file will restore to the original state. Theoretically I can imagine of a mechanism where the changes are saved on an auxiliary file, and there is a virtual file system which manages all this, giving a visualization of a non-persistent file to the end-used. Does anyone know of an implementation of this?


Working with Hebrew text in Redhat

I'm trying to view Hebrew text in my putty terminal, but I keep seeing those squares instead of text (see pic). ![putty vi screenshot](http://i.stack.imgur.com/5qGuR.png) Things I've done so far but didn't work:   1. edited `/etc/sysconfig/il8n` and changed `LANG="he_IL.UTF-8"`   2. `yum install xorg-x11-fonts-Type1`   3. `yum install xorg-x11-fonts-misc`   4. `yum install langinstall he_IL` I'm using Red Hat Enterprise Linux Server release 6.5 (Santiago)


Address of host you connect from

When you connect to some remote machine using ssh, is there an easy way to **address of the machine you connecting from** ? (with some env variable, or hostname for instance) Main use how that would be to scp/transfer file back where you connect from, without having to disconnect. _(Might be a possible duplicate, didn't realy how to well formulate the question)_


Samba 3.6 Configuration in Fedora 17

I need help configuring the Samba server so I can connect from a Windows ( **edit** Windows 7) machine to my Fedora. I followed several tutorials because and non of them work for me. Here are two of them:   tutorial 1   tutorial 2   tutorial 3 (samba and selinux) Here is the fpaste of my Samba configuration file. When accessing my machine by IP Windows machines see the shared folders `allusers` and `Share`.   1. When trying to open `allusers` folder it asks the user to provide username and password. I've created a test user and added it to users group + samba's users but it's not working with it (meaning It doesn't accept it).   2. When user tries to open the `Share` folder there is a message saying that he doesn't have permissions to open the folder. The folder is in 777 mod + SELinux is disabled + I allowed the Samba, Samba Client, Echo Reply (pong) and Echo Response (ping) to pass the firewall.  Can you point where is my mistake or give me some direction, please? Thanks in advance.


Color schemes good for the eyes

Are there any common guidelines howto choose a color scheme (for example foreground/background color) for terminal, `emacs` etc. to minimize exhaustion of the eyes? If so, is there scientific evidence for such a guideline? In particular are there ready to use eye-friendly color schemes for `urxvt`and `emacs`? **Edit:** It would be also interesting to know, how the decision depends on the screen (matte, glossy) and on the environment (indoor, outdoor,...). In my case it is a Dell Latitude ATG which has a slightly glossy screen (not matte, but not a mirror). I use it indoors in office, in dark rooms and also outdoors. In my case I first thought, that black font on white background is the best because the white background reduces reflections due to the glossy screen. And because black on white seems to be a high contrast. However it seems that the bright white tires the eyes... I should point out, that I am not interested in personal opinions but in scientific evidence or at least in reasonable generally accepted guidelines based on experience.


Debian hibernate problem PM: Swap header not found

I have Debian 6 2.6.32-5-amd64 on netbook. With `pm-utils` Sleep works but hibernate fails with error: `PM: Swap header not found!`. Swap was enabled using ubuntu tutorial after installation - this is probably the key but can't find working solution.


Why does find's -exec only executes on one result?

Here's what I checked: `find mydir -maxdepth 2 -name .project -or -name .classpath` gives output:               mydir/.project     mydir/.classpath      Meanwhile `find mydir -maxdepth 2 -name .project -or -name .classpath -exec echo {} \;` gives output:               mydir/.classpath      so only 1 found item is listed, why? xargs works as expected: `find mydir -maxdepth 2 -name .project -or -name .classpath | xargs -I {} echo {};` prints:               mydir/.project     mydir/.classpath      Am I missing something about `-exec`?


Avoid very fast double clicks

I have a mouse with a weird problem. The left button sometimes fires a double click even if I click just one time.   I would like to know if there's a way to avoid fast double clicks, ignoring clicks with an interval lower than a defined value.   I'm using Fedora 15.   Thanks in advance.


Improve execution time for recursive md5sum check?

This recursive md5sum check for 40000 items of 11.8 GB takes 2 minutes:               ret=$(find "${target}"/ -name ".md5sum" -size +0 | while read aFile; do cd "${aFile%/*}"; md5sum -c ".md5sum"; done | grep -v "OK";)      Can any obvious speed improvements be made, that I have not noticed?


GRUB2 and Foreign Keyboards

If I have GRUB2 installed on a system that is using a foreign keyboard and I want to use CLI Mode, what key would I press? On Latin-based keyboards, we would press "C", but other alphabets lack the symbol "C". Is there a special GRUB documentation page for foreign keyboards? Are older forms of GRUB the same (GRUB Legacy)?


Multi-Distro boot DVD with SystemRescueCD 2.8.0 fails to boot the SRCD portion

I'm trying to create a multi-distro mutli-boot dvd image containing (amongst others) the SystemRescueCD iso. I'm using GRUB as the boot loader and I've managed to get most of the other ISOs booting fine (testing in VirtualBox before I burn to disc). But the RescueCD iso fails to boot fully and just drops me out to a mini console. It starts to load the kernel image and initram.igz okay, then after it prompts for the keymap it attempts to locate the `sysrcd.dat` file (which contains the file system image) by trying to mount `/dev/sr0` and `/dev/sd0` but this is the wrong place. I need it to mount `/dev/scd0` \-- the .dat file is located in `/distro/systemrescuecd` on the CD image. Does anyone please know what file I need to edit to correct the mount paths and/or what command(s) I can append to the kernel load string in GRUB to point it at the right folder/mount point? Thanks


HowTo Chroot to BSD

I recently tried FreeBSD `[9.2]`. I installed it but as i found out it doesn't install any bootloader by default. So now i want to find out **HOW** it is possible to `chroot` to the installed BSD via a livecd or any other means. and if this livecd could be linux (I doubt that).   1. Do i need to mount `/proc` `/sys` and `/dev` partitions?   2. How to declare a sane `env` in `chroot` command? PS: at the end of FreeBSD installation process, there was a nifty script that search my wireless and find out an access-point. then ask me about the password and connect me to it. what is the name of the script and could I run it from the command line?


easy rsync solution with file manager (thunar or nautilus or...)

A common tasks I teach new users in UNIX is how to make backups. Since most are not comfortable with the command line (CLI) and I _want_ to have them make backups (more than forcing them to use the CLI), right now I teach them to drag and drop whole directories around. The problem with that, of course, is that it takes a long time, as all files are copied every time. I would prefer it if file managers would fire up `rsync` instead of `cp -a` when you copy over an existing directory. Is there a plugin for that? Anyone working on such functionality in a file manager already?


How to config Postfix to prevent sender spoofing?

At work, I'm facing security risk with the mail sender spoofing. I have a relay mail server which accepts mail relay from all server subnets. If an user in a normal server sends mail within command line:               user@server$ echo mail_content | mail -r vip@company.com -s Important recipient@company.com      So basically, this guy can pretent to be anyone when sending email, which could lead to really big trouble What I'm expecting is, even though running the above command, the recipient still get the mail with `From: user@server` How can I do it in Postfix? Edit: I forgot to add, the authentication method is Active Directory, not sure if it makes the configuration much complicated :)


How to know whether wget has completed download successfully?

I attempted to download openSUSE 12.1 through wget.   _It stopped after 64% showing:_               05:54:48 (120.30 KB/s) - `openSUSE-12.1-DVD-i586.iso' saved 4429185024/4429185024]      **It appears that the download is complete but then why does it show 64% only?**               anisha@linux-2gbt:~> wget -c http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso     --11:39:58--  http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso                => `openSUSE-12.1-DVD-i586.iso'     Resolving ftp.uni-bremen.de... 134.102.228.70     Connecting to ftp.uni-bremen.de|134.102.228.70|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 4,429,185,024 (4.1G) [application/x-iso9660-image]          47% [===========================================>                                                  ] 2,425,434,388   --.--K/s  ETA 8:59:38          19:55:21 (79.70 KB/s) - Read error at byte 2425434388/4429185024 (Connection timed out). Retrying.          --19:55:22--  http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso       (try: 2) => `openSUSE-12.1-DVD-i586.iso'     Connecting to ftp.uni-bremen.de|134.102.228.70|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 4,429,185,024 (4.1G) [application/x-iso9660-image]          64% [===========================================================>                                  ] 4,429,185,024  192.61K/s  ETA 5:28:09          05:54:48 (120.30 KB/s) - `openSUSE-12.1-DVD-i586.iso' saved [4429185024/4429185024]      **I attempted to start it again thinking since I had used`-c` option, it won't start downloading all over again if once the download is truly complete, but it did start again. What should I conclude from this?**               anisha@linux-2gbt:~> wget -c http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso     --08:50:56--  http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso                => `openSUSE-12.1-DVD-i586.iso'     Resolving ftp.uni-bremen.de... 134.102.228.70     Connecting to ftp.uni-bremen.de|134.102.228.70|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 4,429,185,024 (4.1G) [application/x-iso9660-image]           2% [=>                                                                                ] 207,066,532   93.31K/s ETA 15:56:35^C     anisha@linux-2gbt:~>


Why there is no https transport for debian apt tool?

With all paranoia that has come with NSA and everything, I'm wondering why debian package installation mechanism does not support HTTPS for its transport, let alone using it by default. I know debian packages have some sort of signature validation using GPG, but still I don't think using HTTPS transport instead of HTTP would be too hard, considering how crucial this is security-wise. Edit: I mostly want to protect myself from MitM attacks, not debian mirror administrators. HTTP puts the whole system setup on the table, if anyone snoops on traffic going to debian mirrors.


Create partition with exact size not to specific distance

How does one create a partition of exact size not to specific distance? I have tried:               parted -a optimal /dev/sdd mkpart primary 0% 0%+1GB     # and...     parted -a optimal /dev/sdd mkpart primary 0% +1GB      To no avail. How do I make it accept size instead of end distance?


How do I localize man pages for chinese?

Doing the prerequisite google search didn't turn up anything: I'm looking for a way to install and use localized chinese versions of the man pages (assuming there is some localized package somewhere).   1. Is there a localized package to install? Better yet, is it already installed in the default install?   2. How do I activate this? Do I just change my locale? Is there a canonical way to change the locale outside of just resetting the environment variable in my rc file?


Can I use an SSH key generated on Linux from Putty?

I have been asked to generate a pair of SSH keys so that I can access a remote server for development. To generate the keys, I used the `ssh-keygen` tool on our CentOS box, which I successfully did. Now I have 2 files: `~/.ssh/id_dsa`, `~/.ssh/id_dsa.pub`. I will give the admin the `.pub` file so that he can place it on the remote server. However, I want to use my own personal windows PC (using PuTTY) to access this remote server. So my question is this: even though I generated the SSH keys on a Linux server (that has no relation whatsoever to the remote server and my pc), can I still access the remote server with my Windows PC using the private key that was created? The reason I'm a little unsure is because while I was creating the keys, it said "The key fingerprint is: xxxxxxxx" which made me think that since the "fingerprint" is CentOS's fingerprint, it won't let me use the private key on my Windows machine. Am I right that it won't work, or as long as I have the private key it doesn't matter what machine I use to log in to the remote server?


what is the difference between ~/.profile and ~/.bash_profile

I want to know the difference between `~/.profile` and `~/.bash_profile`.


What are/were the keys on a Sun keyboard for?

I have a Sun type 7 UNIX keyboard that I'd like to get more productivity out of. So what are those extra keys for, or rather, what were they intended for by Sun? And is there a way to approximate those functions in any useful way on a modern Linux or Solaris 11 system? The keys in question are:               Label    Keycode  keysym     ===========================     Compose  135      Menu      Stop     136      Cancel     Again    137      Redo     Props    138      SunProps     Undo     139      Undo     Front    140      SunFront     Copy     141      XF86Copy     Open     142      SunOpen     Paste    143      XF86Paste     Find     144      Find     Cut      145      XF86Cut


How can I get awk to print both matches and non-matches?

Basically, all I want to do is alter outputs if the input matches a filter, but the part being altered isn't what is being filtered (or I would use `sed`). The problem so far is that my `awk` is only outputting the altered lines. Quick example, put this in test.txt:               orange beet pear cowmilk     apple pear berry cowmilk     orange melon cherry cowmilk      If I use the code:               awk /orange/'{gsub(/cow/,"cow~"); print}' test.txt      I get:               orange beet pear cow~milk     orange melon cherry cow~milk      When I would rather get:               orange beet pear cow~milk     apple pear berry cowmilk     orange melon cherry cow~milk      I see you can do `||` with awk, but I haven't been able to figure out how to make that fit with the gsub above. For bonus appreciation, what I'd really like to do is add color instead of `~`, but that totally breaks, i.e.               awk /orange/'{gsub(/cow/,"cow'\e[1;34m'"); print}' test.txt      gives me an error about `\` not being the end of the line.


How do I set a limit on the number of files Linux can have open?

I plan to run a Java app using `nohup ... &`. The limit must apply to commands like this.


What are EXT4 Security Labels?

During Gentoo installation of Gnome keyring, I am told to switch on EXT4 Security Labels, which is described in the kernel documentation by: > Security labels support alternative access control models implemented by > security modules like SELinux. This option enables an extended attribute > handler for file security labels in the ext4 filesystem. That documentation is not of great help, as I now understand that it enables an attribute handler that will in turn enable security labels for ext4 file systems. I could have deduced that from the name of the feature. What are those labels? How do they improve security?


Copy multiple files to one dir with parallel

I'm using the following script to copy multiple files into one folder:               { echo $BASE1; echo $BASE2; echo $BASE3; } | parallel cp -a {} $DEST      Is there any way to use only one echo $BASE with brace expansion? I mean something like this:               { echo $BASE{1..3} } | parallel cp -a {} $DEST


Make and apt-get Have Stopped Working

So I downloaded the non-free broadcom driver(b44) for my debian install, however when I try to make it I get the following error:               make     make -C /lib/modules/2.6.32-5-amd64/build SUBDIRS=/home/scroty/workplace/b44-1.00g modules     make: *** /lib/modules/2.6.32-5-amd64/build: No such file or directory. Stop.     make: *** [default] Error 2      So I looked up my errors, and some other guy here had the same thing, and he fixed it by installing the kernel headers. So I try to do the same, and this is what happens:               sudo apt-get install linux-headers-2.6.32-5-amd64     Reading package lists... Done     Building dependency tree     Reading state information... Done     Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:     linux-headers-2.6.32-5-amd64 : Depends: gcc-4.3 but it is not going to be installed     E: Broken packages      When I try to install gcc-4.3 it's the same thing, except with several more dependencies(some of which I know I have). When I run:               dpkg --get-selections | grep gcc      it returns:               gcc     gcc-4.3-base     gcc-4.4-base     gcc-4.7     gcc-4.7-base     libgcc1      So I have to admit, I'm a huge noob at linux, and have only started to _seriously_ use it(I've used it for years, but not very often) in the past month. So is it bad that I have several different versions of the same package? Is there any reason I shouldn't just delete gcc-4.3 and gcc-4.4 since I have 4.7? I'm having a bit of trouble completely understanding the whole package system. Thanks a lot guys, feel free to ask me to clarify anything. **EDIT:** Does the '32' in 'linux-headers-2.6.32-5-amd64' mean that it's meant for 32bit machiens? Because I'm running 64bit, however I figured 32bit apps would still run.


How to run sh from sh file

I developed a Java application. I divided the application into 5 sub- applications, and created a service wrapper to each sub application using shell scripts:               subaap1/bin/app.sh     subaap2/bin/app.sh     ...      Now I want to create a startup script `startup.sh` to execute all the wrapper scripts:               #!/bin/bash     sh subaap1/bin/app.sh start     sh subaap2/bin/app.sh start     ...      But when I run it, I get: > Unexpected command: start How can I fix this?


Install all Linux Kernel Backports?

A series of simple questions concerning the installation of Linux kernel backports: 1) Does anyone have experience installing the unstable ones? Has anyone ever run into problems with them? Or are they basically sound? 2) Would you recommend installing them all? 3) What is the procedure for installing them all? (I have Linux-headers and build-essential firmly in place)


Is there a command such as xwininfo, xdpyinfo, xprop, or xlsclient that will tell me what font an X client window is using?

I'm trying to find a command that will report what font a given X window is configured to use. Does such a command exist? Looking through these tools I did not see an option that would give me this:   * xwininfo   * xdpyinfo   * xprop   * xlsclient Looking through the output of `lsof` I see font files that appear to be in use, however it's not clear which ones, if any, are actually being used by a given window. ### Example               $ lsof |grep gnome-ter|grep font | head -8     gnome-ter  3282      saml  mem       REG              253,0    223040    1180775 /usr/lib64/libfontconfig.so.1.4.4     gnome-ter  3282      saml  mem       REG              253,0   3656228    1588238 /usr/share/fonts/un-core/UnDotum.ttf     gnome-ter  3282      saml  mem       REG              253,0    585272     266781 /usr/share/fonts/gnu-free/FreeSans.ttf     gnome-ter  3282      saml  mem       REG              253,0    323284    1447753 /usr/share/fonts/dejavu/DejaVuSansMono.ttf     gnome-ter  3282      saml  mem       REG              253,0    190240    1588229 /usr/share/fonts/paktype-naqsh/PakType_Naqsh.ttf     gnome-ter  3282      saml  mem       REG              253,0    683528    1447770 /usr/share/fonts/dejavu/DejaVuSans.ttf     gnome-ter  3282      saml  mem       REG              253,2     42144   10488291 /home/saml/.fonts/ProggyCleanSZBP.ttf     gnome-ter  3282      saml  mem       REG              253,0     15504    1966923 /var/cache/fontconfig/87f5e051180a7a75f16eb6fe7dbd3749-le64.cache-3      To be clear, I'm not interested in this solution, titled: How to check which font the system uses?:               $ gconftool-2 --get /apps/gnome-terminal/global/profile_list     [Default,Profile0]          $ gconftool-2 --get /apps/gnome-terminal/profiles/Default/font     Monospace 12     $ gconftool-2 --get /apps/gnome-terminal/profiles/Profile0/font     TakaoMincho Bold 36      I want to determine this information via X if possible. ### References   * The X Window User HOWTO


How to make the printer Canon Laser Shot LBP-1120 work in Elementary OS Luna (Ubuntu 12.04 TLS) - 32-bit version?

I had previously created this question \+ answer, but that would not work for me after a while. I am looking for an alternative.


Concatenating string variable inside a for loop in the bash shell

#!/bin/bash          names= find /home/devuser -name 'BI*'     echo $names          for name in {names[@]}     do          echo $name      $var = $var$name        done          echo $var


grub won't install

I'm trying to re-install grub from a USB drive. I run the following:               sudo mount /dev/sda6 /mnt     sudo grub-install --root-directory=/mnt /dev/sda      I get the following error:               grub-probe: error: failed to get canonical path of /cow.      can someone explain the error, and how to solve it? **Edit** I'm trying to repair a broken dual-boot system, running from a USB containing linux mint.


How to show all files git knows about?

How can I produce a list of filenames (incl. paths) that git knows about over the course of the whole history?


syslog-ng difference between "not message(something)" and "not match(something)"?

What is the difference between these two?:               filter f_avc { not message(something); };      and:               filter f_avc { not match(something); };      it's hard to google for these types of questions :D


How big is the pipe buffer?

As a comment in I'm confused as to why "| true" in a makefile has the same effect as "|| true" user cjm wrote: > Another reason to avoid | true is that if the command produced enough output > to fill up the pipe buffer, it would block waiting for true to read it. Do we have some way of finding out what the size of the pipe buffer is?


Can I export an NFS share with faked root privileges

I'm writing software for an embedded linux system and I'm using an NFS share as root directory. The root filesystem resides in `/srv/nfs/rootfs`, and it is exported using the following `/etc/exports`:               /srv/nfs *(rw,no_root_squash,no_subtree_check,async,wdelay)      The content of `/srv/nfs/rootfs` need to be owned by root, otherwise the target system will have trouble mounting `/dev`. However, I need to be able to modify the files in `/srv/nfs/rootfs` as regular user, and I don't want to add `sudo` to my scripts or run sudo on every other command. Is there some way of configuring NFS to fake root privileges on `/srv/nfs/rootfs`? I was thinking of trying to run nfs using fakeroot, but that does not seem like the best solution to me.


Ubuntu raid dirty degraded

I have Linux version 3.5.0-17-generic (buildd@allspice) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 (per /proc/version). There are two raid arrays attached: main raid1 (system), and the second raid5 (data). I need to start raid5 in dirty degraded mode. Ubuntu won't boot with inactive array, and instead keeps dropping to initramfs. Is there a way to boot this machine with the second array in a known-degraded state?


In a recursive dns query what happens ttl = 0?

in name resolution (current version of bind), what happens when a recursive answer reaches ttl 0 on the return trip?


Expand less-than sign when using multios and brace expand

With zsh multios set (`setopt multios`) it's possible to do things like:               < in1 < in2 > out      and:               < in > out1 > out2      which is very convenient. I want to combine this feature with brace expand (`setopt braceexpand`), so when I say:               <in{1,2}^I      (`^I` is a literal tab and invokes the completion system), I want it to expand to:               <in1 <in2       but instead I get:               <in1 in2      Is there an easy way to modify this behavior?


How to check that gpg checking is correct on RHEL based machines or not?

How can I check that the "enabled=1" repositories have "gpgcheck=1" in the "/etc/yum.repos.d/" directory (and the "gpgkey=" file exist or not?)? Q: **I'm searching for a solution to do this (oneliner?), I mean to list all the "enabled=1" repositories and "gpgcheck" status, and does the "gpgkey=XXX" file exist or not?** \- the problem is that that one .repo file could contain several repositories! p.s.: afaik the "gpgkey=XXX" -> XXX could only be a local file, not an url through http... but fix me if I'm wrong..


Linux fails to mount Android device in USB MSC mode

I was referred here from android.stackexchange.com. I wish to mount my Sony Xperia ST21i (Android 4.0.4) under Linux (Debian) via USB. However, I get this error:               # mount /dev/sdb /mnt     mount: no medium found on /dev/sdb      For more context see http://android.stackexchange.com/questions/52932/linux- fails-to-mount-android-device-in-usb-msc-mode. Is this more an Android or a Linux issue?


Installing Linux Mint Live USB

First, let me just say that I'm relatively new to Linux, having been forced to use it since the recent death of my hard drive (although having used Linux for a few weeks now, I wish I'd tried it sooner) so I'm probably missing something that should be obvious to more experienced users. Anyway, here's the deal- I finally settled on Linux Mint 16 after trying a few other distributions. I used Unetbootin to create a Live USB with persistence, and it's worked well, except for the fact that after a few days I find that my 8gb USB is almost full. I need my laptop mainly for my online high school classes right now, so I'm not filling it up with games, movies, etc. After exploring my file system I found that while my home folder is full, others like cdrom, tmp, and dev have 1gb+ on them. I ran the command                   df      and got the following:                   Filesystem     1K-blocks    Used Available Use% Mounted on         /cow             4062908 3323888    529308  87% /         none                   4       0         4   0% /sys/fs/cgroup         udev             1744648       4   1744644   1% /dev         tmpfs            1755620 1232916    522704  71% /tmp         tmpfs             351124    1316    349808   1% /run                 none        5120       4      5116   1% /run/lock         none             1755620     680   1754940   1% /run/shm         none              102400      12    102388   1% /run/user         /dev/sda1        7659188 7395068    264120  97% /cdrom         /dev/loop0       1176448 1176448         0 100% /rofs      Any help would be greatly appreciated! P.S.- This is my first post, so please excuse me if I formatted something wrong. Update- After running                   sudo parted -l      I got                   Model: Lexar USB Flash Drive (scsi)         Disk /dev/sda: 7860MB         Sector size (logical/physical): 512B/512B         Partition Table: msdos              Number  Start   End     Size    Type     File system  Flags          1      1049kB  7860MB  7859MB  primary  fat32        boot, lba


Allocating resources to VPS's

I need a layman's term definition of these parameters and what they do in terms of allocating resources to servers, as I'm having issues with the VPS's that I set up, as Java seems to be unable to set up a virtual machine on them for minecraft unless they have over 2Gb's of each parameter, and I'm assuming I must be doing something wrong. Here is the current script exert that I use to initially create the server and assign resources:               SERVID=$1     IPPICK=$2     HOSTNAME=$3     PW=$4     EMAIL=$5          if vzctl create $SERVID --ostemplate centos-6-x86_64.2 --config vps.packtwo-basic ;         then             echo -e "\nVPS container was successfully created...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "Please restart the package install, there was a problem creating the VPS..."             exit $?     fi     if vzctl set $SERVID --onboot yes --save;         then             echo -e "\nSet to boot on start...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, the onboot config went wrong...\n"             exit $?     fi          if vzctl set $SERVID --ipadd $IPPICK --save;         then             echo -e "\nIP added to the VPS successfully...\n"         else             echo -e "\nThe IP address used, may be used on another server, this may mean that the server has an issue contacting external addresses..\n"     fi          if vzctl set $SERVID --hostname $HOSTNAME --save;         then             echo -e "\nHostname assigned to the VPS successfully...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem assigning the Hostname to the VPS...\n"             exit $?     fi     if vzctl set $SERVID --swappages=2224M:2224M --save;             then                     echo -e "\nThe Swap Pages were successfully allocated...\n"             else                     vzctl stop $SERVID                     vzctl destroy $SERVID                     echo -e "\nPlease restart the package install, there was a problem allocating Swappages to this VPS...\n"                     exit $?     fi     if vzctl set $SERVID --userpasswd root:$PW --save;         then             echo -e "\nThe root password was successfully assigned...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem assigning the chosen password for the root account...\n"             exit $?     fi          #Resource double checking     if vzctl set $SERVID --diskspace 30G:32G --save;         then             echo -e "\nThe resources were successfully allocated...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem allocating resources to this VPS...\n"             exit $?     fi          if vzctl set $SERVID --quotatime 800 --save;         then             echo -e "\nThe burst settings were successfully added...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem allocating quta burst time to this VPS...\n"             exit $?     fi               #Add RAM     if vzctl set $SERVID --vmguarpages 1124M --save;         then             echo -e "\nThe Vmguarpages have been successfully allocated...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem allocating Vmguarpages to this VPS...\n"             exit $?     fi     if vzctl set $SERVID --physpages 1124M:1124M --save;         then             echo -e "\nThe RAM was successfully allocated...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem allocating the RAM to this VPS...\n"             exit $?     fi     if vzctl set $SERVID --privvmpages 1124M:1124M --save;         then             echo -e "\nThe Privvmpages have been successfully allocated...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem allocating Privvmpages to this VPS...\n"             exit $?     fi     if vzctl set $SERVID --oomguarpages 1124M --save;         then             echo -e "\nThe Oomguarpages was successfully allocated...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem allocating Oomguarpages to this VPS...\n"             exit $?     fi     if vzctl start $SERVID;         then             echo -e "\nThe VPS was successfully started...\n"         else             vzctl stop $SERVID             vzctl destroy $SERVID             echo -e "\nPlease restart the package install, there was a problem allocating resources to this VPS...\n"             exit $?     fi


Debian doesn't boot anymore

I use Debian Wheezy. Yesterday I added a new HDD to the system and expanded the LVM using the `system-config-lvm` gui-tool. I have a logical LVM group for root, `/`, and one for home, `/home`. I also installed updates. Boot process: ![Boot process](http://i.stack.imgur.com/7FqDD.jpg) Windows 7 boots fine How can I fix it?


Vim: Making XML text "pretty"

Is there an easy way within `vi` to make your XML text "pretty"? For example: I want this..                           <person>       <name>Nick</name>      <age>26</age>              <gender>male</gender>     <occupation>doctor</occupation>         </person>      to be this...               <person>         <name>Nick</name>         <age>26</age>         <gender>male</gender>         <occupation>doctor</occupation>     </person>


Manjaro: don't update an application

I've got a few local dev-servers configured on LAMP. Each time Manjaro (based on Arch) updates its software, PHP needs to be reinstalled for threading support. I have no need to update Apache or PHP so how do I tell Linux not to update these packages?


Unset Fn key in emacs (console)

When I run emacs24 on the console the Fn key on both my Lenovo laptops sets the selection mark (in the same way as `C-SPC`). That's pretty crazy behavior as I need the Fn key to change screen brightness, sound volume etc. How do I unbind the Fn key so it doesn't do anything in emacs? **EDIT:** If I press `C-h k Fn` in emacs I get exactly the same output as if pressing `C-h k C-SPC`:               C-@ runs the command set-mark-command, which is an interactive compiledLisp function.     It is bound to C-@, C-SPC.          (set-mark-command ARG)     ...      If I run acpi_listen and press the Fn key I get the output:               ^@      This is the exact same output I get from acpi_listen if I press `C-SPC` or `C-@` (Ctrl+AltGr+2). That is: they're all registered as the same acpi event. Discovering that, I've tried to unset`C-@`. The only way I've got it working is with this:                (global-set-key (kbd "\C-@") 'ignore)      And this:                (global-set-key (kbd "\^@") 'ignore)      In both instances that prevents `C-SPC` from working too(!) I've tried re- setting `C-SPC` with:               (global-set-key (kbd "C-SPC") 'set-mark-command)      But that doesn't take effect. After this I can refine my question to this: Giving that `C-SPC` and `Fn` are registered as the same acpi event can I make emacs distinguish between them? (Note that this is only a problem in the console. Emacs doesn't pick up the Fn key on my X machine ...)


SSH agent forwarding, multiple hop

**I tested this setup with Linux origin machine - everything is the same - only the first hop can use keys from origin machine.** ### Initial problem I'm trying to set up SSH agent forwarding with multiple hops. My local machine is Windows, with putty and pageant, all Linux machines are Debian 7. The problem is that my private keys, originating from windows, work only on the first hop. Private key added on any the first machine works everywhere. First hop machine is called 'vpn1', second 'www1'. 'vpn1' is connected to internet and to intranet(10.1.0.1). 'www1' is connected only to intranet(10.1.0.10). 'vpn1' adds key(enbyted@vpn1.enbyted.org) using 'ssh- add', this key shows in pageant. ### Debugging I see all 3 keys in `ssh-add -L`:               ssh-rsa [pubkey-1] git@home.enbyted.org //This is github key originating from Windows     ssh-rsa [pubkey-2] enbyted@home.robotronika.pl //This is SSH key originating from Windows     ssh-rsa [pubkey-3] enbyted@vpn1.enbyted.org //This is SSH key originating from 'vpn1'      When I try to `ssh -v -T git@github.com` from 'vpn1'               debug1: Authentications that can continue: publickey     debug1: Next authentication method: publickey     debug1: Offering RSA public key: git@home.enbyted.org     debug1: Server accepts key: pkalg ssh-rsa blen 277     debug1: Authentication succeeded (publickey).      When I try to `ssh -v -T git@github.com` from 'www1'               debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Offering RSA public key: git@home.enbyted.org     debug1: Authentications that can continue: publickey,password     debug1: Offering RSA public key: enbyted@home.robotronika.pl     debug1: Authentications that can continue: publickey,password     debug1: Offering RSA public key: enbyted@vpn1.enbyted.org     debug1: Authentications that can continue: publickey,password     debug1: Offering RSA public key: /home/enbyted/.ssh/id_rsa     debug1: Authentications that can continue: publickey,password     debug1: Trying private key: /home/enbyted/.ssh/id_dsa     debug1: Trying private key: /home/enbyted/.ssh/id_ecdsa     debug1: Next authentication method: password      The same goes with ssh to hosts that accept only 'enbyted@home.robotronika.pl' key. But I can SSH with as many hops as I like with 'enbyted@vpn1.enbyted.org'. Of course, the same goes for git commands. ### Configurations My `~/.ssh/config` (same on all servers):               Host 10.1.0.*         ForwardAgent yes          Host *         ForwardAgent no      My `/etc/ssh/sshd_config` (without comments, same on all servers):               Port <custom-port>     Protocol 2     HostKey /etc/ssh/ssh_host_rsa_key     HostKey /etc/ssh/ssh_host_dsa_key     HostKey /etc/ssh/ssh_host_ecdsa_key     UsePrivilegeSeparation yes     KeyRegenerationInterval 3600     ServerKeyBits 768     SyslogFacility AUTH     LogLevel INFO     LoginGraceTime 120     PermitRootLogin no     StrictModes yes     RSAAuthentication yes     PubkeyAuthentication yes     IgnoreRhosts yes     RhostsRSAAuthentication no     HostbasedAuthentication no     PermitEmptyPasswords no     ChallengeResponseAuthentication no     X11Forwarding yes     X11DisplayOffset 10     PrintMotd no     PrintLastLog yes     TCPKeepAlive yes     AcceptEnv LANG LC_*     Subsystem sftp /usr/lib/openssh/sftp-server     UsePAM yes      ### Questions   * So, why is that?    * What am I doing wrong? Also it's really strange, that on 'www1' github offers two auth methods - password and publickey ... I'm sure that 'www1' SSHing to github.com is connecting to the same server as 'vpn1'. ### Update #1: network setup on image Please note, that image is from article, but pretty much shows my setup.            ![Network setup image](http://i.stack.imgur.com/3LRB3.png) So, I have 2 keys on my home PC, and one key on ruapehu (vpn1). When I SSH to ruapehu from the home PC I can use all three keys just fine. But when I do another ssh from ruapehu (vpn1) to aoraki (www1) I can use only the key from ruapehu. And when I ssh from aoraki (www1) to any hosts below with any amount of hops only key from ruapehu works. It doesn't if home PC is Windows with Putty + pageant or Linux with ssh-agent.


Zsh script cannot find screens

I have created a `zsh` script launching many screens in detached mode with particular names and running particular processes in them in order to automate some data analysis in high energy physics. However, I get the following error occasionally:               No screen session found.      I did not recognize a particular pattern for this `error` to be displayed and it seems to be taking place randomly, my aim is to launch this program many times with different `command-line arguments` and sometimes this error pops up in the second execution and sometimes in the third. In order to be able to perform the analysis, I need to send the particular command to the screens defined inside the `for` loops. The code is as follows:               #! /bin/zsh     ### Script for running everything in screens ###     ### System argument screen name suffix ###     echo You have the following screens running:     screen -ls     #echo Press any key to proceed. NOTE THAT YOUR OTHER SCREENS WILL GET KILLED!     #read     #pkill -15 -U arisevon screen ## We make sure that no screens are running for now     bkgarr=(TopJets BosonJets DiBoson TTbar)     sigarr=(NM1 NM2 NM3 Scenario4 Scenario6)     puarr=(50PU 140PU)     lumarr=(30 300 3000)     echo Please type 1 for 50PU samples and 2 for 140PU samples     read PU     if [[ $PU -ne 1 && $PU -ne 2 ]] ; then         echo You have to enter 1 or 2         return 1     fi          echo Please type 1 for 300fb-1 and 2 for 3000fb-1     read lum          if [[ $lum -ne 1 && $lum -ne 2 ]] ; then         echo You have to enter 1 or 2         return 1     fi          if [ $PU = 1 ]; then         let "lum = $lum + 1"         #echo $lum     fi          ex NEWrunReader.py  <<EOEX       :43s/Lumi.*/Lumi=$lumarr[lum]/       :x     EOEX          echo Compiling the reader file!!!     root -l << EOF     .L readerSummerStd.C+     EOF          echo Press any key to proceed or Ctrl+C to abort!     read           for index in $bkgarr     do         screen -dmS "${index}_${lumarr[lum]}_${1}"          #screen -S $index -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'         screen -S "${index}_${lumarr[lum]}_${1}" -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$index $1 >& "${index}_${lumarr[lum]}_${1}".txt &"$'\r'     done          for sigind in $sigarr     do         screen -dmS "${sigind}_${lumarr[lum]}_${1}"          #screen -S $sigind -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'         screen -S "${sigind}_${lumarr[lum]}_${1}" -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$sigind $1 >& "${sigind}_${lumarr[lum]}_${1}".txt &"$'\r'     done     return 0


How do I troubleshoot ssh tunnels disconnection?

I am using SSH tunnels launched via autossh at boot on a device installed at remote locations. Up to now everything was working fine but yesterday the connection partly went down and autossh wouldn't do its thing. And I would love to figure out what happened to prevent it ever happening again. I have to deal with SLAs and all. Here are the details: **_THE SETUP_** _Remote site:_ -Raspbian on a raspberry pi (debian wheezy) -Autossh running at boot connects to our server and establishes 3 ssh tunnels Tunnel 1: regular tunnel forwarding a local port on the raspberry pi to a server in our office Tunnel 2: reverse tunnel opens a port on our server pointing to a device on the remote network Tunnel 3: reverse tunnel opens a port from our server's loopback (127.0.0.1) adapter pointing to the ssh port of the raspberry pi on its loopback adapter. So basicly with this setup I have to ssh in our server from which I can ssh into each remote devices. _SSH Server:_ -Debian Wheezy -No firewall/iptables on the server, we use another box for this **_THE PROBLEM_** Both reverse tunnels (tunnels 2 and 3) stopped working. The output of               sudo netstat -atp | grep ssh      Showed that the only port still opened was for tunnel # 1 When I killed the ssh process on the server for tunnel # 1 autossh did its thing and all tunnels were reconnected but I would prefer if I didnt have to do this. Is it normal behavior for autossh? Does autossh have issues monitoring reverse tunnels? _SYSLOG from the remote device_               Sep  7 06:25:06 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed     Sep  8 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed     Sep  8 10:24:57 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh     Sep  8 10:24:57 remote_hostname autossh[1428]: starting ssh (count 2)     Sep  8 10:24:57 remote_hostname autossh[1428]: ssh child pid is 24161     Sep  8 16:53:53 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh     Sep  8 16:53:53 remote_hostname autossh[1428]: starting ssh (count 3)     Sep  8 16:53:53 remote_hostname autossh[1428]: ssh child pid is 30541     Sep  9 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed      I googled around "rsyslogd was HUPed" some places suggest it means there was a reboot but I can confirm from the uptime that this is not the case. The remote device was up during all those logs. Not sure what is next here to try to figure out what happened. Can someone please assist me? Fred.


How to use adduser command with a bash script

I'm trying to find the way to use adduser this way:               adduser $username $password      or something like this too:               adduser -u $username -p $password      I know I could use useradd and so, but right now I want to use adduser. Thanks!


How can I execute a shell script that exists in a longish path with a single command without first cd'ing to the directory?

In Linux I always `cd` to a longish path and then run the script:               cd /scratch/someDir/someOthernestedDir/     ./shellscriptName.sh       How can I avoid achieve typing this longish path and then executing the command with a single step? Some thing like the below from any path should do what I want:               executeMyCommand      P.S: I am using C-shell.               [subhrcho@slc04lyo bin]$ echo $0     csh


Using ncurses for basic GUI on a process started inside an init script

I have a custom written application that runs on a embedded setup (buildroot). My application has to run every time the target device boots up and so I wrote an init script to do this and it works fine. However, part of the application has a very basic 'GUI' written with ncurses. The problem I have is that it works fine when I log onto directly or over ssh, but when the binary starts through init, I am unable to access the functionality of the ncurses code. I presume that this is because the console I am logged into is not the same as the console that starts the binary. So my question is do applications/daemons have an associated console, and if so, is there any way to transfer it to another console? If not are there any other ways I could go about solving this problem? I was thinking perhaps enforcing an automated login and then getting the application to start through the login console so that when a monitor is attached to the device at least the GUI will be accessible. Or is there a better way?


Can I see in history output from which directory I had actually issued a command?

`CTRL+R` allows me to reverse search through the command history which is great but can I also find out from which directory that command was run? I am using C-shell in Linux.


AiX topas snapshot to web

My script for taking snapshot from TOPAS looks like this:               #!/usr/bin/bash     whoami     export TERM="xterm"     (sleep 3; echo q)| topas -Emi 2 | \        tr -d '\r'                                             | \        sed 's/\'$'\033''\[[0-9][0-9]G/       /g'              | \        sed 's/'$'\033''/\'$'\n''/g'                           | \        grep -e '^en' -e '^lo' -e '^Network'                   | \        awk '{ printf("%-8s%10s%10s%10s\n", $1,$2,$5,$6); }'   | \     cat      ... fine tuning of removing special characters, and its result inside bash terminal is great:               root     Network       KBPS     KB-In    KB-Out     lo0         3652.9    1826.0    1826.9     en1         2133.4    2109.0      24.4     en2            0.1       0.1       0.0     en0            0.0       0.0       0.0      However, I wanted to shown it at my admin-web with simple:               <?php header('Content-type: text/plain'); echo `myscript.sh`; ?>      But web result is bad (no network interfaces shown):               apache     Network       KBPS     KB-In    KB-Out      Wrapping SUID bit and managing to run it as 'root' does not help, same problem persists. So I think that it is not a privilege issue. Maybe it is something about TOPAS behaviour with TERMINAL (not sure what terminal $TERM should be to make this happen) Does anyone have a clue?


Using KSM in OpenVZ

I am setting up an OpenVZ node and while everything looks good so far, I am confused as to whether or not KSM works in OpenVZ. The majority of this thread seems to note that KSM has been disabled due to some sort of conflict. The last person seems to have got it to work, but is using KVM. This is the best info I could find on KSM in OpenVZ. https://bugzilla.openvz.org/show_bug.cgi?id=1623 If I could use OpenVZ with KSM it would be very useful, as I intend to run many near identical processes which require full isolation from each other. Thanks in advance for any pointers which would help me better understand how to approach OpenVZ (or just stick with KVM)!


Menu not shown in GTK applications

The menu bar is hidden for all my GTK applications (LXTerminal, Leafpad, Thunar...). How can I show it? I have the issue with OpenBox, and with Gnome- shell.


Awesome not showing up in GDM?

I recently installed debian with xfce. Once installed, I upgraded to Debian testing and installed awesome, then rebooted. When I click the list of session options at GDM's login screen, the only options are xfce and "default" (xfce). Awesome has a desktop file in /usr/share/xsessions, but GDM can't find it for whatever reason.


Should I remove previous version of software before install new one?

I have installed qemu by slackbuild. Now I want to install newer version of it from official website. Is it necessary to remove the old one before install the new version?


mysqldump should prompt for password

When I'm executing mysqldump command from localhost or from remote host, it's not prompting me for password. I want the password prompt even though I'm running it from remote or from local. On my server there is no ~/.my.cnf present. Also I have Ubuntu server. I'm running mariadb. Also I would like to know how mysqldump command pick up a password everytime ?