restricting pushes to selected Mercurial repositories using `ssh` forced commands and `hg-ssh`

The context of this question is the `hg-ssh` script. It is helpful but not critical to know something about Mercurial. This script sets up a forced command using public keys so the given public key setup on the server will only allow the owner of the corresponding private key to push to a permitted set of repositories on the server. This forced commands is usually prefixed to the public key in the file `~/.ssh/authorized_keys` on the server. With regard to this permitted set, the documentation before the script in the link above says:               You can use pattern matching of your normal shell, e.g.:     command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"      The idea is to permit only pushing to repositories on the server that match this pattern. I've been using `hg-ssh` with the forced command               command="cd /srv/hg && /usr/local/bin/hg-ssh * */* */*/* */*/*/*",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa [...]      to match all repositories (up to some number of path components) under `/srv/hg`, using shell globbing. I belatedly realized that it is _not_ matching paths which contain components starting with `.`. My current non- working example is the MQ repository `/srv/hg/faheem/bixfile/.hg/patches`. So, my question is, can I select a pattern that corresponds to _all_ paths? I would prefer to use shell globbing, which are less of a headache than regular expressions in general, but I'd take a regular expression if globbing is not an option.


Is there any manual about C in Linux? If any, what is it?

While I find that we can read some manuals about Library calls (C library functions) & acsii in Linux. But I still do not find any manual about C precedence order so far. So you can recommend other useful manual about C now. Thank you! PS: Note that the manual can be accessed via `man` command in Linux, so do not take those online manual or books into answers please.


How to setup a local POP3 server?

I'm developing a Thunderbird extension and I would like to setup a fake POP3 account to play with. What's the easiest way to setup a local POP3 server? It doesn't need to be particularly secure/robust, as it's meant only for local testing purposes.


Loading of shared libraries and RAM usage

I'm wondering about the way Linux manages shared libraries. (actually I'm talking about Maemo Fremantle, a Debian-based distro released in 2009 running on 256MB RAM). Let's assume we have two executables linking to libQtCore.so.4 and using its symbols (using its classes and functions). For simplicity's sake let's call them `a` and `b`. We assume that both executables link to the same libraries. First we launch `a`. The library has to be loaded. Is it loaded in whole or is it loaded to the memory only in the part that is required (as we don't use each class, only the code regarding the used classes is being loaded)? Then we launch `b`. We assume that `a` is still running. `b` links to libQtCore.so.4 too and uses some of the classes that `a` uses, but also some that aren't used by `a`. Will the library be double loaded (separately for `a` and separately for `b`)? Or will they use the same object already in RAM. If `b` uses no new symbols and `a` is already running will the RAM used by shared libraries increase? (Or will the difference be insignificant)


No /proc/sys/fs/binfmt_misc/CLR on my system?

I run docky which is programmed with `mono` so I think the binfmt is running correctly, but `proc-sys-fs-binfmt_misc.automount` complains about it, since I don't have `/proc/sys/fs/binfmt_misc/CLR` I already have `CONFIG_BINFMT_MISC=y` in my kernel config.


securing SSH and disabling direct root

In these instructions below what appears on my terminal is different so not sure what I should change. After port 22 mine says #AddressFamily any and further down for protocol it has longer line saying #activation of protocol 1 then on line below uncommented Protocol 2. Also if you disable direct root login do you use sudo instead with same password you created for root? Scroll down to the section of the file that looks like this:               #Port 22     #Protocol 2, 1     #ListenAddress 0.0.0.0     #ListenAddress ::      Uncomment and change               #Port 22      to look like      Port 5678 (choose your own 4 to 5 digit port number (49151 is the highest port number AND do not use 5678  lol )          Uncomment and change      #Protocol 2, 1     to look like      Protocol 2          Uncomment and change      #ListenAddress 0.0.0.0     to look like      ListenAddress 123.123.123.15 (use one of your own IP Addresses that has been assigned to your server)      Note 1: If you would like to disable direct Root Login, scroll down until you find               #PermitRootLogin yes     and uncomment it and make it look like      PermitRootLogin no      whereas mine is this:               #Port 22     #AddressFamily any     #ListenAddress 0.0.0.0     #ListenAddress ::          # Disable legacy (protocol version 1) support in the server for new     # installations. In future the default will change to require explicit     # activation of protocol 1     Protocol 2      argh you have to do an online course just to work this forum :/


ALSAMIXER - deleted the alsa* from /bin - need to recover

I am an Archlinux user and I ve had problems with alsamixer which didn't play sound in google-chrome. So I 1st tried to uninstall it using:               sudo pacman -Rns alsa-plugins alsa-tools alsa-oss      After "removing" the alsa (so I ve thought) I could still call it using command `alsamixer` which is bizarre. So i tried ti completely remove it by changing my pwd into the `/bin` and using command:               sudo rm alsa*      which did seem to remove the alsa and the command alsamixer wasnt reckognized any more (file `.asoundrc` in my home folder was also removed by me):               [ziga@ziga-cq56 ~]$ alsamixer     bash: alsamixer: command not found      Then I tried to reinstall the same packets that I deleted and now I get:               [ziga@ziga-cq56 ~]$ alsamixer     bash: alsamixer: command not found      It is weird that Amarok music player still plays music. Can anyone help me recover alsa?


How to run the most recent command on AIX?

How can I run the most recent command again from history in AIX Server? And how to edit the most recent command and run it again in AIX?


Is an ethernet bridge the correct way?

I want to access a private subnet, is bridging the right way? ## Example eth0   192.168.178.x tun0   10.8.0.x I can access every VPN client with 10.8.0.x. But I want to access devices from eth0 when connected to my VPN.   Is a bridge between eth0 and tun0 the correct way?


Linux: How to auto-configure IP routing based upon ping results

I've got a linux server with two possible connections to the net: one is a slow, high-latency cellular modem (ppp0), and the other is through fast wifi->broadband (wlan0). The problem is that the broadband connection sometimes goes down. However, because the **wifi** is still there, wicd leaves the default route through wlan0. (If the wifi signal disappeared, then wicd would remove wlan0 from the routing tables and the default route would fail over to ppp0, but, in this case, the wifi, itself, looks fine). What I need is a tool which will actually test for connectivity _all the way_ to some selected servers and, if they are unreachable, set the default routing interface to be ppp0 for a time. I can probably hack together a script which can do this, but it seems like something which other people would have needed to do. Is there not already a tool or script which does this?


How can I speed up operations on sparse files with tar, gzip, rsync?

I have a sparse file. (`du -h` reports 3G and `du -h --apparent-size` reports 100G.) So far, so good. Now, when I want to compress the file using `tar` or send it over the network using `rsync`, it will require as much time as 3G. It seems these tools read all the zeros. I thought the holes are somehow marked and these tools could somehow just skip them? There is likely no issue with my file? Is this a missing feature in `tar` and `rsync` to not look for sparse files? I used the `tar` parameter `\--sparse`, but that didn't speed up things. Neither did `rsync` parameter `\--sparse`. Is there any way to speed these tools up on sparse files?


How do I upgrade TCL on FreeBSD?

I updated the PORTS tree and run portmaster -a, but came to a screeching halt at:               ===>>> The lang/tcl-modules port has been deleted: Modules are now part of the base Tcl distributions     ===>>> Aborting update      So, I installed TCL86 manually and tried to remove tcl-modules, but I'm stuck here now:               / # pkg_delete lang/tcl-modules     pkg_delete: no such package 'tcl-modules' installed      What's the right way to handle this conflict so I can continue upgrading all my other ports?


EXT4 FS needs journal recovery. What does this mean?

$ sudo file -s /dev/sdb1     /dev/sdb1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)      What does "needs journal recovery" mean? Do I need to do something? What more can I check?


How to sort big files?

I have a PC with Intel(R) Pentium(R) CPU G640 @ 2.80GHz and 8 GByte RAM. Installed Scientific Linux 6.5 on it with EXT3 filesystem. **Q:** What is the fastest way I can do a " **sort -u list.txt -o list- sorted.txt** " on a file that is 200 GBytes big? Maybe split it to files, smaller then 8 GBytes, "sort -u" them, then they will be smaller, then put them together, then split them again (?) with different sizes, "sort -u" them again, etc. (?) Or are there any sorting scripts, programs that could handle files this big? (and with this limited RAM?)


E: Some index files failed to download. They have been ignored...” when tunning “sudo aptitude update”?

This is what the end of output after I run `sudo apt-get update` on Ubuntu 12.04:               Ign http://apt.typesafe.com unicorn/main Translation-en     35% [Working]W: Failed to fetch http://ppa.launchpad.net/eclipse-team/ppa/ubuntu/dists/precise/main/source/Sources  404  Not Found          W: Failed to fetch http://ppa.launchpad.net/eclipse-team/ppa/ubuntu/dists/precise/main/binary-amd64/Packages  404  Not Found          W: Failed to fetch http://ppa.launchpad.net/eclipse-team/ppa/ubuntu/dists/precise/main/binary-i386/Packages  404  Not Found          E: Some index files failed to download. They have been ignored, or old ones used instead.      My version of Ubuntu is 12.04. **Update:** I figured out dates with this command `find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;` Here is output: /etc/apt/sources.list                1  #############################################################      2  ################### OFFICIAL UBUNTU REPOS ###################      3  #############################################################      4        5  ###### Ubuntu Main Repos      6  deb http://mirror.mirohost.net/ubuntu/ precise main restricted universe multiverse      7  deb-src http://mirror.mirohost.net/ubuntu/ precise main restricted universe multiverse      8        9  ###### Ubuntu Update Repos     10  deb http://mirror.mirohost.net/ubuntu/ precise-security main restricted universe multiverse     11  deb http://mirror.mirohost.net/ubuntu/ precise-updates main restricted universe multiverse     12  deb http://mirror.mirohost.net/ubuntu/ precise-backports main restricted universe multiverse     13  deb-src http://mirror.mirohost.net/ubuntu/ precise-security main restricted universe multiverse     14  deb-src http://mirror.mirohost.net/ubuntu/ precise-updates main restricted universe multiverse     15  deb-src http://mirror.mirohost.net/ubuntu/ precise-backports main restricted universe multiverse     16       17  ###### Ubuntu Partner Repo     18  # deb http://archive.canonical.com/ubuntu precise partner     19  # deb-src http://archive.canonical.com/ubuntu precise partner     20       21  ###### Ubuntu Extras Repo     22  # deb http://extras.ubuntu.com/ubuntu precise main     23  # deb-src http://extras.ubuntu.com/ubuntu precise main     24  # deb http://linux.dropbox.com/ubuntu precise main     25  # deb-src http://linux.dropbox.com/ubuntu precise main      /etc/apt/source.list                1  deb http://security.ubuntu.com/ubuntu precise-security main universe      /etc/apt/sources.list.d/webupd8team-y-ppa-manager-precise.list                1  # deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu precise main      2  # deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu precise main      /etc/apt/sources.list.d/google-talkplugin.list                1  ### THIS FILE IS AUTOMATICALLY CONFIGURED ###      2  # You may comment out this entry, but any other modifications may be lost.      3  deb http://dl.google.com/linux/talkplugin/deb/ stable main      /etc/apt/sources.list.d/playonlinux.list                1  # deb http://deb.playonlinux.com/ quantal main      /etc/apt/sources.list.d/private-ppa.launchpad.net_commercial-ppa- uploaders_intellij-idea-ce_ubuntu.list                1  # deb https://private-ppa.launchpad.net/commercial-ppa-uploaders/intellij-idea-ce/ubuntu precise main #Added by software-center; credentials stored in /etc/apt/auth.conf      2  deb https://private-ppa.launchpad.net/commercial-ppa-uploaders/intellij-idea-ce/ubuntu precise main #Added by software-center; credentials stored in /etc/apt/auth.conf      /etc/apt/sources.list.d/webupd8team-sublime-text-3-precise.list                1  # deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu precise main      2  deb-src http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu precise main      /etc/apt/sources.list.d/typesafe-apt.list                1  # Typesafe repository.      2  deb http://apt.typesafe.com/ unicorn main # Typesafe "unicorn" releases.      /etc/apt/sources.list.d/eclipse-team-ppa-precise.list                1  deb http://ppa.launchpad.net/eclipse-team/ppa/ubuntu precise main      2  deb-src http://ppa.launchpad.net/eclipse-team/ppa/ubuntu precise main      /etc/apt/sources.list.d/medibuntu.list                1  ## Please report any bug on https://bugs.launchpad.net/medibuntu/      2  deb http://packages.medibuntu.org/ precise free non-free #Medibuntu - Ubuntu 12.04 "precise pangolin"      3  # deb-src http://packages.medibuntu.org/ precise free non-free #Medibuntu (source) - Ubuntu 12.04 "precise pangolin"      /etc/apt/sources.list.d/lezhoev-qstamina-precise.list                1  deb http://ppa.launchpad.net/lezhoev/qstamina/ubuntu precise main      2  deb-src http://ppa.launchpad.net/lezhoev/qstamina/ubuntu precise main      /etc/apt/sources.list.d/webupd8team-java-precise.list                1  deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main      2  deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main      /etc/apt/sources.list.d/tualatrix-ppa-precise.list                1  deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main      2  deb-src http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main      /etc/apt/sources.list.d/kilian-f_lux-precise.list                1  deb http://ppa.launchpad.net/kilian/f.lux/ubuntu precise main      2  deb-src http://ppa.launchpad.net/kilian/f.lux/ubuntu precise main      /etc/apt/sources.list.d/ubuntu-wine-ppa-precise.list                1  deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main      2  deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main      /etc/apt/sources.list.d/fsqcds-goldendict-precise.list                1  deb http://ppa.launchpad.net/fsqcds/goldendict/ubuntu precise main      2  deb-src http://ppa.launchpad.net/fsqcds/goldendict/ubuntu precise main      /etc/apt/sources.list.d/webupd8team-rhythmbox-precise.list                1  deb http://ppa.launchpad.net/webupd8team/rhythmbox/ubuntu precise main      2  deb-src http://ppa.launchpad.net/webupd8team/rhythmbox/ubuntu precise main      /etc/apt/sources.list.d/upubuntu-com-devel-precise.list                1  deb http://ppa.launchpad.net/upubuntu-com/devel/ubuntu precise main      2  deb-src http://ppa.launchpad.net/upubuntu-com/devel/ubuntu precise main      And I caught another snippet of trouble at `sudo apt-get update`:               Err http://ppa.launchpad.net precise/main Sources                                                               404  Not Found     Err http://ppa.launchpad.net precise/main amd64 Packages                                                        404  Not Found     Err http://ppa.launchpad.net precise/main i386 Packages                                                         404  Not Found        * _**How to solve this trouble?_**


How to show the tree view in left pane of Nautilus?

My question is similar to this one, however the answers provided are not sufficient. I'm a linux occasional user / learner, not having much background to understand what to do reading between the lines. I've Ubuntu and Nautilus, in a mode that shows a left pane, without the appropriate content. At the moment a flat list, not a tree, shows personal folders, disk drives and network places (plus some bookmarks I managed to add). I assume I got the spatial view. I'd like to have a tree. In the selected answer, the fix is to hit F9 to show the left pane. Not working. F9 just hides and shows this left pane I don't want. "View" menu also suggested is not even possible, since I've no menu displayed either. The other suggestion to hit Alt-F2 to open a command prompt and then launch `gconf-editor`. Tried that, and got `command not found`. Also tried `sudo gconf-editor` in a terminal. Got the same result. Did a little google work, but I mustn't express my problem correctly, results are similar to the linked question. What's wrong with my configuration?


How can I change the look of applications running via NoMachine?

I have set up the NoMachine NX server on a virtual machine running on a server in my datacenter to use for keeping applications running and connecting/disconnecting from them via my laptop. The problem is, applications I run on there are kinda... ugly! This is what Firefox looks like when running it through NoMachine: ![NX Screenshot](http://i.stack.imgur.com/ROaCN.png) And this is how it looks when running directly in the VMware console: ![Direct Screenshot](http://i.stack.imgur.com/v4u5X.png) How can I change how applications look when using NoMachine NX? **EDIT:** I am starting the NX session using custom desktop settings. I have selected "Run the console" as the Application and "Floating Window" under the "custom desktop" settings under the "Configure..." screen: ![Configure screen](http://i.stack.imgur.com/F1HUH.png) ![Custom Settings Screenshot](http://i.stack.imgur.com/OxCTG.png)


emacsclient -t hangs

I'm trying to use emacs (23.2.1) in daemon mode. I started it as `emacs --daemon` and that works just fine. But whenever I try `emacsclient -t somefile` I first get a line of garbage (e.g., `1;25C2;'), then the file is displayed (with emacs's mode line), but I can't do anything. It hangs; cursor movement keys don't work; C-x # doesn't work; the only thing I can do is open another console and kill the process. If I start emacs normally (by clicking on a launcher on the panel, or just running `emacs`) with `(server-start)` in the config, `emacsclient file` works just fine (i.e., loads the file in the graphical emacs instance). If I start emacs normally but use `emacsclient -t file`, I get the same problem with it hanging. I'm using Debian 6/Xfce, kernel 2.6.32-5-686. `$TERM` is xterm, maybe that needs to be changed to something else? Is there anything else that's a likely culprit? I don't want to post my entire emacs config here because it's extensive, but if you really want to look through it it's here on github. Thanks


No exec permissions on programs in /usr/local/bin

I have installed the newest Erlang from source. As the final step I have executed                sudo make install      Among other things, it placed erl link in /usr/local/bin, but its permissions are insufficient for me to use, other than with sudo                lrwxr-x---  1 root  wheel    21B Apr 19 22:26 erl@      /usr/local/bin permissions:                drwxr-xr-x  18 root  wheel   612B Apr 20 21:45 bin/      sudo gives enough permissions to execute, but not enough to change the permissions. The question is, how do I change the permissions on these symbolic links?


Does ssh compress connections in a tunnel individually?

I have _one_ compressed SSH tunnel with _one_ tunnel and _multiple_ connections over it. Data in every connection tunneled is rather homogeneous, but compressing an interleaved stream will obviously make the compression worse. How does SSH compress data with several connections:   1. On TCP connection level (i.e. one compressed stream, one zlib compression state)?   2. Or on logical in-tunnel connection level (multiple logical streams over one TCP connection, zlib state for each one)? Implementation is OpenSSH.


Determine whether a particular file is compressed

How to know in Linux whether a particular file is compressed or not using a command?


Unidentified network connections

I have an external-facing ftp/webserver (with virtual hosts) running Ubuntu 12.04LTS, and I have some concerns about some network traffic I'm seeing. Some background. I tried to be as preventive in setting up the computer as possible, perhaps relevant:   1. It is directly connected to the internet and independent of our LAN, so that if it were ever compromised the damage can't spread,   2. It runs `ufw` with a deny-first rule structure that only allows:      1. Connections to any ports from the LAN IP address (for admin purposes)     2. Connections to ports 21/80 from any IP address (for the services)   3. `apache2` is configured to only allow access to potentially 'dangerous' webpages, like _admin.php_ or _setup.php_ from the LAN IP address, and   4. Other things like automatic updating, `denyhosts`, etc. My concern is I was looking at the output of `nethogs` this morning and found a lot entries I don't understand (I've removed my server's IP address and cropped the list a bit):               PID   USER     PROGRAM                                             DEV        SENT      RECEIVED     ?     root     server.address:80-180.126.248.132:56745                      11.879       0.454 KB/sec     ?     root     server.address:80-180.126.248.132:56752                       9.568       0.354 KB/sec     8300  jon      sshd: jon@pts/0                                    bond0      5.597       0.323 KB/sec     ?     root     server.address:80-180.126.248.132:56663                       6.690       0.185 KB/sec     ?     root     server.address:80-180.126.248.132:56739                       5.242       0.170 KB/sec     ?     root     server.address:80-180.126.248.132:56608                       4.658       0.170 KB/sec     ?     root     server.address:80-180.126.248.132:56723                       5.242       0.162 KB/sec     ?     root     server.address:80-180.126.248.132:56515                       4.658       0.150 KB/sec     [...]     3614  www-data /usr/sbin/apache2                                  bond0      0.292       0.000 KB/sec     3134  www-data /usr/sbin/apache2                                  bond0      0.292       0.000 KB/sec     3307  www-data /usr/sbin/apache2                                  bond0      0.292       0.000 KB/sec     3009  www-data /usr/sbin/apache2                                  bond0      0.292       0.000 KB/sec     3768  www-data /usr/sbin/apache2                                  bond0      0.000       0.000 KB/sec     3132  www-data /usr/sbin/apache2                                  bond0      0.000       0.000 KB/sec     3384  www-data /usr/sbin/apache2                                  bond0      0.000       0.000 KB/sec      So my question, and obvious concern, is what are these connections? Why are they owned by root and without a PID? Why are there so many? Another answer suggested that similar entries in the other direction (i.e., from a random port to an external port 80 owned by root with no PID) signify connections _to_ external websites, but I don't know if the reverse is the case as I also have listings for `apache2`... I'd like to think I'm pretty experienced with Linux at a user-level, but system administration is a little new to me. The system has `chkrootkit` and `rkhunter` installed, but running them didn't turn anything up. I would obviously like to know if I have a problem, but I'd also like to understand what's going on... ### Appendix For interest, the following is the result of my `sudo ufw status verbose`               Status: active     Logging: on (low)     Default: deny (incoming), allow (outgoing)     New profiles: skip          To                         Action      From     --                         ------      ----     Anywhere                   ALLOW IN    lan.address     80                         ALLOW IN    Anywhere     21/tcp                     ALLOW IN    Anywhere     80                         ALLOW IN    Anywhere (v6)     21/tcp                     ALLOW IN    Anywhere (v6)


How can I configure IP address from class E on Linux?

I would like to configure an IP address from class E, for example `241.0.0.2`. Currently Linux (Linux-2.6.21.7-hrt1) returns the following answer:               ifconfig: SIOCSIFADDR: Invalid argument      Is there a way to do this? (The reason for using class E is that I would like to avoid IP address conflicts with customer IP networks.)


How can I create a unionfs-fuse mount that is readable by all?

I'd previously used aufs2 in aufs-tools with some luck, but apparently this package has been "superseded" (this is strange term to use for a package which seems to have been removed only because it no longer compiles, but never mind). Okay, so I thought I would try to use unionfs-fuse. I can't for the life of me figure out how to make it work for users though. I'm using this command to make my unified mount:               unionfs-fuse /mnt/disk1-pool=RW:/mnt/disk3-pool=RW /mnt/union-pool      When I run this as root, I cannot access this share as joe user:               $ ls -al /mnt          ls: cannot access /mnt/union-pool: Permission denied     ...     d??????????  ? ?    ?       ?                ? union-pool      When I run it as joe user, I cannot access this share as root. I basically get the exact same output as above. This is a little weird to me, root being root. Both root (obviously) and joe user can access the /mnt/disk1-pool and /mnt/disk3-pool mounts. If anybody has any info about aufs-tools for natty I'd also be interested. I am quite fond of this package because it worked.


Can connect to wireless router but can't browse internet

I have a Dell Studio 1450 running Fedora 17. I installed a new wireless router in the office recently. And everybody apart from me is able to connect to the internet via it. Google revealed http://forums.fedoraforum.org/showthread.php?t=276645 which is very similar to my problem. Here are output logs of some commands for you to help me.               $ ifconfig wlan0     wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.11.5  netmask 255.255.255.0  broadcast 192.168.11.255             inet6 fe80::222:fbff:febd:a1d4  prefixlen 64  scopeid 0x20<link>             ether 00:22:fb:bd:a1:d4  txqueuelen 1000  (Ethernet)             RX packets 217025  bytes 207399872 (197.7 MiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 140947  bytes 22960122 (21.8 MiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          $ ping -c 3 192.168.11.1     PING 192.168.11.1 (192.168.11.1) 56(84) bytes of data.     ^C     --- 192.168.11.1 ping statistics ---     3 packets transmitted, 0 received, 100% packet loss, time 1999ms          $ route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.11.1    0.0.0.0         UG    0      0        0 wlan0     192.168.11.0    0.0.0.0         255.255.255.0   U     0      0        0 wlan0          $ cat /etc/resolv.conf      # Generated by NetworkManager     nameserver 192.168.11.1     nameserver 192.168.1.1      Regards EDIT 1: outputs from other machine running Linux Mint, normally working on the network.               $ ifconfig wlan0     wlan0     Link encap:Ethernet  HWaddr e0:ca:94:8a:f4:08                 inet addr:192.168.11.2  Bcast:192.168.11.255  Mask:255.255.255.0               inet6 addr: fe80::e2ca:94ff:fe8a:f408/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:795989 errors:0 dropped:0 overruns:0 frame:0               TX packets:729687 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:871899683 (871.8 MB)  TX bytes:83227427 (83.2 MB)               $ ping -c 3 192.168.11.1     PING 192.168.11.1 (192.168.11.1) 56(84) bytes of data.     64 bytes from 192.168.11.1: icmp_req=1 ttl=64 time=1.12 ms     64 bytes from 192.168.11.1: icmp_req=2 ttl=64 time=1.17 ms     64 bytes from 192.168.11.1: icmp_req=3 ttl=64 time=1.12 ms          --- 192.168.11.1 ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 2002ms     rtt min/avg/max/mdev = 1.123/1.139/1.172/0.035 ms               $ route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.11.1    0.0.0.0         UG    0      0        0 wlan0     169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0     192.168.11.0    0.0.0.0         255.255.255.0   U     2      0        0 wlan0               $ cat /etc/resolv.conf     cat: /etc/resolv.conf: No such file or directory      UPDATE: It is not a problem with fedora, it is my laptop. I tried with other distros (Ubuntu 12.04 anh Bodhi Linux) and the same problem exists.


Circumvent permissions of filesystem on an external drive

Suppose that I have only non-root access on a desktop Linux machine. I want to work with an external, pluggable storage device (hdd, flash drive or memory card) with an ext{2,3,4} file system. Since I have physical control over the storage device, it seems that I should be able to do whatever I want with it, regardless of my privileges on the current system. I can mount it using `pmount`. But how do I access files that have such permissions that I wouldn't be able to access them if they were on a local file system? (For example, files owned by root with permissions `0600`)


Cannot pair my generic keyboard via automatic PIN

I am using Xubuntu, pure Xfce, 64-bit. **The problem:** I have tried 2 ways; both have failed for different reasons: (1) the commandline way (see below) fails because at no stage does it actually ask for a pin verification. (2) the GUI way using the "Bluetooth" utility (that sounds generic but it's what the tool is actually called and how it is catalogued under Synaptic) fails because the keyboard is unresponsive when the pin is requested by Bluetooth. How do I pair my device properly with the use of a automatically generated PIN? I really don't care if the solution will be GUI-based or not, as long as you can get it to pair the secure way, with a PIN. I don't want to be using my keyboard on discovery mode all the time for obvious reasons relating to security. **Details of my failed efforts:** I followed the directions on http://ubuntuforums.org/showthread.php?t=224673 in order to activate a generic bluetooth device (http://www.ebay.com/itm/Mini- Bluetooth-Keyboard-PC-Mac-iPhone-Nokia-PDA- HTC-/110653444332?pt=PCA_Mice_Trackballs&hash=item19c37590ec), which succeeded. Except come the part where I am supposed to be asked for a password, I wasn't. This is a bit disturbing, I think to myself. Anyone in the neighborhood could've in this manner connected to my keyboard and started key- logging my activities. Anyhow this is how I did it:               peter@peter-xfce:~$ hcitool scan     Scanning ...     peter@peter-xfce:~$ hcitool scan     Scanning ...         00:12:A1:11:04:E9   Bluetooth Keyboard     peter@peter-xfce:~$ gksudo mousepad /etc/bluetooth/hcid.conf     peter@peter-xfce:~$ sudo gedit /etc/default/bluetooth     peter@peter-xfce:~$ sudo /etc/init.d/bluetooth restart      * Stopping bluetooth                                                    [ OK ]       * Starting bluetooth                                                    [ OK ]      peter@peter-xfce:~$ sudo hidd --connect 00:12:A1:11:04:E9     sudo: hidd: command not found     peter@peter-xfce:~$ hidd --connect 00:12:A1:11:04:E9     The program 'hidd' is currently not installed.  You can install it by typing:     sudo apt-get install bluez-compat      [at this point bluez-compat is installed]               peter@peter-xfce:~$ sudo hidd --connect 00:12:A1:11:04:E9     peter@peter-xfce:~$       [can now type using the bluetooth keyboard] Again this is unacceptable. I don't consider that the device was paired securely because no pin was requested. Alternatively via GUI: ![enter image description here](http://i.stack.imgur.com/185Bh.png) But the keyboard is unresponsive so I cannot enter to PIN when requested.


Timer interrupts count in `/proc/interrupts` is updated very slowly and is very small

There is the result of `cat /proc/interrupts|grep timer` on my Ubuntu 11.04 machine:                 0:         63          0          0          0   IO-APIC-edge      timer     LOC:         59         44         27         10   Local timer interrupts      As one can see timer interrupts count is suspiciously small and is updated very slowly — it takes more than 30 seconds (or even more) for the value to be incremented. Though this do not cause any work or performance issues, this oddity is very disturbing so I will very appreciate any help. * * * Here is a uname output, I have Core i5 760 with 4 cores:               Linux calculon 2.6.38-11-generic #48-Ubuntu SMP Fri Jul 29 19:02:55 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux


why "ps -ef -u root -U root" also displays user processes?

ps -ef -u root -U root      Also displays processes whose user is not root (the current user). Can someone explain me why ?               -u : EUID          -U : RUID


SELinux interfering with host/guest file sharing using KVM

I'm running Fedora 17 with KVM and the virtual machine runs okay. I tried to follow this to get access to a file on the host system but SELinux prevents the VM from accessing any files other than those in `/var/lib/libvirt/images`. This is the message the host gives when running `ls` inside the VM on the shared path.               SELinux is preventing /usr/bin/qemu-kvm from read access on the     directory share.      How can I get around this? The purpose of my VM is to test binaries on multiple Linux distributions so a shared path would be easiest. Is there a way to make /tmp/share absolutely accessible by everyone?


How do I stop ssh-agent trying all keys with agent forwarding?

Often I'll connect via SSH to VM instances to deploy code from private Bitbucket repositories, cloning repositories via git over SSH. Today I was getting the error: `conq: repository access denied. deployment key is not associated with the requested repository.` A quick search showed it was this problem. The issue is my forwarded SSH agent was trying to connect to Bitbucket with a Vagrant development key that I'd added since I'd last tried to clone a private repository over SSH. (Removing the Vagrant key from my `.ssh` directory allowed me access to the private repositories again.) My SSH `config` is:               Host bitbucket.org       User git       IdentityFile ~/.ssh/bitbucket_key       IdentitiesOnly yes      and locally this seems to behave as expected. The output of `ssh -v git@bitbucket.org` shows               debug1: Authentications that can continue: publickey     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /home/me/.ssh/bitbucket_key      whereas when I'm connected to another server over SSH:               debug1: Offering RSA public key: steve@not_a_bitbucket_key     debug1: Authentications that can continue: publickey     debug1: Offering RSA public key: steve@still_not_a_bitbucket_key     debug1: Authentications that can continue: publickey     debug1: Offering RSA public key: steve@bitbucket_key      Is there some other configuration other than `IdentitiesOnly` that I'm missing to ensure only the requested keys are sent to particular servers when using agent forwarding? Running Ubuntu 12.04 with OpenSSH 5.9p1 installed.


Disable MySQL startup arch

I have KDE, and it has software to manage startup packages. But, I don't see any `mysql`, `mariaDB` or `mysqld` service. How can I disable or prevent the `mariaDB` and `mysql` daemons from starting automatically?


Buildroot: Unknown own user

I crated an image with buildroot. Everything went smooth. When I untarred the bz2 image in vmware and tried to boot into it then I observed an issue, in which, system is unable to recognize any user, even root. While starting dbus, it gives error as: `Could not get password database information for UID of current process: User "???" unknown or no memory to allocate password entry` Unknown username "root" in message bus configuration file `Could not get password database information for UID of current process: User "???" unknown or no memory to allocate password entry` `free -m` returns total=> 1006 used=> 46 free=> 959


Adding multiple sites at once to forward-zone of Unbound?

The usual format for Unbound forward-zone is               forward-zone:     name: "imap.gmail.com"     forward-addr: 8.8.8.8 #googleDNS     forward-addr: 8.8.4.4 #googleDNS      for example. Is it possible to add multiple sites in a list to the `name' field? I've tried comma separation but doesn't seem to work, e.g. something perhaps like:               forward-zone:     name: "site1.com; site2.com"     forward-addr: 8.8.8.8 #googleDNS     forward-addr: 8.8.4.4 #googleDNS      perhaps? If so what is the correct format for the list of sites? I just want to save some space in the `unbound.conf' file.


How to check if disk has linux inside

I am trying to boot a external USB drive which runs Linux to check whether the main computer hard drive is running (so it contains) Linux or not, and mount it into `/mnt` directory to modify some files. I may be able to detect the devices (hard drives) plugged into the computer, but I have no idea how to detect if that disk has an OS in it and if that OS is any distort of Linux. I'm trying to implement it in Python.


What is the source of truth for currently active tty/pts connections?

I'm looking for a simple way to determine the number of currently logged in users, using only the filesystem and basic bash functions (instead of using binaries). The `uptime` binary appears to be reading from `/var/run/utmp` according the its source code, but `/var/run/utmp` doesn't seem to update in real time (it shows `tty7` and `pts/1-5` for my user, but I'm only on `tty7` and `pts/5` at the moment). However, the `uptime` binary correctly shows "2 users". Note: Instead of relying on `uptime` or `getutent()` in C, I'm trying to better understand how the underlying system works. What's the best place to find a current, accurate number of users logged into the system?


How do I pass my password to gksu?

`gksu` doesn't has an option like `sudo` has to pass the password to it in the following way:               echo ' _password_ ' | sudo -S _command_ Anyway I wonder which is the simplest way to pass my password to `gksu`. What I found until now is:               parallel -j 2 -- "gksu _command_ " "( sleep 1; xdotool type ' _password_ ';  xdotool key 'Return' )" But this doesn't look so good for me (`parallel` and `xdotool` must to be installed, there is some time spent until the password is passed, the window which asking password is not avoided). So, is there a better way? * * * Note: I'm not interested to edit the `sudoers` file or in explanations like " _don't do this, it's not safety!_ ".


Run Script at fail login attempt?

Lately, I've been trying to create a Bash script to capture a webcam photo when a fail attempt to login is registered. First of all, I found 2 guides related to this (links at the end), they explained how to create script etc.. It was going pretty good until I noticed my System (Archlinux, Fresh installation) doesn't have PAM's common-auth file. I've checked the entire `/etc/pam.d/` directory and still can't find the file or a file with same contents. My Script so far:               #!/bin/bash          # Let's watch our thief's face n.n               ts=$(date +"%m_%d_%Y_%H_%M_%S")          ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 3 /home/haoa2/Logins-Fail/login-$ts.jpg          exit 0      My `/etc/pam.d/` directory contents: `chage`, `chfn`, `chgpasswd`, `chpasswd`, `chsh`, `groupadd`, `groupdel`, `groupmems`, `groupmod`, `login`, `newusers`, `other`, `passwd`, `polkit-1`, `rlogin`, `rsh`, `shadow`, `slim`, `su`, `sudo`, `su-l`, `system-auth`, `systemd-user`, `system-local-login`, `system-login`, `system-remote-login`, `system-services`, `useradd`, `userdel`, and `usermod` The orginal answer, and a tutorial-like answer. (Note: I know there is a related answer out there, but this quetion is more about the PAM's file rather than Scripting.)


Automated Install Fails due to CRC on /dev/sda

I'm running an X8STI-3F with an onboard LSI 1063E SAS controller running in IT mode. I'm trying to get an automated install going on it and I keep getting               ddf1: physical drives with CRC AE516B03, expected FFFFFFFF on /dev/sda     ERROR: ddf1: Cannot find physical drive description on /dev/sda!     ERROR: ddf1: setting up RAID device /dev/sda`      I've `dd`'ed out `/dev/sda` and continue to get the error.               [anaconda root@TPC-E2-11 ~]# dmraid -r     no raid disks     [anaconda root@TPC-E2-11 ~]# dmraid -l     asr     : Adaptec HostRAID ASR (0,1,10)     ddf1    : SNIA DDF1 (0,1,4,5,linear)     hpt37x  : Highpoint HPT37X (S,0,1,10,01)     hpt45x  : Highpoint HPT45X (S,0,1,10)     isw     : Intel Software RAID (0,1,5,01)     jmicron : JMicron ATARAID (S,0,1)     lsi     : LSI Logic MegaRAID (0,1,10)     nvidia  : NVidia RAID (S,0,1,10,5)     pdc     : Promise FastTrack (S,0,1,10)     sil     : Silicon Image(tm) Medley(tm) (0,1,10)     via     : VIA Software RAID (S,0,1,10)     dos     : DOS partitions on SW RAIDs          [anaconda root@TPC-E2-11 ~]# ls -l /dev/disk/by-id     total 0     lrwxrwxrwx. 1 root root 10 Aug 29 18:32 dm-name-live-base -> ../../dm-1     lrwxrwxrwx. 1 root root 10 Aug 29 18:32 dm-name-live-rw -> ../../dm-0     lrwxrwxrwx. 1 root root  9 Aug 29 19:07 scsi-35000cca00f08c5f0 -> ../../sda     lrwxrwxrwx. 1 root root 10 Aug 29 18:46 scsi-35000cca00f08c5f0-part1 -> ../../sda1     lrwxrwxrwx. 1 root root  9 Aug 29 19:07 wwn-0x5000cca00f08c5f0 -> ../../sda     lrwxrwxrwx. 1 root root 10 Aug 29 18:46 wwn-0x5000cca00f08c5f0-part1 -> ../../sda1          [anaconda root@TPC-E2-11 ~]# lsblk     NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda           8:0    0 558.9G  0 disk     ââsda1        8:1    0   100M  0 part     loop0         7:0    0 278.8M  1 loop     loop1         7:1    0     2G  1 loop     ââlive-rw   253:0    0     2G  0 dm   /     ââlive-base 253:1    0     2G  1 dm     loop2         7:2    0   512M  0 loop     ââlive-rw   253:0    0     2G  0 dm   /          [anaconda root@TPC-E2-11 ~]# dmesg | grep ddf     [  182.059331] type=1400 audit(1409336387.072:42): avc:  denied  { add_name } for  pid=1563 comm="dmraid" name="dmraid.ddf1" scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:root_t:s0 tclass=dir      What does the error mean? How do I prevent it from showing up in the future?


Sudo changes PATH, yet executes the same binary

There are two Python interpreters installed:               [user@localhost ~]$ /usr/bin/python -V && /usr/local/bin/python -V     Python 2.4.3     Python 2.7.6      Sudo changes PATH when executed:               [user@localhost ~]$ env | grep PATH && sudo env | grep PATH     PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/user/bin     PATH=/usr/bin:/bin      Yet Python run through sudo is the same as the one run directly:               [user@localhost ~]$ sudo python -V && python -V     Python 2.7.6     Python 2.7.6      I would expect `sudo python` to run `/usr/bin/python` which is the only one visible on the modified `PATH`. Why does it run `/usr/local/bin/python` instead? I asked this question on sudo-users mailing list but we couldn't find the reason for this behavior in discussion with sudo maintainer Todd C. Miller. For reference:               [user@localhost ~]$ sudo -l     Matching Defaults entries for user on this host:         requiretty, !visiblepw, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS         LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE         LINGUAS _XKB_CHARSET XAUTHORITY"          Runas and Command-specific defaults for user:               User user may run the following commands on this host:         (ALL) NOPASSWD: ALL               [user@localhost ~]$ sudo sudo -V     Sudo version 1.7.2p1          Sudoers path: /etc/sudoers     nsswitch path: /etc/nsswitch.conf     ldap.conf path: /etc/ldap.conf     ldap.secret path: /etc/ldap.secret     Authentication methods: 'pam'     Syslog facility if syslog is being used for logging: authpriv     Syslog priority to use when user authenticates successfully: notice     Syslog priority to use when user authenticates unsuccessfully: alert     Ignore '.' in $PATH     Send mail if the user is not in sudoers     Use a separate timestamp for each user/tty combo     Lecture user the first time they run sudo     Require users to authenticate by default     Root may run sudo     Allow some information gathering to give useful error messages     Visudo will honor the EDITOR environment variable     Set the LOGNAME and USER environment variables     Length at which to wrap log file lines (0 for no wrap): 80     Authentication timestamp timeout: 5 minutes     Password prompt timeout: 5 minutes     Number of tries to enter a password: 3     Umask to use or 0777 to use user's: 022     Path to mail program: /usr/sbin/sendmail     Flags for mail program: -t     Address to send mail to: root     Subject line for mail messages: *** SECURITY information for %h ***     Incorrect password message: Sorry, try again.     Path to authentication timestamp dir: /var/run/sudo     Default password prompt: [sudo] password for %p:      Default user to run commands as: root     Path to the editor for use by visudo: /bin/vi     When to require a password for 'list' pseudocommand: any     When to require a password for 'verify' pseudocommand: all     File containing dummy exec functions: /usr/libexec/sudo_noexec.so     File descriptors >= 3 will be closed before executing a command     Reset the environment to a default set of variables     Environment variables to check for sanity:             TERM             LINGUAS             LC_*             LANGUAGE             LANG             COLORTERM     Environment variables to remove:             RUBYOPT             RUBYLIB             PYTHONINSPECT             PYTHONPATH             PYTHONHOME             TMPPREFIX             ZDOTDIR             READNULLCMD             NULLCMD             FPATH             PERL5DB             PERL5OPT             PERL5LIB             PERLLIB             PERLIO_DEBUG              JAVA_TOOL_OPTIONS             SHELLOPTS             GLOBIGNORE             PS4             BASH_ENV             ENV             TERMCAP             TERMPATH             TERMINFO_DIRS             TERMINFO             _RLD*             LD_*             PATH_LOCALE             NLSPATH             HOSTALIASES             RES_OPTIONS             LOCALDOMAIN             CDPATH             IFS     Environment variables to preserve:             XAUTHORIZATION             XAUTHORITY             TZ             PS2             PS1             PATH             MAIL             LS_COLORS             KRB5CCNAME             HOSTNAME             HOME             DISPLAY             COLORS     Locale to use while parsing sudoers: C     Local IP address and netmask pairs:             10.0.2.15 / 255.255.255.0             fe80::a00:27ff:febb:56ce / ffff:ffff:ffff:ffff::               [user@localhost ~]$ sudo cat /etc/sudoers | grep -v -E '^#|^$'     Defaults    requiretty     Defaults   !visiblepw     Defaults    env_reset     Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \                             LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \                             LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \                             LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \                             LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \                             _XKB_CHARSET XAUTHORITY"     root    ALL=(ALL)       ALL     user    ALL=(ALL)       NOPASSWD: ALL               [user@localhost ~]$ which sudo && command -V sudo     /usr/bin/sudo     sudo is hashed (/usr/bin/sudo)          [user@localhost ~]$ cat /etc/redhat-release      Red Hat Enterprise Linux Server release 5.10 (Tikanga)


Run Java in a chrooted jail

I'm on a CentOS 6.5 machine with Plesk Panel which I used to create a chrooted environment for a user who can access it via ssh. I'm not a big expert but somehow I managed to let him use some basic non chroot standard command like chmod or ps. NOW what I need to do to let him use java to run his own compiled jar inside his new shiny jail? Oh and by the way, I don't know absolutely nothing about Java


Run script as a different user from root

From root user, how can I give permissions to another user to execute the file /root/script.sh ? The idea is to run the script like `sudo -u user1 /root/script.sh`


Raspberry Pi Wireless USB stick

I recently acquired a Raspberry Pi, and have installed Debian Squeeze on it, and after doing a small bit of research (I'm not too proficient with Linux) I found and ordered a USB wireless dongle ("LevelOne WUA-0605 N_Max Wireless USB Adapter") that appears to have support for Linux. This is the page I found that looks like it says the dongle has a Linux driver. I installed (what I think) was the driver package, `firmware-ralink`. Now I'm not sure what i need to do to make it work. `lsusb` lists the device as               Bus 001 Device 008: ID 0bda:8172 Realtek Semiconductor Corp.         RTL8191SU 802.11n wLAN Adapter


Recommend distribution for Graphic Design

I'm new here. I need for a `Linux Distribution` for my girlfriend, to install on her computer (in a `VM`, to be more exactly). She studies Graphic Design, and she use to work on `Windows XP`, but she got problems with License and other stuffs (also, her machine is a little older), so a proffesor on her University recommended her to work on Linux. I do some research and I found `Ubuntu Lucid Lynx` here, and it looks like it will work for her. I've seen the tools that the distro has, but I don't know how useful are. She works a lot with `Photoshop` and `Illustrator` as far as I know, but she could use some other tools.. The question is, is this the best choice for an SO oriented to graphic Design? Better a newest version, or an older ? What other tools she can get on this distro ? Are another option better? Also, about the requerimients, she has a Pentium IV and 2 GB RAM (a little older). I don't remember how much free space disk she has.. Is this a recommended version, or a newest will work better ?


Passing parsed output of sed to find (in this direction)

Well, I think you can find dozens of questions on this platform how to pipe `find` _output_ to `sed`, but I haven't found anything for the reverse direction so far. What I want to do is modify my _input_ , and _then_ pass it to `find`. Supposing I want to do something like the following, in order to make life easier for myself by avoiding to type in those cumbersome asterisk wildcards. (I hope it's obvious enough that the expression which follows the triple redirection operator `<<<` is eventually planned to get replaced by a parameter, e. g. `$1`, in a script later. The line below is merely for demonstration.)               $ sed 's/ /\*/g' <<< ' foo bar baz ' | find . -type f -iname -       That `-` at the end of this one-liner was actually _supposed_ to use the output of `sed` as input for `find`; however, extending the `find` part to               ... find -D tree . -type f -iname - ...       revealed that the parameter was _not_ passed to `find`. Perhaps you cannot pass pre-processed input to `find` using a pipe at all?


ngircd refuses connection over ssh tunnel

This might be just a misunderstanding of how ssh tunneling works, but here goes: In my `ngirgd.conf` file I have the following:               Ports = 6669     Listen = 127.0.0.1      This ngircd server is running on **HostA**. I've tunneled into it using the following: > wayne@ **HostB** % ssh -N wayne@ **HostA** -L 6669: **HostA** :6669 I enter my password. Then inside irssi on **HostB** , I do:               /connect localhost 6669      And I get               Looking up localhost     Connecting to localhost [127.0.0.1] port 6668     Connection to localhost established     Connection lost to localhost      Inside the terminal window where I launched the tunnel, I get:               channel 2: open failed: connect failed: Connection refused      From what I've understood, the ssh tunnel should be connecting `HostB:6669` to `HostA:6669`, so as far as ngirgd is concerned, the connection came from localhost/127.0.0.1. But it appears this is not the case - when I forwarded to port 80 it connected to my server just fine. Am I misunderstanding something, or is something wrong? And how do I fix it?


The most universal scripting language for Linux is?

We are writing scripts for Linux systems, there has been some debate over what would be the most universally Linux present scripting language to use. Bash, SH, Posix? What?


Why would my Linux host suddently stop receiving multicast? All other nics on private network are receiving

Here is my dilemma. Suddenly, as of yesterday, multicast packets are no longer being received from eth1 (private gigabit network) from one node. Routing between all the nodes is fine, no collisions, packet loss, etc. `ifconfig` info, inet addr, Bcast, Mask, are all fine - they all share the same bcast and netmask. Also, they all share: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 on eth1 . These nodes are all hosted by a Xen VM provider. All the guests are seeing each others private IP addresses. There are no `iptables` rules involved. Multicast packets can be seen between all the nodes (20+) except one - using `tcpdump`. The system was restarted, etc. just to add, the affected node, according to netstat -g is not being assigned the multicast group, "eth1 1 224.2.2.4" as all the others. What would cause something like this? It seems that one node is no longer part of the multicast group - I have a ticket opened but I have a feeling they are stumped.


Apple Bluetooth Keyboard

I have an Apple bluetooth keyboard and want to use it with Fedora 15. I turn on the bluetooth on the both devices. Click 'Setup new device' via Gnome3's GUI. The computer detects the keyboard but it shows up with a MAC address kind of number format instead of a name. Upon selecting I am unable to proceed with the setup, i.e., it does not proceed to the stage where it asks for a PIN to connect the devices. It works flawlessly with both a friend's iPad and my own Windows. So there doesn't seem to be any problem with the keyboard itself. I don't have much experience with bluetooth devices and there seem to be no Fedora specific posts regarding the topic, and the Ubuntu forum solutions don't seem to work for me. * * * I know the question is vague but I don't know what else I could post to help the reader. Therefore if any further information is required, please ask for it, I will post the same ASAP.


Flatten Directory but Preserve Directory Names in New Filename

How can I flatten a directory in the following format? Before: `./aaa/bbb/ccc.png` After: `./aaa-bbb-ccc.png`


How to move file from one folder to another in shell script by changing the permission

I want to move a file from one folder to another folder. When the file's format is with space in between (`file _name.dat`) and when I am using the command `mv file _name.dat /tmp` then the file is not moving. But when am using `mv "file _name.dat" /tmp` then the file is moving. Help me in writing a script which helps to change the `file _name.dat` to `"file _name.dat"` when it is moving automatically.


How do I exit or cancel a bad bash command?

I expect to get some flak for this, but I can't find the answer anywhere. It seems like it should be so obvious. Sometimes, when I type a bad command in a bash terminal, the cursor just jumps down to the next line without any error or anything. I can't tell what I did wrong. It's like I'm stuck in the program. Reenactment:               $ tidy      Me: "Oops! That's not what I meant to type..."               :q      Me: "That didn't work..."               :exit     :quit     exit     quit     /exit     /quit     -exit     -quit     -wtf???      I know I screwed up but how do I get back to the prompt without closing the terminal?


Can I watch the progress of a `sync` operation?

I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type `sync`, of course, it all has to go to disk, and that takes a long time. I understand that it's going to be slow, but is there somewhere where I can watch a counter go down to zero? Watching `buffers` in `top` doesn't help.


Unable to control audio volume in BackTrack5 R2

I have Backtrack5 R2, one of the several problems I have is the audio works but I cannot control the volume, it is always the same and it's very annoying. What can I do to fix this?


How to install Gentoo with VirtualBox and use it as native OS later?

I'd like to try Gentoo (again...). I know that many steps require a lot of configuration and much more time. I'd like to do something else on computer during long waiting, because of that I would like to install it using VirtualBox and then move it to an partition and use it as normal OS. Update: I know how to `chroot` from live to HDD, "restore" GRUB bootloader. I need especially to know how to have my Gentoo installed to real HDD partition using VirtualBox.


Support of USN Journal (change journal) in NTFS-3G driver

Does any one know if ntfs-3g driver implements change journal? I checked official website but couldn't find any information re. USN.


Reading System manual and large files

How can I copy the description of cat command from the manual to the file named cat-man? I have tried to the synopsis of cat command while it is always with a error that no file name cat-man or destination.


I'm experimenting with OpenVPN connections routed through Tor, using pairs of Tor gateway and OpenVPN-hosting VMs. On the server side, link local ports are forwarded to Tor hidden-service ports on the associated gateway VM. On the client side, OpenVPN connects through socks proxies on the associated Tor gateway VM. The above setup works using Debian 7 for all Tor gateway and OpenVPN-hosting VMs. I'm using Whonix, which has been updated to OpenVPN 2.3.2 (built on 2013-09-12). Server-client ping is about 1200 msec. However, the setup does not work using pfSense 2.1 as Tor gateway and OpenVPN- hosting VMs on the server side. pfSense 2.1 also has OpenVPN 2.3.2 (built on 2013-07-24). For both Debian and pfSense clients, I see:               TCP connection established with [AF_INET]192.168.0.10:9152     recv_socks_reply: TCP port read timeout expired: Operation now in     progress (error ...)      This is the same error reported in Debian bug #657964 for openvpn version 2.2.1-3: "openvpn: Can't connect to a VPN using SOCKS proxy". It's also been reported in OpenVPN bug #328 for openvpn version 2.3.2: "openvpn client gives up instead of retrying when proxy server is slow". However, this may not be the same bug. The problem here may be latency in forwarding OpenVPN server ports through Tor hidden services, rather than latency in Tor SOCKS proxies on the client side. Or it may be both. In any case, I find that OpenVPN 2.3.2 servers fail with this client error in pfSense 2.1, but not in Debian 7. Perhaps the latest package in the Debian 7 repository includes bug fixes that were issued since the pfSense 2.1 build. How can I configure OpenVPN to wait for slow SOCKS proxies?


Copy a directory to external HDD

I'm trying to copy a directory to external HDD- i mounted the device and then typed : `cd root tar -cf - * | (cd /mnt ; tar -xpf -)` I got this error message: "cowardly refusing to create an empty archive" When I do `ls` to the same root directory- it is not empty at all- all my needed files are there. Why does this happen?


Solaris - get a list of the commands run at startup/boot?

Is there any way of seeing a list of commands that were run at startup/boot on Solaris? I know there is a network drive being mounted at startup but I wanted to see the exact 'mount ...' command being used.


sources.list - Understanding syntax & structure in Debian

I have generated a sources.list file from http://debgen.simplylinux.ch/ with the following parameters:   * Country: New Zealand   * Release: Stable (Wheezy)   * Architecture: 64 bits   * Sources: Main + Security + Updates   * Include source package: No The output I get is:               deb http://ftp.nz.debian.org/debian stable main         deb http://ftp.debian.org/debian/ wheezy-updates main         deb http://security.debian.org/ wheezy/updates main      My questions are:   1. **Observation:** The 'base' source (line 1) points to my local repository (NZ) but the wheezy-updates source (line 2) points to the main repository (US?). **Question:** Is there any good reason why they cannot both point to my local (NZ) repository? Possible reasons I can assume are that the NZ repository does not contain the wheezy-updates, or that the main repository releases them earlier than the NZ mirror.   2. **Observation:** Line URL in line 2 ends with a trailing slash, compared with the URL in line 1 that does not.  **Question:** Is the trailing slash required or important for either line 1 or 2?   3. **Observation:** The order of the lines goes:     1. Base installation source     2. Base updates source (my understanding is this used to be called volatile?)     3. Security updates source **Question:** Is the order of the lines really all that important? I read here that: > "It is important to list sources in order of preference, with the most > preferred source listed first. Typically this will result in sorting by > speed from fastest to slowest (CD-ROM followed by hosts on a local network, > followed by distant Internet hosts, for example)." However, I would have thought that the security updates were more important, so would go on line 1. Or is is really not that much of an issue?


set up a proxy in nginx

I'm using amazon cloud. I have configured LB with SSL certificates and LB's port 443 is pointing to 80 to the instance. Nginx is running on instance on port 80. I have configured `nginx` like if some request, say abc.com, comes on port 80 of instance it will proxypass the request to another instance say xyz.com on HTTP. But my concerns is, when I hit `https://abc.com`, it's proxypassing to`http://xyz.com`. I want that, `http://xyz.com` should show `https://xyz.com`. How to set up a proxy in `nginx` where the client connects over HTTPS, but the proxy connects to the final destination server using HTTP?


print command instead of echo in linux

I simply can print a message in terminal using linux `echo` command.               prayag@prayag$ echo "prayag works on JVM"     prayag works on JVM      Can I have the same output with `print` command. I actually went through their manuals, where `$ man print` describes it as Run-mailcap-programs which term I never heard before. And came to know that it is used to find the correct program to open a file with, based on MIME. ## So is there any way to **print a simple line** using `print` alone instead of `echo`? Found similar kind of problem at Need to assign the contents of a text file to a variable in a bash script, but people suggesting `echo` over `print` there. I tried following, but got issues.               $ print --"text/plain" "prayag works on JVM"     Warning: unknown mime-type for "prayag works on JVM" -- using "application/octet-stream"     Error: no such file "prayag works on JVM"      It asks for a file, with file provided.               $ print --"text/plain" application.properties      Warning: unknown mime-type for "application.properties" -- using "application/octet-stream"     Error: no "print" mailcap rules found for type "application/octet-stream"      But got working in combination with `awk` command with a file provided,               $ awk '{print}' application.properties      prayag works on JVM


Why is Vim eating up Ctrl when used with Ctrl+v and how to fix it?

I'm using Vim `/etc/zsh/zshrc` to add key bindings for `zsh` because it doesn't work with `inputrc`. In my terminal with tmux when I type `Ctrl`+`v` then `Ctrl`+`LeftArrow` the shell will show `^[OD`. However, when I'm in Vim insert mode, pressing the same sequence will result in `^[[D`. I found out that `^[[D` is what the shell produces when I type `Ctrl`+`v` then `LeftArrow`. I have also changed `^[[D` to `^[OD` in the file `/etc/zsh/zshrc` and it works as expected (pressing `Ctrl`+`LeftArrow` causes the cursor to move back a word). Here is the line I'm talking about:               bindkey "^[OD" backward-word      I guess something is wrong with Vim because it's consuming the `Ctrl`. How do I fix this?


No 32 development library error after install glibc-devel.i686

I am trying to install gcc 4.9.0 on centOS 6. During `./configure` there is an error coming up:               /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s     /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-   linux/4.4.7/libgcc_s.so when searching for -lgcc_s     /usr/bin/ld: cannot find -lgcc_s     collect2: ld returned 1 exit status     configure: error: I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.      I have searched for an answer and found out that this error should be resolved by installing the `glibc-devel.i686` package. However, the same error persists even after I install it using `yum`. Any ideas?


Is there a way to determine machine hostname without touching "/etc/hosts"?

Considering that I'm in a LAN that assigns IP addresses using DHCP (and that I'm not its administrator), how do I set things up such that when I `ping <hostname>` (instead of `ping <IP address>`, I do get something back, without having added the match in "/etc/hostname")? Would I need to do this change in separate places for the web- and for ssh-server? I'm wondering because I _think_ there was a time when I could do this without any fiddling with "/etc/hosts" (or am I mistaken?). The problem with that file is that I would have to do it on every client that wants to use the name-to-IP mapping, and to have to continually change it if some IP address changes. The question really is: is there's a tool that can do network discovery of hostnames (matched to their IP addresses of course).


Fun, tricky and hard questions for Unix/Linux Admin interview

I am now preparing process of recrutation for group of Unix/Linux Administrators and I was wondering if maybe you have idea for fun or tricky or hard questions to ask the candidates in order to test their knowledge, level of system understanding and way of thinking? I'd ask for fun questions (to lighten the atmosphere and for beginners), tricky questions (to induce thinking and for medium/high level admins) and hard ones (for highest level people, to find ninja administrators). Ideally, you might give the answer along with the question, but this is not entirely required ;) So, any ideas?


How to unpack, modify, rebuild and install a SRPM

I would like to modify a Fedora 15 package (`gnome-shell-extensions- alternative-status-menu`). It's a small modification (reverting this commit). Using `yumdownloader` I'm able to download a SRPM (`gnome-shell- extensions-3.0.2-1.g63dd27cgit.fc15.src.rpm`). After this, how do I unpack it and then rebuild it?


vsftpd - ftp user cannot create folders

CentOS - I have created an ftp user that can log in remotely over the internet to the vsftpd server. Now I can log in via ftp, see all the directory listings (not limited/jailed) to any directory, but I **cannot create a new folder** inside `/var/www/html` When I want to create a new directory, it fails:               550 Create directory operation failed      Note, that I have done the following:               chmod 775 as well as chmod 777      as the root user on the server itself (using putty). How do I get write access to a specific folder for an FTP user? **Note** : I have the following permissions:               drwxr-xr-x. 6 david root 4096 Jul  7 20:30 html


Missing /etc/default/grub in fedora15

Based on this suggestion, I want to edit `/etc/default/grub` to add the line:               GRUB_CMDLINE_LINUX="acpi_osi=Linux"      However, I don't have that file on my system. What should I do?


start autossh reverse tunnel automatically when network comes up

I connect from my home PC thru an Internet server I own to a restricted client (that I also own) using a reverse ssh tunnel. I have a script that sets up the restricted client to middleman leg of this ssh tunnel. It works fine if I execute the script manually. Here it is:               #!/bin/sh     autossh -M 12399 -oPubkeyAuthentication=yes -oPasswordAuthentication=no -oLogLevel=error  -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ~/.ssh/named_id_rsa -R 12345:localhost:22 client@example.com -p 22      **I want to have it run automatically whenever the network is up** on this machine. To accomplish this I thought about saving it as: /etc/network/if- up.d/reverse_ssh_tunnel.sh I know I would have to remove "~/" and specify the full path to the private key as home/username/.ssh/named_id_rsa. I suspect I'll have to use su -c `my_script_name` username, but I can't get that to work. Solving this part of my question is the most important. It needs to be fully automatic & unattended. To connect from my home, I do two manual steps: A. ssh home -> middleman   B. ssh middleman -> restricted client Can A & B be done in a single step? (This would be nice, but not essential.) In summary:   1. Ideally, I'd like to do A & B in one step, manually.   2. And I need the restricted client -> middleman `autossh` connection to be fully automatic.


apt config file location

I have my / mounted as read-only (and my /root as well). Every time I start aptitude, it complains that it cannot write to /root/.aptitude/. Is it possible to tell aptitude to use another directory to store its config files ? For example /var/tmp/aptitude ?


How to find list of available shells by command-line?

How to list available shells for use by command-line?


GNU utility: sort

I have an issue sorting a file based on the first two columns. The layout of the file is:               1 998688068 PizzaFan Insurance 22.47     5 072821325 Plaisio Computers 26.35     4 998688068 PizzaFan Food 27.32     5 456834578 G.Yannopoulos Medical 91.67      .... .... I used this command : `sort -n -k 1,2 "$fpath" -o "$fpath.ordered"` The sort result is:               1 473151252 Goodys Food 7.15     1 951515524 Atlantic SuperMarket 41.32     1 998688068 Atlantic SuperMarket 80.23     1 998688068 PizzaFan Food 61.72     1 998688068 PizzaFan Insurance 22.47     2 094321587 Vasilopoulos SuperMarket 6.50      .... .... I don't understand why all columns get sorted (see 3rd column & PizzaFan Insurance) I think -k 1,2 means sort on column 1 and resolve ties with column 2, but it's like it doesn't work. It's the same as using the: `sort -n "$fpath" -o "$fpath.ordered"`


RED HAT LOGIN problem with root

I want to log in to my new installed RHEL 6.2 I am totally new to Linux. I tried to log in with root, and password that I created during the installation process, but after log in this appears root@myName ~1# : what should I write? I wrote startx but it didn't work


Weird samba and gvfs behavior - ~half of directories/files randomly appears to be "missing"

_The situation:_ Server with Gentoo Linux and Samba on it. There's around 15 Windows PCs, one MacBook Pro and one Samsung's laptop with Ubuntu. There's no domain, just a workgroup and the server is used only for Samba shares. On Ubuntu I use gvfs to mount samba shares. _And the problem:_ One day around half of directories went missing, but only when viewing on this Ubuntu laptop. If I ssh to the server I can see the missing files/dirs and I can also see the missing things from win or mac computers. _The tempfix:_ When I rename some of the missing directories, even if it's one symbol, missing directories reappear … even without reloading/refreshing the gvfs-mounted share. If I rename instantly back to the previous directories/file names, all previously missing dirs/files instantly go missing again. So, as this problem reappeared again around month later, I could use some advice where to start checking.


bind9named binary missing - not starting

I have just compiles and installed BIND 9.9.1-P1 on Debian 6.0 as the version in the repositories is too old for Samba4, and am getting the said error. I have been looking for source for named, but cannot find any.               # ls ¦ grep named in /usr/sbin     named-checkconf     named-checkzone     named-compilezone      Any suggestions? Regards


"Modules not found" error during kernel install

I have a question regarding a kernel installation. I downloaded a new version of net-next kernel source and I performed the following steps:   * `make allyesconfig`   * `make -j16`   * `make modules_install`   * `make install` The problem is that when I try to execute `make install`, I get a "modules not found" error. I am confused here since someone else was able to make the kernel with the same procedure and I am unable to do the same (We both have root permission). Is there something extra I need to do to make sure those modules are visible/available?


Shell script hangs on mail command

I'm finding that a call to the mail command is causing a script to suspend without error. To close the script I have to ctrl-c or issue a kill command on the process id. The pertinent section of the script is below:               EMAIL_TO="my@email.com"          if [ -f /www/archives/pdf/pdf_201207021048.tar ]; then         echo "file exists"     else         echo "file does not exist"     fi          echo "sending mail next..."          mail -s "pdfbackup" "$EMAIL_TO"          echo "mail sent?"      When running this, I'm seeing the text "sending mail next..." and nothing more. It never returns to prompt. I can see the script is still in memory with ps -ax | grep myscript.sh. I've tried using quotes around the subject and email, and again without. The same result is produced either way. What am I doing wrong?


Debian Sparc on Sunfire 240V recommended?

We're working on a Sunfire V240 server with SunOS 5.9 (Solaris 9, yeah really old one), I'm not expert on server architecture and I'd like your advices about installing Debian Sparc on those systems.   Is this a good choice, could we even install Solaris Sparc 11 other wise, what about compatibility?


Convert output of tree command to json format

Is there a convenient way to convert the output of the *nix command "tree" to JSON format? **Edit:** I think I didn't describe my problem well enough. My goal is to convert something like:               .     |-- dir1     |   |-- dirA     |   |   |-- dirAA     |   |   `-- dirBB     |   `-- dirB     `-- dir2         |-- dirA         `-- dirB      into:               {"dir1" : [{"dirA":["dirAA", "dirAB"]}, "dirB"], "dir2": ["dirA", "dirB"]}


usage of ! -d in a if condition

When reading the bash script for hadoop management, I found the following one               if [ ! -d "${HADOOP_HOME}" ]; then        if [ -d "${CDH_HADOOP_HOME}" ]; then      what does `! -d "${HADOOP_HOME}"` and `-d "${CDH_HADOOP_HOME}`stand for?


How can I write a sed script to delete numbers from a line?

**Sample File**               a.b.gg3d 0000000001 0000000001 y     a.b.112a 0000000000 0000000001 y     a.b.gg3s 0000000001 0000000001 y     a.b.1111 0000000000 0000000001 m      I have a file that includes about three thousand unique lines, similar to the sample above. I want to use sed to remove the "xxxxxxxxxx xxxxxxxxxx" numbers from each line. Using the sample above, I would like the sed script to produce the following output:               a.b.gg3d y     a.b.112a y     a.b.gg3s y     a.b.1111 m      How can I accomplish this? Is there a string of commands to tell sed something like "delete all numbers after the first whitespace, but leave the last character"?


2 snmp packages; ports 161/162 already in use, can I configure additional ports?

I have 2 snmp packages to install on a standalone server. 1 package is already using ports 161/162. Where can I configure a Cacti Listener and which ports can I use? Also which `snmpd.conf` file should I edit?


MongoDB install errors / E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm trying to install things in Linux (Crunchbang Linux - a derivation of Debian), and I'm getting errors which point towards mongodb-20gen. When I try to remove it using :-                 cometbill@Linuxn00b:~$ sudo apt-get remove mongodb-10gen      I get ...                Reading package lists... Done      Building dependency tree      Reading state information... Done      The following packages will be REMOVED:        mongodb-10gen      0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.      1 not fully installed or removed.      After this operation, 221 MB disk space will be freed.      Do you want to continue [Y/n]? y     (Reading database ... 81657 files and directories currently installed.)      Removing mongodb-10gen ...      arg: remove      invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.      dpkg: error processing mongodb-10gen (--remove):       subprocess installed pre-removal script returned error exit status 100      invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.      dpkg: error while cleaning up:       subprocess installed post-installation script returned error exit status 100      Errors were encountered while processing:       mongodb-10gen      E: Sub-process /usr/bin/dpkg returned an error code (1)      I read something on here for similar errors with MongoDB, and it suggested removing mongo-clients, so, I tried:-                cometbill@Linuxn00b:~$ sudo apt-get remove mongodb-clients      and get:-                Reading package lists... Done      Building dependency tree      Reading state information... Done      Package 'mongodb-clients' is not installed, so not removed      0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.      1 not fully installed or removed.      After this operation, 0 B of additional disk space will be used.      Setting up mongodb-10gen (2.4.6) ...      invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.      dpkg: error processing mongodb-10gen (--configure):      subprocess installed post-installation script returned error exit status 100      Errors were encountered while processing:       mongodb-10gen      E: Sub-process /usr/bin/dpkg returned an error code (1)      on schaiba's advice, I tried :-               cometbill@Linuxn00b:~$ sudo apt-get install -f      and got :-               Reading package lists... Done     Building dependency tree            Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.     1 not fully installed or removed.     After this operation, 0 B of additional disk space will be used.     Setting up mongodb-10gen (2.4.6) ...     invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.     dpkg: error processing mongodb-10gen (--configure):      subprocess installed post-installation script returned error exit status 100     Errors were encountered while processing:      mongodb-10gen     E: Sub-process /usr/bin/dpkg returned an error code (1)


grep contents of files based on a list of files

Running CentOS 6.5, qemu-kvm. I have a script which builds a list of running VM's. I want to pull information from those .xml files of only the VM's that are running. `cat /dev/null > /<path>/runlist virsh list --all|grep running|awk -F" " '{print $2}' > /<path>/runlist.tmp` Now that I have the list of running vm's, I want to match them to their appropriate .xml files in a directory listing that includes the .xml files of all of our vm's and pull bits of information out. I know that I can:               grep <info> </path/file.xml>      But how do I get that middle bit that will parse the runlist file against the directory listing and only search for the information from the files that are pertinent to the running VM's. * * * Sample xml file:               <domain type='kvm'>       <name>"X"</name>       <uuid>"X"</uuid>       <memory unit='KiB'>"X"</memory>       <currentMemory unit='KiB'>"X"</currentMemory>       <vcpu placement='static'>1</vcpu>       <os>         <type arch='x86_64' machine='X'>hvm</type>         <boot dev='hd'/>       </os>       <features>         <acpi/>         <apic/>         <pae/>       </features>       <clock offset='utc'/>       <on_poweroff>destroy</on_poweroff>       <on_reboot>restart</on_reboot>       <on_crash>restart</on_crash>       <devices>         <emulator>/<path>/qemu-kvm</emulator>         <disk type='file' device='disk'>           <driver name='qemu' type='raw' cache='none'/>           <source file='/path/file.img'/>           <target dev='vda' bus='virtio'/>           <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>         </disk>         <controller type='usb' index='0'>           <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>         </controller>         <interface type='bridge'>           <mac address='X'/>           <source bridge='br1'/>           <model type='virtio'/>           <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>         </interface>         <serial type='pty'>           <target port='0'/>         </serial>         <console type='pty'>           <target type='serial' port='0'/>         </console>         <input type='tablet' bus='usb'/>         <memballoon model='virtio'>           <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>         </memballoon>       </devices>     </domain>


Stop ssh config on first match

I have a added a local proxy for all my hosts in my .ssh config, however I want to shell into my local vm without the proxy command. Output of my ssh attempt:               debug1: /Users/bbarbour/.ssh/config line 1: Applying options for local.dev     debug1: /Users/bbarbour/.ssh/config line 65: Applying options for *      Given the following ssh config how do I prevent the ProxyCommand from being applied to the local.dev entry?               Host local.dev         HostName dev.myserver.com         User developer     ...     Host *         ProxyCommand /usr/local/bin/corkscrew 127.0.0.1 8840 %h %p


How can you get the current terminal line (the one that is still editable by the user)?

I need a way to use the current line which the users typed into as variable for a shell function. my current code, which can be called by ctrl+r               zle -N search          bindkey "^R" search          search () {     read str;     fc -ln -30 | grep $(printf "%q\n" "$str");     }      or simply, to call it as a function               search () {     fc -ln -30 | grep $(printf "%q\n" "$1");     }      updated: target pseudo code, to call as a function called by ctrl+r that needs no further input prompt               zle -N search          bindkey "^R" search          search ()     echo ""; #for better formatting because ctrl+R is not enter so the BUFFER(current line) gets corrupted and looks messy and the current input is not correctly shown     fc -ln -30 | grep $(printf "%q\n" "$BUFFER"); #edited to be the solution where $BUFFER is the current terminal line     }


How can I query for obsolete/outdated installed packages (ebuilds) on Gentoo?

Installed packages sometimes become obsolete because the package got version bumped and the ebuild for the old version got dropped. Also it happens that packages are dropped completely from the tree (usually for a good reason). I'd like to query those packages in order to take the appropriate action (update, remove). **How to query installed packages** that   1. have no ebuild for the current installed version; and    2. have no ebuild at all anymore (e.g. because it got deleted)


How can I renew lease when it kept printing eth0 lease expired x seconds ago?

My guest VM cannot get an IP address from my host. It keeps printing:               eth0: lease expired x seconds ago      I've tried to start `dhclient -r` and `dhclient` and restart eth0 to no avail, see here for more. How can I get a new lease in my guest?


Untraceable stability problem of 3.6.8 kernel on ASUS P53E

Randomly, but not later than after 10 hours of work, the laptop freezes. Just freezes. Knowing that not all hardware errors are reported back to the user I tried the netconsole. Unfortunately the netconsole also didn't output anything at the time of freeze. The «BUSIER» combination also doesn't work when system hangs. The only correlation I've found is that usually, on next powering up (after forced powering off) the laptop consumes 10W more power. But I suspect it might by a concidence; this behaviour is not limited to the times, when system was powered on after the freeze. After 1.5 (on average) times rebooting, the power consumption is back to normal.   * The problem persists across any of kernel 3.5.x - 3.7.1.    * The problem persists with WiFi turned off.   * The laptop works just fine with Windows XP (I've never tried 7 on it)   * I never tried 32-bit Linux on this machine.   * I use both VirtualBox and VMWare. The hanging happens also when no virtual machine is powered on, but I know that both programs insert some kernel modules.   * I use btrfs, dm-crypt, Huwavei E220 modem, bluetooth and a ton of other stuff typical for a notebook.  ...   * I will paste whatever log/configuration file that you deem necessary.  **What is the next course of action for troubleshooting this freezing problem?** Knowing exactly nothing about the causes of the problem, there is almost infinite number of combinations to try. But maybe some of you are more experienced with debugging hardware and can suggest some usual suspects? UPDATE: Suspecting that the non-standard Ubuntu mainline kernel is a culprit I did reinstall the whole system, this time with Mint14 which is based on Ubuntu 12.10, which in turn is based on the 3.5.x kernel family. Unfortunately, the same problem :-( UPDATE 2: The distribution of hanging events seems to be non-Poisson (i.e. sometimes more frequently, sometimes less frequently), but so far I don't know how to correlate it with any type of event. It happens both when laptop is used interactively or not. It happens both when the memory is used (and the system page is used - zram in my case) and when the memory is only 30% used.


Backtrack 5 R2 Dual-Boot w/Windows 7 No Longer Loads

A while back, I installed Backtrack 5 R2 to Dual Boot on a Windows 7 PC. It worked fine for a while, but now when I try to load it, the screen gets all messed up (tried to get a picture with my phone, but it wasn't working too well). The last line before it freezes says:               fb: conflicting fb hw usage: nouveaufb vs VESA VGA - removing generic driver      Since it last worked, the only changes I can think of are that the computer is now connected via the ethernet cable to the router, and I upgraded the graphics card (to Nvidia). Because of the last line, I personally would put my money on the latter, but I still have no clue how to fix this. Can someone help me?


minimal graphic requirements linux distribution

Which modern distribuition of linux has minimal graphic requirements? My graphic card has only 64MB of memory.


Finding out the values of kernel options related to sysctl.conf and sysctl.d

On my Ubuntu machine, in `/etc/sysctl.conf` file, I've got reverse path filtering options commented out by default like this:               #net.ipv4.conf.default.rp_filter=1     #net.ipv4.conf.all.rp_filter=1      but in `/etc/sysctl.d/10-network-security.conf` they are (again, by default) not commented out:               net.ipv4.conf.default.rp_filter=1     net.ipv4.conf.all.rp_filter=1      So is reverse path filtering enabled or not? Which of the configuration locations takes priority? How do I check the current values of these and other kernel options?


How do I choose between ext 3 and 4?

I tried looking at the difference, the main ones seem to be 4 supports more subdirectories in a file, supports larger files, has delayed write which I don't prefer as I don't want data loss. I also see timestamps are more accurate but it also mentions there is no support in glibc so no apps would use it. Also I just need it ot be as accurate as NTFS, I don't need anything more accurate. I'm thinking I should go with ext3 because its more likely to be more stable. What should I look at when choosing between the two?


how to check openpgp (gpg) signature against a set of public key blocks

I have some content that needs to be checked against a predetermined whitelist of OpenPGP (also keyword: gpg) public keys for a valid signature by one of them. The whitelist is maintained separately. Ideally it would be a concatenation of ascii-armored public key blocks, but a directory with one public key per file would be fine. Because the whitelist is maintained separately, we don't want to use any of gpg's keyring management functionality. If the content is signed by a key in our set of keys, it passes. No different trust levels, no web of trust, etc. Ideally we would have a program with an interface like this:               some-program KEYS_FILE CONTENT SIGFILE      or, with example arguments,               some-program /etc/ourapp/ourapps_trusted_pubkeys.asc /var/lib/ourapp/newcontent.tar.gz /var/lib/ourapp/newcontent.tar.gz.asc      The quickest way to do this with gpg seems to be:   * use a temporary file as its keyring   * point gpg to this using --keyring, but also give --no-default-keyring   * iterate through the keys in ourapps_trusted_pubkeys.asc, importing them one at a time   * iterate through the keys again, setting them to trusted with gpg --import-ownertrust   * run the gpg --verify This is a huge amount of effort for what I imagine to be a common use case. What am I missing? Does a tool similar to the postulated some-program(1) exist?


What video card will support four monitors without Xinerama?

I'm running OpenSuse 12.3 and currently have two NVIDIA video cards spanning four monitors. The problem I have is performance since Xinerama can't utilize the hardware acceleration. There are lots of video cards that will support four monitors but will I be able to have a single desktop spanned across four screens without using Xinerama? The answer I'm hoping for is, "yes, I have _*_ card running 3|4 monitors with full hardware acceleration."


IPTables and transparent proxies

I have set up a local, transparent TCP proxy on `localhost`. I want to redirect ALL TCP traffic to this proxy, so it can handle it and nothing "leaks out," circumventing the proxy. I need to use IPTables to redirect the traffic. I thought about using TPROXY, but that requires application support and only the REDIRECT target is supported at the moment. I have used the following IPTables rules:               iptables -t nat -A OUTPUT -o lo -j RETURN     iptables -t nat -A OUTPUT -d 127.0.0.0/8 -j RETURN     iptables -t nat -A OUTPUT -d 192.168.0.0/16 -j RETURN     iptables -t nat -A OUTPUT -m owner --uid-owner proxy-owner -j RETURN     iptables -t nat -A OUTPUT -p tcp --syn -j REDIRECT --to-ports $PROXY_PORT          iptables -A OUTPUT -o lo -j ACCEPT     iptables -A OUTPUT -d 127.0.0.0/8 -j ACCEPT     iptables -A OUTPUT -m owner --uid-owner proxy-owner -j ACCEPT     iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT     iptables -A OUTPUT -j LOG     iptables -P OUTPUT DROP      They _seem_ to work fine, however I'm confused as to why. Here are two questions that I still don't know the answer to: 1) Regarding the last rule in the NAT table, **why do I only want to redirect SYN packets to the local proxy port (`\--syn`)?** I want to redirect ALL TCP packets. In the current configuration it seems like only the SYN packet is redirected to the local proxy, and all other packets are allowed to directly flow to the destination, leading (in theory) to a total mess (or all except SYN being blocked by the filter table). However, if I drop the `\--syn` option and redirect ALL packets to the local proxy, the proxy does not work at all. Why? 2) Regarding the 4th rule in the filter table, **why do I need to explicitly allow outgoing established connections?** The proxy is the only application that is allowed to send packets to non-localhost destinations anyway, and it already is allowed to do so (rule 3), so what do I need the 4th rule for? It seems like it allows non-proxy connections to circumvent the proxy. Thank you!


Unable to capture program exit

I started a program written using Node.js and started it using launch pipe into logfile and send it to background. Half way running the program exited w/o any error both on the console nor the log, I even checked the /var/log/message and no way I could figure out what's wrong with the program. Are there any better way to able to capture the error/messages that causes the exit? The current execution bash script is following:               ./run_all_with_logs >> logs/my.log &


Increasing kernel memory size

I have an embedded board with 512MB of RAM running Linux 2.6.29 and UBoot bootloader. But the kernel is able to utilize only 128MB of RAM. I tried changing the value of `XCODE_MEMSIZE`, which I think determines how much RAM the kernel uses. When I set it to 512, the kernel crashes while booting up. Is there any other configuration parameter that needs to be changed?


Kernel config for ASUS P8Z77-V mainboard series

I want to build a kernel (3.6 series) for a system with a ASUS P8Z77-V mainboard. Which settings fit to the built in components? (The ideal answer would contain an example .config for this board.)               # lspci           00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)     00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)     00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)     00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)     00:1c.4 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 5 (rev c4)     00:1c.5 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c4)     00:1c.6 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 7 (rev c4)     00:1c.7 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 8 (rev c4)     00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation Z77 Express Chipset LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)     00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)     03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 09)     04:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 03)     06:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9120 SATA 6Gb/s Controller (rev 12)     07:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller


All installed software/commands will not run unless root user in Slackware 14

I originally thought it was just startx, but now I've discovered ALL commands are "not found" for any user except root... I obviously haven't checked the path for every single one, but the path for 'startx' is fine. Basic commands such as ls, echo, cd, etc. all still work, just not ones I've had to install like startx, nano, google-chrome, etc. This happened after installing Vidalia, with the dependencies libevent, GeoIP, tor, and vidalia. Vidalia ran once, but did not run again, and upon reboot all was gone... was this a virus?? (all were from Slackbuilds)


How can we limit the impact of ssh probes?

My webserver is constantly attacked by various IP addresses. They try five passwords and then change the IP address. I have done various lockdowns like using ssh-keys and not permitting passwords, and not allowing remote root login. Is there something I can do to get rid of these attack attempts? Failing that, are there specific defenses I should put up?


Moonlight in Debian

What is the preferred way to install moonlight in Debian (Testing)? I searched the repositories, but there seems to nothing relevant. Also this wiki: http://wiki.debian.org/Teams/DebianMonoGroup/Moonlight just states its out of date. Any ideas?