title: DROP all for port 22 if not geoip set of US for iptables and xtables

text: I want to simply block all ssh access from anywhere but with in the US. This is my whole iptables, and I have followed http://www.howtoforge.com/xtables- addons-on-centos-6-and-iptables-geoip-filtering               # Generated by iptables-save v1.4.7 on Wed Jul  3 02:30:42 2013     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [1749:280570]     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j DROP     -A INPUT -m geoip --src-cc US --dport 22 -j ACCEPT     -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 3000:3050 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     COMMIT     # Completed on Wed Jul  3 02:30:42 2013      I have `-A INPUT -m geoip --src-cc US --dport 22 -j ACCEPT` and the goal is to only accept ssh from the us where admins work from. as of right now I get an error.               iptables: Applying firewall rules: iptables-restore v1.4.7: Couldn't load match `geoip':/lib64/xtables/libipt_geoip.so:     cannot open shared object file: No such file or directory Error occurred at line: 10      **_update_** I have searched for the file and can't find it any were. Ran through the how to and realized that the Xtables-addons was version 1.37, so I updated it 2.5 but there was no change. I look in `/lib64/xtables/` and there are tons of files but not the geoip one. So I think that is where I need to start on how to correct the Xtables-addon install I guess.


title: How to prevent a process from writing files

text: I want to run a command on Linux in a way that it cannot create or open any files to write. It should still be able to read files as normal (so an empty chroot is not an option), and still be able to write to files already open (especially stdout). Bonus points if writing files to certain directories (i.e. the current directory) is still possible. I’m looking for a solution that is process-local, i.e. does not involve configuring things like AppArmor or SELinux for the whole system, nor root privileges. It may involve installing their kernel modules, though. I was looking at capabilities and these would have been nice and easy, if there were a capability for creating files. ulimit is another approach that would be convenient, if it covered this use case.


title: How does "$" work in "apt-cache search something$"

text: I understand that               $ apt-cache search package_name      will search for matches in names and descriptions. But how does this work?               $ apt-cache search package_name$      For example,               $ apt-cache search desktop      will produce a list of names and short descriptions of packages that have "desktop" anywhere in the name or description. Then, if I understand correctly,               $ apt-cache search desktop$      should produce a subset in which "desktop" is the last word either in the name or in **any line** in the description. But I found one example, `xjig`, which shows up with `apt-cache search desktop` but doesn't show up with `apt-cache search desktop$` even though the description according to `apt-cache show xjig` has "desktop" in the second- last line of the description: > Description-en: An X11 jigsaw puzzle   >  xjig is a puzzle that tries to replicate a jigsaw puzzle on the screen   >  as closely as possible. Any GIF, JPEG or PPM image may be loaded and cut   >  into pieces. The goal (as with any jigsaw puzzle) is to reassemble the   >  original picture.   >  .   >  Tiles may be freely rotated by use of the mouse, flipped (for   >  double-sided puzzles) and even shown as shaped windows on the **desktop**   >  (fast machine/video card recommended for the latter!). An example image   >  is provided in /usr/share/games/xjig . So why is `xjig` not included in the output of `apt-cache search desktop$`?


title: Redhat “httpd” can not start anymore. Showing “suEXEC” and “SELinux” notices

text: I'm on RHEL `6.5` and Apache `2.2.15`. When I `restart` the `httpd`, I can not start that `httpd` anymore. Showing following things in the `/var/log/httpd/error_log`:               [Fri Aug 01 18:31:48 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Fri Aug 01 18:32:35 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0     [Fri Aug 01 18:32:35 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Fri Aug 01 18:42:46 2014] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0     [Fri Aug 01 18:42:46 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Fri Aug 01 18:43:15 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0     [Fri Aug 01 18:43:15 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Fri Aug 01 18:43:59 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Fri Aug 01 18:44:12 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Fri Aug 01 18:45:03 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)      Actually I have already `disabled` the `SELinux` and rebooted.   What should I do please?


title: Firefox freezes with attachments or pdf

text: I am working on an old CentOs 5 machine. I am using Firefox as a browser. It worked fine until now, when every time I try to open a pdf or to attach something to the emails, it crashes. I tried to follow some guides online, and renaming the `mimeTypes.rdf` to `mimeTypes.rdf.old` in the `.mozilla` but no luck. Any suggestions please? It is frustrating to surf with such limitations. EDIT: I have updated to the latest Firefox version available for CentOs5, following this link (the link is for FF 24 but I have used it to update to _firefox-24.7.0-1.el7.centos.x86_64_ ), but the issues are still there.


title: How to know in which distribution is present one command

text: How can I know the Linux distribution of the command? For example, `lscpu` command Is there any place with a matrix (distribution, commands)?


title: What is /dev/xvde1?

text: I'm having to do with an _OpenShift RHEL Linux_ installation running on _Amazon EC2_. In the filesystem, there is a device file named `/dev/xvde1` mounted to `/` ... and a device file named `/dev/xvde2` mounted to `/var`. What is an **xvdeN** device file?


title: Which of VPN or IPSec or xxx can I use here?

text: I'm renting a dedicated server which has a fixed / static IP and I'm using this server / IP for my business. I'm hosting a webapp / webappserver on it (Apache + Tomcat) and I've also set it up as a HTTP Proxy (Squid). I do need to test both websites and softwares (because that is precisely my job) that are restricted geographically (based on the IP adress) to the region where I did rent my dedicated server (which is the very reason I did rent the server there in the first place). For websites it's already working fine seen that I managed to set up Squid the way I intended to (and I've configured it to be as transparent as it could). Now I'd like to configure either a VPN or IPSec or something else so that I can run the software I need to test on my home machines (both Macs and Windows) and the software would "think" they're being run with the IP of my dedicated server. I'd like to point out that I do not want to compile a new kernel on the dedicated server nor mess up the network configuration of the dedicated server: the dedicated server has a local IP and there are a lot of other dedicated servers (not mine) on the same subnet so I'm limited (I think) in what I can do here. Ideally I'd like some "userland" configuration / setup that does not require rebooting nor changing the network setup. In other words: I'd like something as "simple" to setup as Squid, but providing transparent "forwarding" for every single port, not just 80 / 443. What is the technology I should use here and how should it be configured? _(I've set up the dedicated server myself and configured Squid myself so I've got some admin skills but I'm not a professional sysadmin)_


title: pure ftpd : how to set owner on files uploaded

text: I have a debian with pure ftpd installed with virtual users. I'm not an expert at all of unix systems. I used the documentation for my setup so the local account of pure ftpd is ftpuser:ftpgroup When a user uploads a file, the file is owned by ftpuser:ftpgroup. I want the uploaded file to be owned by another system user (mylocaluser). I added my virtual user this way :               pure-pw useradd uploadimages -u mylocaluser -d /var/www/mysite/current/images


title: How to find the difference in tokens in two strings using Unix tools?

text: I have two strings as below-               token1, token2, token3, token4, token5, token6, token8, token9, token10          token2, token7, token4, token3, token5, token6, token8, token10, token9      Visually, I can see that "tokens" like `token1` and `token7` are not present in both strings. But is there an easy way to get the differing tokens using Unix tools? The long route would be to write a script and maintain a hashmap of {token => count} and in the end print only those keys that have count = 1. But I suppose there is a shorter way.


title: Alternative to diff with progress for massive directory compare?

text: I just rsync-ed 2,000,000 files (3TB) from one RAID to another. I want to make sure my data is intact. `rsync -c` takes a really long time. `diff` doesn't show me what it's doing. Is there an alternative that's (a) faster, and (b) will show me progress while it's comparing? (I'm on Mac, and `brew search diff` gives me `apgdiff colordiff diffstat diffutils fmdiff libxdiff open-vcdiff podiff rfcdiff vbindiff bsdiff diffpdf diffuse dwdiff kdiff3 ndiff perceptualdiff rdiff-backup tkdiff wdiff ` ... would one of these do the job?)


title: Allowing write access to an SMB mounted drive

text: Following this guide I was able to get my Samba share to mount on my Ubuntu 12.04 system. I can navigate the folders just fine. However I cannot create a directory nor create a file. I get the following error: > mkdir: cannot create directory `ServerBackups': Permission denied Looking at the directory permissions, I see               drwxr-xr-x  1 root root    0 Aug 14 22:34 stora      I have tried to change that to root:sambashare with no errors with `sudo chown :sambashare stora/`, however when I confirm it completed, it is back to root:root. This is what I added to my `/etc/fstab`:               \\10.0.1.20\mylibrary   /media/stora    cifs    credentials=/etc/samba/user,noexec  0       0      Mounting the drive works fine. I want a regular user (primarily me) to be able to write to this mount. What could I be missing?


title: git diff - listen for key press

text: I want to run the following commands:               git diff     git commit      `git commit` will open the default editor to edit the commit message. But if the difference if not too long it will close immediately. How can I prevent closing `git diff` before pressing `Enter` or other keys?


title: alias for 'emacs /usr/local/nagios/etc/objects'

text: I'm trying to get the following working:               alias banana='emacs /usr/local/nagios/etc/objects/'      So i want to just type "banana firewall.cfg" to edit this file(/usr/local/nagios/etc/objects/firewall.cfg). If i type that, emacs opens two buffers, one for "/usr/local/nagios/etc/objects" in directory edit mode, and the other just as a blank second file called firewall.cfg, which is expected, and obviously the command "bananafirewall.cfg" doesn't work. I've been scratching my head for a good 30 minutes. Is alias even the right command for this? I guess I could ln -s all these files to /root, but any other suggestions?


title: 'Binding' Bash Curly Braces

text: In Bash,               echo a{b,c}d{e,f}      prints               abde    abdf    acde    acdf      The output I'd like to see is               abde    acdf      In other words, given _N_ parameters, I'd like Bash to use the _i_ th parameter within each pair of braces to construct _N_ strings.


title: Are disks interchangeable in a mirrored RAID setup?

text: It is often written that disks in a mirrored RAID (like RAID 1) are an exact mirror copy one of another. So can I turn the machine off and simply swap the two harddisks cables? And if one of the two disks crashes and is dead forever, can I simply turn the machine off, put a third (new) harddisk instead of the dead one, boot from a live CD and "dd" the entire content of the disk which is still good to the new disk and then boot again with RAID 1 operational? If it's not that simple, why isn't it so?


title: How to download pdf files referenced by pages one or two levels inside of the seed

text: I have a list of URLs, and they are all like this: http://www.contratos.gov.co/consultas/detalleProceso.do?numConstancia=10-10-85225 ; inside those pages there are .pdf files being referenced. I need to download those files with wget or curl. I tried to do this:               wget -r http://www.contratos.gov.co/consultas/detalleProceso.do?numConstancia=10-10-85225 -l2 --accept .pdf      and               wget -r -l1 --no-parent -A ".pdf" http://www.contratos.gov.co/consultas/detalleProceso.do?numConstancia=10-10-85225        but I get a protocol error: > Resolving www.contratos.gov.co (www.contratos.gov.co)... 201.234.78.2 > Connecting to www.contratos.gov.co > (www.contratos.gov.co)|201.234.78.2|:80... connected. HTTP request sent, > awaiting response... 200 OK Length: unspecified [text/html] > www.contratos.gov.co/consultas/detalleProceso.do?numConstancia=10-10-85225: > Protocol error > > Cannot write to > `www.contratos.gov.co/consultas/detalleProceso.do?numConstancia=10-10-85225' > (Protocol error) What flags can I use to command wget to parse a URL and then download pdf files linked inside of the initial page?


title: Set up chroot for LDAP users in RHEL6

text: I have been working on this for 2 days now and am about to give up so someone please help. I have a Red Hat 6 server joined to my active directory domain. Logins work just fine under normal circumstances. I have SSH login restricted to specific active directory groups by using require_membership_of= in the file/etc/security/pam_winbind.conf. It works great. Now I need to lock those users to only have access to their home directory (chroot) and only allow sftp logins. I have tried about a billion combinations of editing the /etc/ssh/sshd_config file but either end up with the user not being restricted to their home folder or them not being able to log in. **The below configuration works just fine when I use local users/groups to restrict chroot and sftp login.** (obviously I change the `Match group` to the local user group) The problem I _think_ I have is the fact that LDAP users are not local users and they don't have local groups. Here is the relevant section of my sshd_config file                 Match group 'Domain Users'         ChrootDirectory %h         X11Forwarding no         AllowTcpForwarding no         ForceCommand internal-sftp      When I restart sshd this give an error `/etc/ssh/sshd_config line 135: Bad Match condition ` When I change `'Domain Users'` to `Domain\040Users` I don't get the error but LDAP users are not restricted to their home directories (chroot isn't working). I also tried changing the `ChrootDirectory %h` to a new /chroot folder as well as /home/%u but both did not work. The possible solutions I have thought of are   * Change the default group LDAP users are a part of (I haven't found this anywhere and the settings is /etc/default/useradd don't apply)   * Change the `Match group` in the sshd_config file to something that DOES apply to domain users. I tried `'Domain Users'`, `Domain\ Users`, `Domain\040Users`, and the SID from LDAP of the Domain users group. All of which did not work or gave errors when restarting sshd   * Upon first login have the system create a local user/group (but this may break password syncing to AD   * Something else I have missed completely. Does anyone have experience with setting up chroot restrictions with LDAP logins? I am at a loss and don't think I can open any more tabs in my browser.


title: chrome freezes Ubuntu 13.04

text: Since about 2 to 3 weeks ago, my Ubuntu 13.04 desktop frequently freezes after I am using Chrome for a while. The mouse is movable, but nothing respond to mouse or keyboard. I have to push the power button to shut down the machine and restart it. Sometimes, the symptoms are not complete freezing, but all files become read-only, which makes nothing works. All Chrome tabs shows error message. Every time I use the new version of google map in chrome, Ubuntu freezes very soon. Though I actually never expected a browser program could freezes the whole system, now I believe the culprit is Chrome. If I don't use Chrome, say using Firefox instead, then the system runs OK. I first thought my hard disk has some errors. I tried to fix it and use disk utility to do extended smart test, and found no errors. I also searched on Web and found people asking similar questions, without getting good solutions. Some suggest this is related to video card driver. But I've always been using Chrome on Ubuntu smoothly until 2 or 3 weeks ago. Some information about my system:               Ubuntu 13.04     kernel version: 3.8.0-30-generic     cpu: Intel core i7 2600K (use its integrated video card)      Update: Using `echo 0 | sudo dd of=/sys/module/i915/parameters/semaphores` as suggested by goldilocks seemed to solve the problem at first. The next day, problems come again: (1) The first problem is that I cannot boot into Ubuntu, because the root partition /dev/mapper/ubuntu (a LVM partition) cannot be found. I tried several times of restart, sometimes I can get into Ubuntu, but nothing is usable, even vi a text file shows input/output error in the command. Eventually, I use recovery mode to check disk and repair packages. Then I can boot into Ubuntu as usual. (2) However, Chrome freezes Ubuntu again. The initial symptoms described in the beginning of the post come back. The command `echo 0 | sudo dd of=/sys/module/i915/parameters/semaphores` seems only extend the time when Chrome works OK. However, eventually, after half or one hour, the system will freeze or everything become read-only again. If I use Google map, then several minutes later, the system will freeze. Then I have to shut down the machine by brute force. After I reboot into Ubuntu, the content of the file /sys/module/i915/parameters/semaphores is changed back to "-1", instead of "0" I've written before. Using `grep i915_hangcheck_hung /var/log/*` didn't find relevant errors for the crashing time. I also suspect the problem is related to the flash plugin in Chrome, so I switched the flash plugin from adobe's to the Chrome built-in one. But the problem remains. So I am not certain this is 100% due to Chrome now. For now, I'll use Firefox, and see if the system is stable.


title: Wifi broadcom 4313 with proprietary driver (Ubuntu) randomly stops connecting to wireless networks

text: I have a laptop with `Broadcom 4313` wireless module, using Ubuntu 13.10 and Windows 7 as OS When reconnecting to network or when waking laptop from suspend/rebooting it sometimes cannot connect to any wireless network. Disable/re-enable network doesn't help. I have to reboot laptop few times in a row to make it work again. It throws these errors to `syslog`:               wpa_supplicant[1091]: wlan0: Authentication with xx:xx:xx:xx:b4:80 timed out.     NetworkManager[814]: <info> (wlan0): supplicant interface state: associating -> disconnected     NetworkManager[814]: <info> (wlan0): supplicant interface state: disconnected -> scanning     wpa_supplicant[1091]: wlan0: Trying to associate with xx:xx:xx:xx:b4:80 (SSID='xxxxxxxxx' freq=2457 MHz)     NetworkManager[814]: <info> (wlan0): supplicant interface state: scanning -> associating     wpa_supplicant[1091]: wlan0: CTRL-EVENT-ASSOC-REJECT status_code=16     wpa_supplicant[1091]: wlan0: Authentication with xx:xx:xx:xx:b4:80 timed out.      The only solution to have any wireless connection is to switch from proprietary driver `wl` to opensource `brcmsmac` (or reboot few times), the the second one has so poor connection even if sitting next to wireless router that it becomes unusable in most situations. Btw, sometimes it even happens on Windows, but it has some 'troubleshooting' routine which somehow makes it work then. Does anyone know why this is happening? Is there any way to properly flush networking so it will think that system has just rebooted? `service networking restart` doesn't fit because it breaks X server somehow. Google doesn't give me any clue how to fix it.


title: Why is my ssh connection unauthorized although I have updated my key on the remote machine?

text: On my local machine I have a public key stored in               .ssh/id_rsa.pub      To be able to log in to a remote machine I copy this key using `ssh-copy-id`:               ssh-copy-id user@remote-host      On the remote host, I see two lines added to the file `.ssh/authorized_keys` starting with `ssh-dss` and `ssh-rsa`, and ending with the local machine information. However, when I now log in to the remote machine with               ssh user@remote-host      I am still asked for a password. Why is that and how can this be fixed?   * The file permissions of `authorized_keys` are correct.   * The following is the result of `ssh -v`: OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to xxx [xxx] port 22. debug1: Connection established. debug1: identity file /home/alexander/.ssh/id_rsa type 1 debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 debug1: identity file /home/alexander/.ssh/id_rsa-cert type -1 debug1: identity file /home/alexander/.ssh/id_dsa type 2 debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024 debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024 debug1: identity file /home/alexander/.ssh/id_dsa- cert type -1 debug1: identity file /home/alexander/.ssh/id_ecdsa type -1 debug1: identity file /home/alexander/.ssh/id_ecdsa-cert type -1 debug1: Remote protocol version 2.0, remote software version dropbear_0.52 debug1: no match: dropbear_0.52 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client->server aes128-ctr hmac-md5 none debug1: sending SSH2_MSG_KEXDH_INIT debug1: expecting SSH2_MSG_KEXDH_REPLY debug1: Server host key: RSA XXXX debug1: Host 'remote_host' is known and matches the RSA host key. debug1: Found key in /home/alexander/.ssh/known_hosts:26 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering DSA public key: /home/alexander/.ssh/id_dsa debug1: Authentications that can continue: publickey,password debug1: Offering RSA public key: /home/alexander/.ssh/id_rsa debug1: Authentications that can continue: publickey,password debug1: Trying private key: /home/alexander/.ssh/id_ecdsa debug1: Next authentication method: password user@remote_host's password:


title: Preserve bash history in multiple terminal windows

text: I consistently have more than one terminal open. Anywhere from two to ten, doing various bits and bobs. Now let's say I restart and open up another set of terminals. Some remember certain things, some forget. I want a history that:   * Remembers everything from every terminal   * Is instantly accessible from every terminal (eg if I `ls` in one, switch to another already-running terminal and then press up, `ls` shows up)   * Doesn't forget random things if there are spaces at the front of the command. Anything I can do to make bash work more like that?


title: What do you use to manage your shell history?

text: > **Possible Duplicate:**   >  Preserve bash history in multiple terminal windows   >  Can I easily search my history across many screen windows? I rely on my shell history a lot, I use `Ctrl``r` and arrow keys and I `grep` through it often. The problem with with history is if you have more than one session, like if you are using `tmux` or `screen` or you open multiple terminal windows or tabs, you would lose all your history except the one you close last. I thought, there should be a solution for this, I bet others had the same problem and either they use a replacement for history or use a tool to manage history properly.


title: How to preserve bash history in multiple terminal windows

text: > **Possible Duplicate:**   >  Preserve bash history in multiple terminal windows While working, usually I have multiple terminal windows open (or tabs). I use konsole, but it could be few ssh sesions to one and the same machine, or using screen. In any case, I'm looking for a way to preserve the history from each one of them on closing (or even better - while still open) and merged, so it can be reused later from any new session (or even the current opened ones). Any idea how to accomplish this?


title: Can I easily search my history across many screen windows?

text: My current `screen` session has 12 open windows on it. It's been running for weeks... I know I executed an ImageMagick `convert` command in _one_ of these 12 screen windows sometime last week... is there any way I can easily search through the Bash history of all 12 instances, without closing them or running `history | grep convert` in all 12 screens?


title: How to set up a daemon to monitor an error log and trigger email notifications alerts (maybe syslogd?)

text: I have a log file that my custom application uses named 'application.log'. I want to set up a daemon that will monitor this file and scan for any errors marked CRIT and ignore the other DEBUG and WARN messages. The daemon should be easily configurable to work with other applications, so that the logging mechanism can be standardised across the network. Furthermore, the software should be mature in the sense that it should have an extensive feature set. For example, the software should be intelligent enough to send multiple errors occurring within 30 seconds in one email rather than spamming duplicate notification events. I was told that syslogd can be used to this effect? I am currently diving blindly into the documentation, but I would very much appreciate some guidance from an experienced sysadmin. ;-)


title: Intermittent ping times on a raspberry pi wifi access point

text: I have set up a raspberry pi as a wifi access point. At this point, all I want to do is ssh the rpi. I'm finding that the ssh sessions hang for 5-30 seconds ever 1 to 6 minutes or so. My laptop is the only client connected to the AP. If I set up a continuous ping from my laptop to the AP address, the average ping time is around 1-4ms, but then every so often, excessive delays of around 100-500ms or timeouts for up to 5-30 seconds will occur. This occurs whether there is an ssh session active or not. By comparison, if I ping the ethernet port, all delays are 1ms or less and I have no timeouts. I have tried changing channels with no benefit. What is interesting is that if I disable wifi 'n' mode (now running in g), wmm and ht_capab in hostapd.conf, I greatly improve the situation with very few (if any) timeouts. With these disabled, usual ping times are 1-2ms with occasional delay of 120ms. lsmod shows the following modules:               -Module Size Used by     -aes_generic 31536 1     -8021q 17966 0     -garp 6295 1 8021q     -stp 1969 1 garp     -llc 5440 2 stp,garp     -snd_bcm2835 15846 0     -snd_pcm 77560 1 snd_bcm2835     -snd_page_alloc 5145 1 snd_pcm     -snd_seq 53329 0     -snd_seq_device 6438 1 snd_seq     -snd_timer 19998 2 snd_pcm,snd_seq     -snd 58447 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device     -arc4 1676 2     -rt2800usb 14940 0     -rt2800lib 55351 1 rt2800usb     -rt2x00usb 11215 1 rt2800usb     -rt2x00lib 42334 3 rt2x00usb,rt2800lib,rt2800usb     -mac80211 273413 3 rt2x00lib,rt2x00usb,rt2800lib     -cfg80211 184163 2 mac80211,rt2x00lib     -rfkill 18202 2 cfg80211     -crc_ccitt 1522 1 rt2800lib     -leds_gpio 2235 0     -led_class 3562 2 leds_gpio,rt2x00lib      * * * hostapd.conf               -interface=wlan0     -driver=nl80211     -ctrl_interface_group=0     -ssid=ivoPI          -hw_mode=g     -ieee80211n=1     -wmm_enabled=1          -channel=5     -#macaddr_acl=0     -auth_algs=3     -#ignore_broadcast_ssid=0     -wpa=3     -wpa_passphrase=*******     -wpa_key_mgmt=WPA-PSK     -wpa_pairwise=TKIP     -rsn_pairwise=CCMP          -ht_capab=[HT20][SHORT-GI-20] #[RX-STBC1]      * * * If anyone can help out here, it would be greatly appreciated. cheers Ivo Further to the above: I have now tried the wifi adapter above, along with another, in client mode. The first adapter has rt3072 chip with rtl2800usb / cfg80211 driver. The second adapter has a Realtek rtl8188us chip with r8712u staging driver. Each adapter (separately), was connected to a powered hub. The pi didn't have the Ethernet connected. First adapter With low processor load and no shell or shell with no traffic, there was no typical ping results. Delays appeared to be totally random from 2ms to 320ms - all over the place. There were occasional timeouts. When top was run at 0.01 sec, pings became very steady at 2-3ms with occasional single ping delays of 195-222ms. I observed on timeout 5 sec over a period of about 20 minutes. second adaptor With low processor load and no shell or shell with no traffic, typical ping results were 1-2ms. Ping results were generally very stable. Under load - top running 0.01 sec, ping delay was around 2-3ms with occasional 166-200ms single ping delays. I didn't observe any timeouts. So what does one conclude from this? It looks to me to be a driver problem with rtl2800usb / cfg80211 or some other related component. One could almost fix the problem by running top continuously, but it does seem kind of wasteful!! and I do still get the occasional timeout. I don't know yet whether it was the higher processor load or the increased tcp/ip traffic that made the improvement.


title: Files are opened by wrong applications if opened from a number of programs

text: History: I had problems with mime associations under Firefox. Firefox opened downloaded files with wrong programs. I deleted ~/.local/share/applications/mimeapps.list and now it works. Now I noticed that the problem is transferred to Calibre and Chromium. For example, cbr files are opened with file-roller instead of evince, and directories are opened with Firefox! Mime associations with the file browser (PCManFM) worked before and works now without problems. I'm under Lubuntu 13.10.


title: ssh-keygen utility

text: Is this possible to change the path that ssh-keygen use the files from? The default one is `$HOME/.ssh/` so is this possible to change this? Like for example when using ssh-keygen -R to remove the host from known_hosts file how can I provide another known_hosts file (`$HOME/.ssh_other/known_hosts` for example) other than the default one?


title: How can I determine what program or user connected to a particular port after the fact?

text: I am examining the egress IPTABLES log of my computer for yesterday and notice the following: > IN= OUT=eth0 SRC=192.168.1.1 DST=69.46.36.10 LEN=60 TOS=0x00 PREC=0x00 > TTL=64 ID=12345 DF PROTO=TCP SPT=56789 DPT=4000 WINDOW=29200 RES=0x00 SYN > URGP=0 After looking up the list of well known TCP ports, there is only a Diablo II game using port **4000**. I don't have the game installed on my computer. I tried but could not determine what other services could be connecting to the port. As this only happen yesterday, if I use `netstat`, I could be staring at the screen the entire day to catch the service in action. Is there a better way to determine what program or user connected to this particular port?


title: How do I escape a sub-directory name with an ampersand in it?

text: Running a kornshell and trying to traverse a directory tree. Want to cd to a sub-directory named as follows:                -3ab_&_-3dc.img      My question is HOW do I need to escape the ampersand in this name? I've tried different combinationsof double-quotes and backslashes without success.


title: Multiuser seedbox with creating torrents

text: I'm running small seedbox company. My new clients want new feature which allow them to create new torrent from files that already are on server. So the question is: do you know any app which will help my configure new dedicated server to this features:   * multiuser   * ability co create torrent from existing files   * user panel, where users can check their torrents, files   * I'd like to have ability to share internet connection and space equally


title: How to manage 2 vm using upstart?

text: I use an upstart script to monitor a vm and respawn it when it gets killed. I would like to simulate a failover by doing the following. Create a clone of the VM1 say VM2. When either of them is running , I have the other VM in saved state. As soon as one gets killed , I resume the other and start the killed vm but keep it paused. How should I modify this single vm script to work for 2 vms or maybe multiple vms even?               start on (local-filesystems and net-device-up IFACE=eth0)     stop on runlevel [016]          console output          respawn     respawn limit 5 10          pre-stop script     su pankajm -c “VBoxManage controlvm ubuntu-server savestate”     end script          exec su pankajm -c “VBoxHeadless –startvm ubuntu-server”


title: What does 'l' in file metadata mean

text: When we type `ls -l`, we get meta data regarding all the objects in the current directory. The meta data has 10 dashes and the 1st dash indicates if the object is a directory or file or a link ![Screenshot](http://i.stack.imgur.com/NbHz2.jpg) `d` indicates that the object is a directory like a folder `-` indicates that the object is a file etc : .cpp, .png, .jpeg `l` indicates that the object is a link What exactly does it mean when a object is a link, how do you create a object that is a link?


title: Remote ls on multiple machines

text: I want to connect to multiple machines specified in a file and perform 'ls' there. That's what I've come up with:               for machine in $(cat machines)     do        echo "Connecting to " $machine        ssh $machine ls -la && exit     done      Apart from the fact that I need to 'cd' to a different directory before the 'ls', the loop ends after the first entry in the file. This first entry is my machine itself, if that is important. What am I missing?


title: 80-net-setup-link no longer functions when I downgraded systemd

text: I've downgraded systemd to version 208. Although I still have `/etc/udev/rules.d/80-net-setup-link.rules` on my disk, but the names of network interfaces were not named correctly: e.g `wlp3s0` is not renamed to `wlan0`, and so is `enp0s25` to `eth0` Any ideas? I want the names back to wlan0 and eth0 P.S I'm running Arch Linux, I marked `systemd` and a few other package for upgrade               warning: systemd: ignoring package upgrade (208-11 => 210-2)


title: replacement script multiple targets

text: I have this input file               Name=code_229633_138;isoforms=1               Name=code_229633_138                 Name=code_229633_138;Target=R77_09738T0          Name=code_230519_1;isoforms=1                 Name=code_230519_1               Name=code_230519_1;Target=R77_13591T0          Name=code_299097_0;isoforms=2                 Name=code_299097_0               Name=code_299097_0;Target=R77_15554T0      Name=code_299097_0               Name=code_299097_0;Target=R77_14520T0           Name=code_010512_23;isoforms=1                Name=code_010512_23              Name=code_010512_23;Target=R77_14520T0          Name=code_550_30;isoforms=3     Name=code_550_29     Name=code_550_29;Target=R77_14520T0       Name=code_550_31     Name=code_550_31;Target=R77_13591T0     Name=code_550_31;Target=R77_13591T0     Name=code_550_32     Name=code_550_32;Target=R77_13771T0          Name=code_67379_19;isoforms=2     Name=code_67379_19     Name=code_67379_19;Target=R77_14095T0     Name=code_67379_19     Name=code_67379_19;Target=R77_00109T0      and I would like to sensitive replace the "code_xxxxxx_xxx" sections only in the first lines which are containing the word "isoforms" (lines 1, 5, 10, 16, 20, 27) with all the "Target" values (R77_xxxxxT0) that are found in each of the 6 records, respectivelly and separate them by a "/" if there are up to 2 isoforms per record. I need also these replacements to take into account how many times each of the "Target" values are found in the text and accordingly to add a proper suffix when they would replace the "code_xxxxxx_xxx" section in the first lines. Finaly, I would prefer the series of the "Target" values in each replacement to follow the series that these Target values are displayed in each of the 6 records in the initial input file. I would expect the following output:               Name=R77_09738T0;isoforms=1               Name=code_229633_138                 Name=code_229633_138;Target=R77_09738T0          Name=R77_13591T0.a;isoforms=1                 Name=code_230519_1               Name=code_230519_1;Target=R77_13591T0          Name=R77_15554T0/R77_14520T0.a;isoforms=2                 Name=code_299097_0               Name=code_299097_0;Target=R77_15554T0       Name=code_299097_0               Name=code_299097_0;Target=R77_14520T0          Name=R77_14520T0.b;isoforms=1                Name=code_010512_23              Name=code_010512_23;Target=R77_14520T0          Name=R77_14520T0.c\R77_13591T0.b\R77_13771T0;isoforms=3     Name=code_550_29     Name=code_550_29;Target=R77_14520T0       Name=code_550_31     Name=code_550_31;Target=R77_13591T0     Name=code_550_31;Target=R77_13591T0     Name=code_550_32     Name=code_550_32;Target=R77_13771T0          Name=R77_14095T0\R77_00109T0;isoforms=2     Name=code_67379_19     Name=code_67379_19;Target=R77_14095T0     Name=code_67379_19     Name=code_67379_19;Target=R77_00109T0       The following script (case sensitive substitution; same target ids) was quite helpful to make simple replacements and add suffixes when it was needed. Any possible improvements?


title: Strange error message during CentOS 6.5 installation regarding disk containing BIOS RAID metadata?

text: While attempting to use an old 40GB HDD to setup a kind of junky though usable Athon 1GHz system I ran into the following error during the HDD identification/partitioning phase of the installation: > Warning: Disk sda contains BIOS RAID metadata, but is not part of any > recognized BIOS RAID sets. Ignoring disk sda How can I work around this issue?


title: Mouse pointer moves on its own

text: When I leave the mouse _(Logitech Performance Mouse MX)_ alone, it moves (somewhat continuously) ever so slightly on its own! This causes several issues:   * when watching a video full screen, the seek bar at the bottom never closes   * screensaver/monitor sleep never activates I'm running Debian Testing and the issue has been persisting for months now, so I assume it's something that is wrong with my setup (maybe I lack some essential packages?) PS: I checked, there is no such issue on Windows, so it's not the mouse surface or something wrong with the mouse. PPS: I've also tried solaar, but didn't help.


title: Problem with regular expression in gawk ('\<' not working)

text: I am trying to get into bash a little bit. I was going through this guide but the second example in this subsection on gawk doesn't seem to work. The problem is this command:               ls -l | awk '/\<(a|x).*\.conf$/ { print $9 }'      It works only if I replace `\<` with a space. I also tried using `\y`, but no luck there either. Does anyone have any idea what the problem might be here? Thanks :)


title: Can't Get "lsdvd" To Work On Remastered Live CD's

text: I have attempted to make Tiny Core Linux, Archboot (didn't get very far), and SliTaz remastered live CD's with **lsdvd** included, in order to create a lightweight transcoding solution that allows as much of the processing to be on the transcoding as I can manage. Additionally, I opted for these RAM distributions so that I would be able to swap the live CD's out for a DVD without problems. I have two Virtual Machines set up, one for Tiny Core Linux and the other for SliTaz. Within the respective operating systems, **lsdvd** seems to work just fine (I installed **libdvdcss** and **libdvdread** on both). On each, I remastered live CD's so that all three of these packages are installed, and they both seem to behave in a similar way. That is, although they work on the installed OS's, they bring up similar errors when in a live CD environment. Here is the the error output for each (this occurs after the version of **libdvdcss** and before the DVD Title Table are displayed): **Tiny Core Linux:**               libdvdread: Can't seek to block 100301     libdvdread: Can't seek to block 100301     libdvdread: Can't seek to block 4096128     libdvdread: Can't seek to block 4096128      **SliTaz:**               hdc: command error: status=0x41 { DriveReady Error }     hdc: command error: status=0x50 { LastFailedSense=0x05}     hdc: possibly failed opcode: 0xa0      What interests me is that the problem seems to be distribution-independant. Is there something that I have on my installed VM's that I should be including in order to mitigate this error? In researching Google, I found that setting a region might help, but I am unsure how I would go about doing that in a portable way. If there is a simpler way to go about what I am trying to make than how I am making it, I would be grateful if you could let me in on it! Learning the remastering processes for these different systems is intuitive, but it does take some time.


title: differences between vesa and fbdev Xorg drivers?

text: What are the differences between the 'VESA' driver and the 'fbdev' driver for Xorg? Both have no hardware acceleration a.f.a.i.k.


title: Single command to login to SSH and run program?

text: Is there a way to structure a single command to login via SSH to a remote server and run a program on the remote login shell? In the OpenSSH manual, it reads "If command is specified, it is executed on the remote host instead of a login shell." So, for example, `ssh user@server mail` will login to the remote server, display the mailbox status, and then return you to the local shell. Is there a way to stay on the remote shell after displaying the mail status? Furthermore, `ssh user@server [command]` does not seem to work if the command is a program, for example vim or mutt. Is there a way to login to the remote shell and run a program while staying in the remote shell during the program and after exiting the program, only finally exiting upon a specific `logout` command (just like in a normal SSH session)? I would eventually like to be able to put such a command as an alias in the local .bashrc, so that it could be run quickly when desired. An example would be to login via SSH to a remote server and open mutt on the remote server to read or send email.


title: Why use `sudo yum install <pkgs>` when I can use `yum install <pkgs>`?

text: The above question can also be rephrased to, `what is the use of the sudo command?` `man` pages for `sudo` in the bash shell has the following description. `sudo, sudoedit - execute a command as another user.` This doesn't make any sense to me. Don't I have to be the `root` user to install from terminal? How does using `sudo` before the `yum install` command help?


title: How can I close a terminal without killing the command running in it?

text: Sometimes I want to start a process and forget about it. If I start it from the command line, like this:               redshift      I can't close the terminal, or it will kill the process. Can I run a command in such a way that I can close the terminal without killing the process?


title: How can I tell a running process to disregard SIGHUP?

text: > **Possible Duplicate:**   >  How can I close a terminal without killing the command running in it? I have a very low-end "server" running Debian Squeeze that I occasionally ssh to. The system tends to be slow, e.g. running `apt-cache search` might take half a minute. Occasionally I find that I can't wait for a process to complete (I'm on my laptop and need to go somewhere). If I had originally started the process with `nohup` or inside `screen`, this would be no problem. But how can I get an already running process to continue despite my logging off?


title: Launch independent process

text: > **Possible Duplicate:**   >  How can I close a terminal without killing the command running in it? If I open a terminal emulator, type `firefox &` and then close the terminal, the process it launched -Firefox- gets killed as it was its child. How can I prevent this behavior?


title: is there a way to keep a session alive even when logging out?

text: While I am always logging into a CentOS server for simulations it got me thinking: why can't I keep running the simulations even if my session is closed? I know that when a session is ended or a user logs out, any process generated from the session is also terminated. Could there be a way to let the processes keep on running by itself even if the session is closed? -- a silly question from a user with not much unix background :)


title: How to run regular programs as daemons/services

text: > **Possible Duplicate:**   >  How can I close a terminal without killing the command running in it? I'm using Debian for my Server. I just installed MediaCore, which works well. Now I want to have it always started and want to ask, how it'd be possible to start it as a service or in the background. I know how to start but then the shell is useless as long as the program runs. So how can I run it silently, as I run services/daemons?


title: How to make sure that a command is not interrupted, even if terminal is closed?

text: In Linux. Say I want to run a command and it takes too long. I just want to ensure it's done. How?


title: What is MEAN (on Ubuntu)?

text: This might initially seem like the sort of question that is easy to Google, but it's not. Instead of useful results, you get things like answers to the question "What does Ubuntu mean?", or "what does ~ mean in a Linux shell?" or "mean, median, mode, and range". Every different attempt I've made fails because of the normal meaning of "mean" and how Google interprets that. The context in which I've encountered this is my Digital Ocean control panel: ![Digital Ocean control panel for creating a new droplet \(VM\)](http://i.stack.imgur.com/6SpER.png)


title: Installing Flash Player for Safari in Ubuntu

text: I have installed Safari browser in Ubuntu 10.10 using Wine tricks. Now I wish to run a website which has Flash content. I am trying to install Adobe Flash but it is not working even though Flash is already installed in Ubuntu. Is there any work-around for this?


title: Impossible to login after crash

text: I am using Fedora 16. I have downloaded MySQL Server and tried to start it; while doing so my Fedora hung. So I shutdown by pressing the power button. When I try to log in next time then this error occurs: > Oh no! Something has gone wrong.A problem has occurred and the system can't > recover.Please contact a system administrator How do I recover my Fedora?


title: How to grep recursive UNIX tree results along with each tree node?

text: Here is what I do               tree -R /Applications/NetBeans/NetBeans\ 7.0.app/ | perl -e 'while (<>) { print if /java$/ }'      but of course this doesn't return the result I want. What I want is to display an **executable java file** along with its recursive directory so that I would know where that java file is. Something like this structure below               `-- Contents         `-- Resources             `-- NetBeans                 `-- ExecutableJavaEnv                     `-- java      This question is inspired from my question on SU. The structure display above actually is not really important because I'm not sure if I can get what I want using `find`. What I need is just **get the path** so that I can set my TextMate to run NetBeans' Java instead of `/usr/bin/java` from my Mac OS X 10.5.8. Advice? Help? 1st Edit: Thanks for answers so far, I appreciate it. Here is the result of the command I tried:               . find /Applications/NetBeans/NetBeans\ 7.0.app/ -name java     /Applications/NetBeans/NetBeans 7.0.app//Contents/Resources/NetBeans/java     . ll /Applications/NetBeans/NetBeans\ 7.0.app/Contents/Resources/NetBeans/     total 632     -rw-rw-r--   1 arie  admin   6.6K Apr  8 09:29 CREDITS.html     -rw-rw-r--   1 arie  admin   1.7K Apr  8 09:29 DISTRIBUTION.txt     -rw-rw-r--   1 arie  admin   2.1K Apr  8 09:30 LEGALNOTICE.txt     -rw-rw-r--   1 arie  admin    78K Apr  8 09:30 LICENSE.txt     -rw-rw-r--   1 arie  admin   5.4K Apr  8 09:30 README.html     -rw-rw-r--   1 arie  admin   158K Apr  8 09:30 THIRDPARTYLICENSE.txt     drwxrwxr-x   8 arie  admin   272B Apr  8 09:29 apisupport/     drwxrwxr-x   3 arie  admin   102B Apr  8 10:32 bin/     drwxrwxr-x   9 arie  admin   306B Jul  1 15:56 cnd/     drwxrwxr-x   9 arie  admin   306B Apr  8 09:29 dlight/     drwxrwxr-x   9 arie  admin   306B Apr  8 09:30 enterprise/     drwxrwxr-x   6 arie  admin   204B Apr  8 09:30 ergonomics/     drwxrwxr-x   6 arie  admin   204B Jun 11 22:17 etc/     drwxrwxr-x   7 arie  admin   238B Apr  8 09:30 groovy/     drwxrwxr-x  21 arie  admin   714B Jun 11 22:15 harness/     drwxrwxr-x  11 arie  admin   374B Jun 11 22:25 ide/     drwxrwxr-x  12 arie  admin   408B Jul  1 15:56 java/     drwxrwxr-x  10 arie  admin   340B Apr  8 10:15 mobility/     -rw-rw-r--   1 arie  admin    33K Apr  8 09:30 moduleCluster.properties     drwxrwxr-x  15 arie  admin   510B Jun 11 22:17 nb/     -rw-rw-r--   1 arie  admin    15K Apr  8 09:30 netbeans.css     drwxrwxr-x  11 arie  admin   374B Apr  8 09:30 php/     drwxrwxr-x  11 arie  admin   374B Jun 11 22:25 platform/     drwxrwxr-x  10 arie  admin   340B Apr  8 09:30 profiler/     drwxrwxr-x   3 arie  admin   102B Apr  8 08:43 ruby/     drwxrwxr-x   7 arie  admin   238B Apr  8 09:30 websvccommon/     .       And for another answer is this               . find /Applications/NetBeans/NetBeans\ 7.0.app -type f -executable -name java     find: -executable: unknown option


title: Remove green from Linux Mint browser

text: When I use Firefox in Linux Mint, everything has a kind of green shade to it. The monitor is fine. I'm guessing it's Mint branding. How do I remove it? **Edit** My original question wasn't clear - it's not the browser chrome that has the green shade, it's the pages themselves. Here's a screenshot - compare with the actual page, and you'll see what I mean. To prove it's not the monitor, I right click on the photo of the sausages (I bet that's the first time that word's appeared on unix.se.com!) and save the image to the desktop. Then I view the image by double clicking on the new file and it displays fine. http://imgur.com/qiX6H.png There are two plugins installed - `Mint Search Enhancer` and `Stylish` - deactivating these makes no difference.


title: Environment variable for ip address

text: I see somewhere people use:               IF_ADDRESS="$(echo "$IP4_ADDRESS_0" | cut -d'/' -f1)"      to get the IP address in a network configuration script. In my system, I create a script under the directory `/etc/network/if-up.d/` and test with:               echo "$IP4_ADDRESS_0" >> /tmp/test.log      but get nothing with this variable. What's wrong? My `/etc/network/interfaces` is like this:               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp      My final purpose is to set up the IP routing policy with a script like this.


title: How to use 'unsquashfs' with lzma?

text: I'm using Ubuntu 12.04. I want to unsquash an lzma image. I have done               sudo apt-get squashfs-tools      Now, when I do               unsquashfs <squashed_image_filename>      I get               Filesystem uses lzma compression, this is unsupported by this version      I know my squashed image is lzma. How do I install support for lzma? I have downloaded the squashfs-tools from here: http://sourceforge.net/projects/squashfs/files/ It is my understanding that after extracting that tarball, I need to `cd` into `squashfs4.2/squashfs-tools` and edit the `Makefile` by uncommenting the line `LZMA_XZ_SUPPORT = 1`. Then I just need to run `make`. That does not work for me. I get the error:               gzip_wrapper.c:23:18: fatal error: zlib.: No such file or directory      I think I need to install `lzma-devel` and `xz-devel`. I have tried this and been Googling for a couple hours and haven't gotten anywhere or found any solid instructions that show how this should work. Can anyone who has done this help me out? **I am new to desktop Linux** so if you could be fairly verbose in your instructions that would be appreciated.


title: Debian Sid, AMD RS880 [Radeon HD 4250], black screen on boot

text: My computer booted under Debian Wheezy (3.2 kernel) with no graphics problems whatsoever. After updating to sid (3.10 kernel), the screen goes black (that is, the display flashes a bit and then goes into power-saving mode) and turns off whenever the kernel tries to set up the radeon framebuffer (both if I boot without the `nomodeset` option and if I load the module via `modprobe radeon modeset=1`). I then compiled the kernel (both 3.10 and 3.11), Mesa and the xorg driver for myself with the same results. `lspci -s 01:05.0 -vv`:               01:05.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RS880 [Radeon HD 4250] (prog-if 00 [VGA controller])         Subsystem: ASRock Incorporation Device 9715         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Latency: 0, Cache Line Size: 64 bytes         Interrupt: pin A routed to IRQ 18         Region 0: Memory at d0000000 (32-bit, prefetchable) [size=256M]         Region 1: I/O ports at d000 [size=256]         Region 2: Memory at febf0000 (32-bit, non-prefetchable) [size=64K]         Region 5: Memory at fea00000 (32-bit, non-prefetchable) [size=1M]         Expansion ROM at <unassigned> [disabled]         Capabilities: [50] Power Management version 3             Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)             Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-         Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+             Address: 0000000000000000  Data: 0000             Kernel driver in use: radeon      `dmesg | grep -i 'drm|radeon'`:               [    6.995487] [drm] Initialized drm 1.1.0 20060810     [    7.744080] [drm] VGACON disable radeon kernel modesetting.     [    7.744125] [drm:radeon_init] *ERROR* No UMS support in radeon module!     [  395.010450] [drm] radeon kernel modesetting enabled.     [  395.010779] [drm] initializing kernel modesetting (RS880 0x1002:0x9715 0x1849:0x9715).     [  395.010828] [drm] register mmio base: 0xFEBF0000     [  395.010859] [drm] register mmio size: 65536     [  395.015827] radeon 0000:01:05.0: VRAM: 512M 0x00000000C0000000 - 0x00000000DFFFFFFF (512M used)     [  395.015863] radeon 0000:01:05.0: GTT: 512M 0x00000000A0000000 - 0x00000000BFFFFFFF     [  395.015898] [drm] Detected VRAM RAM=512M, BAR=256M     [  395.015930] [drm] RAM width 32bits DDR     [  395.016192] [drm] radeon: 512M of VRAM memory ready     [  395.016223] [drm] radeon: 512M of GTT memory ready.     [  395.016261] [drm] GART: num cpu pages 131072, num gpu pages 131072     [  395.030829] [drm] Loading RS780 Microcode     [  395.085860] [drm] PCIE GART of 512M enabled (table at 0x00000000C0040000).     [  395.085978] radeon 0000:01:05.0: WB enabled     [  395.086019] radeon 0000:01:05.0: fence driver on ring 0 use gpu addr 0x00000000a0000c00 and cpu addr 0xffff8801f7aacc00     [  395.086065] radeon 0000:01:05.0: fence driver on ring 3 use gpu addr 0x00000000a0000c0c and cpu addr 0xffff8801f7aacc0c     [  395.086109] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).     [  395.086147] [drm] Driver supports precise vblank timestamp query.     [  395.086201] [drm] radeon: irq initialized.     [  395.086502] radeon 0000:01:05.0: setting latency timer to 64     [  395.118357] [drm] ring test on 0 succeeded in 0 usecs     [  395.118455] [drm] ring test on 3 succeeded in 1 usecs     [  395.118664] [drm] ib test on ring 0 succeeded in 0 usecs     [  395.118716] [drm] ib test on ring 3 succeeded in 0 usecs     [  395.119245] [drm] Radeon Display Connectors     [  395.119283] [drm] Connector 0:     [  395.119319] [drm]   VGA-1     [  395.119357] [drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c     [  395.119397] [drm]   Encoders:     [  395.119433] [drm]     CRT1: INTERNAL_KLDSCP_DAC1     [  395.119470] [drm] Connector 1:     [  395.119505] [drm]   HDMI-A-1     [  395.119540] [drm]   HPD3     [  395.119577] [drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c     [  395.119617] [drm]   Encoders:     [  395.119652] [drm]     DFP3: INTERNAL_KLDSCP_LVTMA     [  395.119715] [drm] radeon: power management initialized     [  395.183376] [drm] fb mappable at 0xD0142000     [  395.183417] [drm] vram apper at 0xD0000000     [  395.184903] [drm] size 9216000     [  395.184939] [drm] fb depth is 24     [  395.184975] [drm]    pitch is 7680     [  395.185145] fbcon: radeondrmfb (fb0) is primary device     [  395.380720] radeon 0000:01:05.0: fb0: radeondrmfb frame buffer device     [  395.380813] radeon 0000:01:05.0: registered panic notifier     [  395.381119] [drm] Initialized radeon 2.34.0 20080528 for 0000:01:05.0 on minor 0      My Xorg.log is here: http://lpaste.net/92865


title: Automatically set Linux timezone according to location

text: How can we automatically set the system default timezone in Linux using the Internet? As I see it, NTP servers can update only time, but not timezone. Is there any server that can change the timezone?


title: Creating an extended partition

text: I'm trying to create an extended partition. In GParted, I shrunk the size of the existing partition and now want to create a new EXTENDED partition in the free, unallocated space. GParted only lets me create a PRIMARY partition. What am I doing wrong here? Here's what I've got right now: http://i.stack.imgur.com/WkEIS.png You can actually ignore the flag for the swap as "boot." That was me just messing around trying to get it to work. I've removed that flag. Not sure how the question of boot affects all of this...maybe it factors in somehow.


title: `chattr +i` error on NFS

text: I'm trying to secure my `authorized_keys` file to prevent it from being modified. I run this:               [root@localhost]# chattr +i authorized_keys      chattr: Inappropriate ioctl for device while reading flags on authorized_keys      I think it may be due to the filesystem:               [root@localhost]# stat -f -c %T /home/user/     nfs      there is a way to modify it with chattr?


title: Running -march optimized software on another architechture?

text: I'm running an Athlon64 server with LFS and would like to have a local copy of the server in a virtual machine for testing purposes and building software. My PC uses an i7 and the existing server software was built with -march=athlon64. Despite the optimizations am I able to run this on my hardware?


title: Linux date/time - monthly "mongodump"

text: For MongoDB backups, I want to backup only the newest changes from the previous month instead of everything from the previous month. As part of the query I need to pass to "mongodump", I have to determine the first day/last month and the last day/last month, which I've done as follows:               date -d "-1 month -$(($(date +%d)-1)) days"     Sat Dec  1 21:05:21 UTC 2012          date -d "-$(date +%d) days -0 month"      Mon Dec 31 21:06:22 UTC 2012      As you can see this almost works, but the time portion of the above 'date' examples reflect the current time relative to my timezone. In order for only the newest backup data from the previous month to be 100% inclusive, I need to specify the timestamp portion for the first and last day of the previous month to instead be displayed as follows:               Sat Dec  1 00:00:00 UTC 2012     Mon Dec 31 23:59:59 UTC 2012      Is there a way to display the time portion of the date/time in the manner listed above?


title: convert arecord output to flac

text: I'm trying to convert arecord wav output to flac and it does work in part:               pi@raspberrypi /tmp $ arecord -d4 -f dat -t wav -r 48000 -c 2 |flac -f -o message.flac - --channels=1 --sample-rate=16000      it will create a file that's recognized and played as a valid flac file by mplayer:               pi@raspberrypi /tmp $ mplayer message.flac     ==========================================================================     Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders     libavcodec version 53.35.0 (external)     Mismatching header version 53.32.2     AUDIO: 48000 Hz, 2 ch, s16le, 125.8 kbit/8.19% (ratio: 15723->192000)     Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)     ==========================================================================      however, I can't figure how to properly tell flac I want a 16kHz 1 channel track as the result. When I use -d instead of plain '-' it will not accept it. _You may ask why I'm not setting arecord channel/rate to the target settings - the answer is that if I do that, the quality of sound captured is horrible, conversion to flac via sox/flac with lower settings works out much better._ _I initially wanted to use sox to record flac without having to recode wav to flac but it's giving me a segmentation fault and I couldn't find a way to overcome this yet._


title: How to Find a Fugitive Crontab

text: A few years ago I setup a cron job to automatically ping a URL every minute as part of a monitoring system (that's oversimplification, but it'll do for this question). Because I'm a horrible person, I didn't document this anywhere. Today, years later, I started having trouble with the application on the other end of the URL that's being pinged. I fixed it, but then realized, **I have no idea where this cron job is coming from**. Is there a way to quickly search through or cat out all the crontabs on a particular system? I have root access so permissions aren't a problem. I've only ever been a user of `cron`, I've never looked too deeply at its implementation, but my *nix instincts say there has to be a group of text files somewhere that hold all the crontabs. I just don't know where they'd be, and if I dug into it I'd be afraid of finding some, but not all of them, or missing some weird nuance of the system Also, I realize with root access I could   1. Get a list of all the users in the system   2. `su` as a user   3. `crontab -l`   4. Repeat with all the users but I'm looking for something a little less manual (and looking to learn something about cron's implementation)


title: Improve Fedora 17 fonts

text: Having installed Fedora 17, the fonts still not feel smooth enough... I've tried this, and they improved a lot, still I don't get Windows like smoothness. Using a Java IDE, called intellij so font rendering is very important. Any ideas on how to get them better? Using 24" display, 1920 x 1200 res It's basically this question updated for Fedora 17 (procedure there did not make much change) Here is a sample: ![enter image description here](http://i.stack.imgur.com/yfiKx.png) Here is a Consolas font (In Windows) (is different, I don't have the same font in Linux) ![enter image description here](http://i.stack.imgur.com/5pJSp.jpg)


title: way to select lines that show variations

text: I have a huge file that contains 80 genomes and five chromosomes. I was wondering is there is an easy way to select only the lines from ONE chromosome (for example 1) but only at the position showing SNP VARIATIONS.               1   180754  GGGGGGGCC        1   180755  CCCCCCCCC          1   180756  CCTCCCCTC        1   180757  AAAAAAAAA        1   180759  TTTTTTTTT        3   7874113 TTTTTTTTT        3   7874114 GGGGGGGGG        3   7874115 GGGGGGGGG        3   7874116 GGGGGGGGG      This is what I want to get in the end:               1   180754  GGGGGGGC             1   180756  CCTCCCCT


title: IP Tables / netfilters and modules

text: I am trying to understand how firewall works in linux... I have read documentation but i am not sure about some things.... Netfilters is included in the modern kernels which allows you using hooks to monitor packages without changing their content. Iptables they say that it is a software that uses netfilter and ip_tables module maybe..   My questions are....   * Does IPTables userspace software register any hook ?    * What does ip_table module do?    * Who does the processing iptables or the module ?   * What things IPtable do ?(Just manages the rules in memory?? or it has hooks and proccesses the traffic?)?


title: Arch installs but GRUB does not load

text: I installed Arch Linux from a USB flash drive. Everything went well, no errors at all. When I rebooted, however, I got only a blank screen with a blinking cursor. No GRUB. I cannot input anything. I'm sure I followed the installation instructions properly. Can anybody suggest what might be the problem? Edit: grub's menu.lst:               # Arch Linux     title Arch Linux     root (hd1,0)     kernel /vmlinuz26 root=/dev/disk/by-uuid/db9d5d80-d822-481e-885f-c93bf2927512 ro     initrd /kernel26.img          # Arch Linux fallback     title Arch Linux Fallback     root (hd1,0)     kernel /vmlinuz26 root=/dev/disk/by-uuid/db9d5d80-d822-481e-885f-c93bf2927512 ro     initrd /kernel26-fallback.img      A sketch of the drives and partitions, until I have a chance to boot to the USB again and get more certain details: sda: will be Windows 7 on 1st half of drive, data partition on second. Total size 1 TB. sdb: also 1 TB. If I recall correctly from Arch install, it has: 100MiB /boot, 256MiB swap, 20GiB /, remainder is /home. I think they're in that order, too. I believe /boot is ext2 and / and /home are ext3. Edited to add: output of `fdisk -l`:               Disk /dev/sdb: 100.2 GB, 100204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders     Units=cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes/512 bytes     I/O size (minimum/optimal): 512 bytes/512 bytes     Disk identifier: 0x00022eec             Device Boot Start    End    Blocks  ID System     /dev/sdb1  *       1     13    104391  83 Linux     /dev/sdb2         14     46    265072+ 82 Linux swap/Solaris     /dev/sdb3         47   2596  20482875  83 Linux     /dev/sdb4       2597 121601 955907662+ 83 Linux


title: how to access the running VMs?

text: A colleague of a friend of mine established a voluntary project for a gaming union. But the problem now is, that the person is unavailable and I don´t know how I should access the running VMs. I spent days in searching through the internet to find the solution. Now I know that the VMs are running under libvirt with qemu and kvm. It´s possible for me to start or to shutdown the VMs through the virsh command (which was also new for me).               ps ax | grep qemu      shows me the following:               16767 pts/0    S+     0:00 grep --color=auto qemu     18250 ?        Sl   388:50 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 1000 -smp 4,sockets=4,cores=1,threads=1 -name Teamspeak1 -uuid a973dbb4-04e1-942b-1546-615f425b931b -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Teamspeak1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/Teamspeak1.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=18,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:29:5f:61,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5     18295 ?        Sl    79:15 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 1024 -smp 8,sockets=8,cores=1,threads=1 -name Webserver -uuid 14b56603-7323-2333-180c-227d02260acf -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Webserver.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/var/lib/libvirt/images/Webserver.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=18,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:f6:a1:37,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:1 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5     18380 ?        Sl    19:32 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 10000 -smp 8,sockets=8,cores=1,threads=1 -name Gameserver1 -uuid cb7b70e3-f049-7545-65d2-3adff36f34ff -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Gameserver1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device ahci,id=ahci0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/Gameserver1.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/var/lib/libvirt/images/Gameserver1-1.img,if=none,id=drive-sata0-0-0,format=raw -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0 -netdev tap,fd=18,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:62:7d:6e,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:2 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5      He left me also the following notices: For the "Gameserver1":               root: kecks     user : game     pass: ***          ip: 192.168.122.161     FTP connection : ftp://***:2121          IP-Tables:             //FTP: (Chrooted)             49152-49153 (FTP Passive)             2121 -> 21             2020 -> 20             //CS:GO              27015      And also e. g. for the "Webserver":               ##User     root -> ***     webserver -> ***          192.168.122.198     Mysql root -> ***               ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:12001 // FTP     ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:12000 //FTP     ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:ftp-data     ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:ftp     ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:http      Maybe it´s helpful for system administrators which have already worked with this tools, but for me not really. The XML configuration files for the VMs are only generated. So in my opinion it´s not needed here. The server is running under Ubuntu 12.04.3 LTS. All my tryings to access it via complex ssh and vnc commands brought me only to the host machine, not to the VM. Of course I tried this locally with a ssh connection on the host machine, because I saw only class C local IPv4 address. Edit: Solved with the two answers below. The solution is to establish a ssh connection to class c ip-adresses inside the ssh session to the host machine.


title: Centos - executing a bash script from PHP

text: I have 3 scripts (I have removed the help_page function from the networkstats.sh script when I pasted here to save some space): api3.php               <?php          output = shell_exec('/bin/bash /usr/share/nginx/status/getnetworkstatsin.sh');     echo $output;          ?>      getnetworkstatsin.sh               #!/bin/bash     ssh -i /tmp/id_rsa1 root@centos7clone bash -s -- -I < ./networkstats.sh      networkstats.sh               #!/bin/bash          interface=enp0s3          read -r inbytesold outbytesold < <(awk -v dev="^$interface:" '$1 ~ dev {                   sub(/[^:]*:/,""); print $1, $9; exit }' /proc/net/dev)          sleep 1          read -r inbytesnew outbytesnew < <(awk -v dev="^$interface:" '$1 ~ dev {                   sub(/[^:]*:/,""); print $1, $9; exit }' /proc/net/dev)          kilobitsin=$(( ( ( inbytesnew - inbytesold ) * 8 ) / 1024 ))          kilobitsout=$(( ( ( outbytesnew - outbytesold ) * 8 ) / 1024 ))          show_outgoing() {     echo $kilobitsout     }          show_all() {     echo "kilobits in: $kilobitsin"     echo "kilobits out: $kilobitsout"     }          if [[ $# -eq 0 ]];     then             help_page             exit 1     fi          for arg in "$@"      do             case $arg in                     -h|--help)                     help_page                     ;;                          -I)                     show_incoming                     ;;                          -O)                     show_outgoing                     ;;                          -A|--all)                     show_all                     ;;             esac      done      The problem I have is that when I execute the api3.php script from console, it is able to execute and return a value. However when I try and execute from a webpage it fails to return anything. I believe it is not even executing when I load it via the webpage by navigating to localhost/api3.php. Can someone help, what is the reason behind this? I have added               nginx ALL=NOPASSWD: /usr/share/nginx/status/getnetworkstatsin.sh      To my visudo section, I have tried to change permissions of all files involved to 777 (temporally) without success. All these scripts are located inside /usr/share/nginx/status which nginx has access to.


title: Is it possible to auto translate words via scripting language?

text: Some words in String.log as following: English Home Wait Come Back And I want to translate words of String.log into French,like this: Anglais maison attendez venir arrière As we all know ,Google can do this,but if I have more then ten thousand words to translate,maybe do this via scripting language is more perfect. Update Question： I know about translation of a word depends heavily on context,so I just want to translate individual words, as @Gilles says,'it is a button for someone to click to switch to English'. By the way,customers need confirm translation,so it is accepted translations barely readable. Thanks for any help.


title: Conky - string formatting

text: I have conky the record:               ${color lightblue} Down: ${downspeed wlan0} Up: ${upspeed wlan0}      Conky prints link speed, but the text moves:               Down: OB  Up: OB      Down: 60B  Up: 60B     Down: 148B  Up: 148B     Down: 1KiB  Up: 1KiB     Down: 1.8KiB  Up: 1.8KiB     Down: 1.08KiB  Up: 1.08KiB     Down: 31.8KiB  Up: 31.8KiB      Based on this topic Creating Conky text variables with zero padding? I tried to format the output, but the text still moves.               ${color lightblue} Down: ${lua_parse format %7s ${downspeed wlan0}} Up: ${lua_parse format %7s ${upspeed wlan0}}      I want the printed output conky:               Down:      0B  Up:      0B     Down:     60B  Up:     60B     Down:    148B  Up:    148B     Down:    1KiB  Up:    1KiB     Down:  1.8KiB  Up:  1.8KiB     Down: 1.08KiB  Up: 1.08KiB     Down: 31.8KiB  Up: 31.8KiB


title: how to run new software without updating GLIBC?

text: I installed Mathematica 9 on an old Red Hat Enterprise Linux AS release 4 system. After the installation, I tried to start Mathematica, but following message came out: > > /home/wcbao/M/Wolfram/Mathematica/9.0/SystemFiles/FrontEnd/Binaries/Linux-x86-64/Mathematica: > /lib64/tls/libc.so.6: version `GLIBC_2.4' not found (required by > /home/wcbao/M/Wolfram/Mathematica/9.0/SystemFiles/Libraries/Linux-x86-64/libML64i3.so) > > > /home/wcbao/M/Wolfram/Mathematica/9.0/SystemFiles/FrontEnd/Binaries/Linux-x86-64/Mathematica: > /lib64/tls/libc.so.6: version `GLIBC_2.4' not found (required by > /home/wcbao/M/Wolfram/Mathematica/9.0/SystemFiles/Libraries/Linux-x86-64/libQtCore.so.4) I don't want to update the system glibc, because it's risky and the administrator don't allow me to do that. Someone suggested that it is possible to just install new version of glibc somewhere else, and run the program as               LD_LIBRARY_PATH=/lib/new your_application      and this will not affect the system. So I am asking here if this method really works. And if it works, I want to know how to do it step by step (I lack experience in Linux right now, and want to use Mathematica on Linux as soon as possible). **Edit** : I noticed that there is a software called "Ermine". It seems that it can deploy a software as standalone package which doesn't rely on the external environment. Unfortunately, it is a shareware. So I think since "Ermine" can do it, there must be a way to use new software on old system.


title: How do you output an info page to pdf?

text: If `man -t ls | ps2pdf - > ls.pdf` is useful for outputting the `ls` man page via `ps2pdf` to pdf, what about **info** pages? I've tried something like the following but with no success:               info -o info | ps2pdf - > info.pdf      All this does is output a blank pdf file called info.pdf and output the body into a text file.


title: USB3 Hard Drive Not Recognised by Linux

text: My external USB 3 hard drive is behaving very strangely:   * If I plug it into a USB 2 port, it works fine   * If I plug it into a USB 3 port, it doesn't work at all. It's not even mentioned in `/var/log/messages`.   * If I plug a USB 2 device (memory stick) into the same USB 3 port, it works fine.   * I _think_ the USB 3 drive is mentioned in `dmesg` during boot up when it's plugged into the USB 3 port, but it's hard to tell. There are no clear device names listed, just serial ids etc. The last time I used it on this machine, everything was alright, but that was at least a month ago. Since then I've gone through a few kernel upgrades and a number of package updates. My guess is something went wrong in the process, so I'm here to try and narrow that down. Useful information:   * I'm running Gentoo (kernel version: 3.7.4-gentoo)   * `CONFIG_USB_STORAGE` is enabled in the kernel (obviously, since USB 2 works)   * `CONFIG_USB_XHCI_HCD` is also enabled in the kernel The hardware involved is:   * Lenovo X1 laptop   * WD 1tb portable drive. There's no external power options, and I've never needed one (when it was working)


title: Why does wlan1 not get a static IP?

text: I have a Raspberry Pi with two USB wlan adapters. wlan0 is configured with DHCP and wlan1 is configured with a static IP address and hostapd (access point) is running on this interface. The adapter supports master mode. But wlan1 never gets it's IP address after boot and the network does not work properly. Any clues to why? /etc/network/interfaces looks like this:               auto lo          iface lo inet loopback          iface default inet dhcp          auto eth0     allow-hotplug eth0     iface eth0 inet static      address 192.168.2.201      netmask 255.255.255.0          auto wlan0     allow-hotplug wlan0     iface wlan0 inet manual     wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf          auto wlan1     iface wlan1 inet static     address 10.0.0.1     netmask 255.255.255.0      Directly after booting the RPi, **ifconfig** returns the following:               eth0      Link encap:Ethernet  HWaddr b8:27:eb:47:0d:a5           inet addr:192.168.2.201  Bcast:192.168.2.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:102 errors:0 dropped:1 overruns:0 frame:0           TX packets:91 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:11281 (11.0 KiB)  TX bytes:15674 (15.3 KiB)          lo        Link encap:Local Loopback           inet addr:127.0.0.1  Mask:255.0.0.0           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)          mon.wlan1 Link encap:UNSPEC  HWaddr 54-E6-FC-89-BE-4B-00-00-00-00-00-00-00-00-00-00           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:2665 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:810921 (791.9 KiB)  TX bytes:0 (0.0 B)          wlan0     Link encap:Ethernet  HWaddr 80:1f:02:84:f8:3f           UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:12 errors:0 dropped:14 overruns:0 frame:0           TX packets:5 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:3672 (3.5 KiB)  TX bytes:1106 (1.0 KiB)          wlan1     Link encap:Ethernet  HWaddr 54:e6:fc:89:be:4b           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      As you can see wlan1 is not assigned the expected 10.0.0.1 address. If I issue ifdown and then ifup it will get the IP address. The command **ip link** shows this before doing ifdown/ifup:               4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000      and this afterwards:               4: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000      Any help is appreciated.


title: Plymouth keeps quitting

text: I'm setting up a customised single-purpose Linux image. It's based on OpenSUSE, and it uses Plymouth to display some nice graphics during startup and shutdown. The trouble is, for reasons beyond my comprehension, the Plymouth display keeps turning off. I need to prevent this from happening. In particular, if I shutdown or reboot while X11 is running, Plymouth displays for 6ms and then I get a black terminal screen that says `Starting LSB: X Window Display Manager [ OK ]`. But if I press Ctrl+Alt+F1 to switch to one of the vterms and _then_ issue a shutdown or reboot command, Plymouth displays perfectly. Similarly, when the OS is first installed, I've set a script to run which reconfigure the OS, and then reboots it. The script also writes various messages to the Plymouth screen to indicate that something is actually happening. Trouble is, about half way through this process, Plymouth just quits, revealing a terminal full of random text. And then when the system reboots, Plymouth comes back. But I don't want it to ever close! Does anybody know how I can fix these issues? Where to look for further troubleshooting? Anywhere that has any documentation for how Plymouth works?


title: Bash history in script: `!#:*`

text: I have been reading through the study guides for the LPIC-1.               echo "This is a sentence. " !#:* !#:1->text3      I'm having trouble understanding how the above line of code repeats the `echo` command multiple times. I know that it is using a feature of `bash`'s history but I can't find any documentation on `!#:*` or `!#:1`. Could someone explain this for me?


title: Can't mount drive in Thunar anymore

text: Today, I got a `Not authorized to perform operation.` message when I tried to mount a drive in Thunar.               # cat /etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla      [Local Users]     Identity=unix-group:storage     Action=org.freedesktop.udisks2.*     ResultAny=yes     ResultInactive=no     ResultActive=yes      I'm in the `storage` group.


title: Debian kernel package update freezes

text: So I have a Debian squeeze i386 install, and I'm trying to update to 3.2. I added the sources to the backports, I updated apt-get, I installed the `firmware-linux-free`, and when I try to install the image it freezes. It prompts me to say yes, and seems to finish, but rather than returning to the console, it just displays this screen that says:               * Some HP Smart Array controllers are now handled by the new 'hpsa' driver, rather than the 'cciss' driver.          ...          blah blah blah some boring stuff          ...          -- Ben Hutchings <ben@decadent.org.uk> Wed, 16 Mar 2011 13:19:34 +0000          (END)      I read somewhere that this happens if you don't have the non-free firmware, which I installed. It still doesn't work. The computer is an HP(which is apparently the type of computers that have these problems). Does anybody know what I'm doing wrong? Maybe it's something entirely different, I've never updated the kernel before.


title: Message while booting : “can't allocate mem resource [0xc0000000-0xbfffffff]”

text: I get the following message on the console every time the Linux kernel boots:               pci 0000:00:00.0: BAR 0: can't allocate mem resource [0xc0000000-0xbfffffff]      Is this an error message? What causes this message? I am using Linux 2.6 kernel running on PowerPC (P2020). Updating the question with the output of lspci and content of /proc/iomem `lspci`:               0000:00:00.0 Class 0604: Unknown device 1957:0070 (rev 20)     0000:01:00.0 Class 0200: Unknown device 14e4:1692 (rev 01)     0001:02:00.0 Class 0604: Unknown device 1957:0070 (rev 20)     0001:03:00.0 Class 0200: Unknown device 14e4:1692 (rev 01)      `/proc/iomem`:               a0000000-bfffffff : /pcie@ffe09000     a0000000-bfffffff : PCI Bus 0000:01     a0000000-a000ffff : 0000:01:00.0     a0000000-a000ffff : tg3     c0000000-dfffffff : /pcie@ffe0a000     c0000000-dfffffff : PCI Bus 0001:03     c0000000-c000ffff : 0001:03:00.0     c0000000-c000ffff : tg3     ffe04500-ffe04507 : serial     ffe04600-ffe04607 : serial     ffe07000-ffe07fff : spi     ffe24000-ffe24fff : ethernet     ffe24520-ffe2453f : mdio     ffe25000-ffe25fff : ethernet


title: How on earth can I stop this CUPS-related message on my Debian 6 virtual machine?

text: I’ve got a Debian 6 VMWare virtual machine that I mostly use via SSH (but occasionally via the GUI). Every few minutes, the following message gets printed in my terminal:               CUPS config timestamp change detected but old config retrieved via interface!      For a while, I ignored it. Then, I uninstalled CUPS:               $ sudo apt-get remove cups     $ sudo apt-get autoremove      and restarted. I’m still getting the message. How on earth can I stop it? I’m never, ever going to want to print from this machine.


title: How does the sticky bit work?

text: SUID The _sticky bit_ applied to executable programs flagging the system to keep an image of the program in memory after the program finished running. But I don't know that what it's stored in memory. And how I can see them, in this case.?


title: Chaining commands within `watch`

text: Ok, this is driving me a bit nuts. I'm trying to watch the number of files in a set of subdirectories. `find . | wc -l` correctly returns the number of sub-folders and files. However, `watch 'find . | wc -l'` returns ` watch: find . | wc -l: No such file or directory` in the watch screen.   It returns the same with double-quotes, or backquotes (`). * * * This is on an **ancient** version of bash:   `GNU bash, version 3.00.16(2)-release (i486-slackware-linux-gnu)   Copyright (C) 2004 Free Software Foundation, Inc.` This is also an embedded device, so it's running busybox (`BusyBox v1.1.0 (2010.06.14-02:47+0000) multi-call binary`) rather then the normal gnu utils, so most of the switches and functionality of most of the common tools is not there either. So that has to be taken into account. However, the linux install is baked onto a disk-on-module, so there is no easy way to update it. The same command (`watch 'find . | wc -l'`) works correctly on a more recent linux install, so this question is more about dealing with out-of-date bash then what is wrong with this exact snippet (since it _seems to be correct elsewhere!_ ).


title: How do I install multiple java command-line programs?

text: I have a bunch of java command-line programs I've written and would like to install for all users. Building with NetBeans, I get a `/dist` directory which contains `myprog1.jar` and a `/libs` directory with all the necessary libraries. The usual method to run is to go there and `java -jar my.jar -options`. So what I'd like to do is just type `myprog1 -options` from anywhere and have it run. The method I have thought of is:   1. Create `/opt/myjava/myprog1` which contains `myprog1.jar` and its `/libs`.   2. Create a bash script `myprog1` in `/usr/local/bin` which simply redirects all of the command line args to `java -jar /opt/myjava/myprog1/myprog1.jar` I'm not too keen on bash scripting... if this is a reasonable method, what would that script look like, given that each program has a variable number and order of arguments? Does the script have to also worry about standard Unix bits such as output redirect `>` and pipes `|`?


title: Find the process id of a java application in a bash script (to see if the target application is already running)

text: I know there are a million questions on getting the process ID, but this one seems to be unique. Google has not given me the answer, so I hope stackexhange will help rather than close this question. When Java is involved it seems trickier to find a process ID (pgrep doesn't work afaik). Furthermore, I need to automate this in a bash script. One issue I've encountered is that when I use `ps aux | grep` the grep process itself always shows up, so handling the results in a simple bash script is not trivial enough for me to figure out a good solution on my own (with my limited bash skills). Some things I have tried: Example 1 - this returns a process even though there is no application by that name:               $ ps aux | grep -i anythingnotreal     user2   3040  0.0  0.0   4640   856 pts/3    S+   18:17   0:00 grep --color=auto -i anythingnotreal      Example 2 - this returns nothing even though "java_app" is currently running:               $ pgrep java_app      It returns nothing. However, here's proof that "java_app" is running:               $ ps aux | grep java_app     tester2   2880  0.7  2.8 733196 58444 ?        Sl   18:02   0:07 java -jar /opt/java_app2/my_java_app.jar     tester2   3058  0.0  0.0   4644   844 pts/3    S+   18:19   0:00 grep --color=auto java_app      What I need is a solution I can plug into a bash script that will tell me if the java application of interest (for which I know the jar file name and path) is currently running. (If it is running, I need to ask the user to close it before my script continues.)


title: Is collectd able to send data tagged as a host other than itself?

text: I log various stats both generic and custom from a lot of different servers using `collectd` to a single host running a network listener. The setup is pretty simple. All the systems run an instance of collectd. The collection server runs the rrdtool plugin to save the data and runs the network plugin in server mode to keep a port open and collect stuff from everybody else. All the other servers don't have any write plugins and just run the _network_ in client mode to pass on the data they collectd. The nice thing about this setup is that all the data written by `rrdtool` comes in a nice consistent file structure that is easy to process for graphs and other monitors. This works great for a simple layout with one hub that everybody can send to. I am now trying to configure a more complex setup. Still using the same central server and clients, the daemon running one of those clients is able to gather stats for several hosts other than itself that are unable to run the `collectd` daemon itself.                 A      /|\     B C D       |\       E F      I am able to setup the configs on C such that it reports the stats that it gathered from E and F. That much works. What I can't do is get C to report that data under several different hostnames. All the data it sends is labeled with it's own host, which is incorrect. How can I identify some of the _Plugin_ or _Type_ blocks in the `collectd.conf` to report themselves as belonging to a different host than the machine running the daemon?


title: How do i fix the to address when forwarding with mail/exim?

text: I am using debian squeeze (i believe, the box doesnt really say) i config exim4 to use gmail and put `root: someuser` in `/etc/aliases` then put my email address (name+box@gmail.com) in `.forward` I receive the email however the from is user@mysite.com which is correct and the to is `root@localhost` or `anotherUser@localhost` with name+box mentioned nowhere. I wanted to write a filter so all emails to name+box@gmail.com will be tagged as something but my name is not mentioned and it goes directly to spam How do i modify this so my name shows up in the email address?


title: Encrypt IP payload + URL

text: I need to encrypt IP payload + request URL so that my ISP can't understand my requests. Do you know any project such as `zebedee` except VPNs? Tor doesn't work with my ISP, because SSL was banned, so systems corresponding to Socks don't work.