title: Configuring ssh fingerprints on dns to replace known_hosts fails

text: The SSHFP records were generated on the ssh server as follows and then added to the zone in bind:               $ ssh-keygen -r www.test.us.     www.test.us. IN SSHFP 1 1 ad04dfaf343a93beeb939eed1612168f7eadbed7     www.test.us. IN SSHFP 2 1 432209c72c4f0e99546d601dd96c04ce804191f9      The required records can be grabbed from the ssh client via DNS as shown:               $ dig www.test.us any     ;; QUESTION SECTION:     ;www.test.us.           IN  ANY          ;; ANSWER SECTION:     www.test.us.        120 IN  SSHFP   1 1 AD04DFAF343A93BEEB939EED1612168F7EADBED7     www.test.us.        120 IN  SSHFP   2 1 432209C72C4F0E99546D601DD96C04CE804191F9     www.test.us.        120 IN  A   192.168.1.50      However ssh on the client fails to find them when connecting:               $ rm .ssh/known_hosts     $ ssh -vo VerifyHostKeyDNS=yes www     OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011     debug1: Reading configuration data /Users/test/.ssh/config     debug1: Reading configuration data /etc/ssh_config     debug1: /etc/ssh_config line 20: Applying options for *     debug1: /etc/ssh_config line 53: Applying options for *     debug1: Connecting to www [192.168.1.50] port 22.     debug1: Connection established.     debug1: identity file /Users/test/.ssh/id_rsa type 1     debug1: identity file /Users/test/.ssh/id_rsa-cert type -1     debug1: identity file /Users/test/.ssh/id_dsa type -1     debug1: identity file /Users/test/.ssh/id_dsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8p2_hpn13v11     debug1: match: OpenSSH_5.8p2_hpn13v11 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9     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: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Server host key: RSA 69:dc:47:97:e1:a5:c9:07:4a:2b:9e:3c:a2:2b:c8:8c     DNS lookup error: name does not exist     The authenticity of host 'www (192.168.1.50)' can't be established.     RSA key fingerprint is 69:dc:47:97:e1:a5:c9:07:4a:2b:9e:3c:a2:2b:c8:8c.     No matching host key fingerprint found in DNS.     Are you sure you want to continue connecting (yes/no)?      Any ideas as to why this is failing? I know that DNSSEC is required to make it secure and that I should get a warning since DNSSEC is not currently enabled. I'm hoping to get this working without DNSSEC first before I start tackling that as an additional problem. The ssh server is FreeBSD 9.1 with OpenSSH_5.8p2_hpn13v11 and is also hosting DNS using BIND 9.8.3-P4. I've tried connecting from OS X 10.8.2 with OpenSSH_5.9p1 as well as Arch Linux 3.6.10-1-ARCH with OpenSSH_6.1p1. ## Update In a further attempt to troubleshoot this, I stood up a new OpenBSD 5.2 VM which has OpenSSH_6.1 built into it as an ssh server. Since all other implementations of OpenSSH server are just ports of the OpenBSD one, surely this should work. On the server I generate the SSHFP records:               # ssh-keygen -r vm1.test.us.       vm1.test.us. IN SSHFP 1 1 419c5338920e11183380d81f002fc998389b944f     vm1.test.us. IN SSHFP 1 2 cb5bbbf5aef231f57a1a4dcf1e790f1be032b124d0d591023f33cfd5f91ec556     vm1.test.us. IN SSHFP 2 1 0fdf92ce946b5cfee5f96a3e1ef710edc50280ff     vm1.test.us. IN SSHFP 2 2 f2ee7334ee9f9a426f51f20af8f4bc7155d567c9d38a6bffaa6c643af405711e     vm1.test.us. IN SSHFP 3 1 b5e94320f0bc0b46cc6627ca7221679a65c79962     vm1.test.us. IN SSHFP 3 2 60704213a0bbd8dae813d113bfe4ae190a780b89836e6e1c567b7cfde89805f8      I add them to the FreeBSD bind server and reload named. Then test to see if I can access the records:               $ host -t any vm1     vm1.test.us has SSHFP record 1 1 419C5338920E11183380D81F002FC998389B944F     vm1.test.us has SSHFP record 1 2 CB5BBBF5AEF231F57A1A4DCF1E790F1BE032B124D0D591023F33CFD5 F91EC556     vm1.test.us has SSHFP record 2 1 0FDF92CE946B5CFEE5F96A3E1EF710EDC50280FF     vm1.test.us has SSHFP record 2 2 F2EE7334EE9F9A426F51F20AF8F4BC7155D567C9D38A6BFFAA6C643A F405711E     vm1.test.us has SSHFP record 3 1 B5E94320F0BC0B46CC6627CA7221679A65C79962     vm1.test.us has SSHFP record 3 2 60704213A0BBD8DAE813D113BFE4AE190A780B89836E6E1C567B7CFD E89805F8     vm1.test.us has address 192.168.1.60               $ dig -t any vm1.test.us     ;; QUESTION SECTION:     ;vm1.test.us.           IN  ANY          ;; ANSWER SECTION:     vm1.test.us.        120 IN  SSHFP   1 2 CB5BBBF5AEF231F57A1A4DCF1E790F1BE032B124D0D591023F33CFD5 F91EC556     vm1.test.us.        120 IN  SSHFP   2 1 0FDF92CE946B5CFEE5F96A3E1EF710EDC50280FF     vm1.test.us.        120 IN  SSHFP   2 2 F2EE7334EE9F9A426F51F20AF8F4BC7155D567C9D38A6BFFAA6C643A F405711E     vm1.test.us.        120 IN  SSHFP   3 1 B5E94320F0BC0B46CC6627CA7221679A65C79962     vm1.test.us.        120 IN  SSHFP   3 2 60704213A0BBD8DAE813D113BFE4AE190A780B89836E6E1C567B7CFD E89805F8     vm1.test.us.        120 IN  SSHFP   1 1 419C5338920E11183380D81F002FC998389B944F     vm1.test.us.        120 IN  A   192.168.1.60      The records are clearly being served over DNS, so I try to use ssh:               $ rm .ssh/known_hosts     $ ssh -vo VerifyHostKeyDNS=yes root@vm1     OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011     debug1: Reading configuration data /etc/ssh_config     debug1: Connecting to vm1 [192.168.1.60] port 22.     debug1: Connection established.     debug1: identity file /Users/test/.ssh/id_rsa type 1     debug1: identity file /Users/test/.ssh/id_rsa-cert type -1     debug1: identity file /Users/test/.ssh/id_dsa type -1     debug1: identity file /Users/test/.ssh/id_dsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1     debug1: match: OpenSSH_6.1 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9     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: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Server host key: RSA d8:01:b5:b2:3e:c7:55:ce:19:c1:6d:77:39:92:7d:0f     DNS lookup error: name does not exist     The authenticity of host 'vm1 (192.168.1.60)' can't be established.     RSA key fingerprint is d8:01:b5:b2:3e:c7:55:ce:19:c1:6d:77:39:92:7d:0f.     No matching host key fingerprint found in DNS.     Are you sure you want to continue connecting (yes/no)?       At this point, I think it is safe to eliminate the ssh clients and servers as the point of failure. Instead I am going to focus the DNS server. Unless someone has a suggestion of where to look, I guess I'm stuck with taking packet captures and digging through them to find clues. ## Update2 Okay, here are the results of my packet captures. ssh www; fails with the standard               No matching host key fingerprint found in DNS.      and the packet capture shows that DNS fails to return a record for the lookup.               mbp13.test.us   www.test.us DNS Standard query 0x1c5e  SSHFP www     www.test.us   mbp13.test.us DNS Standard query response 0x1c5e No such name      Compare with ssh www.test.us; which also fails with the message               No matching host key fingerprint found in DNS.      however the packet capture shows that DNS actually returns the record.               mbp13.test.us   www.test.us DNS Standard query 0x0ebd  SSHFP www.test.us     www.test.us   mbp13.test.us DNS Standard query response 0x0ebd  SSHFP SSHFP`      First, it is a little disconcerting that the error message is the same for both cases. I can add some records to fix case 1 where no records are returned, but the big problem is case 2. DNS works and the SSHFP records are being returned to the ssh client. No packets are sent after the DNS query response and the ssh client immediately displays the no matching fingerprint message. This means either all of the ssh clients I'm testing with are broken or the fingerprint stored in DNS is wrong and doesn't match. I doubt it is the clients so why is the fingerprint in DNS wrong? The fingerprints were generated from the built in ssh tools ssh-keygen as described at the very beginning of this post. Also, the problem is not helped by the fact that the fingerprints are displayed in different formats depending on the context. If they were displayed in the same format it would be easy to see that the record stored in DNS is not the same as the fingerprint of the key returned by the ssh server being connected to.               DNS record format:      ad04dfaf343a93beeb939eed1612168f7eadbed7     ssh client mesg format: 69:dc:47:97:e1:a5:c9:07:4a:2b:9e:3c:a2:2b:c8:8c      Does anyone have any suggestions as to why the fingerprints output from ssh- keygen -r don't match the public keys returned by the same ssh server? ## Update3 I'm down to my last option. Unless someone points me in the right direction before the weekend, I'll spend my Saturday creating a duplicate environment using VMs that is completely OpenBSD based. Since OpenBSD owns OpenSSH, this would have to be ideal conditions for SSHFP over DNS to work. If an OpenBSD OpenSSH server with bind serving an OpenBSD OpenSSH client doesn't work, then SSHFP is broken as implemented and I'll move things to the OpenBSD forums and possibly file a bug report. I'm still hoping that I'm missing something obvious and that a helpful reply will save my weekend.


title: Error when restarting Postfix

text: I have recently purchased an SMTP server for my web app (I need to send account confirmation emails to my users and I don't want them to go into the SPAM folder, I will also be using it for email marketing.) and I'm following a guide found on this website. http://syslog.tv/2011/09/15/postfix-dovecot- imapimaps-sasl-maildir/ How ever when I go to restart all the applications I get two errors.                   Restarting IMAP/POP3 mail server: dovecotError: Error in configuration file /etc/dovecot/dovecot.conf line 892: Expecting '='      I have looked at the file and nothing seems out of place, is there anything that I'm doing wrong here?               auth default {        mechanisms = plain login             passdb pam{        }        userdb passwd {        }        socket listen {     client {         path = /var/spool/postfix/private/auth         mode = 0660         user = postfix         group = postfix         }        }     }      And the other error I recieve is when I try to restart POSTFIX Stopping Postfix Mail Transport Agent: postfixpostfix: fatal /etc/postfix/main.cf, line 47: missing '=' after attribute name: "permit_mynetworks," My code is                   home_mailbox = Maildir/         smtpd_sasl_auth_enable = yes         smtpd_sasl_security_options = noanonymous         smtpd_sasl_local_domain = $myhostname         broken_sasl_auth_clients = yes              smtpd_sender_restrictions = permit_sasl_authenticated,         permit_mynetworks,              smtpd_recipient_restrictions = permit_mynetworks,         permit_sasl_authenticated,         reject_unauth_destination,         reject_unknown_sender_domain,      Any help at all would be appreciated, I've been havign trouble trying to find any help on trying to set up my SMTP server -Greg


title: Permission denied when running logrotate with anacron

text: I am trying to figure out what is causing `anacron` to send me the following error message:               /etc/cron.daily/logrotate:          /var/log/mariadb/mariadb.log-20140710.gz: Permission denied     error: error running last action script for /var/log/mariadb/*.log      These are the relevant configs:               # /etc/cron.d     01 * * * * root run-parts /etc/cron.hourly     ------------------------------------------     # /etc/cron.hourly/0anacron     ...     /usr/sbin/anacron -s     ------------------------------------------     # /etc/anacrontab     ...     1   5   cron.daily      nice run-parts /etc/cron.daily     ------------------------------------------     # /etc/cron.daily/logrotate     /usr/sbin/logrotate /etc/logrotate.conf     ...     ------------------------------------------     # /etc/logrotate.conf     ...     include /etc/logrotate.d     ...      This is the main config in question:               # /etc/logrotate.d/mariadb          /var/log/mariadb/*.log {       create 640 mysql mysql       missingok       sharedscripts       nodelaycompress            postrotate        .....            lastaction              dir="/var/log/mariadb/"         today=$(date -u +%Y%m%d)         attach1=$(ls -t1 ${dir}mariadb*gz 2>&1 head -1 | grep $today)         ....              attachment=""         totalsize=0         if [[ $attach1 ]]; then          attachment+=" -a $attach1"          totalsize=$((totalsize + $(stat -c %s $attach1)))         fi         ....       endscript     }      When I tested the above on commandline with `# logrotate -f /etc/logrotate.conf`, there is no error. But when anacron is running it, it gets permission denied error as shown above. I am guessing that the error is generated when it runs the `stat` command. I have the following permission setting for the file in question               -rw-r-----. mysql mysql system_u:object_r:mysqld_log_t:s0 mariadb.log-20140711.gz      The SELinux context looks fine to me and I don't see any avc error in my journal log, so it shouldn't be due to SELinux. Also, from `cron.d`, `run- parts` is executed with root as user, so there shouldn't be a permission problem. I have read this question of which the recommendation is to do `strace`. But I don't have `strace` and I am not allowed to install it. Is there anyone who can tell me what is causing the permission error?


title: Substituting strings in a very large file

text: I have a very long series of urls with no separating character, in the same format as below:               http://example.comhttp://example.nethttp://example.orghttp://etc...      I want each URL to be on a new line. I tried to do this by replacing all instances of "http://" with "\nhttp://" using sed               sed 's_http://_\nhttp://_g' urls.txt      but a segmentation fault occurs (memory violation). I can only surmise that the sheer size of the file (it's over 100GB) is causing sed to exceed some limit. I could split the file into several smaller files for processing, but all instances of "http://" would need to be kept intact. Is there a better way to do this?


title: nmap shows me that one service is "open|filtered" while locally it's "open", how to open?

text: I have a Quake 3 server. And it's launched successfully. The problem is that no one can connect to that server. I am running: `nmap -sU -p 27960 hostname` and it's showing me that it's state `open|filtered` if I am running that command right from the server it is `open`. Also, I am making sure that it's binding to the right `iface` I checked the **iptables** rules and couldn't find any filters related to it. Furthermore, I tried to open the port explicitly via `iptables -A INPUT -p udp --dport 27960 -j ACCEPT` but this didn't help. What it could be? I called to ISP support center and they said they are not filtering anything.


title: How to prevent tmux from displaying date in new window

text: When I create new window in `tmux` it displays name of current directory and date:               Directory: /home/killy     nie, 4 lis 2012, 14:51:18 CET     [killy@xerxes : ~]      How can I prevent that? EDIT: I realized that this problem appears when I set `TERM` variable to `xterm`.


title: why inode value changes when we edit in "vi" editor?

text: When I edit a file in "vi" editor the inode value of the file is changing. But when edited with cat command the inode value is not changing.


title: systemd stuck on mounting an encrypted volume

text: systemd seems to stuck on mounting an encrypted volume, when I set the `init` to `/usr/sbin/systemd` in grub.cfg, I have one line in `/etc/crypttab` `secure /dev/sda8 /etc/cb.key` That works with original init program, but when I switched to systemd, it stuck at [ OK ] Reached target Encrypted Volume And it got the right device name, right mapper name, but just won't go on. Wait for like 60s, I got a timeout message. How should I debug it?


title: Wrong number of logged in users using "w"

text: There was a temporary network glitch and all user terminal ssh sessions were broken. Upon logging in to the CentOS server again and running the "w" command lists a higher number of users logged in than they actually. It adds up the users whose session was broken. Manually killed the earlier "pts" sessions. However the number of logged in users is still higher than the actual number now. Is there any way I can properly kill these disconnected "ssh" sessions to get correct number of logged in users in "w" output?


title: Unable to get rid of root user and privileges

text: I am told that the most basic security to set up in Linux is to change the superuser name from `root` to something obscure so I run these steps to add new user               $ /usr/sbin/adduser new_username     $ passwd new_usersname      then went to give ssh access to new user               $ /usr/sbin/visudo     root           ALL=(ALL)        ALL  // didn't modify this     new_username   ALL=(ALL)        ALL  //added this      Now despite the above change, my new user `new_username` does not have superuser privileges. I am always forced to change to root using `su` use root privileges. So, what I want is to remove completely the `root` account, and give all root's power to my `new_user` How do I accomplish this task ?


title: Errtrace and local

text: I am using the following script:               #!/bin/bash -Eu          trap 'echo Hi' ERR          exit_failure() {       echo "Hello, World!"       return 1     }          sub_failure() {       res=$(exit_failure)     }          sub_failure      It results in the following:               Hi     Hi      If I change `sub_failure()` to the following, however:               sub_failure() {       local res=$(exit_failure)     }      I get no output; `ERR` is not trapped anymore? Why is the signal hidden? How can I trap `ERR` if I want to use local variables? I know I can do `local res; res=$(exit_failure)`, but why do I have to separate both?


title: How to set root permission for all users?

text: I'm a beginner and I don't have any idea about how to give root permissions to all users, I've tried using `gpasswd -a sqeeph root` but the terminal still displays `sqeeph@root`


title: what's the right pattern to match my command

text: OS: AIX 7.1   I am working on a shell script which let user input some command and execute it, one of the commands is in this form:               compile appname      the appname only can be one of [ccms|asws], what's the right pattern to match it in case statement ? here is my shell script:               while true     do      read cmd      case $cmd in      "compile(\s)(ccms)|(asws)") compile       ;;      *) break       ;;      esac     done          compile(){      ...     }


title: SSH parameter to ignore .bashrc script

text: I have a server which when it starts, a line in `.bashrc` executes the following command `/bin/watch ~/checker.bash` which as expected watches that command upon server start. I also have a client which logs into that machine, but I do not want the client's sessions to execute the same command from the `.bashrc`. I have looked at `AcceptEnv` for passing env vars, though it requires configuration of the server, which I want to avoid. I also don't want to have 2 different user accounts for different `.bashrc`'s. Is there another angle to approach this from?


title: What is the concept behind "tty" in linux?

text: Where did the terminology "tty" come from in Linux?


title: svn and webserver files ownerships

text: I've an issue with files ownerships. I have a drupal website and the "files" folder needs to be owned by "www-data" in order to let the users to upload files with php. However I'm now using svn and I need all folders and files to be owned by my ubuntu user in order to work. Files have 775 permissions, so both user and group have full access to the files. I've added my ubuntu user to www-data group but it still doesn't work. I dunno why. I've tried to change the group to my ubuntu user group but it still doesn't work. I've also tried to set my ubuntu user as owner, and www-data as group, but in this case the webserver php script cannot anymore upload files into the folder (and this is again strange because the group has full privilegies). thanks


title: Tiling window manager that keeps the titlebar?

text: I'm very interested in tiling window managers but none seem to conform to my idea of how it should work. I have a mouse and I'm not afraid to use it! Most tiling window managers seem to focus on keyboard combinations to get things done.   * I'd like to be able to drag and drop my window into prearranged placeholders.   * I'd like to exit the app via an X button on a titlebar.   * I'd like to resize the tile layout (window sizes) by dragging the window borders around.   * I'd like to see the name of my document in the window's titlebar. If there's no such thing as a tiling window manager that fits the above description, I would love to have some kind of software running on my floating window manager that I could drag my windows into predetermined arrangements. Does anything like this exist?


title: How to change the install path of my Linux Source tree?

text: I was trying to bring up my custom kernel. I did the following :               $ make menuconfig && make modules && make modules_install && make install      I would like to change the install PATH. How can i do that? I tried doing               $ export INSTALL_PATH=<my custom path>      But then it is only creating `vmlinux.bin` (it is not creating the ramdisk image!) But if I don't do that, `make install` will automatically create the ramdisk image in the default `/boot` folder. How can i change that?


title: Move a logical volume from one volume group to another

text: Is it possible to move a logical volume from one volume group to another in whole? It is possible to create a (more or less) matching lv and copy the data over, but is there any way to do this with LVM tools alone? If not, is there a theoretical reason or a technical limitation (extent sizes)?


title: permission reporting on sudoers

text: I'm looking for a good, consistent and easy way to do a report of sudoers permissions for every user and group on the system. For users, I want the report to include permissions granted via group membership.


title: Is it possible to enable execution of files from a cifs mount in bash?

text: I have a remote mount with cifs and it would seem there is no way to have bash execute scripts from that mount, is it possible to enable such execution?               ls -lh ini*     -rwxrwxr-x 1 alan 500 222 2012-03-23 10:16 initall.sh          bash --version     GNU bash, version 4.2.8(1)-release (i686-pc-linux-gnu)          ./initall.sh     bash: ./initall.sh: Permission denied      The cifs mount seems to support also unix extensions as I am able to chmod the file correctly. Here follows the mount options: user,auto,pass=`***`,uid=alan,user=`***`


title: VMWare daemon doesn't startup when system starts

text: I have installed VMware Player on my Debian squueze, but after the reboot the vmware daemon(`/etc/init.d/vmware`) does not start up automatically, i have tried without any success to set the daemon startup with insserv :               insserv vmware       but it gives me the following output :               insserv: warning: script 'K01vpnclient_init' missing LSB tags and overrides     insserv: warning: current start runlevel(s) (2) of script `vmware' overwrites defaults (2 3 5).     insserv: warning: current stop runlevel(s) (0 3 5 6) of script `vmware' overwrites defaults (2 3 5).     insserv: warning: script 'vpnclient_init' missing LSB tags and overrides     insserv: script vboxdrv: service vboxdrv already provided!      and it doesn't work ... Why ? How can i solve the problem ?


title: sort at jobs chronologically

text: Possibly a simple solution I misplaced. How can I get the output of `atq` sorted chronologically, so I can easily see who's due to run next? The `man` page for `sort` doesn't have anything built-in to recognize timestamps like the following:               atq     1264    Sat Mar 24 15:03:00 2012 a master     1445    Sat Mar 24 20:28:00 2012 a master     1548    Sun Mar 25 15:09:00 2012 a master     1193    Sat Mar 24 11:03:00 2012 a master     1359    Sat Mar 24 17:13:00 2012 a master     1726    Mon Mar 26 21:24:00 2012 a master     1736    Mon Mar 26 22:04:00 2012 a master     1748    Mon Mar 26 22:46:00 2012 a master     1704    Mon Mar 26 20:19:00 2012 a master     1288    Sat Mar 24 15:38:00 2012 a master     1532    Sun Mar 25 11:53:00 2012 a master      `atq |sort` wouldn't work either at the job id's jump around.


title: How should I format a USB prior to writing an ISO to it?

text: I found these Debian EeePC HowToInstallUsingStandardInstaller instructions at the Debian Wiki, stating that I can install an ISO to a USB using this:               dd if=debian-*-netinst.iso of=/dev/sdX        * Do I need to delete the contents of the USB prior to running this so that nothing is left at the end of the USB?   * Does it matter what filesystem is already present on the USB prior to running this command?


title: Does cron jobs per se represent a significant burden on a modern system?

text: I'd like to run a pretty simple script (is there a dir with name x in dir y if so move it to dir z–and x will only be there about once a day) every 15 seconds or so (one minute divided into 4*15 seconds). Does running cron jobs like that (where the scripts they run are not resource intensive) have a non- neglible negative impact on performance, stability or anything else?


title: Host lookup that respects /etc/hosts

text: Utilities like `host` and `dig` let you see the IP address corresponding to the host name. There is also the `getent` utility that can be used to query `/etc/hosts` or other NSS databases. I am looking for a convenient standard utility (which is available in Debian, say) which resolves a host name regardless of where it is defined. It should be more or less equivalent to               ping "$HOST" | head -1 | perl -lne '/\((.*?)\)/ && print $1'


title: Bash won't execute files

text: I have a `foo.sh` file in my current directory. If I try to run `./foo.sh`, I get:               -bash: ./foo.sh: /bin/sh: bad interpreter: Permission denied      But if I run `/bin/sh ./foo.sh` then it runs fine. How can I fix this so I can just run `./foo.sh` and it automatically runs it with /bin/sh? Edit: Okay, this is Chrome OS and this particular folder is mounted with `noexec`. Apparently that foils the ability to just run `./foo.sh`; but **why?** Why can I still run `sh foo.sh` to achieve the exact same thing? What security, then, does `noexec` give?


title: Why Process CPU % Usage larger than Total CPU Time

text: When I run the TOP command, a process shows 1208% cpu usage and the total CPU usr time is 81.7% with IRIX mode on. When I change to IRIX mode off, the process shows 99% cpu usage and the total user cpu time is 43%. Any ideas what might be going on? **Update** Could the VM be misconfigured so CPU usage is not reported correctly?


title: Setting a network hostname doesn't work

text: I'm on a Kubuntu 11.10 and I'm having trouble setting a hostname on the network. I already tried changing `send host-name "myhostname"` in `/etc/dhcp/dhclient.conf` or `/etc/dhcp3/dhclient.conf` with a networking restart after that (even a reboot). My hostname is still new-host-4 or new-host-5. I assume it's the DHCP server who gave me these names. I also know that the servers allows these request since iPhones, Macs can set their hostnames and the hostname I ask is not in use. Any idea what to do ?


title: How to add a repository on Fedora?

text: With one repository I did it like this (as root):               # cd /etc/yum.repos     # wget https://some.repo.example.org/foo/bar/Fedora_14/foo_bar.repo     # grep enabled foo_bar.repo     enabled=1      Is this the recommended way to add a package repository under Fedora (>= 14)? Is there some policy/standard which specifies that each proper Fedora package repository should (or must) contain such a config file (i.e. such a `.repo` file)? (basically just for the reason that a user or some tool can copy it to the local `/etc/yum.repos` directory?)


title: Kernel Mode Setting vs. Framebuffer?

text: With KMS, the graphics drivers are moved into the kernel. Since the framebuffer was already in the kernel, I wouldn't expect this to affect framebuffer operation. Yet, I read that KMS supercedes the fb, augments the fb, requires the fb, and requires fb support to be removed. What the heck? The answer I'm looking for is an explanation of the relationship between KMS and the framebuffer. I have been using uvesafb to get native resolution at the tty. My purpose here is to understand how that is going to work on a system with KMS. It would also help to cover things like.. Is scrolling faster with KMS? Do utilities like fbterm and fbida work the same? Is stability better?


title: How to trigger a system self destruct with a certain password is entered

text: How do I configure my system to destroy all personal data when a certain password is entered? The motivation behind this being NSA stuff. I imagine there being three primary usage cases.   1. At login, the entering of a predetermined password triggers destruction of user data.   2. At system wake up. entering of a predetermined password triggers destruction of personal data.   3. Entering any privileged command with a predetermined password triggers destruction of personal data. I know that something like               dd if=/dev/urandom of=/dev/$HOME      Should be adequate for data destruction. I don't know how to have that triggered by a certain password, however. Bonus points if it then permits a login while the data is being deleted.


title: Is it possible to set su to use WE password dialog

text: I have sometimes problem when during entering password for su other window appears and steals the focus ("wait - did I just entered root password on public IRC chatroom?" - it did not happened but might). Is it possible to configure su/sudo/PAM to use system dialog instead of terminal? I'm using gnome3/gnome-shell if it helps.


title: Light GUI user interfaces

text: I have some older machines that cannot run new versions of Debian/Ubuntu/SUSE/etc on KDE and GNOME GUI, they just crash. It's probably because of the graphics card driver or unsupported graphic cards or not enough video RAM. Is there a light version of a GUI user interface which is still maintainable and can run all the current applications.


title: /run in Debian Squeeze

text: I'm running Debian Squeeze (6.0.1) on a NAS (LinkStation, mipsel). I installed minidlna from unstable and noticed the daemon won't start because it can't create `/run/minidlna`. After a little googling I found http://wiki.debian.org/ReleaseGoals/RunDirectory. This somewhat explains what's happening, and for now I just made a symlink to make stuff work:               ln -s /var/run /run      I'm a little afraid this isn't a good way to solve the problem. What would be the proper way of getting `/run` on Debian Squeeze? What problems could be caused by just symlinking like I did?


title: Why does awk do full buffering when reading from a pipe

text: I'm reading from a serial port connected to a gps device sending nmea strings. A simplified invocation to illustrate my point:                 $ awk '{ print $0 }' /dev/ttyPSC9        GPGGA,073651.000,6310.1043,N,01436.1539,E,1,07,1.0,340.2,M,33.3,M,,0000*56       $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39       $GPRMC,073651.000,A,6310.1043,N,01436.1539,E,0.42,163.42,070312,,,A*67       GPGGA,073652.000,6310.1043,N,01436.1540,E,1,07,1.0,339.2,M,33.3,M,,0000*55       $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39      If I instead try to read from a pipe, awk buffers the input before sending it to stdout.               $ cat /dev/ttyPSC9 | awk '{ print $0 }'     <long pause>     GPGGA,073651.000,6310.1043,N,01436.1539,E,1,07,1.0,340.2,M,33.3,M,,0000*56     $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39     $GPRMC,073651.000,A,6310.1043,N,01436.1539,E,0.42,163.42,070312,,,A*67     GPGGA,073652.000,6310.1043,N,01436.1540,E,1,07,1.0,339.2,M,33.3,M,,0000*55     $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39      How can I avoid the buffering? **Edit** : Kyle Jones suggested that cat is buffering it's output but that doesn't appear to be happening:               $ strace cat /dev/ttyPSC9 | awk '{ print $0 }'     write(1, "2,"..., 2)                    = 2     read(3, "E"..., 4096)                   = 1     write(1, "E"..., 1)                     = 1     read(3, ",0"..., 4096)                  = 2      When I think about it: I thought that a program used line buffering when writing to a terminal and "regular buffering" for all other cases. Then, why is cat not buffering more? Is the serial port signaling EOF? Then why is cat not terminated?


title: Is the process of backing-up a database and sending the generated CSV to a remote server easier on Windows or Linux?

text: My employers currently use a Windows IIS Database server which I am trying to change to Linux. But I need to convince them. **There is a requirement to automate a process of backing-up the database and sending the generated CSV to a remote server.** Can anyone tell me if the process described above is easier to accomplish on Windows or Linux? Also, **is there a Linux based database system which can handle large volumes of data like Windows SQL SERVER ?**


title: Running VLC from a cronjob: How to get a DBUS connection?

text: I'm trying to run VLC headless from a cron job. The idea is to grab single images from a RTSP stream every two minutes and (later, and in another script) ftp them to a distant machine. The command line I use is (added linebreaks for clarity):               vlc -I dummy rtsp://somesourceaddress/     --rate=1 --vout=dummy     --video-filter=scene --start-time=0 --stop-time=1 --scene-format=png --scene-prefix=img1 --scene-path=/tmp/ --scene-replace      vlc://quit      However, while this works beautifully from a terminal window inside an X session, running this from cron results in the following error message:               [0x81d1154] inhibit interface error: Failed to connect to the D-Bus      session daemon: Unable to autolaunch a dbus-daemon      without a $DISPLAY for X11     [0x81d1154] main interface error: no suitable interface module     [0x81d15fc] main interface error: no suitable interface module     [0x80503fc] main libvlc error: interface "globalhotkeys,none"      initialization failed     [0x81d15fc] dummy interface: using the dummy interface module...      So, where can I obtain suitable values for $DISPLAY if there is none? Or how can I create the DBUS connection manually?


title: Powertop tunables: what does it do?

text: I just installed Powertop 1.98 on my laptop (T420 + FC15). There is a section called "Tunables". Half of my devices show as Bad. I see I can toggle from Bad to Good? What this section is for? What should/can I toggle? Also, is there any documention available for that app? `man` and google were unhelpful.


title: Problems with CMake in CentOS 6

text: I try to install a software in CentOS 6.2, without success. In README file it says:               Requirements:       - qt4 gui lib version >= qt4.6.x              Note that many linux distributions split packages into a user         and developer package and that you need to install both.            - ALSA Version 1.0 or newer (audio/midi input/output)       - CMake >= 2.4.6       - libsndfile >= 1.0.19            - recommended: JACK audio server (audio output)            - recommended: portaudio 19         (required for windows version)      when I try to install it with `make release`, I get the following:               -- The C compiler identification is GNU     -- The CXX compiler identification is unknown     -- Check for working C compiler: /usr/bin/gcc     -- Check for working C compiler: /usr/bin/gcc -- works     -- Detecting C compiler ABI info     -- Detecting C compiler ABI info - done     CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.      Can anyone help me on this issue?


title: Measuring time within a script

text: This thread shows how to measure the time it takes to run a script. In my case, I am interested in measuring time **between two points within a script**. Here is an example of how I would like to use this:               start_measuring_time     Line 1     Line 2     ..     Line N     stop_measuring_time     show_elapsed_time      I would like the displayed time to be **human readable** (secs, min, hours, days, etc.), if possible. Any ideas how to do this?


title: Is there a way to kick kswapd and make it swap out pages?

text: Even though I have set swappiness to 100 and enabled swap, nothing is being swapped out. This is probably because I don't have high memory pressure at the moment. For testing purposes though, I want to force kswapd to swap out as much as it can. Is there a way to kick it into action even though there isn't high memory pressure?


title: Remember applications on logout from LXDE

text: When I start my computer I want that remember my applications opened before close the last session such as Ubuntu, and other distros do normally. Googling, I see that I can run apps when I start session, configuring the autostart file but I don't want always run the same programs at start, instead I want reopen the programs opened before close last session. I use Fedora spin with LXDE.


title: Endless pulseaudio error logging: failed to acquire autospawn lock

text: I have an issue with pulseaudio logging error messages in a loop and wonder how I can fix them:               Aug  7 20:22:17 s pulseaudio[25638]: lock-autospawn.c: Cannot access autospawn lock.     Aug  7 20:22:17 s pulseaudio[25638]: main.c: Failed to acquire autospawn lock /tmp/.esd/sock     Aug  7 20:22:18 s pulseaudio[25644]: module-protocol-stub.c: Failed to create socket directory '/tmp/.esd/socket': Permission denied      after deleting /tmp/.esd I get the following error:               Aug  7 20:22:32 s pulseaudio[25690]: lock-autospawn.c: Cannot access autospawn lock.     Aug  7 20:22:32 s pulseaudio[25690]: main.c: Failed to acquire autospawn lock     Aug  7 20:22:37 s pulseaudio[25694]: core-util.c: Home directory /var/lib/gdm not ours.


title: Running programs over ssh

text: I am planning to log in to my college PC using ssh and run some simulations. These simulations take very long time, so I would like the relevant process to run longer than the ssh session (I want to log in, run the process, log out and collect the results the next day). How can I do it   1. If the process is a command line tool that doesn't expect any inputs (so that I just need the resulting output file)?   2. If the process is a GUI, which sadly doesn't save the results to a file, but displays it instead. So in this case I was thinking of using `ssh -X ...` command, but then I don't know how to reconnect to the open window.


title: Swap two columns in a CSV using SED

text: I have a CSV file that contains 10 different fields (`,` is the deliminator). Example data:               student-id,last,first,hwk1,hwk2,hwk3,exam1,hwk4,hwk5,exam2     pts-avail,,,100,150,100,200,150,100,300     991-78-7872,Thompson,Ken,95,143,79,185,135,95,259      I need to swap `field2` and `field3` using `sed` but having a difficult time understanding how to write the regular expression. I have tried along with other variations:               sed 's/\(.*[,]\)\(.*[,]\)\(.*[,]\)/\1\3\2/g' test      In my test file:               abc,def,ghi,jkl     1234,5678,abcd,efgh      It works fine… I have been looking at this for a while and can't figure it out. Anyone able to provide some direction?


title: Two usb wifi adapaters, only wlan0 appears, how to get wlan1?

text: I'm attempting to connect two wifi usb dongles to a debian system, one is to connect to a local lan, the other I plan to use in adhoc mode to connect to a specific device. You could look at this as an attempt to connect two wifi dongles to a linux device to connect to two separate wifi networks at the same time. The USB devices appear to be recognised correctly with no problems. ifconfig reports wlan0 and I was able to setup /etc/network/interfaces so it configures correctly and connects to my lan via my access point. My /etc/network/interfaces is: auto wlan0               iface lo inet loopback     iface eth0 inet dhcp     iface wlan0 inet dhcp          wpa-conf /etc/wpa.config      my /etc/wpa.config is: ap_scan=1 ctrl_interface=/var/run/wpa_supplicant               network={         ssid="###"         psk="##########"     }      Both usb wifi dongles are identical (ASUS EX N) and the first one is recognised and I can configure (as above), while the second one is detected but not recognised as a lan device. Experimenting with dmesg I can find out the following for each usb device: dmesg | grep "usb1"               [    1.841842] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002     [    1.850929] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1     [    1.860403] usb usb1: Product: DWC OTG Controller     [    1.867357] usb usb1: Manufacturer: Linux 3.2.27+ dwc_otg_hcd     [    1.875306] usb usb1: SerialNumber: bcm2708_usb      dmesg | grep "1-1:"               [    2.343158] usb 1-1: new high-speed USB device number 2 using dwc_otg     [    2.563416] usb 1-1: New USB device found, idVendor=0424, idProduct=9512     [    2.572622] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0     [    2.583814] hub 1-1:1.0: USB hub found     [    2.591025] hub 1-1:1.0: 3 ports detected      dmesg | grep "1-1.1:"               [    2.873414] usb 1-1.1: new high-speed USB device number 3 using dwc_otg     [    2.983730] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00     [    2.995145] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0     [    3.078641] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:e8:9f:ac     [   24.257871] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1      dmesg | grep "1-1.2:"               [    3.193382] usb 1-1.2: new high-speed USB device number 4 using dwc_otg     [    3.306387] usb 1-1.2: New USB device found, idVendor=0b05, idProduct=1786     [    3.319133] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [    3.329079] usb 1-1.2: Product: ASUS EZ N Network Adapter     [    3.340862] usb 1-1.2: Manufacturer: Manufacturer Realtek      [    3.349052] usb 1-1.2: SerialNumber: 00e04c000001      I've tried googling but cannot find any info about connecting two wifi dongles to a device. I suspect that I have to somehow apply the drivers (which are obviously already available) and make wlan1 appear, once there then I will be able to figure out the rest. Any help would be appreciated. Added extra information as requested: lsusb:               Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.      Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.      Bus 001 Device 004: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU]      /var/log/messages (sample, presuming this is relevant):               [   13.057545] r8712u: module is from the staging directory, the quality is unknown, you have been warned.     [   13.500489] r8712u: DriverVersion: v7_0.20100831     [   13.783452] r8712u: register rtl8712_netdev_ops to netdev_ops     [   13.791591] r8712u: USB_SPEED_HIGH with 4 endpoints     [   14.027050] r8712u: Boot from EFUSE: Autoload OK     [   15.017889] r8712u: CustomerID = 0x0010     [   15.024091] r8712u: MAC Address from efuse = 30:85:a9:6e:a6:bb     [   15.032267] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"     ...     [   30.073530] r8712u: 1 RCR=0x153f00e     [   30.074269] r8712u: 2 RCR=0x553f00e     ...     [   38.336980] r8712u: [r8712_got_addbareq_event_callback] mac = 58:6d:8f:00:37:45, seq = 0, tid = 0      The mac addy 30:85:a9:6e:a6:bb matches the one from ifconfig, so I am presuming that the r8712u is what is used for the ASUS EX N that is recognised. `ifconfig -a`:               eth0  Link encap:Ethernet  HWaddr b8:27:eb:e8:9f:ac             inet addr:192.168.1.132  Bcast:192.168.1.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:656 errors:0 dropped:0 overruns:0 frame:0           TX packets:453 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:59529 (58.1 KiB)  TX bytes:105486 (103.0 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)          wlan0 Link encap:Ethernet  HWaddr 30:85:a9:6e:a6:bb             inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:418 errors:0 dropped:1 overruns:0 frame:0           TX packets:8 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:111070 (108.4 KiB)  TX bytes:1308 (1.2 KiB)      Please note that while I'm an experienced Unix/Linux user, I'm not very experienced with the kernel and drivers. So please be patient with me. More info: Tried replacing the second wifi dongle with a flash drive. That worked fine. Looking at messages I can see that it detects a usb 1-1.3, which it doesn't detect if I have the second wifi dongle in there.               [    9.443324] usb 1-1.3: new high-speed USB device number 5 using dwc_otg     [    9.945760] usb 1-1.3: New USB device found, idVendor=090c, idProduct=1000     [    9.963268] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [    9.976352] usb 1-1.3: Product: USB DISK     [    9.982674] usb 1-1.3: Manufacturer: SMI Corporation     [    9.992819] scsi0 : usb-storage 1-1.3:1.0      Even more info: I decided to switch the to move the wifi dongle that works to the other usb port and then decided to plug in the other one. Interestingly `lsusb` now states: Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU] Bus 001 Device 005: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU] So it appears to detect both now (no idea why this is different to before). Strangely though wlan1 isn't coming up automatically, not sure why. In `/var/log/messages` I now see:               [    3.173177] usb 1-1.2: new high-speed USB device number 4 using dwc_otg     [    3.296059] usb 1-1.2: New USB device found, idVendor=0b05, idProduct=1786     [    3.305833] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [    3.320060] usb 1-1.2: Product: ASUS EZ N Network Adapter     [    3.331367] usb 1-1.2: Manufacturer: Manufacturer Realtek     [    3.343032] usb 1-1.2: SerialNumber: 00e04c000001     [    3.443224] usb 1-1.3: new high-speed USB device number 5 using dwc_otg     [    3.566236] usb 1-1.3: New USB device found, idVendor=0b05, idProduct=1786     [    3.575638] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [    3.585429] usb 1-1.3: Product: ASUS EZ N Network Adapter     [    3.593239] usb 1-1.3: Manufacturer: Manufacturer Realtek     [    3.601034] usb 1-1.3: SerialNumber: 00e04c000001     ...     [   11.713221] r8712u: module is from the staging directory, the quality is unknown, you have been warned.     [   11.728515] r8712u: module is from the staging directory, the quality is unknown, you have been warned.     [   12.124771] r8712u: DriverVersion: v7_0.20100831     [   12.131967] r8712u: register rtl8712_netdev_ops to netdev_ops     [   12.550340] r8712u: USB_SPEED_HIGH with 4 endpoints     [   12.691051] r8712u: Boot from EFUSE: Autoload OK     [   13.716918] r8712u: CustomerID = 0x0010     [   13.723264] r8712u: MAC Address from efuse = 30:85:a9:6e:a6:c9     [   13.731529] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"     [   13.740279] r8712u: DriverVersion: v7_0.20100831     [   13.750556] r8712u: register rtl8712_netdev_ops to netdev_ops     [   13.760178] r8712u: USB_SPEED_HIGH with 4 endpoints     [   13.774319] r8712u: Boot from EFUSE: Autoload OK     [   14.532517] r8712u: CustomerID = 0x0010     [   14.538717] r8712u: MAC Address from efuse = 30:85:a9:6e:a6:bb     [   14.546902] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"     ...     [   32.273631] r8712u: 1 RCR=0x153f00e     [   32.274494] r8712u: 2 RCR=0x553f00e      Via `ifconfig` I am only seeing wlan1 and not wlan0. Very weird... * * * Changed `ifconfig` to `ifconfig -a` above, output is the same (wlan1 is not shown). If I do a `ifconfig wlan1` then I get:               wlan1: error fetching interface information: Device not found      When I swap them around and `lsusb` is showing all five usb devices (listed above), when I do a `ifconfig -a` I get both wlan0 and wlan1:               eth0  Link encap:Ethernet  HWaddr b8:27:eb:e8:9f:ac             inet addr:192.168.1.132  Bcast:192.168.1.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:117 errors:0 dropped:0 overruns:0 frame:0           TX packets:95 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:12685 (12.3 KiB)  TX bytes:12594 (12.2 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)          wlan0 Link encap:Ethernet  HWaddr 30:85:a9:6e:a6:bb             inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:32 errors:0 dropped:1 overruns:0 frame:0           TX packets:5 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:5674 (5.5 KiB)  TX bytes:1098 (1.0 KiB)          wlan1 Link encap:Ethernet  HWaddr 30:85:a9:6e:a6:c9             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)      and doing a `ifconfig wlan1` shows the wlan1 info as shown above. * * * `ip link show` in the swapped usb device config shows:               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000         link/ether b8:27:eb:e8:9f:ac brd ff:ff:ff:ff:ff:ff     3: wlan1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 1000         link/ether 30:85:a9:6e:a6:c9 brd ff:ff:ff:ff:ff:ff     4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT qlen 1000         link/ether 30:85:a9:6e:a6:bb brd ff:ff:ff:ff:ff:ff


title: Prepend x/ to line where x is a variable on each line

text: I want to add `$x/` from data formatted as `$x-xyz` (`xyz` is a mix of text and number to be ignored). **Example data**               AB-10C     CD-02E      **Output**               AB/AB-10C     CD/CD-02E      How do I describe the variable as text before the hyphen? My idea is:               define $x = # dunno how to do that     ## and then somehow use sed to prepend     sed -i s/$/$x/ file     # I don't know if sed can handle variables though - the above one liner is from Googling      Please advise.


title: Why is my grep + regex not working?

text: I recently decided that enough was enough -- I was going to learn to use grep fluently. It's been all of three hours and I'm already stumped by this toy problem. I'm currently syncing a RAID5 array, the progress of which can be monitored by reading `/proc/mdstat`. The output of `cat /proc/mdstat` is shown below.               $ cat /proc/mdstat     Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md1 : active raid5 sda4[0] sdb4[1] sdc4[2]           5858765824 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]           [=============>.......]  resync = 67.3% (1972073120/2929382912) finish=205.7min speed=77537K/sec          md0 : active raid5 sda3[0] sdb3[1] sdc3[2]           998400 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]          unused devices: <none>      For fun, I thought I would use `watch` to monitor `/proc/mdstat` in real time, pipe it's output into grep, and show only the estimated remaining time. My approach is as follows: `watch cat /proc/mdstat | grep finish=\d+\\.\d | grep \d+\\.\d` I'm stumped as to why this produced no output. In fact, the first grep expression produces no output, even though it seems to work on Regex101. What am I doing wrong?


title: Qt application gray on OpenBox when launched from autostart.sh

text: I have a Qt application, I have added it to `~/.config/openbox/autostart.sh` like this:               (sleep 5 && /home/user/UI/UI) &      When I start Openbox from terminal, the Qt application opens as a unusable gray box. If I launch xterm on Openbox and then manually start the Qt application, it works fine. What am I doing wrong?


title: Force wget to download only from HTTPS?

text: wget https://skype.com -O - > /dev/null      isn't good. I just want to create a short bash script to check that an HTTPS cert is valid or no. i think wget doesn't connects if the cert is invalid. i just need a parameter? to wget to only work on HTTPS! are there any?


title: Windows 8 style window manager for Linux

text: Are there any windows managers out there for Linux that offers the "metro" style window management that Windows 8 offers? Actually it's not just Windows 8 that offers the style I'm looking for. iOS, Android and tablets in general seem to take a simpler approach to window management that I'm attracted to. I've heard about tiling managers, which I suspect might be what I am looking for, but from this post I get the impression that they are most often geared for more experienced users who are willing to spend the time to really customize their environment. Are there such window managers for the less apt user?


title: How to recompile exim4-daemon-heavy?

text: I have had a few problem with exim4 and various phone mail clients (Windows Phone in particular) that seem to result from bad mail clients together with GnuTLS. I'd like to recompile exim4-daemon-heavy to use OpenSSL to see if that helps anything. Now, I've gotten used to debian's packaging system and am unsure on how to do this. I've downloaded the exim4 source using `apt-get source exim4`. I then edited the file Debian/rules to uncomment `OpenSSL = 1`. Then I tried `make`, but was told that I need to copy the template `src/EDITME` to `Local/Makefile` and edit it to my taste. My taste would be a drop-in replacement for the existing and running exim4-daemon-heavy, just using OpenSSL. And here I am stumped as there are quite a lot of options there and I don't like to break my email setup more than neccessary. So... what can I do to make this test?


title: tail -f, but with line numbers

text: I'm trying to see how many times `foo bar` appears in `/var/log/foo.log` within an arbitrary amount of time on a remote server, but nothing that I've tried so far has worked. I've already got a timer script that I use to keep track of how long it has been since I started tailing `/var/log/foo.log`, and now I'd just like a way to tell how many times `foo bar` has appeared in the tailed output. I searched google, but I didn't find anything pertinent within the first 10 pages of results. Here's what I've tried with frustrating results:               ## works on local machine, but doesn't work as expected on remote     tail -f /var/log/foo.log | grep foo\ bar | sed '='          ## works on local, but not remote     tail -f /var/log/foo.log | grep foo\ bar | cat -n -          ##  works on local, but not remote     tail -f /var/log/foo.log | grep foo\ bar | awk -F'\n' '{printf "[%d]> ", NR; print $1}'      I even tried to write a sed script that'd act like `tail -f`, but I made limited-to-no headway with that. **NOTE** the remote server is running an older version of coreutils, and upgrading is an option, but is **NOT** in any way the desired solution.


title: LXDE: How to run a program/command when I press one or more keys?

text: I have a numpad on my keyboard and I want to make the keys do something when (the otherwise useless) `ScrollLock` is on under LXDE graphical environment. For example, I want to run my browser when I press `7` and `ScrollLock` is on. Another example is to open the tile manager when I press two or more mouse keys at once.


title: What is the purpose of Local Folders in Kmail and can they be removed?

text: Using a fresh install of Kontact under KDE 4.8, I have found that there is a default "Local Folders" Akonadi resource that can not be removed (or rather as soon as it is removed, it is immediately recreated). It automatically points to `~/.local/share/local-mail`, which is a maildir. I am already using a local maildir directory (at `~/.mail`) as a separate Akonadi resource, so I have no need for this pre-created "Local Folders". There also appears to be a concept of `SpecialCollectionAttributes` in Akonadi to mark certain mail folders as `Inbox`, `Outbox`, `Sent` and so on. Kmail provides no means to change which directories are marked with these "special" flags. In my setup, I can see the need for designating which of my directories should be used for certain purposes. What I'd like to know is what purpose was envisioned for "Local Folders" and how I can avoid using them in favour of my own designated "special folders".


title: ChrUbuntu on a samsung arm

text: I just installed Chrubuntu on my Samsung ARM Chromebook and after it finished downloading in the developer console my computer rebooted. It just started up in the normal Chrome startup. I still haven't figured out what to do and would love to hear if anyone can help me at all...


title: Boot Linux system from a subdirectory on a partition?

text: I would like to try to set up a computer so that it has multiple Linux installs all in the same filesystem. For example, the filesytem would have 3 folders: `/Ubuntu_Precise`, `/Ubuntu_Oneiric`, and `/Ubuntu_Natty`. (I know you can do this with BTRFS and subvolumes, but I would like to use EXT4 for speed). I once set up multiple installs of different distros using BTRFS, and from getting that working, I know Grub does just fine with booting the vmlinuz and initrd image from 'nonstandard' paths. But when I was doing the BTRFS thing, there was the `rootflags=subvol=@<subvolume_name>` that told the kernel to mount that subvolume as / in the filesystem. Is there any argument that you could pass the kernel that would make it bind mount a subfolder in a partition as / and then boot? I think for the other parts, I'm fairly close. I know how to specific a bind mount in `/etc/fstab`. Also, from when I set up my system with multiple linux installs in BTRFS subvolumes, I'm used to installing a distro in a VM and then migrating it using rsync, so I'm not too worried about what I would need to do to get the right configuration, I'm just trying to find out what the right configuration would be. Once I know that, I should be able to do the migration into the subfolders and file editing easily enough. I already know about virtualization and partitions, but that's not what I'm looking for. The target computer does not have enough power to do virtualization, and partitions do not share free space. I'm looking to set up a system that dual/triple/quad/etc boots linux distros, but that does it with one filesystem, so that there is no case of "I have free space, but it's in the wrong partition!' If anyone has suggestions how to edit my question or its title to be clearer, I'm all ears.


title: How to 'ls' current directory (which is under svn) files info (path)?

text: How can I sort of list current directory contents (including sub-directories recursively) (which is under svn) files info (path relative to current dir)? I want this to get log in format like:               none|main.lua     none|src/main.h      I wonder if it is possible and how to do such thing using svn and bash?


title: Run an SSH command on two hosts whose name comes from another command

text: So what I'm trying to do should be fairly simple but I can't seem to figure it out. I need to kill a certain process on different boxes, they all have a defined IP range although they will eventually change. Let's say for example,               arp |sort |awk '{print $1}'|grep 10.20.30.18 # IP's range from 180 to 189 so this does the trick      output is               xxx.xxx.xxx.180     xxx.xxx.xxx.181      So I want to SSH into both and do               ps -ef | grep X11 | grep -v grep | awk '{print $2}' | xargs kill      How would I go on about this without having to SSH into each one and then killing the process?


title: mpd daemon prematurely ending jobs

text: I am a little out of my depth here so bear with me. I am trying to configure mpirun and mpiexec to run software called Materials Studio on a 1 node, 2 processor, 12 core cluster. The submission scheme is PBS. I had everything set up properly (with some help) and where I could submit jobs and they would work well but after a few days I ran into issues where I would get this sort of error: mpiexec_server.org: cannot connect to local mpd (/tmp/mpd2.console_user); possible causes: 1. no mpd is running on this host 2. an mpd is running but was started without a "console" (-n option) It seemed like the daemon for mpd was somehow set up but eventually terminated. I had luck adding this (bold part) to my submission script:               export PATH=/data1/opt/MD/Linux-x86_64/IntelMPI/bin:$PATH          export LD_LIBRARY_PATH=/data1/opt/MD/Linux-x86_64/IntelMPI/lib:/data1/opt/MD/Linux-x86_64/IntelMPI/bin:/data1/opt/MD/Linux-x86_64/IntelMKL/lib          **mpdboot -n 1 -f ~/mpd.hosts**          nohup mpd &          /data1/opt/MD/Linux-x86_64/IntelMPI/bin/mpiexec -n 6 /data1/opt/MD/2.0/TaskServer/Tools/vasp5.3.3/Linux-x86_64/vasp_parallel      The job now submits and runs properly but times out after 30 minutes or so. I tried adding '-r ssh' without quotes to the end of the mpdboot line but I am not sure if that is the right strategy to take. Also, I am a little confused about why I need to run this daemon in this script and why I need to call a hosts file when I run- I thought that PBS creates that when the job picks up. Could anyone please give me some advice on where to go next? Basically how can I prevent a job that is running from quitting because of something to do with the mpi daemon. EDIT: Could anyone shed any light on what is involved with running that mpiexec that I have on the last line? If I properly link to the folder where it is, do I need to run a boot command? I must admit that I am confused why I need to run mpdboot/mpd when then whole point of mpiexec is to eliminate the need for mpd (at least according to the mpiexec website).


title: Two pipes to one command

text: I am little bit confused by the following syntax. Although it works, It do not understand why it works. It seems, like there are two pipes attached to the diff command. But isn't there only one `STDIN`? Examples:               diff <(echo "foobar") <(echo "barbaz")     diff <(cat foo.txt) <(cat bar.txt)


title: Changing the order of workspaces in Gnome Shell

text: In Gnome Shell, is it possible to change the sequence of workspaces by using drag-and-drop? For instance, is it possible to make Workspace 2 the uppermost one by dragging it above Workspace 1 (which currently is the uppermost one)? Please take a look at the image to see what I mean: ![Dragging a workspace](http://i.stack.imgur.com/2CTnK.jpg)


title: Why is JFS so obscure?

text: When I first got into using Slackware years ago I quickly learned to love JFS over ext3 or reiserfs given that it was reliable and if there was an unclean shutdown, its disk checking was very very quick. It's only been recently that I've found out that JFS is obscure to the point of being almost completely unmaintained by anyone. I had no idea I was in such a minority. Why is it that this happened? Is it that filesystem technology has since advanced to the point that JFS now lacks any comparative advantages? Is it that ext3 was more interoperable with other operating systems? Was a particular other filesystem blessed by a particular vendor or the kernel developers? Not so much a technical question as a historical one.


title: How to make ldapsearch working on SLES over tls using certificate?

text: We need to connect our php script to LDAP over tls using a certificate. LDAP connection works nicely without tls. More details here http://stackoverflow.com/questions/15260252/how-to-use-multiple-tls- certificates-for-ldap-from-php-zend We managed to connect via tls from Windows using Softerra LDAP Browser. It asked us to install a certificate and whether we trust it. My end result is to be able to authenticate with LDAP using TLS from php. I have been given a certificate of type .cer. It comes from a Windows Exchange machine. From what I can see SLES supports .pem certificates. So my question is ... **Q1: Do I need to convert from .cer to .pem** first before I can install the certificate on the client (which is SLES server) and finally **Q2: what is the best way to install this certificate on the server so my php application can access it and do its job**. Note that on the SLES server we need to connect to different LDAP servers. At present if we run               ldapsearch -H ldaps://localhost:9215 -W      we get               Enter LDAP Password:      ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)     additional info: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (unable to get local issuer certificate)      I found lots of good info here http://www.php.net/manual/de/function.ldap- connect.php#36156 and especially this sentence is important in my eyes `Once you've gotten the ldapsearch tool working correctly PHP should work also.` * * *   * SUSE Linux Enterprise Server 11 (x86_64)   * ldapsearch: @(#) $OpenLDAP: ldapsearch 2.4.26 (Sep 26 2012 13:14:42) $ abuild@baur:/usr/src/packages/BUILD/openldap-2.4.26/clients/tools (LDAP library: OpenLDAP 20426)


title: remount chrooted read-only subdirectory (non-mountpoint) to read-write from within jail?

text: I'm trying to do the same of this question (multiple linux installation on same filesystem) but I get this result (root filesystem mounted as read-only) . I'm using debian/sid, have successfully modified the initrd /init script and patched the busybox switch_root to chroot into a subdirectory, the filesystem is ext4. The kernel boot but the filesystem is mounted read-only and any variant of mount -o rw,remount fail. I just guess (not investigated yet) the mount command is unable to resolve the new root / with the old /mountpoint. Mounting the filesystem as read-write before chrooting (as the second link suggest) is just a ugly workaround, I would like to know if there's a better way do remount rw properly from within the chroot.


title: List the bash completion that's current active on a program?

text: Is there anyway to list the bash completion function in use for current command ? e.g for `ls`


title: Error QProcess: Destroyed while process is still running

text: **Edit:** _I discovered that the problem is not related with the script cited below, but I'll leave it there just for history._ Well, this error appears when I close texstudio **with the viewer open** (xdvi or evince). If I close the viewer first and then close texstudio, no problem, no errors on the terminal. This is the error:               QProcess: Destroyed while process is still running.      * * * **Old text:** Every time when I close my texstudio after opened by my script below I got this error on the terminal:               QProcess: Destroyed while process is still running.      Here is the script `fastex.sh`               #!/bin/sh          # Copyleft 2012 by Sigur          caminho=/home/$USER     file=$caminho/fastex-temp     exec 3>&1     exec > "$file".tex     printf '\\documentclass[11pt,a4paper]{amsart}\n'      printf '\\usepackage{amsfonts,amsthm,amsmath,amssymb}\n'      printf '\\usepackage[latin1]{inputenc}\n'      printf '\\usepackage[T1]{fontenc}\n'      printf '\usepackage{tikz}\n'     printf '\usepackage[brazil]{babel}\n'     printf '\n'      printf '\\begin{document}\n'      printf '\n'     printf '\\end{document}'           linha=$(wc -l < "$file".tex)     texstudio --line $linha  "$file".tex     find . -name  "fastex-temp.*" | grep -vP '.tex$|.pdf$' | while read -r i; do rm $i; done      I guess that the problem is with the `find` command to delete auxiliary files. So, is `find` executed only after I close texstudio? Thanks for a while. Best wishes. **Edit** ![enter image description here](http://i.stack.imgur.com/OprKx.png)


title: Where would additional IP addresses assigned to a NIC be configured on CentOS 4.4?

text: I have a very old CentOS 4.4 machine with multiple IP addresses assigned to `eth0`. However these ip addresses are not configured in `/etc/sysconfig/network-scripts` where I would expect them to be i.e.               ifcfg-eth0:0     ifcfg-eth0:1     ifcfg-eth0:2      ...and so on. `ifconfig` shows:               eth0      Link encap:Ethernet  HWaddr 00:0F:4B:09:FE:39               inet addr:#.#.#.98  Bcast:#.#.#.127  Mask:255.255.255.224               inet6 addr: fe80::20f:4bff:fe09:fe39/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:361746101 errors:0 dropped:0 overruns:0 frame:0               TX packets:3276279311 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:2539629048 (2.3 GiB)  TX bytes:2436041815 (2.2 GiB)          eth0:1    Link encap:Ethernet  HWaddr 00:0F:4B:09:FE:39               inet addr:#.#.#.99  Bcast:#.#.#.127  Mask:255.255.255.224               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          eth0:2    Link encap:Ethernet  HWaddr 00:0F:4B:09:FE:39               inet addr:#.#.#.104  Bcast:#.#.#.127  Mask:255.255.255.224               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          eth0:3    Link encap:Ethernet  HWaddr 00:0F:4B:09:FE:39               inet addr:#.#.#.105  Bcast:#.#.#.127  Mask:255.255.255.224               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1      (I've replaced the first three octets with `#` to protect the innocent) But I'm at a loss as to where these are being configured. I've also checked:               /etc/sysconfig/networking/devices     /etc/sysconfig/networking/profiles/default     /etc/sysconfig/network      I've also done a `find / -name eth0*` but to no avail. What other locations would these additional addresses be configured?


title: How to repair the boot selection on grub?

text: I had installed on my computer as a dual-boot: Debian Squeeze and Windows XP, so I decided to install Windows 8 just to test and then I would remove it and install in its place Debian Wheezy as dual-boot with Windows XP, that was already installed. During the Debian Wheezy installation, I deleted the Windows 8 partition to install Debian W. on its place. The problem is, that after the installation finished I rebooted the computer and on the grub menu was written: Debian Wheezy and Windows 8 (loader) - this Windows 8 (loader) is a boot manager as grub, and after the Win8 installation I was capable of choose between Win8 and WinXP. And when I select Windows 8 (loader) it says the Windows 8 is corrupted and is not possible to boot Windows XP. So, after that, **I would like to know, how can I get Windows XP on the grub menu?** Because I know its there (the Windows XP), but I can not boot it from grub. **Observation:** I already tried `update-grub`, but it only finds Debian W. and Windows 8.


title: Value assigned inside a function variable is alway empty

text: I have a following simple script. In this script, I am assigning value to a global variable inside a function. I can clearly see that the value being assigned to the variable via debug statement. However, when I echo the variable at the end, it's always empty.               function getValue()     {     local key=$1     local configFile=$2     keyValuePair="$(egrep "$key" "$configFile")"           if [ ! "$?" -eq 0 ]     then         echo "Cannot find the value for the specifed key"         return 1;        fi          value="$(cut -d"=" -f"2" <<< "$keyValuePair")"     echo "$value"     return 0;     }     function configuer()     {     if [ ! -f "$RMCFGFILE" ]     then         echo "Cannot file RMGCFG file."         return 1;     fi          #Recyclebin configuration     value=$(getValue "recyclebin" $RMCFGFILE)     if [ ! "$?" -eq 0 ]     then         echo "$value"         return 1;     fi          RECYCLEBIN="$value" **#### I am assigning here**     return 0;      }     RECYCLEBIN=     RMCFGFILE="/home/sas/.rm.cfg"     LOCALEFILE=""     CONFIG_RESULT=$(configuer)          if [ ! "$?" -eq 0 ]     then     echo "$CONFIG_RESULT"     exit 1;     fi          echo "Configuration success"     eval echo "Recyclebin: ${RECYCLEBIN}" **##No value**      Anyone see what's going wrong here??


title: Usable screencast tool for Linux?

text: ..under windows.. I think Camtasia studio is the best screen recorder. But I just cant find any good tool for Linux (to be exact: Scientific Linux). What are the best tools for recording the screen?


title: EST/REL or REL/EST in iptables firewall scripts?

text: -A INPUT -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT      every Firewall rule usually starts with this. **Q:** Does it matter that is it RELATED,ESTABLISHED OR ESTABLISHED,RELATED?


title: How to clean up dual ESP partition mess

text: My initial setup:   * Lenovo U510 Ultrabook    * HDD + SSD (used by ExpressCache)    * UEFI + SecureBoot enabled    * Windows 8 preinstalled  My goal was to create a nice dualbooting setup for Windows 8 and Fedora 20.   1. I installed Fedora 20 without turning of SecureBoot of 3 new partitions (root, boot, home). Grub couldn't see the Windows boot partition, Fedora worked fine.    2. I installed rEFInd bootloader to fix this, as it scans whole HDD for possible boot points. (I probably could've just manually set things in grub, but I chose the easier way).    3. My boot sequence looks like this: rEFInd -> "Windows 8 Boot" from it's partition OR "Fedora 20" boot which starts grub, giving me choices I've had before installing refind (Fedora, rescue, and "Windows Boot Manager" - entry which woulnd't load, as the path is wrong or something)  The Issue(s): I'd like to have only one bootloader working (`refind` looks like a good choice), with no `grub`, everything SecureBooting properly. Also I'd like to put all bootloaders onto one partition (the Windows one), to reduce the partition count without reinstalling anything. **How should I proceed?** Details:               [root@lenovo refind]# parted /dev/sdb print     Model: ATA ST1000LM024 HN-M (scsi)     Disk /dev/sdb: 1000GB     Sector size (logical/physical): 512B/4096B     Partition Table: gpt     Disk Flags:           Number  Start   End     Size    File system  Name                          Flags     1       1049kB  1050MB  1049MB  ntfs         Basic data partition          hidden, diag     2       1050MB  1322MB  273MB   fat32        EFI system partition          boot, hidden     3       1322MB  2371MB  1049MB  fat32        Basic data partition          hidden     4       2371MB  2505MB  134MB                Microsoft reserved partition  msftres     5       2505MB  318GB   316GB   ntfs         Basic data partition     6       318GB   318GB   210MB   fat16        EFI System Partition          boot     10      318GB   319GB   524MB   ext4     11      319GB   489GB   170GB                                              lvm     7       489GB   490GB   367MB   ntfs                                       hidden, diag     8       490GB   979GB   489GB   ntfs         Basic data partition     9       979GB   1000GB  21.5GB  ntfs         Basic data partition          hidden, diag          * `sdb6` is /boot/efi (fat16 - can't enter it's directories, but I can modify them)    * `sdb6` directory tree: http://pastebin.com/nKJyyY7X   * `sdb2` is where /EFI/Microsoft/Boot/bootmgfw.efi resides (I assume this is the windows bootloader, because this is the "SYSTEM_DRV" partition from which refind boots windows)    * `sdb2` dir tree: http://pastebin.com/QHHUkMki Currently available options in `refind`:   * Boot Microsoft EFI boot from SYSTEM_DRV => boots correctly    * Boot EFI\BOOT\fallback.efi from 199 MiB FAT volume    * Boot EFI\fedora\grubx64.efi from 199 MiB FAT volume => boots grub    * Boot EFI\fedora\gcdx64.efi from 199 MiB FAT volume    * Start MS recovery on LRS_ESP => sdb3    * MokManager Options in grub:   * Fedora (various kernels) => boots fedora (finally)    * Windows Boot Manager => gives error: `file /EFI/Microsoft/Boot/bootmgfw.efi not found, you need to load the kernel first` `EFI` order in BIOS: `rEFInd`, Fedora, Windows Boot Manager


title: Why am I getting inconsistent IP values from icanhazip.com or curlmyip.com?

text: I wrote a bash script and appended to my crontab to query my IP address every minute, and if it is not the same with the previous query it sends me an e-mail to inform me for the IP address change. But there's a strange thing. As it queries constantly every minute for the IP address, from time to time ( very frequently )it sends me irrelevant IP addresses. What can be the reason for this? ![enter image description here](http://i.stack.imgur.com/q4TJF.jpg)


title: mptscsih: ioc0: task abort: SUCCESS (rv=2002) causes 30 seconds freezing

text: I/O to my software RAID6 often freezes for around 30 seconds after which everything is back to normal. After the freeze is over this is put into syslog:               Mar 14 18:43:57 server kernel: [35649.816060] sd 5:0:23:0: [sdy] CDB: Read(10): 28 00 6c 52 68 58 00 04 00 00     Mar 14 18:43:58 server kernel: [35651.149020] mptbase: ioc0: LogInfo(0x31140000): Originator={PL}, Code={IO Executed}, SubCode(0x0000) cb_idx mptscsih_io_done     Mar 14 18:43:58 server kernel: [35651.151962] mptscsih: ioc0: task abort: SUCCESS (rv=2002) (sc=ffff8807b02dfe80)     Mar 14 18:43:58 server kernel: [35651.151967] mptscsih: ioc0: attempting task abort! (sc=ffff88002a7f30c0)     Mar 14 18:43:58 server kernel: [35651.151972] sd 5:0:23:0: [sdy] CDB: Read(10): 28 00 6c 52 6c 58 00 04 00 00     Mar 14 18:43:58 server kernel: [35651.151981] mptscsih: ioc0: task abort: SUCCESS (rv=2002) (sc=ffff88002a7f30c0)     Mar 14 18:43:58 server kernel: [35651.151984] mptscsih: ioc0: attempting task abort! (sc=ffff8804120e5ec0)     Mar 14 18:43:58 server kernel: [35651.151988] sd 5:0:23:0: [sdy] CDB: Read(10): 28 00 6c 52 70 58 00 04 00 00     Mar 14 18:43:58 server kernel: [35651.151996] mptscsih: ioc0: task abort: SUCCESS (rv=2002) (sc=ffff8804120e5ec0)     Mar 14 18:43:58 server kernel: [35651.151999] mptscsih: ioc0: attempting task abort! (sc=ffff880154afb280)     Mar 14 18:43:58 server kernel: [35651.152020] sd 5:0:23:0: [sdy] CDB: Read(10): 28 00 6c 52 74 58 00 04 00 00     Mar 14 18:43:58 server kernel: [35651.152029] mptscsih: ioc0: task abort: SUCCESS (rv=2002) (sc=ffff880154afb280)      I have googled the error and someone suggested trying using 1.5Gbps instead of 3.0Gbps. Using `lsiutil` I changed the link speed:               # lsiutil -p 1 -i           Firmware Settings     -----------------     SAS WWID:                       500605b002c0f680     Multi-pathing:                  Disabled     SATA Native Command Queuing:    Enabled     SATA Write Caching:             Enabled     SATA Maximum Queue Depth:       32     Device Missing Report Delay:    0 seconds     Device Missing I/O Delay:       0 seconds     Phy Parameters for Phynum:      0    1    2    3    4    5    6    7       Link Enabled:                 Yes  Yes  Yes  Yes  Yes  Yes  Yes  Yes       Link Min Rate:                1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5       Link Max Rate:                1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5       SSP Initiator Enabled:        Yes  Yes  Yes  Yes  Yes  Yes  Yes  Yes       SSP Target Enabled:           No   No   No   No   No   No   No   No       Port Configuration:           Auto Auto Auto Auto Auto Auto Auto Auto     Target IDs per enclosure:       1     Persistent mapping:             Enabled     Physical mapping type:          None     Target ID 0 reserved for boot:  No     Starting slot (direct attach):  0     Target IDs (physical mapping):  8     Interrupt Coalescing:           Enabled, timeout is 16 us, depth is 4      That did not help. I tried changing 'Device Missing I/O Delay' to 32. That did not help either. I tried changing /sys/class/scsi_device/*/device/timeout from 30 to 100 and then to 3. All failed.               $ uname -a     Linux server 3.2.0-0.bpo.1-amd64 #1 SMP Sat Feb 11 08:41:32 UTC 2012 x86_64 GNU/Linux     $ grep LSISAS1068E /var/log/messages     Mar 13 15:47:44 server kernel: [   21.082363] scsi5 : ioc0: LSISAS1068E B3, FwRev=01210000h, Ports=1, MaxQ=483, IRQ=45     $ modinfo mptscsih     filename:       /lib/modules/3.2.0-0.bpo.1-amd64/kernel/drivers/message/fusion/mptscsih.ko     version:        3.04.20     license:        GPL     description:    Fusion MPT SCSI Host driver     author:         LSI Corporation     srcversion:     85D42A00FEBA3C95555E3AF     depends:        scsi_mod,mptbase     intree:         Y     vermagic:       3.2.0-0.bpo.1-amd64 SMP mod_unload modversions      $ cat /sys/block/sdae/device/model     ST3000DM001-9YN1     $ cat /sys/block/sdae/device/rev     CC4C      The problem happens extremely rarely if there are only read or write operations: I can read or write 1 TB with no problem. The problem seems to arise when there are **both** read and write operations. On a raid6 that happens if you write a file smaller than stripe size and you do not have the stripe cached already (in which case the stripe must be read to compute new checksum). The system is not a virtual machine. What is causing the problem? How do I get rid of the 30 seconds of freezing? **Edit: additional testing** I have found a nice test set that seems to provoke the problem. It contains files that are smaller than the stripe size thus forcing recomputation of parity thus forcing a lot of reads combined with the writes. I must admit that I did not think that the queue scheduler would have any effect on this problem. I was wrong. It is clear that `deadline`is much worse than the others. None of them solve the problem, though.               # cat /sys/block/sdaa/queue/scheduler     noop deadline [cfq]      Changing scheduler to `noop` causes the problem to arise after 100-120 secs.               parallel echo noop \> {} ::: /sys/block/sd*/queue/scheduler      Changing scheduler to `deadline` causes the problem to arise after 20-30 secs.               parallel echo deadline \> {} ::: /sys/block/sd*/queue/scheduler      Changing scheduler to `cfq` causes the problem to arise after 120-300 secs.               parallel echo cfq \> {} ::: /sys/block/sd*/queue/scheduler      **Edit2** Since the scheduler has an effect I am thinking if the problem is caused by too many requests in a timeframe. Can I somehow throttle the number of requests sent per second?


title: What's faster, dd 1.5TB or rsync 500GB?

text: I need to save data from a failing hard drive. Sounds like ddrescue or myrescue (or maybe clonezilla?) will be my best friends here, but I'm just wondering what will likely be faster:   1. using dd/ddrescue/myrescue/clonezilla to simply clone the failing drive to a new drive of identical capacity   2. using rsync/tar/cp to move files from the failing drive to a new drive ? dd-ish choices avoid moving data back and forth between kernel-space and user- space, right? But rsync and others avoid moving empty space, right? Another oddly fortunate bit if I choose a dd-ish solution: the failing drive is currently mounted read-only (part of the failure process, I think) so I guess I don't have to worry about data changing while I'm dd'ing. This is the root partition, so dd would be handy in that I should be able to boot the new drive after it completes.


title: Possible to find out the sizes of data types (int, float, double, ...) on a system, without writing a C program?

text: Is it possible to find out the sizes of data types (int, float, double, ...) on a Linux system, without writing a C program? Would the results for C same as for C++, and other programming languages in the same Linux system?


title: limit stdout to terminal output speed

text: > **Possible Duplicate:**   >  How can I limit the output speed of stdout? What's the easiest way to limit the speed at which stdout is output in a terminal, so that, for instance, `tail -f` outputs content at the speed at which a human could read it? I've tried changing the output baud rate of the current terminal (`stty -F $(tty) ospeed 110`), but the output still seems to be a the same speed. I've tried sending it trough `pv -L`, but it garbles the output.


title: Why Ubuntu 12.04LTS stopped at "could not write bytes : broken pipe"

text: When I update the system, and reboot the machine, it stopped at: > "could not write bytes:broken pipe". I could not login into the system through the `lightdm`, but when I change to the `gdm`, it works. If I use `Ctrl`+`Alt`+`F1`, and input `sudo lightdm`, it works too. Then I write `/usr/sbin/lightdm` into the `.bashrc` file, but the message displayed again. Is there somebody having the same problem？


title: What's the best strategy to catch mystery process?

text: I have running processes on my server that get killed every night at midnight. It's at work, I'm not around when it happens and I don't have remote access. The kill occurs very predicably at 23:59 every night. I know this because when I arrive the next day:   * Processes are up until 23:59   * Logs of the process show last modified time of 23:59 (and new dated log is started right after). Since the killing occurs at the same hour, I strongly suspected a batch job. I went through the `crontab`s of all our machines and couldn't find anything. Clearly I'm missing something. I am thinking of laying out a surveillance script that would report the output of `ps` intermittently, would be launched with `at` a few minutes before and would loop for a little while. This idea seems weak and highly error prone, so I'm wondering if anyone has a better idea. **More details:**   * The universe is a very large and very old legacy system; no one in my team seems aware of such a process (if anyone did, she'd be in our team) although the larger organization consists of thousands of employees, a lot of them would theoretically have access to this (I don't see why they would). In other words, security isn't very tight.    * Environment consists of multiple machines running Solaris 10.   * It's not a production environment, so timeout or down time isn't critical.   * I'm not excluding the possiblity that the killing might not be due to a batch job, although unlikely because of how accurate the timing is.   * Clearly, there are defficiencies in our bookkeeping, so anything imagineable is possible.  My question is what's the best strategy to adopt? It falls under the greater umbrella of "the joy of working on legacy systems". I'm starting to work on my script that I'll post here shortly for feedback. In the meanwhile if anyone has a better idea, please say so.


title: installed teamspeak 3 on freebsd using portinstall but can't connect

text: I installed teamspeak 3 on freebsd 7 using portinstall. When i do service teamspeak status i see teamspeak is running but somehow I cannot connect to the server. did I miss something? I followed this tutorial:               # portinstall teamspeak3-server     added teamspeak_enable="YES" to /etc/rc.conf      found on: http://blog.dev001.net/post/5492274720/installing- teamspeak-3-server-on-freebsd


title: Utility to easily extract archives

text: A while back I came across a utility that you could pass an archive to and it would not only take care of figuring out the unarchiver to use, but use the correct command line options, and ensure that the contents of the archive ended up in their own directory instead of being extracted to the cwd. I can't seem to remember what the utility is called, however, but it was very useful and I am hoping someone knows what it was called.


title: Remove many many many files from a folder

text: I have a folder with 137795 files in it. I need to delete all of them. When I run `rm *` I get `-bash: /bin/rm: Argument list too long`. How do I get past this error?


title: Slow start of Midnight Commander on CentOS

text: Is there any way to prevent `mc` from taking 10-30 seconds to open? Never seen this with Debian.


title: removing an OU from a record on OpenLdap Database

text: I am trying to remove "ou=ABCD" from this ldap record:                  # testing@mydomain.net, ABCD, Active, Member, myldapdomain.org        dn: uid=testing@mydomain.net,ou=ABCD,ou=Active,ou=Member,dc=myldapdomain,dc=org        uid: testing@mydomain.net        cn: testing@mydomain.net        mail: testing@mydomain.net        mydn: 012348        middleName: middleName        sn: McManum        class: Member        status: A        branch: Philadelphia        securityAnswer: Skippy        securityQuestion: First pet's name?        givenName: James        userPassword:: easdfafy8xUksdeti23MMW1asdfqbl123HBdfa0a9        objectClass: top1        objectClass: person        objectClass: AbcPerson        objectClass: AbcUser      input.ldif                 dn: uid=testing@mydomain.net,ou=ABCD,ou=Active,ou=Member,dc=myldapdomain,dc=org       changetype: modify      Executing the following statement :                 ldapmodify -v -h localhost -x  -D "cn=admin,dc=myldapdomain,dc=org" -w mypassword -f < input.ldap      Getting the following error:                 ldap_initialize( ldap://localhost )       delete :ABCD       modifying entry "dn:id=testing@mydomain.net,ou=ABCD,ou=Active,ou=Member,dc=myldapdomain,dc=org"       modify complete       ldapmodify: Undefined attribute type (17)       additional info: ABCD: attribute type undefined


title: Where should I place my websites files with multiple vhosts?

text: If vhosts are enabled, where should I place my website files?   1. `/home/aunser/www`   2. `/var/www/site1`, `/var/www/site2`   3. `/usr/local/website/site1`, `/usr/local/website/site2` the systems is CentOS 6.x/RHEL 6.x,SELinux enabled.


title: Linux freezing guess: keyboard & mouse (Archlinux and Ubuntu)

text: Linux on my PC is freezing a few seconds after startup. I am unable to use the mouse / keyboard. Neither Ubuntu nor Arch do anything after a few seconds. Windows has been running fine for years now. Found so far:   * When I installed Archlinux, everytime I would fire up my PC it would start filling the console with these characters: ^@6^@6^@6^@6^@6... I had to press half the keyboard for it to go away. I think this has to do with the underlying Linux not with a specific distro.    * When the PC starts and I don't touch anything It wont freeze. I let it on untill I had to relogg, I was able to log in (Keyboard worked). Mouse was moving but I couldn't click anything. Shortly after keyboard was not usable anymore. I have:   * Unplugged the Keyboard and plugged it into different USB hubs.    * USB Keyboard & mouse (Logitech G710+, Logitech G500) both with cable.   * Asus Rampage 2 Extreme motherboard (http://www.asus.com/ROG_ROG/RAMPAGE_II_EXTREME/)   * Ubuntu 12.04, 14.04, and Archlinux (used gnome and K).    * Keyboardlayout: Swiss German with Sun Accent   * Tryed another usb and a PS/2 Keyboard   * No USB 3 on my Mainboard   * The Keyboard is plugged directly into the motherboard, changed to different USB ports already.   * Enabled legacy keyboard support   * Turned EHCI off I can't test things on Linux because it will freeze shortly after start (after the GUI loaded) whatsoever I have access to the drive.


title: CentOS, Apache Vhosts enabled,but DOCUMENT_ROOT cant towards /home/auser/website/www1

text: # environment > CentOS 6.5 x86_64   >  Apache2.4.9 _(locate=/usr/local/apache2)_   >  PHP 5.5.13 _(locate=/usr/local/php5)_   >  Apache vhosts enabled.   >   > **site1** > > domain=localhost   >  path=/usr/local/apache2/htdocs   >  rst=OK   > **site2** > > domain=phpmyadmin   >  path=/usr/local/apache2/htdocs/phpmyadmin   >  rst=OK   > **site3** > > domain=phpmyadmin3   >  path=/home/default7/website/phpmyadmin   >  rst=You don't have permission to access /   > **site4** > > domain=mysite1   >  path=/home/default7/website/mysite1   >  result=You don't have permission to access /   > When i turned off selinux,403 as the same.


title: Codeswarm visualization: how to quickly setup OpenGL rendering mode on Linux (Archbang x86_64)?

text: The Codeswarm project provides a software project repositories visualization tool in Java. The software leverages the commit information from a log generated from a repository that you clone locally. The rendering illustrates the sequencing of how files "pass" - as a token so to speak - from one contributor to another, and grow in size as changes are made. Color coding is applied to specified file extensions to differentiate visually from one programming language to another, or from code to docs or images etc. This is a sample screenshot using the Ruby `git` repository: ![enter image description here](http://i.stack.imgur.com/VX8lj.jpg) Support is available for the following "types" of (D)VCS: Subversion, CVS, Git, Mercurial, Perforce, VSS, Starteam, Wikiswarm, Darcs. It may be helpful to summarize the **process** involved with using this software from scratch:   1. Make sure we have the required software     * `apache-ant` and what it pulls i.e. `openj*` and `glu`...     * `mesa-demos` (the package which includes `glxinfo`)     * `git` (or the software we need for repository access and cloning)     * `python 2.x` (try "python"+tab to see what you have...)   2. Insure that the `video driver` is set up properly and `OpenGL` is set up correctly (if we ever want to use OpenGL) - try `glxinfo | grep OpenGL` to see if there are any errors.   3. Clone a repository with `git clone somerepourl.git`   4. Generate a log from the repository directory by running a specific `git log` command   5. Bring that .log file to our software directory in `/bin` where we'll run a `python` script to `convert` it to a .xml file   6. Bring that output .xml file to our software `/data` directory for use at execution   7. (1st run) Make sure our run.sh script where the `java` command is issued contains the appropriate components and `library path`   8. Make sure we configured `sample.config` properly in /data   9. Go to the top directory and execute `./run.sh`, which compiles the software then runs it * * * Considering this, how should we proceed to quickly set this up in a VM Linux guest OS (Archbang Linux version 3.12.6-1-ARCH 64bit)? Setup info:               lspci -v | grep VGA     01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1) (prog-if 00 [VGA controller])          $ java -version     java version "1.7.0_45"     OpenJDK Runtime Environment (IcedTea 2.4.3) (ArchLinux build 7.u45_2.4.3-1-x86_64)     OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)          $ [tmt@arch ~]$ glxinfo | grep OpenGL     OpenGL vendor string: nouveau     OpenGL renderer string: Gallium 0.4 on NVD9     OpenGL core profile version string: 3.1 (Core Profile) Mesa 10.0.1     OpenGL core profile shading language version string: 1.40     OpenGL core profile context flags: (none)     OpenGL core profile extensions:     OpenGL version string: 3.0 Mesa 10.0.1     OpenGL shading language version string: 1.30     OpenGL context flags: (none)     OpenGL extensions: