title: What does "Cannot make/remove an entry for the specified session" mean?

text: Instead of logging me in, `PAM` greets me with the message " **Cannot make/remove an entry for the specified session** " after I enter the password. What entry is it talking about (and what session)? The string with the error message is found in `libpam.so.0`(.83.1). My system is based on binaries from Fedora release 20 (Heisenburg). How can I troubleshoot PAM to figure out what is needed to successfully login? I have no syslog (and no persistent disk, only an initramfs). ## Updates: SELinux is Disabled. I am more than willing to replace the entire PAM config with something simple that allows login (normal user and root) on the virtual consoles only. Source code from Linux-PAM-1.1.8, `libpam/pam_strerror.c` reveals that the message comes from the error code `PAM_SESSION_ERR`, which can be caused by all sorts of internal problems, such as memory allocation error or failure to locate the users home directory. So much for trying to interpret the error message. :-( * * * Below are my config files based on the comment indicating `/etc/pam.d/login` as a starting point: (I have also tried removing all lines containing `pam_loginuid.so` without any noticeable difference) * * * **/etc/pam.d/login** :               auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so     auth       substack     system-auth     auth       include      postlogin     account    required     pam_nologin.so     account    include      system-auth     password   include      system-auth     session    required     pam_selinux.so close     session    required     pam_loginuid.so     session    optional     pam_console.so     session    required     pam_selinux.so open     session    required     pam_namespace.so     session    optional     pam_keyinit.so force revoke     session    include      system-auth     session    include      postlogin     -session   optional     pam_ck_connector.so      **/etc/pam.d/postlogin** :               session     [success=1 default=ignore] pam_succeed_if.so service !~ gdm* service !~ su* quiet     session     [default=1]   pam_lastlog.so nowtmp showfailed     session     optional      pam_lastlog.so silent noupdate showfailed      **/etc/pam.d/system-auth** :               auth        required      pam_env.so     auth        sufficient    pam_fprintd.so     auth        sufficient    pam_unix.so nullok try_first_pass     auth        requisite     pam_succeed_if.so uid >= 1000 quiet_success     auth        required      pam_deny.so     account     required      pam_unix.so     account     sufficient    pam_localuser.so     account     sufficient    pam_succeed_if.so uid < 1000 quiet     account     required      pam_permit.so     password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=     password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok     password    required      pam_deny.so     session     optional      pam_keyinit.so revoke     session     required      pam_limits.so     -session     optional      pam_systemd.so     session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid     session     required      pam_unix.so      * * * **I have these shared PAM-related libraries** :               libpam_misc.so.0     libpam.so.0     pam_access.so     pam_console.so     pam_deny.so     pam_env.so     pam_fprintd.so     pam_gnome_keyring.so     pam_keyinit.so     pam_lastlog.so     pam_limits.so     pam_localuser.so     pam_loginuid.so     pam_namespace.so     pam_nologin.so     pam_permit.so     pam_pkcs11.so     pam_pwquality.so     pam_rootok.so     pam_securetty.so     pam_selinux_permit.so     pam_selinux.so     pam_sepermit.so     pam_succeed_if.so     pam_systemd.so     pam_timestamp.so     pam_unix_acct.so     pam_unix_auth.so     pam_unix.so     pam_xauth.so      **as well as these that are referenced by the above shared libraries (according to`ldd`)**:               libattr.so.1     libaudit.so.1     libcap.so.2     libcrack.so.2     libcrypt.so.1     libc.so.6     libdbus-1.so.3     libdbus-glib-1.so.2     libdl.so.2     libffi.so.6     libfreebl3.so     libgcc_s.so.1     libgio-2.0.so.0     libglib-2.0.so.0     libgmodule-2.0.so.0     libgobject-2.0.so.0     liblzma.so.5     libnsl.so.1     libnspr4.so     libnss3.so     libnssutil3.so     libpcre.so.1     libpcre.so.3     libplc4.so     libplds4.so     libpthread.so.0     libpwquality.so.1     libresolv.so.2     librt.so.1     libselinux.so.1     libsmime3.so     libssl3.so     libutil.so.1     libz.so.1


title: List all chflags file flags?

text: Is there a way to see a file's flags, such as hidden, schg, etc? I've got an rwxrwxrwx file that I can't edit, and I think a flag might be responsible.


title: Backtrack panels issue

text: I accidentally hid the bottom panel and created another panel on the right side of the screen. That panel is on top of the button to show the bottom panel again. The panel on the right is unclickable and I cant figure out how to delete it. Is there some config file i can edit to delete that panel? Can i reset my desktop to default settings? Thanks, giodamelio


title: How do I install kbuild?

text: How do I run/install this: https://github.com/kevmoo/kbuild? I installed the dependencies and tried to execute the bin/kbuild Python script, but it's giving me this error:               Traceback (most recent call last):       File "kbuild/bin/kbuild", line 12, in <module>         BREW_PREFIX = subprocess.check_output(['brew', '--prefix']).strip()       File "/usr/lib/python2.7/subprocess.py", line 537, in check_output         process = Popen(stdout=PIPE, *popenargs, **kwargs)       File "/usr/lib/python2.7/subprocess.py", line 679, in __init__         errread, errwrite)       File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child         raise child_exception     OSError: [Errno 2] No such file or directory      My guess is that this tool was intended for OSX and Homebrew and that's why it's choking. I just wasn't sure based on the minimalist installation instructions.


title: Finding where a process reads in a file

text: Is there a way to attach to a process and find out, not only which files it is reading from, but what the read locations (byte offsets) of those reads are? I tried using strace for this, but it doesn't seem to show that information.


title: Why is the US international keyboard layout on Debian/Ubuntu different?

text: > **Possible Duplicate:**   >  Why is the US international keyboard layout on Debian different? I asked this question on askubuntu.com recently but I was not satisfied with any answer. I realized that the "problem" was not only in Ubuntu but in Debian itself and Ubuntu just inherited it and now I decided to try my luck here to a broader audience. So, if you don't want to click the link, here is what I'd like to know: > I have been using Linux on and off for 10 years, and more recently I have > spent more time with OSX. > > But, I still remember that in the beginning I'd choose the US international > keyboard layout and it would have exactly the same output as the Windows > keyboard layout (and most recently, the OSX US international layout). > > However, a few years ago when I installed Ubuntu, I noticed that the cedilla > wasn't printed anymore (ç or Ç). This is a combination of the following > keys: ' + c. Instead, what I get is the ć letter. > > When did it start to happen, and why the difference to the behavior on the > other OSes? What puzzles me even more is that there is even an "US > International alternative" keyboard layout, which prints exactly the same > keys! So, what's it alternative to? > > This has been reported as a bug back to Canonical (can't find the link now), > but the keyboard layout has never changed back to what I'd expect. I know > the workarounds to fix it to what I need, but I just would like to know > why/when it has become different.


title: *nix working on eBox 3300

text: I'm not sure if hardware questions are alright here, I didn't see many. I am trying to install any Linux operating system on an eBox 3300. I am having trouble, and the only thing I have been able to get to work is Ubuntu's Netbook Remix. I would rather have fedora/ Debian/ or just about anything else. What I really want to know is has anybody here encountered one of these devices and/or used them yourself? If so, what steps did you take to get it going? Update for phunehehe's comment: The processor is a Vortex86MX, which is a i586 chip, so we have to specifically find i386 images instead of i686 (which is slightly more troublesome than one would think). The network card is the R6040 from RDC, which I been unable to get Ubuntu Netbook Remix to recognize. A couple distros (I forget which ones) would not recognize the SD card slot, which is what we are using for storage. The specific model is eBox 3300MX-C.


title: Renaming the system users bin and man without doing harm?

text: In my setup I need to rename the Linux system users man and bin because I need the usernames for humans. I'm using Ubuntu 12.04. I know that I have to change `/etc/passwd`, `/etc/shadow`, etc. But when updating through apt, packages use the man user for their man pages, and those files would have false ownership then. Is there an configuration option in Ubuntu where I can set how the manual user is called? Same with the bin user: I don't know when it is used but I assume changing its name will mess something up.


title: Installing rpm & dependencies

text: I am trying to install an rpm, namely the Oracle 10g database for CentOS 6 for testing an app. The problem is that the machine the OS is installed on does not have access to the internet and there is a list of dependencies that the 10g needs which also have other library dependencies. With 'yum' being unhelpful in this case, is there somewhere or a way dependencies for an rpm can be downloaded without having download each one individually?


title: Distros that support compiling from source

text: A long time ago I used to use FreeBSD with its ports system and after that Gentoo for portage in order to install applications via compiling from source. I did this in order to directly target my system. Are there any other distros out there which support such a configuration? I seem to remember Slackware having something similar.


title: X server locking up when displaying applications from another system

text: My main display is on Gentoo, using xorg 1.15.1 (maybe I should try 1.16.0). I'm running applications in a RHEL 6.5 VM (using xorg 1.13.0). I ssh into the RHEL virtual machine, launch some heavy (java-based?) X applications that don't otherwise work on Gentoo, and get them to display on my main screen. This has the advantage of allowing the windows to move around my desktops or even integrate with my system tray. Unfortunately, when I do this, my entire X server stops responding fairly quickly. Nothing pops out at me in the X server logs. The screens stop repainting, except for the mouse, and even the mouse eventually stops moving. This is usually within 5 to 10 minutes, but sometimes faster. Making this worse is that my kernel can't seem to display to the console, most likely due to a combination of nvidia proprietary driver + UEFI, so hitting ctrl-alt-F1 and looking at the logs isn't an option (but I can restart X that way, losing my VM, etc., in the process). This is a different problem that isn't part of the question, only the context as to why the above is a significant issue. I'm looking for anything I can try to get this configuration to stop locking up my X server. Restarting X every ten minutes can really impact one's productivity.


title: virt-resize complains: "virt-resize: error: You cannot use --expand when there is no surplus space to expand into."

text: I am resizing an installed KVM domain               # resize the partitions     virt-resize --expand /dev/vda2 --LV-expand /dev/vg_main/lv_root $VMFILE $VMFILE.tmp      and `virt-resize` throws an error:               virt-resize: error: You cannot use --expand when there is no surplus space to expand into.  You need to make the target disk larger by at least 224.0K.      What does this mean and how can I avoid it? I am using resizevm.sh script from CentOS KVM Image Tools and the script produces a dead disk image (domain doesn't boot up). I am using the latest CentOS 6.5


title: What is wrong with these iptables' rules?

text: The following is what I got after googling:               iptables -A INPUT -i lo -j ACCEPT     iptables -A OUTPUT -o lo -j ACCEPT #allow loopback access     iptables -A OUTPUT -d 255.255.255.255 -j ACCEPT #make sure you can communicate with any DHCP server     iptables -A INPUT -s 255.255.255.255 -j ACCEPT #make sure you can communicate with any DHCP server     iptables -A INPUT -s 192.168.0.0/16 -d 192.168.0.0/16 -j ACCEPT #make sure that you can communicate within your own network     iptables -A OUTPUT -s 192.168.0.0/16 -d 192.168.0.0/16 -j ACCEPT     iptables -A FORWARD -i eth+ -o tun+ -j ACCEPT     iptables -A FORWARD -i tun+ -o eth+ -j ACCEPT # make sure that eth+ and tun+ can communicate     iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE # in the POSTROUTING chain of the NAT table, map the tun+ interface outgoing packet IP address, cease examining rules and let the header be modified, so that we don't have to worry about ports or any other issue - please check this rule with care if you have already a NAT table in your chain      Here's what I did: A. As I am using Debian, I installed iptables-persistent. B. I `sudo /etc/iptables/rules.v4` and replaced the default in it with the following:               *filter     -A INPUT -i lo -j ACCEPT     -A OUTPUT -o lo -j ACCEPT #allow loopback access     -A OUTPUT -d 255.255.255.255 -j ACCEPT #make sure you can communicate with any DHCP server     -A INPUT -s 255.255.255.255 -j ACCEPT #make sure you can communicate with any DHCP server     -A INPUT -s 192.168.0.0/16 -d 192.168.0.0/16 -j ACCEPT #make sure that you can communicate within your own network     -A OUTPUT -s 192.168.0.0/16 -d 192.168.0.0/16 -j ACCEPT     -A FORWARD -i eth+ -o tun+ -j ACCEPT     -A FORWARD -i tun+ -o eth+ -j ACCEPT # make sure that eth+ and tun+ can communicate     -t nat -A POSTROUTING -o tun+ -j MASQUERADE # in the POSTROUTING chain of the NAT table, map the tun+ interface outgoing packet IP address, cease examining rules and let the header be modified, so that we don't have to worry about ports or any other issue - please check this rule with care if you have already a NAT table in your chain     -A OUTPUT -o eth+ ! -d 111.222.333.444 -j DROP # if destination for outgoing packet on eth+ is NOT a.b.c.d, drop the packet, so that nothing leaks if VPN disconnects     COMMIT      C. I save the changes to /etc/iptables/rules.v4 and reboot the computer. Note that 111.222.333.444 is an example of an IP address of the VPN server located in XYZ country D. Upon reboot, I am unable to connect to the VPN server. Something is wrong with the contents of rules.v4


title: What does -p do when creating directories

text: What does the following command do to my system?               $ mkdir -p /tmp/aes      I typed the following command into my command line and it executes as expected. I know the folder is created as when I attempt to execute the line of code again, I get the following error: `mkdir: cannot create directory /tmp/aes: File exists` I can't see the folder on my desktop though. I know `mkdir /tmp/aes` will create a folder. What is the function of `-p`? How do I delete this unseen folder?


title: convert scientific data into generic

text: I have a file containing only numerical values in scientific format. I want to convert them into generic notation and multiply them by 1000. e.g.   _input.txt_               1.1234e-01       2.123e+01       3.12345e-02       ...       ...        _output.txt_               112.34       21230       31.2345       ...       ...          I have many such files to perform the task (one file at a time) so command line single liner solution is preferable.


title: Reverse proxy for OVZ containers

text: Is it possible to use a reverse proxy to channel all network traffic from one domain to a single container using the same IP for all the domains? The reverse proxy would have to read the domain and then channel all the traffic to the correct container. If someone know someplace I can get information for this or a sort of tutorial that would be fantastic.


title: How can I add a package to the default installation of Ubuntu?

text: I want to add the `xclip` package as default package in Ubuntu. When I install Linux then `xclip` package should also be installed with it. How can I do it?


title: How to use a variable plus glob ($var*) in bash

text: I'm having a issue with a script. So this is the code               #!/bin/bash          date=`date +"%m-%d-%y"`          dokuwiki="dokuwiki.$date*.toolbox.admin.tar.gz"          if test -e  $dokuwiki     then     echo "works"     else     echo "shits broken yo"     fi      My problem, I think it doesn't find the file which is weird files are like this:               dokuwiki.09-12-14-06-00.toolbox.admin.tar.gz      cheers


title: Extract csv files from path to multiple files in bash

text: I have a files multiple file path for backup purpose ,now i want to filter it based on ".csv " fromat. I have tried this.               filesall=(/home/abc/allfiles/*)     files=$((${filesall[@]}|grep -F ".csv"))     files=$(${filesall[@]}|grep -oe "*.csv")      but unable to extract .csv files from **$filesall** . I know i can achieve it like this               files=(/home/abc/allfiles/*.csv)      any suggestion ,how can i get all .csv files from filesall.Thanks.


title: What precautions should I take running Windows 7 on a VM on Linux?

text: I'm thinking of running Windows 7 on a virtual machine on VirtualBox on top of Linux, so that Windows is sort of a "self-contained sandbox" (especially in terms of data storage) for things that require Windows to run. However, I've heard that running a VirtualBox VM may have some security or stability implications for the host system. What sort of things could the Windows system in a VM do that would mess up the Linux system it runs on?


title: What app can I use to change sound levels in GNOME 3 (fallback)?

text: With GNOME 2, I use my the volume control applet to change loudness levels. It doesn't load on GNOME 3 (fallback) applet, so I wonder what other UI can I use for this, preferably a GNOME one.


title: Remote connection to RedHat virtual machine from other PCs in the network

text: I have installed a virtual machine `RHEL 6.1` using `Oracle Virtual Box` on my `Windows 7` Computer. I have set the network options to Bridged adapter mode, my host Computer (Win-7) is connected on my home network via statically assigned IP =192.168.25.1, so I set the IP on the RHEL virtual machine = 192.168.25.2. I have also Enabled Server on Remote Display options (Server port 3389, Authentication Null, Timeout 5000, Allowed multiple connections) on the virtual machine settings. The remote access option is also enabled on the Virtual Machine RHEL and disabled the Firewall as well on the VM. But still I am unable to access the VM remotely from another computer on the network IP = 192.168.25.3 using VNC. I can successfully ping from the VM to both the Host Win7 as well as the other Win7 PC on the network. But I cant Ping to the VM from the Win7 PCs. Any clues regarding the solution ??? The screenshot of ifconfig -a is shown below. During this test scenario the host machine is 192.168.25.50 (which can be taken on remote using MSTSC from anothe PC on the network). And the RHEL VM is given IP 192.168.25.15. ![enter image description here](http://i.stack.imgur.com/wMlUx.png)


title: Keyboard input to be translated to gamepad (joystick) input?

text: I'm trying to participate in Steam Hardware Beta for the Steam Machine but I can't complete one of the tasks "Launch and play a game using a gamepad in Big Picture mode" because I don't have a gamepad so I'm looking for software like this http://headsoft.com.au/index.php?category=vjoy to run on Linux. Or the opposite of http://qjoypad.sourceforge.net/. Or probably I should buy gamepad.


title: why does the dollar sign cause this command to be executed?

text: test_script.sh:               #!/bin/sh     D1="$(dirname $0)"     echo $D1     D0="(dirname $0)"     echo $D0      What I type on the command line:               $ ./test_script.sh      Output:               .     (dirname ./test_script.sh)      What significance does the first dollar sign in D1's value have s.t. the command gets executed while D0's value is interpreted as a string?


title: Try manufacturer iwlwifi driver

text: Since I have been issues with my WiFi, I would like to try a driver I found on the manufacturers site. Whether this will improve anything is questionable, but I'm running out of options.. Anyway, what would be the best way to go about it? I am running Ubuntu 12.04.4 (3.5.0.48 kernel) and have downloaded the tgz container with the ucode file I suspect I will be needing. It would be nice to be able to revert to the current version easily if this doesn't help.


title: How to properly setup user/groups/permissions for a web server?

text: I spent all day figuring this out, but without success, so hopefully I can get some help here: I have Ubuntu 13.10 VPS server with nginx, PHP 5 and MariaDB installed. I created custom system user (for example "myuser") which I use for connecting through SFTP to my server. In my user home directory I created "public_html" dir for my web root. What I am trying to accomplish is that if I copy my files through SFTP (or rsync as well) they will be working not only with my user, but also with the PHP/server. For example if I install WP it has no permissions to write in files as I am the owner of them. (therefore cannot upload files, install themes, plugins etc.) However this is not a WP problem, but overall user/group/permission setup problem I was playing around with directory sgid, umask, assigning myself to www-data etc. but cannot find the right way to do this. (without manually chmod my files) For example on my ex-shared hosting I just uploaded a file where I am the owner and there is no problem with permissions. Running nginx/php under my user I consider as not secure. Please help me with this issue - I need a stable and secure option. P.S. I know I can chmod my files after I upload/create them, but this is not a solution as it is very time consuming/overhelming. I need to automate this process and I believe there is a proper solution.


title: Apt-get autocompletion

text: I am currently running 64-bit Debian Wheezy. I am having some trouble with auto completion for apt-get. I have bash- completion installed. If I am logged in as root in a shell, I can use auto completion for apt-get (ex: _apt-get install wicd[tab][tab_ ]) and it will show me all the packages that match that. But if I try to use auto completion for apt-get in another non-root user (even with sudo) it will not work at all. I can auto complete other things like file names. Any help? I do have the following code in my .bashrc and /etc/profile                if [ -f /etc/bash_completion ]; then           . /etc/bash_completion      fi


title: changing the order of items in a list

text: I have a file with plain text. This file contains a list like this:               @"Joe", @"211",     @"Bob Nelson", @"132",     @"Jack Sierra", @"3422",     @"Walt Robert", @"14",      The list goes on and on with thousands of names... I need to switch the elements order and transform this list to               @"211", @"Joe",     @"132", @"Bob Nelson",     @"3422", @"Jack Sierra",     @"14", @"Walt Robert",      How do I do it from terminal?


title: Open source duplicate image finder for Linux?

text: Is there a free and open source duplicate image finder for Linux based systems? Finding exact duplicates (based on content, not file name) is sufficient for me, but the ability to find similar images would certainly be great, too.


title: How to Allow Outgoing SMTP on iptables Debian Linux

text: If I choose to allow all traffic on the OUTPUT chain (`iptables -P OUTPUT ACCEPT`) mail sends fine. As soon as I lock down my server with these rules, outgoing mail stops working. All else works though, which is strange. Does anyone see anything in here that would keep my outgoing mail from sending? I am stumped, have looked at these rules over and over and tried lots of different versions.                iptables -F      iptables -P INPUT DROP      iptables -P FORWARD DROP      iptables -P OUTPUT DROP                iptables -A INPUT -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT      iptables -A OUTPUT -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT           iptables -A INPUT  -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT      iptables -A OUTPUT -p tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT           iptables -A INPUT  -p tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT      iptables -A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT           iptables -A INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT      iptables -A OUTPUT -p tcp --sport 443 -m state --state NEW,ESTABLISHED -j ACCEPT           iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT      iptables -A OUTPUT -p tcp --dport 587 -j ACCEPT           iptables -A OUTPUT -p tcp --sport 25 -j ACCEPT      iptables -A OUTPUT -p tcp --sport 587 -j ACCEPT           iptables -A OUTPUT  -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT      iptables -A INPUT -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT           iptables -A OUTPUT  -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT      iptables -A INPUT  -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT           iptables -A INPUT -i lo -j ACCEPT      iptables -A OUTPUT -o lo -j ACCEPT           iptables -A OUTPUT -p udp  --dport 53 -j ACCEPT      iptables -A INPUT -p udp  --sport 53 -j ACCEPT           iptables -A INPUT -p tcp --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT      iptables -A INPUT -p tcp --dport 443 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT                iptables -N LOGGING      iptables -A INPUT -j LOGGING      iptables -A LOGGING -m limit --limit 2/min -j LOG --log-prefix "IPTables Packet Dropped: " --log-level 7      iptables -A LOGGING -j DROP


title: Configuring a vncserver so it's only accessible from my ssh tunnel

text: Since I use vnc through an ssh tunnel, is there any way I can block the open vnc port that the remote machine is listening on without it affecting my ability to use the ssh tunnel? Both machines are linux debian based.


title: Fedora 15 - Limited RAM Access

text: I have an issue with Fedora 15's available memory. The laptop it is installed on has 4GB of SDRAM, but Fedora only sees 2GB.               [njozwiak@calvin xpmc6720]$ free -m                  total       used       free     shared    buffers     cached     Mem:          2193       1994        198          0         59       1405     -/+ buffers/cache:        529       1663     Swap:         4255          0       4255      I realize F15 is a 32-bit OS, but I should still be able to access more than 2193MB. Any ideas?               [njozwiak@calvin xpmc6720]$ uname -a     Linux calvin 2.6.38.6-27.fc15.i686 #1 SMP Sun May 15 17:57:13 UTC 2011 i686 i686 i386 GNU/Linux


title: I deleted files from my Linux box's /boot directory and now it won't boot

text: I deleted files from `/boot` to save space, but now when I boot I see: > GRUB loading, please wait ... ERROR 15 `/boot` still has files corresponding to the 2.6.32-27 version of Linux. But I deleted all others that did not have that string in /boot How can I fix this?


title: How to find what's hogging what resources?

text: I've found lots of similar questions, but nothing that's exactly right. I'm trying to figure out what's making one server run slower than another. I'm hoping for something that would say something like what resources are being used the most (I/O, ram, cpu, chickens) and what processes are using those resources in significant amounts. I don't just want to start throwing solutions at it to see what will stick. I want metrics of some kind. I don't want to sit there with top, iotop, nettop & chickentop open, scribbling in a notebook.


title: Jerky animations with gnome shell 3.12

text: Since I upgraded to Gnome Shell 3.12 on ArchLinux x86_64, shell animations (i.e. windows overview) became very jerky on my Intel HD graphics 3000.   This happens with both latest kernel 3.14.1 and previous 3.13.8. Is there any xorg or other config settings to set, that would resolve this problem? **Edit:** As it seems I'm not alone with this issue, I reported a bug here. Let's see what developers say...


title: Tool to force use FILE instead of RAM

text: I'm wondering why there is no such tool like **ram2swap** , similar to cpulimit in parts. E.g. There is program daemon.bin. Let's create temporary swap file ( 1 Gb ):               % dd if=/dev/zero of=tmp.swap bs=1m count=1000      Launch:               % cpulimit -l 10 ram2swap -f tmp.swap daemon.bin      Instead of RAM usage or SWAP, daemon.bin will allocate memory in the `tmp.swap` file. Dramatically decrease performance, yes. But How this is flexibly.


title: iptables and securing an smtp

text: I am trying to block all SMTP out of my network, that is not from my internal mail server address. So i would just like to know if there could be anything i am missing or perhaps anything i could improve on my current iptable rules for my mail server.               iptables -I FORWARD -p tcp --dport 25 -j DROP     iptables -I FORWARD -p tcp --dport 25 -j LOG --log-prefix "FORWARD-SMTP-DROP: "     iptables -I FORWARD -p tcp -s <SMTP IP HERE> --dport 25 -j ACCEPT     iptables -I FORWARD -p tcp -d <SMTP IP HERE> --dport 25 -j ACCEPT          iptables -I OUTPUT -p tcp -m multiport --dport 25,465,587 -s ! <SMTP IP HERE> -j DROP     iptables -I OUTPUT -p tcp -m multiport --dport 25,465,587 -s ! <SMTP IP HERE> -j LOG --log-prefix "OUTPUT-SMTP-DROP: "      Thanks in advance :)


title: Rescue value from second last line

text: After I run a script, I've got the following lines: * * *                PyMOL(TM) Molecular Graphics System, Version 1.4.1.      Copyright (c) Schrodinger, LLC.      All Rights Reserved.              Created by Warren L. DeLano, Ph.D.               PyMOL is user-supported open-source software.  Although some versions         are freely available, PyMOL is not in the public domain.              If PyMOL is helpful in your work or study, then please volunteer          support for our ongoing efforts to create open and affordable scientific         software by purchasing a PyMOL Maintenance and/or Support subscription.              More information can be found at "http://www.pymol.org".              Enter "help" for a list of commands.         Enter "help <command-name>" for information on a specific command.           Hit ESC anytime to toggle between text and graphics.           Command mode. No graphics front end.      Detected 8 CPU cores.  Enabled multithreaded rendering.     PyMOL>align MHC1, MHC2      Match: read scoring matrix.      Match: assigning 385 x 384 pairwise scores.      MatchAlign: aligning residues (385 vs 384)...      ExecutiveAlign: 3810 atoms aligned.      Executive: RMS =    0.000 (3810 to 3810 atoms)     PyMOL>sele EP1, chain M      Selector: selection "EP1" defined with 63 atoms.     PyMOL>sele EP2, chain R      Selector: selection "EP2" defined with 64 atoms.     PyMOL>rms_cur EP1 and n. CA, EP2 and n. CA      Executive: RMS =    7.457 (9 to 9 atoms)      PyMOL: normal program termination.      * * * I need to extract the value "7.457" from the line " Executive: RMS = 7.457 (9 to 9 atoms)". It should be noted that the "7.457" value, as well the "9 to 9 atoms" information will vary among different rounds, so I can't use it as a pattern. The "Executive: RMS" is not variable, but it is repeated some lines above. Apparently, I'll have the value always in the second last line. This could be used to extract the value, but I don't know how to do it with python or shell script. Can someone help me? Thank you very much! By the way, this is the script I'm working on(It's specific PyMol program, retrieving RMSD values):               ## RUNNING     ## Importing PyMol files     from pymol.cgo import *     from pymol import cmd     from pymol import stored     # Loading MHC1     cmd.load ("MHC1.pdb")     #Change chain C to chain M (MHC1 epitope)     cmd.alter (('chain C'),'chain="M"')     # Loading MHC2     cmd.load ("MHC2.pdb")     #Change chain C to chain R (MHC2 epitope)     cmd.alter (('chain C'),'chain="R"')     ## Align MHC1 and MHC2     cmd.do ("align MHC1, MHC2")     ## MHC1 epitope selection (EP1)     cmd.do ("sele EP1, chain M")     ## MHC2 epitope selection (EP2)     cmd.do ("sele EP2, chain R")     ## Remove chain names (this is required so 'rms_cur' will work properly)     cmd.alter (("all"),'chain=""')     ## Residues numbers aligned (this is required so 'rms_cur' will work properly)     cmd.alter (("all"),'segi=""')     ## RMSD Calculation between EP1 and EP2     cmd.do ("rms_cur EP1 and n. CA, EP2 and n. CA")


title: How can I page up or down in tmux with Terminal.app?

text: I have `tmux` installed. But I can not scroll up or down.   I.e. as soon as I `tmux` I get only a portion of the screen and can not scroll up.   `crtl-b` + `Page Up` does not work since I am in `Mac` and I can not figure out why these keys are messed up and don't properly work.   Also neither `ctrl-b` + `[` works. It is really annoying and I am pretty sure it is the `Mac` (first time user and I am really starting to be annoyed.....)   How can I do scrolling in `tmux` (on Mac I guess should be part of the question) **UPDATE:**   I will try to describe my problem more:   When I am in `tmux` only a portion of the text shows up. If I try to scroll up or down the console scrolls up **but not the actual text**.   If I do `CTRL+b` followed by `[`, I see in the status bar `*tmux`, and If I press the up or down arrow I can actually go up/down on the text _line by line_. When I press `q` I see in the status line `bash`.   When I do `CTRL+b` follow `Page UP` or `Page` the console goes up or down but not the text. How can I scroll up or down the text in more than one line at a time?


title: partitioning using 2 hard disks (SSD and non-SSD) in linux

text: I have the following free spaces on 2 disks:   1. SSD - 240G (sda)   2. non-SSD - 240G (sdb) I understand that I should use SSD to install packages and non-SSD just for storing data. What's the best partitioning schema (including swap) in my case? When I tried automatic partitioning it installs only on 1 disk and dedicating 8G for swap. PS. I'm going to install Linux Mint as a dual-boot alongside with Windows 7, which is already installed. **UPDATE:** I have 8GB of RAM Windows has been installed on non-SSD drive.


title: Test whether Linux binary is compiled as position independent code

text: I recently learned that (at least on Fedora and Red Hat Enterprise Linux), executable programs that are compiled as Position Independent Executables (PIE) receive stronger address space randomization (ASLR) protection. So: How do I test whether a particular executable was compiled as a Position Independent Executable, on Linux?


title: How to run hello world in Maemo

text: Do you know any other way to start app than using `./`? I've just compiled one in c++ and i can't run it.


title: How to shut down Linux if idle for 30+ minutes?

text: We define "idle" based on how screen savers in Linux define it. I found this tool called "xautolock". I tested it like this:               /usr/X11R6/bin/xautolock -time 1 -locker "notify-send test"      I placed this in `/etc/rc.d/rc.local`, but for some reason it was not working and I couldn't debug it. Someone said to place it in `.bash_profile`. I found this file and placed it in there, but now my GUI won't start. Because this command is a forever command, it always listens once executed. It never stops listening in order to determine idleness, so this means it can not go into `.bash_profile`. I do not know how to place it in to `/etc/rc.d/rc.local`, so where can it go if it can not go into these files? Perhaps there is a way to modify it so it can go into `/etc/rc.d/rc.local`? Perhaps something like:               DISPLAY=:0.0 /usr/X11R6/bin/xautolock -time 1 -locker "notify-send test"      Would that work? I'm on CentOS and GNOME.


title: How to allow recursion for only 1 zone?

text: Is it possible to allow recursion for a single zone in BIND 9.6?


title: Yum, force the update of dependencies

text: I have a package with several dependencies. I updated my repo with the given package and his dependencies but when I'm updating the package dependencies are not updated since the required versions are already installed. How could I force those dependencies to be updated? Here's an example to clarify it: I have installed               RPM_A_1.0      Who have in dependencies :               RPM_B version 2.1     RPM_C version 1.1      Now I updated my repo so I have the following versions:               RPM_A_2.0     RPM_B version 2.1-12     RPM_C version 1.1-12      When I call `yum update RPM_A` the others RPMs are not updated and I would like to force those updates


title: Bash : compare two strings with space

text: I am trying to write a bash script which run a command and compare the result with another string.               #!/bin/bash -x          STATUS=`/root/setup_ha show --password-file=/root/password | grep ">HA State" | awk '{print $3}' |  cut -c 2-`          TEST=`echo $STATUS`     if [[ "$TEST" == "ON Master" ]];     then echo CLUSTER CRITICAL     else       echo CLUSTER OK MASTER     fi      As the Original string is on two lines, I echo it in a new variable TEST. The New variable have the output of the command on one line. Here is the Bash debug output :               ++ /root/setup_ha show --password-file=/root/password     ++ grep '>HA State'     ++ awk '{print $3}'     ++ cut -c 2-     + STATUS='ON     Master'     ++ echo 'ON' Master     + TEST='ON Master'     + [[ ON Master == \O\N\ \M\a\s\t\e\r ]]     + echo CLUSTER OK MASTER     CLUSTER OK MASTER      I also tried the following test :               if [[ "$TEST" =~ "ON Master" ]]      The thing is bash is not able to compare the strings it is always false. Any idea ? EDIT : Here is the output with the first answer :               + STATUS='ON     Master'     ++ echo 'ON' Master     + TEST='ON Master'     + '[' 'ON Master' == 'ON Master' ']'     + echo CLUSTER OK MASTER     CLUSTER OK MASTER      Still not working ON seems weird on line 3, plus in my bash it takes green color !


title: Laptop wifi connectivity dependent on other devices being connected (RaspPi Access Point)

text: I've been trying to setup a Raspberry Pi as a WiFi router using `hostapd`, yet have encountered a strange issue when trying to connect:   1. Laptop (Macbook Pro 2009) finds WiFi network, yet fails to connect: being too far from the router named as possible issue.   2. I connect my mobile phone to the WiFi network, after standing a bit closer, and it works fine.   3. Once the phone is connected, my laptop immediately connects to the network (not having been moved), signalling full signal strength. Could someone explain to me why this is happening on a technological level? Are there maybe ways the Raspberry Pi can be configured, so that all devices are able to connect without this strange workaround?


title: Unix Shell and colours

text: Can any one please help me understand this code snippet that I found in .profile file               echo -en "\e[32;44m $(hostname) \e[m";echo -e "\e[m"


title: install oracle java sdk in ubntu - configuration problem - runs only with sudo priviledge

text: I am trying to to configure java sdk on ubuntu 12.04. I ha/ve copied the jdk folder to `/usr/lib/java` and made a link as "sudo ln -s -b /usr/lib/java/jdk1.7.0_45/bin/javac /etc/alternatives/javac" and "sudo ln -s -b /usr/lib/java/jdk1.7.0_45/bin/javac /bin/bin/javac" but when i try to run command "javac" it doesn't run. however it runs as "sudo javac" correctly. how can i make it run without sudo


In short, this is where I found the best answers to my problem with my disks: https://help.ubuntu.com/community/DataRecovery * * * During Fedora 15 installation, I added all my 3 drives to be mounted on boot. However, after the installation ended I could not mount them any more. During the reboot, I was presented with this message?               **Give root password for maintenance     (or type Control-D for normal startup):**       "Control-D" did not work and I ended turning off manually and reinstalling Fedora 14, in the hope it was a bug, but, as I knew latter, it was not. So I tried to added the disks manually in fstab:               $ nano /etc/fstab     /dev/sdb1                /media/Unus                     ext4     defaults  0 0     /dev/sdc1                /media/Duo                     ext4     defaults       0 0      But they do not mount:               $ mount media/Duo     mount: wrong fs type, bad option, bad superblock on /dev/sdb,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      This is what I get from dmesg:               $ dmesg | tail     [  897.592207] EXT4-fs (sdc): VFS: Can't find ext4 filesystem      However, the disks are there:               $ testDisk          Disk /dev/sdb - 1000 GB / 931 GiB - ATA ST31000528AS     Disk /dev/sdc - 2000 GB / 1863 GiB - ATA ST2000DL003-9VT1          Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63         Partition                  Start        End    Size in sectors     >   P ext4                     0   0  1 121601  80 63 1953525168 [Unus]          Disk /dev/sdc - 2000 GB / 1863 GiB - CHS 243201 255 63         Partition                  Start        End    Size in sectors     >   P Unknown                  0   0  1 243201  80 63 3907029168      Note that just before installing Fedora 15, both disks were formated with ext4 and were working normally. Is there a way to rebuild the filesystem without loosing the data recorded on the disks? I wish to know what I should do for both disks have indispensable data in them. Thanks. * * * **UPDATE:** Following: http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken- ext4-superblock-in-ubuntu/ As root I ran:               $ fsck.ext4 -vy /dev/sdb      And this recovered one of my disks. So I could mount it:               $ mkdir /media/Unus && mount /dev/sdb      However, I was not so lucky with the other:               $ fsck.ext4 -vy /dev/sdb     e2fsck 1.41.12 (17-May-2010)     fsck.ext4: Superblock invalid, trying backup blocks...     fsck.ext4: Bad magic number in super-block while trying to open /dev/sdc     The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:         e2fsck -b 8193 <device>      As a folk suggested, I ran:               $ file -s /dev/sdb1 /dev/sdc1     /dev/sdb1: ACB archive data     /dev/sdc1: LVM2 (Linux Logical Volume Manager) , UUID: XlSIOVm3e8Ozqv4EO0TgTCiKAOdW4V6      Now I am figuring out how to fix disk /dev/sbc - 2000 GB / 1863 GiB - ATA ST2000DL003-9VT1 (which was **ext4** , by the way). * * * **NEW UPDATE:** # e2fsck -n /dev/sdc1               # e2fsck -n /dev/sdc1          e2fsck 1.41.12 (17-May-2010)     e2fsck: Superblock invalid, trying backup blocks...     e2fsck: Bad magic number in super-block while trying to open /dev/sdc1          The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:         e2fsck -b 8193 <device>      Some print screens of the disks: http://imgur.com/a/hY6ze * * * **LAST UPDATE** While I am waiting for the new disk to arrive, I was trying some of your suggestions. In order to try to activate a logical volume, I got this:               # lvchange -ay vg_atipico/**lv_duo**       One or more specified logical volume(s) not found.      Did I write the command right or should I write instead: "lvchange -ay vg_atipico/ **sdc1** " ? **Thanks!**


title: bash scripting add arguments

text: I have created a script which takes parameters and arguments. I want to insert the --help argument. I already know how to parse normal arguments with -, but I don't know how to parse the -- ones. to parse optiopns for `test.sh -h` i use the following check               while getopts ":h" opt;      do      case $opt in         h ) {                 echo "help!!!"                 exit 1         } ;;     esac     done      But I want to have the option to call the script with `test.sh --help` Thanks in advance. P.S. I am using Ubuntu 12.04...but it doesn't really matter. Apparently I can't answer my own question if I have so less rep. I found the solution in one of the .sh scripts from /usr/bin                 if test $# = 1; then         case "$1" in           --help | --hel | --he | --h )             func_usage; exit 0 ;;           --version | --versio | --versi | --vers | --ver | --ve | --v )             func_version; exit 0 ;;         esac       fi


title: Using sed to get rid of characters < > ,

text: I have a file with lines as follows:               ...     ... <230948203[234]>, ...     ... <234[24]>, ...     ..      I would like to use sed to remove the characters `<` `,` and `>` from every line I tried using `sed 's/<>,//g'` but it didnt work (it didn't change anything). Do I need to escape these special characters. Is it possible to delete multiple characters using a single `sed` command?


title: Make Tar Incremental Backups into One Backup?

text: Well, I know this question is quite strange. I have done a lot of incremental backups. It makes the total file size is too large, because there are a lot of duplicated files with similar contents, and some files actually deleted. These historical versions of files are useful, that's why I do not use rsync. BUT I don't want too much. I just want, for example, history of 3 months. I don't want to start a new incremental backup every 3 months, but group the backups 3 months before into one file instead, i.e. make the backups done ...6, 5, 4, 3 months before be one backup done 3 months before. Is there anyway to do that? Or any alternative solution?


title: Chrubuntu on Acer C7: SD card reader only works on AC power?

text: I have an Acer C7 chromebook on which I have installed Chrubuntu. Everything works great except that the SD card reader doesn't work when the computer is running from battery power. It recognizes the card and works perfectly as soon as I plug it into AC power. Is there a power management setting somewhere that I need to toggle to be able to use my SD card reader on battery power?


title: What protocol/standard is used by terminals?

text: I was wondering how the "GUI" of a command line application is communicated over a network. Most of the time, it's quite simple (plain text / input) but sometimes it's more complex (aptitude). Is it defined by some sort of standard so that anyone can write their own terminal and that all terminal implementations behave in the same way (colors, positioning, etc.)?


title: Correlating /var/log/* timestamps

text: `/var/log/messages`, `/var/log/syslog`, and some other log files use a timestamp which contains an absolute time, like `Jan 13 14:13:10`. `/var/log/Xorg.0.log` and `/var/log/dmesg`, as well as the output of `$ dmesg`, use a format that looks like               [50595.991610] malkovich: malkovich malkovich malkovich malkovich      I'm guessing/gathering that the numbers represent seconds and microseconds since startup. However, my attempt to correlate these two sets of timestamps (using the output from `uptime`) gave a discrepancy of about 5000 seconds. This is roughly the amount of time my computer was suspended for. Is there a convenient way to map the numeric timestamps used by dmesg and Xorg into absolute timestamps? ## update As a preliminary step towards getting this figured out, and also to hopefully make my question a bit more clear, I've written a Python script to parse `/var/log/syslog` and output the time skew. On my machine, running ubuntu 10.10, that file contains numerous kernel-originated lines which are stamped both with the dmesg timestamp and the syslog timestamp. The script outputs a line for each line in that file which contains a kernel timestamp. ### Usage:               python syslogdriver.py /var/log/syslog | column -nts $'\t'      ### Expurgated output (see below for column definitions):               abs              abs_since_boot  rel_time      rel_offset  message     Jan 13 07:49:15  32842.1276569   32842.301498  0           malkovich malkovich      _...`rel_offset` is 0 for all intervening lines ..._               Jan 13 09:55:14  40401.1276569   40401.306386  0           PM: Syncing filesystems ... done.     Jan 13 09:55:14  40401.1276569   40401.347469  0           PM: Preparing system for mem sleep     Jan 13 11:23:21  45688.1276569   40402.128198  -5280       Skipping EDID probe due to cached edid     Jan 13 11:23:21  45688.1276569   40402.729152  -5280       Freezing user space processes ... (elapsed 0.03 seconds) done.     Jan 13 11:23:21  45688.1276569   40402.760110  -5280       Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.     Jan 13 11:23:21  45688.1276569   40402.776102  -5280       PM: Entering mem sleep      _...`rel_offset` is -5280 for all remaining lines ..._               Jan 13 11:23:21  45688.1276569   40403.149074  -5280       ACPI: Preparing to enter system sleep state S3     Jan 13 11:23:21  45688.1276569   40403.149477  -5280       PM: Saving platform NVS memory     Jan 13 11:23:21  45688.1276569   40403.149495  -5280       Disabling non-boot CPUs ...     Jan 13 11:23:21  45688.1276569   40403.149495  -5280       Back to C!     Jan 13 11:23:21  45688.1276569   40403.149495  -5280       PM: Restoring platform NVS memory     Jan 13 11:23:21  45688.1276569   40403.151034  -5280       ACPI: Waking up from system sleep state S3      _... The final lines are from a bit further down, still well above the end of the output._ Some of them presumably got written to `dmesg`'s circular buffer before the suspend happened, and were only propagated to `syslog` afterwards. This explains why all of them have the same syslog timestamp. ### Column definitions: `abs` is the time logged by syslog. `abs_since_boot` is that same time in seconds since system startup, based on the contents of `/proc/uptime` and the value of `time.time()`. `rel_time` is the kernel timestamp. `rel_offset` is the difference between `abs_since_boot` and `rel_time`. I'm rounding this to the tens of seconds so as to avoid one-off errors due to the absolute (i.e. `syslog`-generated) timestamps only having seconds precision. That's actually not the right way to do it, since it really (I think..) just results in a smaller chance of having an off-by-10 error. If somebody has a better idea, please let me know. I also have some questions about syslog's date format; in particular, I'm wondering if a year ever shows up in it. I'm guessing no, and in any case could most likely help myself to that information in TFM, but if somebody happens to know it would be useful. ..Assuming, of course, that someone uses this script at some point in the future, instead of just busting out a couple of lines of Perl code. ### Next: So unless some welcome revelation is unto me given by one of You, my next step will be to add a function to get the time skew for a given kernel timestamp. I should be able to feed the script one or a set of syslogs, along with a kernel timestamp, to get an absolute timestamp. Then I can get back to debugging my Xorg issues, which escape me at the moment.


title: change environment of a running process

text: How might it be possible to alter some variable in the `env` of an already running process, for example through `/proc/PID/environ?` That "file" is `read-only`. Need to change or unset the DISPLAY variable of a long-running batch job without killing it.


title: Linux nat/iptables configuration for a chain of peer-to-peer links

text: I have an experimental setup, of 4 Linux (CentOS) machines: ![http://i.imgur.com/PBW2ifj.png](http://i.imgur.com/PBW2ifj.png) All 4 machines are internally connected using different networks and can ping eachother directly connected interfaces. However only PC4 has access to internet. I am trying to setup iptables rules that can allow PC1 to be able to access internet via PC4, but I have no idea how to do this. I tried to add NAT at outgoing interface on PC2, PC3 and PC4:               iptables -t nat -F POSTROUTING     iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE      However, this does not work, can you give me some idea how in such a setup i can make PC1 access 10.0.0.1 network??


title: Must I store a private key in a file?

text: I have a db-driven application that needs to communicate with another server via ssh. The web app can generate a keypair and give the user the pubkey, or it can accept the unencrypted private key in a field on a web form. It then encrypts the key with reversible encryption and stores it in its database. When the web app goes to communicate with the ssh server, I need to unencrypt the private key and provide it to ssh some way or another. I could create a secure temporary file with `mktemp`, point ssh at it, and then destroy the file, but that's extra work that exposes the key in a new way that seems like it shouldn't be necessary. I've looked at `man ssh`, `man ssh-agent` and `man ssh-add`, but there doesn't seem to be any way to use the key without adding it to a file first. What am I missing?


title: Recursively Remove SVN files

text: I'm still learning the bash shell. I want to recursively find and remove svn files within the child directories of a given folder. I made the mistake of checking out instead of just cloning. So i'm trying to clean up my mess. I've tried these but i've only get output of all the files found: `rm | find -name ".svn"` When i run this i get no output and the files are still there: `find . -executable -o ! -regex '.*\\.svn' -exec rm -i {} \\+`


title: ls and find command excluding a certain directory

text: I want to do this:               ls -altrhS 'find / -type d \( ! -name tmp -prune \) -size +10000k 2> /dev/null -print' | egrep -v 'ibd|MYD|MYI'        So I want to list, in that format, files of a specific size excluding the tmp directory. All that I've read says that should do it, but it does not work, I keep getting the temp directory stuff as well.


title: No qemu-debootstrap in Arch Linux

text: I just installed lxc in Arch Linux, but the `qemu-debootstrap` binary seems missing, This command `sudo lxc-create -n test -t ubuntu -P /run/shm/1` complains about that. I couldn't find it with either `pacman` or `yaourt`. Any ideas how to fix that? I have the `debootstrap` script installed and that works though


title: LibreOffice 4.0 looks ugly in KDE

text: I installed recent LibreOffice version (4.0) but it looks so ugly in my KDE on Linux Mint, as shown in the following picture... how can I fix this issue? ![enter image description here](http://i.stack.imgur.com/5oide.png)


title: How to know which hard disk is the new one and which one is the old one

text: I ordered 2 SSDs from my provider. However, which drive is the main drive? How do I know which drive is the new SSD drives?


title: In emacs, how can I pass an argument to a function in a keybinding defintion

text: I want to create a keybinding for funcion _`end-of-line+`_ and pass a value of _`-1`_ to i. The function is declared as:   * (end-of-line+ &optional n)  The first of the following snippets below, works ( _without an arg_ ). but the other attempts ( _with an arg_ ) fail... I haven't been able to find an example of a keybinding with args. What's the right way to do this?               (global-set-key (kbd  "C-s-E") 'end-of-line+)     ;; Okay!          (global-set-key (kbd  "C-s-E") 'end-of-line+ -1)   ;; Fails      (global-set-key (kbd  "C-s-E") 'end-of-line+ '-1)  ;; Fails     (global-set-key (kbd  "C-s-E") '(end-of-line+ -1)) ;; Fails


title: ln gives different results when run multiple times

text: I have this simple script to use with seventh sense (it's a lone wolf gamebook reader/player):               #!/bin/bash     GAME_PATH=$(dirname "$(readlink -f "$0")")     SEVENTH_SENSE_PATH=$(echo ~)"/.wine/drive_c/users/"$(whoami)"/Documents"     mkdir -p $SEVENTH_SENSE_PATH     ln -s -f "$GAME_PATH/Lone Wolf/books" "$SEVENTH_SENSE_PATH/Seventh Sense"     cd "$GAME_PATH/Lone Wolf"     wine Lone\ Wolf.exe      It's very simple, only moving a directory inside the folder to the location that this windows program expects it on the wine dir - but that is not the problem. `ln` here works the first time (it creates a symlink to `books` named `Seventh Sense` inside the `Documents` folder of the wine user. The problem is, the second time it makes a `books` symlink inside the folder that the `Seventh Sense` symlink points to (ironically, exactly the original `books` folder), when run twice. It causes no harm, but it seems like an obvious bug that is escaping me. (`books` is a folder (inside the `Lone Wolf` folder that is at the same level as the script)).


title: Debian 2.6.32-5-amd64 I have all torrents client use only 100 MB speed but I have worked 1 GB

text: I have server in local network and i have problem with local speed. On this server I put deluged 1.2.3 opentracker. So when users download torrent for all peers availeble speed is 100 mb, but if in this time i opening ftp and start download I can use full 1 gb channel. Why torrent clients can use all channel?


title: Negate exit code without using shell features

text: Is there any standard command that will negate the the exit code of another command provided as an argument without using shell features, or starting a shell? I have a program that does something based on exit code of an `system()` call. I have another program that returns its status via the exit code. But the program I am calling returns the results opposite from what I want. I can simply specify something like `bash -c '....'`, but is there an easier way? P.S. Yes, I know I am probably trying to optimize something that probably doesn't really matter all that much. But mostly I am curious, since unix seems to have a command for almost everything, why I can't find a simple negate-the- exit-code command.


title: unable to install GRUB in /dev/sda, Linux Mint 14.1 Nadia

text: Executing 'grub-install /dev/sda' Failed.     This is a fatal error      Why I got this error message when installing Linux mint 14.1 Nadia 64 bit, even 32 bit, I got this message? I have 1 partition ext4 with 40 GB. Before I was trying to install it, I was having Window 7 and I formatted it.


title: squid access.log delete entries older than 6 months

text: Squid generates a log of the accessed sites by the users. I want to delete the entries in the `/var/squid/logs/access.log`, which are older than 6 months. I would execute the script each week. I have thought of a perl script or any like that. **Here is how the`access.log` looks like:** ![enter image description here](http://i.stack.imgur.com/2fsYi.png) **Entries are generated like this:**               IP - - [15/Oct/2011:02:04:32 -400]


title: Why doesn't my client IP address appear in the netstat output?

text: My client is a MS Excel plug-in running on my laptop (client_machine1) that connects to a Solaris server (server1) to request some WebLogic Application running on port `28080`.               bash-3.2$ set | grep SSH_CONNECTION     SSH_CONNECTION='<client_machine1 IP Address> 64134 <Server1 IP Address> 22'          bash-3.2$ netstat -a | grep <client_machine1 IP address>     <Server1 FQDN>.28080 <client_machine1 IP address>.49592  260836      0 49950      0 FIN_WAIT_2     <Server1 FQDN>.28080 <client_machine1 IP address>.49595  261216      0 49950      0 FIN_WAIT_2     <Server1 FQDN>.28080 <client_machine1 IP address>.49596  261216      0 49950      0 FIN_WAIT_2     <Server1 FQDN>.ssh <client_machine1 IP address>.64134  65024    135 49950      0 ESTABLISHED      During my client session, I kept checking the output of `netstat -a | grep <client_machine1 IP address>` to see if my client's IP address shows up. Only for a brief period of time I was able to see it and capture the above output. For the rest of the time I can only see the ssh connection entry. I find this confusing as the client session is active at that time and data exchange is in progress. Am I missing something here..? I also tried `lsof | grep <client_machine1 IP address>` but that doesn't return anything.


title: If file does not get closed, will OS close it?

text: If a file is being opened by a process and it is not being closed by any of the processes, will the OS automatically close that open file?


title: VPN Setup Errors

text: I'm trying to install a VPN on one of our servers for use within my campus so that we can play some games, but I appear to be getting errors when I try to connect, as shown below. Not quite sure about all this and what's going wrong, I followed this guide: http://www.photonvps.com/billing/knowledgebase.php?action=displayarticle&id=58 We are trying to use the VPN with our macs, but they seem to be encountering some authentication errors from what I have gathered. The errors below were filtered from the messages logs.               Sep 16 06:38:07 localhost pptpd[1550]: GRE: read(fd=6,buffer=611860,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs     Sep 16 06:38:07 localhost pptpd[1550]: CTRL: PTY read or GRE write failed (pty,gre)=(6,7)     Sep 16 06:38:07 localhost pptpd[1550]: CTRL: Client 137.195.117.105 control connection finished     Sep 16 06:38:55 localhost pptpd[1559]: CTRL: Client 137.195.117.105 control connection started     Sep 16 06:38:55 localhost pptpd[1559]: CTRL: Starting call (launching pppd, opening GRE)     Sep 16 06:38:55 localhost pppd[1560]: Warning: can't open options file /root/.ppprc: Permission denied     Sep 16 06:38:55 localhost pppd[1560]: Plugin /usr/lib64/pptpd/pptpd-logwtmp.so loaded.     Sep 16 06:38:55 localhost pppd[1560]: pppd 2.4.5 started by root, uid 0     Sep 16 06:38:55 localhost pppd[1560]: Using interface ppp0     Sep 16 06:38:55 localhost pppd[1560]: Connect: ppp0 <--> /dev/pts/1     Sep 16 06:38:55 localhost pptpd[1559]: GRE: Bad checksum from pppd.     Sep 16 06:38:58 localhost pppd[1560]: Peer conner failed CHAP authentication     Sep 16 06:38:59 localhost pppd[1560]: Connection terminated.     Sep 16 06:38:59 localhost pppd[1560]: Exit.


title: Prevent scp from asking passphrase

text: I have enabled private key based access to my server. I have generated the certificates with a passphrase. So to ssh to that machine I have to do -               $ ssh -i .ssh/id_rsa_server foo@example.com      and It asks me for my passphrase before allowing access to the server -               Enter passphrase for key '/home/magic/.ssh/id_server':      When I want to copy a file from server, I do -               $ scp -i id_rsa_server foo@example.com:~/backups/dailyHeavyBkp_21112013.sql.lzma ~/backup      It again asks me for the passphrase. I want to avoid this. I know I can avoid this with an empty passphrase but I don't want that. Because I am going to put `scp ...` as a `cronjob` I don't want it to ask for passphrase. How do I do that?


title: Disable authentification for ssh

text: Is there a way to store my password when ssh'ing on a server? I tried to change the variables `BatchMode` and `PasswordAuthentication` in my file `/etc/ssh/ssh_config`, but to no avail. Could someone indicate me how to proceed?


title: Possible to upgrade to latest Bluez using Mint 15 Olivia (Cinnamon)?

text: I'm using the latest version of Mint 15. I noticed that the Bluez version that is shipped with Mint 15 is 4.101 (http://www.bluez.org/bluez-4101/). As you can see the release date is : 22nd June 2012. I want the best possible bluetooth support and am currently experiencing numerous minor bugs during connection process / pairing / profile selection on my a2dp headphones. I would like to upgrade to the latest version of Bluez (http://www.bluez.org/release-of-bluez-5-8/) version 5.8. Is this possible , and if yes, how can this be done?


title: Postfix: restrict all external access but allow for only mynetworks

text: How can I restrict access for an internal domain but allow all access for me the administrator? All users should be blocked from communicating outbound and no external domain may contact them, but I should be able to receive emails from any domain and send to any domain.


title: supress error messages sent to console?

text: How can I suppress error messages sent to a console? On: Ubuntu? Fedora? Debian? CentOS? RedHat?


title: Convert newlines to null-delimited when using tail

text: How can I change the output from `tail` to use null-terminated lines instead of newlines? My question is similar to this one: How to do `head` and `tail` on null- delimited input in bash?, but differs in that I want to do something like:               tail -f myFile.txt | xargs -i0 myCmd {} "arg1" "arg2"      I am not using `find`, and so cannot use `-print0` All this is to avoid the error that occurs in xargs:               xargs: unmatched double quote;         by default quotes are special to xargs unless you use the -0 option


title: USB 3.0 ports not working

text: I have a Sager NP8130 notebook with two USB 3.0 ports which I cannot get to work in any linux distros I've tried. The distros I've tried so far are the latest 64-bit (where available) versions of the following:   * Ubuntu   * Mint   * OpenSUSE   * Crunchbang   * Arch In each distro I tested the port with two devices, a USB 3.0 Super Talent 8GB Express DUO flash drive and a USB 2.0 Logitech optical mouse. When I plug the flash drive in it will light up, signaling it is receiving power from the port but the drive does not attempt to mount. When I plug the mouse in the optical laser does not light up and it appears to be completely nonfunctional. In each case I also plugged both devices into a USB 2.0 port which worked as expected. It should be noted that both USB 3.0 ports work fine in the Windows 7 OS that came with the laptop, with Windows even telling me my device could perform faster when I plug the flash drive into a USB 2.0 port but not giving me such a message when I use the 3.0 ports. Research on Google says that USB 3.0 support should have been in the Linux kernel since about 2009, so I'm thinking this isn't an issue with any particular distribution. I've heard other reports of USB 3.0 working fine, so my amateur suspicion is that it's not a protocol support issue as much as it's likely a driver issue. I'm not sure what commands will produce any relevant diagnosis information, but if anyone would like me to copy/paste the results of any commands just let me know in a comment and I'll update the question. Thanks


title: How to write script for automatic joomla installation in webhost

text: I want to create a script in Linux that automatically downloads the latest Joomla from their website and then installs it to the specified user. Is it possible in a shell script? I don't know how it will find the latest Joomla and how it will work, but I want to know if it's possible


title: How to map one vim command to execute bash commands based on OS?

text: In short, can single bash commands in the terminal contain conditionals? If so, how? I have in my vimrc (shared across systems) the following command to open my current LaTeX document in .pdf form: `map ,v :!gnome-open %<.pdf <CR> <CR>` My question is, what is the best way to have ,v execute simply "open %<.pdf" when I'm at home on my OS X machine? Here is my pseudo-code guess: `... if [$OSTYPE == "darwin*"] then open %<.pdf else gnome-open %<.pdf ...` This is executed as a single BASH command. Are such conditionals possible? If so, could someone help me with the syntax? If not, can this be done via conditionals in the vimrc file?


title: How to block the execution of files owned by root through lighttpd?

text: I've created a group and a user to run lighttpd. I would like to run from the web server only files that have these permissions (myuser:mygroup). I don't want to run files with root permissions. Is this possible?


title: Why does the location of Enviroment Variables vary that much?

text: Reading the book Hacking: The Art of Exploitation by Jon Erickson, I am trying to approximate the address of an environment variable `SHELLCODE` to exploit a program. Every time I run `getenv("SHELLCODE");` to get the location, the result is completely different. Extract from my shell:               > for i in $(seq 10); do ./a.out SHELLCODE; done     SHELLCODE is at 0xff9ab3a3     SHELLCODE is at 0xffcdb3a3     SHELLCODE is at 0xffb9a3a3     SHELLCODE is at 0xffa743a3     SHELLCODE is at 0xffdb43a3     SHELLCODE is at 0xfff683a3     SHELLCODE is at 0xffef03a3     SHELLCODE is at 0xffc1c3a3     SHELLCODE is at 0xff85a3a3     SHELLCODE is at 0xff8e03a3      I understand that if the program name is modified or new environment variables are added, the position would be slightly different, but why does the location vary that much?


title: How to restore accidentally deleted kdesu

text: Trying to create a link to kdesu with:               ln -s /usr/bin/kdesu /usr/lib64/kde4/libexec/kdesu      I ended up without kdesu (I might have interchanged source and destination, not sure). Which is the package to reinstall kdesu? I can't find it. I'm using Mageia, but it should be similar in different distros.


title: Is there handy way to exec a program binding it to IP-address of choice?

text: In FreeBSD 4.9 it was very easy to accomplish with just a single command like               jail [-u username]  path hostname ip-number command      if path was `/` you had running just the same program as usual but all its network communication was restricted to use only given IP-address as the source. Sometimes it's very handy. Now in Linux there's LXC, which does look very similar to FreeBSD's `jail` (or Solaris' zones) — can you think of similar way to execute a program?


title: I need find 1 simple rootkit to test chkrootkit in centos?

text: I want to find 1 simple rootkit to test `chkrootkit` (a tool used to detect rootkit). Please recommend to me 1 rootkit and show me how to set it up or install it.


title: How to use stty to bind alt/option j to stop current process

text: I know `stty intr ^j` will bind `Ctrl`+`j` to do `intr`, but I want to bind this to `Alt`+`j` or `Option`+`j`. Any one know how to do this?


title: Slick one-liner to convert a list like "1: 2, 3, 4, 5" to "1.2, 1.3, 1.4, 1.5"

text: Let's say I have a file that looks something like this:               23: a, b, c, d     24: b, d, f     25: c, g      and I want to get output like this:               23.a     23.b     23.c     23.d     24.b     24.d     24.f     25.c     25.g      Of course it's not too hard to just bang something out, but I was wondering if there was a slick one-liner using something like awk.


title: emacs, How to copy region, and leave it highlighted?

text: I'm happy enough with the default M-w as `(kill-ring-save)` which loses the region's highlighting upon running the command. I don't want to alter its behaviour, but I do want to re-bind `<C-insert>` to perform a similar action and maintain the region's highlighting. I've tried (un)setting `transient-mark-mode` directly and via a function, but the region still loses its highlighting. Running only `(kill-ring-save (region-beginning) (region-end))` in an interactive function works as expected, ie. it loses highlighting. Running only `(exchange-point-and-mark) (exchange-point-and-mark)` in an interactive function works as expected, ie. it re-highlights the region and puts/leaves point in its original/correct place. However when I put them all together in a function, it does _not_ re-highlight the region. Here is non-functioning function and binding:               (defun kill-ring-save-keep-highlight ()       (interactive)       (kill-ring-save (region-beginning) (region-end))       (exchange-point-and-mark) (exchange-point-and-mark)     )     (global-unset-key (kbd "<C-insert>"))     (global-set-key   (kbd "<C-insert>") 'kill-ring-save-keep-highlight)      * * * Using: GNU Emacs 23.1.1 in Ubuntu 10.04.3


title: Grant account permission to check service status

text: I've created a new account svchk and via visudo granted it permission to run the following command /sbin/service postfix status:               Cmnd_Alias POSTFIXCMDS = /sbin/service postfix status     svchk ALL = NOPASSWD: POSTFIXCMDS      But when I su svchk and run /bin/service postfix status I get the following error:               su svchk     /sbin/service postfix status     master status unknown due to insufficient privileges.      Why am I getting this and how can I properly grant svchk permission to check the status of the postfix service?


title: Simple iptables filter rule for 101/8 block not working

text: I run a webserver that caters to an entirely local crowd, so to keep hacking attempts to a minimum, I have inserted a bunch of international IP-blocking rules into my iptables, but my filters don't seem to be working. For instance, in the *filter section I have the following rule:               -A INPUT -s 101/8 -p tcp -m tcp -j DROP      as part of the set of rules to filter out international traffic. But I find repeated login attempts from this address: 101.227.170.42 in my lastb output. Shouldn't the iptables rule filter out these attempts?


title: Converting a line from a firewall on OpenBSD 4.9 to OpenBSD 4.7

text: What is the OpenBSD 4.7 equivalent of this line from OpenBSD 4.9 for use with pf?               no nat on egress proto udp from 192.168.1.10 port 4672 to any


title: USB 3G dongle internet keeps failing on Fedora 20 laptop

text: I use a 3G dongle for internet in my summerhouse, it has worked fine all summer, but since yesterday it has been losing connection, or something and I have to unplug it and insert it again for the internet to come back on. This is very frustrating. The device is a USB Huawei 3G dongle with SIM-card.   1. How would I troubleshoot such a device? Malfunction?   2. What are the steps to find the cause?


title: Can't connect remotely to server running redhat (ec2)

text: I created a RedHat 6.1 VM with EC2. Logged in as root, I installed (unzipped) JDK1.7 in `/root/bin/jdk1.7.0` and installed (unzipped) GlassFish 3.1.1 in `/root/bin/glassfish3`. I set `JAVA_HOME` and `GLASSFISH_HOME` in root's `.bash_profile` and I started GlassFish. It's definitely running, because if I do a `wget localhost:8080` from the command line, `wget` downloads the `index.html` file. The problem is, when I browse to the machine at `http://ec2-107-20-96-43.compute-1.amazonaws.com:8080`, I get nothing. I added port 8080 to the VM's security group; is there something else I have to do there? Is there something else I have to do on the linux machine to make 8080 visible?


title: Can libvirt check if virtual machine is fully booted? Can another tool?

text: I currently have small VM to do certain tests (it has multiple benefits - like testing on another distribution, Fedora 15, as well as running `make distcheck` without the problem of polluting `/`). However I'd like to automate tests and I'd like to be able to programatically (eg., using sh, python, c, ...) do the following:   * Boot headlessly a VM (`qemu`) from local image   * Wait till VM is fully booted (that's hardest part - initially I thought about magic sleep)   * Sync the repository between host and guest (not necessary at this point)   * Execute `./autogen && make && sudo make install && sudo make distcheck` on machine   * Download the generated tarballs from machine I started to read about `libvirt` and it might allow me to use an API for that. While this would require guest support and I cannot find documentation regarding it, such ability would seem to be a logical element of `libvirt`. Is it possible to check if machine is fully booted? Is there a ready tool to do this? **EDIT:** By fully booted I mean that the system rc scripts have finished execution/all systemd services which were suppose to start have started. I know that qemu cannot know when it happens but I assume the support on guest side.


title: Is there a way to make GNOME Panel backgrounds stretch vertically, rather than repeat?

text: I have another strange issue with the GNOME Panel. Images I'm using as backgrounds, instead of scaling vertically, are actually repeating vertically, leaving me with a really weird effect: ![enter image description here](http://i.stack.imgur.com/URuXu.png) ![enter image description here](http://i.stack.imgur.com/XSBlq.png) Notice the line straight through the middle of the panel, this is the edge at which the pattern repeats. I'm using SVG images for the background, so scaling shouldn't be an issue. Is there a way to specify "scale" and not "repeat" for vertical layout? This whole thing is brought on by having a panel size not in keeping with the defaults, and I need the extra panel size because of the icon set I'm using.


title: What is the best CentOS 6 repo list for LAMP stacks?

text: I'm just getting into server administration and now everybody needs something. Lately I'm getting stuck on package hunting, so I'm on the search to find the most comprehensive repo list of LAMP packages. What repositories do you use in your list for LAMP resources and why do you use them?


title: What font is this?

text: I'm on Linux Mint 16. Recently I saw a font I liked. I guess this was on Mac OS. What's it called? How do I install it on Mint? ![enter image description here](http://i.stack.imgur.com/JQYQI.png)


title: Unable to start Virtual Box in Cent OS

text: [root@localhost sysadmin]# /etc/init.d/vboxdrv setup     Stopping VirtualBox kernel modules                         [  OK  ]     Uninstalling old VirtualBox DKMS kernel modules            [  OK  ]     Trying to register the VirtualBox kernel modules using DKMSError! echo     Your kernel headers for kernel 2.6.32-431.20.3.el6.i686 cannot be found at     /lib/modules/2.6.32-431.20.3.el6.i686/build or /lib/modules/2.6.32-431.20.3.el6.i686/source.                                                                [FAILED]       (Failed, trying without DKMS)     Recompiling VirtualBox kernel modules                      [FAILED]       (Look at /var/log/vbox-install.log to find out what went wrong)     [root@localhost sysadmin]#       Please help me. I am using CentOS 32-Bit version.


title: How to loop a read function in Bash Script?

text: I needed to remove spaces and capital letters to various strings of text like:               "My Name is Mauro" -> "my_name_is_mauro"      So I have created this bash script:`lowercase_underscore.sh` (call it the same for testing). Is there another way to accomplish this with a loop?               #!/bin/bash     echo "Please enter a word:     (leave blank and press Enter to exit)"          # read user input     read foobar          # exit     if [[ $foobar == '' ]]; then         exit     fi          # convert upper case to lower     foobar=$(echo "$foobar" | tr '[:upper:]' '[:lower:]')          # strip underscore and apostrophe     foobar=${foobar// /_}     foobar=${foobar//\'/}          # output     echo "########     "          echo "machine_name_"${foobar}          echo "     ########"          # loop - execute itself (this could go against the Three Laws of Robotics)     bash lowercase_underscore.sh


title: Running uuidd automatically on startup on Ubuntu 13.10 server?

text: I am running the 13.10 Ubuntu server edition on which I have installed SAP's Netweaver Gateway 2.0 trial. This requires the UUID daemon to be running. Whenever I start up the system and run `uuidd` as root (because it is not running), it gives the following error:               Failed to open/create /var/run/uuidd/uuidd.pid: No such file or directory      I then have to create `/var/run/uuidd` and give write permission to all, after which I can start uuidd. I previously ran 11.04, and did not have this problem, so I assume `uuidd` was running by default (the SAP system never complained, but it does complain if it's not running). Is there a way to get uuidd to start on boot, maybe an init script I can copy from somewhere? Part of the problem also is that /var/run/uuidd needs to be created each time.


title: How to detect TMux level

text: Is there any way to detect how many levels of tmux I'm currently in? I've been able to hack it with 2 levels by simply checking `[[ -n "$SSH_CLIENT" && -n "$TMUX" ]]`, so I can have one level on the client and one on the server. I use that check to setup a different prefix (ctrl-a, ctrl-b). But now I'm finding I want to ssh from inside the server shell, so would like even a third level, thus requiring a third prefix combination to be setup. ![Obligatory Inception meme](http://i.stack.imgur.com/tIGSX.jpg)


title: Is there a reason Apache would ignore DocumentRoot/Directory in httpd.conf?

text: I am wondering this, because I am getting a 403 error, and in my error log it says:               Mon Aug 04 23:54:12.270990 2014] [autoindex:error] [pid 299] [client      192.168.1.22:54175] AH01276: Cannot serve directory /srv/http/: No matching      DirectoryIndex (index.html) found, and server-generated directory index forbidden by      Options directive      However, in my httpd.conf I have my DocumentRoot set as: `DocumentRoot "/opt/minepeon/http/"` I also have my Directory directive set as:               <Directory "/opt/minepeon/http/">         Options Indexes FollowSymLinks ExecCGI         AllowOverride AuthConfig FileInfo         Order allow,deny         Allow from all     </Directory>


title: Why iperf still reports 1Gbps performance when using bonding over two 1Gbps adapters?

text: As I understand it, bonding brings among other benefits the ability to increase the network speed between two machines in a LAN. > Bonding [...] means combining several network interfaces (NICs) to a single > link, providing either high-availability, load-balancing, **maximum > throughput** , or a combination of these. _Source:Ubuntu documentation, emphasis mine._ I have bonding configured on two servers; both have two 1Gbps NIC adapters. When testing speed between those servers using `iperf`, the report indicates:   * 930 to 945 Mbits/sec when using `balance-rr` bonding mode.   * 520 to 530 Mbits/sec from machine A to B when using `802.3ad`,   * 930 to 945 Mbits/sec from machine B to A when using `802.3ad`. An interesting thing is that when using `802.3ad`, `ifconfig` indicates that practically all `RX` is on `eth0` (2.5 GB vs. a few KB/MB) and all `TX` on `eth1` on machine A, and the inverse on machine B. When asking `iperf` to use multiple connections (`iperf -c 192.168.1.2 -P 10`), the obtained sum is very close to the results displayed when using a single connection. Two machines are connected to a Netgear GS728TS which has LACP configured properly (I hope), with two LAGs covering two ports each. IEEE 802.3x mode is enabled. Is `iperf` suited well for this sort of tests? If yes, is there something I'm missing?


title: GeForce GTX 660 as passthough device with KVM : error no iommu_group for device qemu-system-x86_64

text: I'm tryng to use my GeForce GTX 660 as passthough device with KVM. I'm reading this guide : http://www.pugetsystems.com/labs/articles/Multiheaded-NVIDIA-Gaming-using- Ubuntu-14-04-KVM-585/ I'm running debian sid with the kernel version 3.14.15 I think that I have followed carefully the guide,but it does not work as expected,infact when I launch qemu with these commands : root@ziomario-Z87-HD3:/home/ziomario# lspci -nn | grep NVIDIA 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1) 01:00.1 Audio device [0403]: NVIDIA Corporation GK106 HDMI Audio Controller [10de:0e0b] (rev a1) root@ziomario-Z87-HD3: nano /etc/initramfs-tools/modules pci_stub ids=10de:11c0,10de:0e0b root@ziomario-Z87-HD3:/home/ziomario# dmesg | grep pci-stub [ 3.313699] pci-stub: add 10DE:11C0 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000 [ 3.313705] pci-stub 0000:01:00.0: claimed by stub [ 3.313708] pci-stub: add 10DE:0E0B sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000 [ 3.313711] pci-stub 0000:01:00.1: claimed by stub root@ziomario-Z87-HD3:/home/ziomario# ls /sys/bus/pci/devices 0000:00:00.0 0000:00:14.0 0000:00:1c.0 0000:00:1f.0 0000:01:00.1 0000:00:01.0 0000:00:16.0 0000:00:1c.2 0000:00:1f.2 0000:03:00.0 0000:00:02.0 0000:00:1a.0 0000:00:1c.3 0000:00:1f.3 0000:04:00.0 0000:00:03.0 0000:00:1b.0 0000:00:1d.0 0000:01:00.0 root@ziomario-Z87-HD3: nano /etc/vfio-pci1.cfg 0000:01:00.0 0000:01:00.1 root@ziomario-Z87-HD3:/home/ziomario# nano /usr/vm1 # !/bin/bash configfile=/etc/vfio-pci1.cfg vfiobind() { dev="$1" vendor=$(cat /sys/bus/pci/devices/$dev/vendor) device=$(cat /sys/bus/pci/devices/$dev/device) if [ -e /sys/bus/pci/devices/$dev/driver ]; then echo $dev > /sys/bus/pci/devices/$dev/driver/unbind fi echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id } modprobe vfio-pci cat $configfile | while read line;do echo $line | grep ^# >/dev/null 2>&1 && continue vfiobind $line done sudo qemu-system-x86_64 -enable-kvm -M q35 -m 4096 -cpu host \ -smp 4,sockets=1,cores=4,threads=1 \ -vga none \ -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \ -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \ -device vfio-pci,host=01:00.1,bus=root.1,addr=00.1 \ -drive file=/home/ziomario/Scrivania/windows1.img,id=disk,format=raw -device ide- hd,bus=ide.0,drive=disk \ -drive file=/home/ziomario/Scrivania/windows_8_x86.iso,id=isocd -device ide- cd,bus=ide.1,drive=isocd \ -boot menu=on exit 0 it comes out with these errors : vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: error no iommu_group for device qemu-system-x86_64: -device vfio- pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device initialization failed. qemu-system-x86_64: -device vfio- pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device 'vfio- pci' could not be initialized root@ziomario-Z87-HD3:/home/ziomario# dmesg | grep -e DMAR -e IOMMU [ 0.000000] ACPI: DMAR 00000000ba1e7d40 000090 (v01 INTEL HSW 00000001 INTL 00000001) [ 0.000000] Intel-IOMMU: enabled [ 0.000000] Your BIOS is broken; DMAR reported at address 0! [ 0.018531] dmar: parse DMAR table failure. what can I do to fix it ?


title: Which Linux distro resembles HP-UX?

text: I'm looking for a Linux distro (or some Unix flavor...) that is similar to HP- UX so that I practice the command line as well as other things. This is in order to get CSA Certification. Which distro should I use? I already know Linux basics.


title: How can I control bash's brace expansion to do the right thing (which zsh does automatically)?

text: In zsh, I get the expected result from both of these brace expansions:               $ touch file-{001..100}     $ touch file-{1..100}      The first one gives me files named file-001, file-002, etc., all the way to file-100. The second one gives me files named file-1, file-2, etc., all the way to file-100. In bash, however, both give me files named file-1, file-2, etc. This strikes me as a pretty major bug (or design flaw) in bash's brace expansion. Is there any way to configure bash to do the right thing in this case?


title: White listing directories for GTK

text: Back in 2007 there was some work done to allow system admins to lock down GTK+ and Nautilus. File dialogs can only view white-listed directories. This won't create permission problems for programs, but will simplify things for new users. http://live.gnome.org/SummerOfCode2007/Reports/Sayamindu However the code seems to be abandoned. Is there any other way to do this? Is there a similar project that still works?


title: Redhat Network Service Restart

text: I modified the /etc/sysconfig/network-scripts/ifcfg-eth0 file to set a static ip for my redhat. Then I tried to use command "service network restart" to make the change stick, however, it became stuck with the last message "Shutting down interface eth0". The network service has really been shut down since I can't connect via the old ip any more(nor the new one). Why did it fail to restart the network with the new settings? Also, since the network service on my redhat(remotely) is down, how can I restart it? I need to be able to reconnect to it.


title: How can I make PuTTY compatible with Solaris?

text: I'm connecting to a Solaris machine from WinXP using PuTTY. When I try to use the NumPad keys for editing a command in Bash (Home, End, Delete) a ~ character is instead printed to the console. Relevant envirnoment parameters as follows:               MACHTYPE=sparc-sun-solaris     SHELL=/bin/bash     HOSTTYPE=sparc     OSTYPE=solaris     TERM=xterm      **Can I configure PuTTY to get the NumPad keys working?**


title: Is the Unix Power Tools book still relevant today?

text: I was wondering if the _Unix Power Tools_ book, Third edition, is still relevant today? I want to order it but I am afraid it contains only outdated material. If so, is there a recent similar book?


title: ls should display contents of flat directory structure in columns

text: I've got the a flat directory structure like this.               ├── kanban     │   ├── 1_backlog     │   ├── 2_analyze     │   ├── 3_doing     │   ├── 4_test     │   ├── 5_approval     │   └── 6_done      Each directory contains text files while each represents a task. A typical kanban board displays columns. I want to show the content of each directory column-wise like this.               1_backlog       2_analyze      ...     ├── 1234_task   ├── 34235_task     ├── 4567_task   ├── 32322_task      How is that possible? Cheers.


title: GNOME 3 fails to load (old ATI graphic card driver problem)

text: I'm delighted to find this version of StackExchange as I normally lurk in the GIS board. I would greatly appreciate help with the following problem (which seems to be quite common - but I am just starting to wean myself off Windows so I don't fully understand how to achieve what should be a simple task as every solution I find seems to raise another problem): I have an old PC which I want to set up as a 'lab-rat' to learn Linux. I have Debian Wheezy installed (as the only operating system) but GNOME 3 fails to load and I get the fall-back GUI. I have an old ATI Radeon 9250 graphics card and believe I need to install drivers for this. I have read and attempted to follow the Debian AtiHowTo but when I get to the bit about editing the `/etc/X11/xorg.conf` file, things fall apart because I don't have this file. I read here that this file no longer exists by default and must be created although that advice is on a Ubuntu forum, though I believe Ubuntu is based on Debian so could that be my issue here? The 'offical' Debian site mentioned previously makes no reference of needing to create the `/etc/X11/xorg.conf` file, however, I attempted to create the file as directed on the Ubuntu site anyway but that also fails. I'm sure this is a simple problem for seasoned Linux users and I would appreciate supplementary directions of how to install the ATI Radeon driver mentioned in the AtiHowTo as I have no idea how to proceed. **EDIT:   ** I followed the instructions in the accepted answer on Ubuntu site mentioned above (I didn't understand this initially but now do). I now have an xorg.conf file and it includes a section for DEVICE radeon, which pretty much matches the simple definition in the AtiHowTo page. I suspect I now need to restart GNOME. I found this advice on this board, but when I follow this advice I got a message "Stopping GNOME" and then the log-in screen again but I still have no GNOME and don't know whether the driver is installed. What do I do now? **EDIT 2**   Result of $glxinfo | grep render:               direct rendering: Yes     OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 0x209)         GL_NV_conditional_render, GL_AMD_draw_buffers_blend,


title: Origin of 'root' account

text: What's the origin of root account? Where did it come from and why is it called root anyway? (Originally asked by @lizztheblizz on Twitter.)


title: How can I tell if I'm in a tmux session from a bash script?

text: I like to keep my `bash_profile` in a git repository and clone it to whatever machines I have shell access to. Since I'm in `tmux` most of the time I have a `user@host` string in the status line, rather than its traditional spot in the shell prompt. Not all sites I use have `tmux` installed, though, or I may not always be using it. I'd like to detect when I'm not in a `tmux` session and adjust my prompt accordingly. So far my half-baked solution in `.bash_profile` looks something like this:               _display_host_unless_in_tmux_session() {         # ???     }     export PROMPT_COMMAND='PS1=$(_display_host_unless_in_tmux_session)${REST_OF_PROMPT}'      (Checking every time probably isn't the best approach, so I'm open to suggestions for a better way of doing this. Bash scripting is not my forte.)


title: How to connect a KVM guest to the internet with wireless

text: Because my wireless network adapter does not support bridging, it is really difficult to get the guest VM to connect to the open internet and have an IP address in the same network as the host. I am using Ubuntu 10.10, and the KVM version does not support vde, so it becomes even more difficult. How can I fix that? @stribika's idea is great, but I would prefer to let my VMs connect to the same network as my host. e.g. my host network is 192.168.1.0, and I want my VM's network to be the same.


title: Google Chrome Monospace Fonts Hard to Read

text: In Google Chrome on Ubuntu, I find it hard to read code. How can I change the font settings to make it easier to read?


title: rsync-like tool that supports compression and maintains hardlinks?

text: I use an `rsync`-based backup scheme to maintain daily (and soon weekly and monthly as well) "snapshots" of my file server, using `rsync`'s link-dest feature to store hardlinks between the snapshots for files that haven't changed. This works very well: Backing up more than 330 GB of data, an entire snapshot takes up only 1.5 MB on disk if no files changed. Recently a hard drive failure in this server shocked me into the realization of how fragile I am right now -- while I lost no data thanks to these backup snapshots, the backups and the data they back up both live in the same physical box in the office in my apartment; something as simple as a small fire in my apartment building could completely obliterate every last bit (pun intended) of my data! I have an off-site location that I could be taking external hard drives to, so I intend to implement a rotating off-site backup wherein I would have one hard drive offline and off-site while a second is plugged in and backing up my snapshots, and I would periodically (e.g. once a week) swap them, so that if the worst does happen I lose at most the last weeks' worth of data. Now here's the rub: I want to backup my snapshots, not the data itself, on the external hard drive. (I failed to notice the failed hard drive for a day, so that day's daily snapshot is all but worthless; having additional snapshots, however, is what saved my bacon, and I want that same level of assurance here as well. Note to self: Actually _monitor_ that handy SMART data...) Tried-and- true `cp` won't work because it will see individual files, not hard links, increasing storage needed by 7 fold! `rsync` would work, but I'd like the data on these external drives to be compressed so that I can get away with having smaller drives (I'm targeting 1TB, more than enough for the current 337 GB of data but markedly smaller than the nearly 3TB capacity of my file server; I don't expect to be able to back up all 3 TB to just a 1 TB drive, even with compression, I just want the 1 TB to have a maximum useful lifespan as my data grows). So, does anyone know of a method by which I could maintain hard-link associations between the snapshots while also compressing the files I'm backing up? The ideal solution would also support an exclusion list so I could simply skip compressing already-compressed files (.zip, .gz, .mp3, .jpg, etc.). Just for absolute clarity, I'm looking for a scheme where a hard-link in /backup/snapshots/daily.1/file1 that points to /backup/snapshots/daily.0/file1 would get copied over to /mnt/external_hdd/snapshots/daily.1/file1 as a hard- link that points to /mnt/external_hdd/snapshots/daily.0/file1, the latter of which (the actual file itself) is now compressed (e.g. gzip).


title: How to use the EXTRA_FIRMWARE_DIR kernel option?

text: I am using Gentoo, and I need to load an extra firmware to get my USB Wifi adapter work. I found an `EXTRA_FIRMWARE_DIR` kernel option, but I do not understand if it is used during compile time only or if it is effective after the new kernel is used. My WiFi adapter chip is Atheros, and according to this page, I have to put the firmware to the **right place**. On Ubuntu, I found the `/lib/firmware` directory as it is indicated in that page, but I cannot find that directory on Gentoo.


Which version of openSUSE is closest to SLES11SP1 in terms of package versions?


title: how to download linux kernel using rsync

text: I tried git clone, but it's too slow, how to do it with rsync? is it faster? If I do `rsync rsync://rsync.kernel.org/pub/` it just shows:               drwxr-sr-x        4096 2011/11/16 04:40:02 kernel


title: How do I install mono's System.Windows.Forms on Ubuntu?

text: I haven't found any concise explanation of this.


title: Why the non-root user can't login with a key in putty?

text: I read an article and found it very useful: http://www.howtoforge.com/ssh_key_based_logins_putty I made two key pairs for `root` and the other user. But it only works for root When it comes to the other one, the server shows:               Using username "theotheruser".     Server refused our key     theotheruser@mydomain.com's password: