title: Can't acces DNS

text: I'm running CentOS as a Virtual Machine. I can access the VM's server (IP = 192.168.0.107, which displays a phpinfo() page as it should), but now I would like to acces a custom domain name: "imd.be" and reach that same phpinfo() page. This has worked before but not anymore (on other router). Here's what I've done. in resolv.conf                nameserver 192.168.0.107      in named.conf               zone "imd.be" IN {         type master;         file "/var/named/imd.be.zone";         };      in imd.be.zone               $TTL 86400     @   IN SOA localhost. root.localhost. (                                         42              ; serial                                         3600            ; refresh                                         900             ; retry                                         1W              ; expire                                         1D )            ; minimum ttl voor cache     @                       NS              localhost.                         A               192.168.0.107     www             A               192.168.0.107     ftp                     CNAME   www     admin           CNAME   www     jo              A               192.168.O.107     herexamen               CNAME   www      in /etc/httpd/conf.d/imd.be.conf               <VirtualHost *:80>       ServerAdmin webmaster@dummy-host.example.com       DocumentRoot /var/www/imd.be       ServerName imd.be       ErrorLog logs/imd.be-error_log       CustomLog logs/imd.be-access_log common     </VirtualHost>      and               dig imd.be      returns               ;; connection timed out; no servers could be reached      What am I missing to browse imd.be and acces my own webpage?


title: virtualbox mail server postfix+dovecot

text: I'm setting up a mail server(ubuntu14.4 serverX64) for development/testing purposes (using virtualBox bridged-mode) and I just finished this tutorial and everything seams to work.   Now I'm not able to login/ use the email service using either:   * Thunderbird client    * Squirrelmail  with Thunderbird it says: login to server failed and on squirrel "Unknown user or password incorrect"., What am'I missing? this is my postfix main.cf               #See /usr/share/postfix/main.cf.dist for a commented, more complete version               # Debian specific:  Specifying a file name will cause the first     # line of that file to be used as the name.  The Debian default     # is /etc/mailname.     #myorigin = /etc/mailname          smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)     biff = no          # appending .domain is the MUA's job.     append_dot_mydomain = no          # Uncomment the next line to generate "delayed mail" warnings     #delay_warning_time = 4h          readme_directory = /usr/share/doc/postfix          # TLS parameters     smtpd_tls_cert_file = /etc/postfix/smtpd.cert     smtpd_tls_key_file = /etc/postfix/smtpd.key     smtpd_use_tls = yes     smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache     smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache          # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for     # information on enabling SSL in the smtp client.          smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination     myhostname = mail.ely.net     #myhostname = 192.168.1.100     alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases     alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases     myorigin = /etc/mailname     mydestination = mail.ely.net, localhost, localhost.localdomain     #mydestination = 192.168.1.100, localhost, localhost.localdomain     relayhost =      mynetworks = 127.0.0.0/8 [::1]/128     mailbox_size_limit = 0     recipient_delimiter = +     inet_interfaces = all     html_directory = /usr/share/doc/postfix/html     virtual_alias_domains =      virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf     virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf     virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf     virtual_mailbox_base = /var/vmail     virtual_uid_maps = static:5000     virtual_gid_maps = static:5000     inet_protocols = all     smtpd_sasl_auth_enable = yes     broken_sasl_auth_clients = yes     smtpd_sasl_authenticated_header = yes     smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf     smtpd_tls_security_level = may     transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf     relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf     relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf     proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks     smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf     smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf     smtpd_client_message_rate_limit = 100     maildrop_destination_concurrency_limit = 1     maildrop_destination_recipient_limit = 1     virtual_transport = dovecot     header_checks = regexp:/etc/postfix/header_checks     mime_header_checks = regexp:/etc/postfix/mime_header_checks     nested_header_checks = regexp:/etc/postfix/nested_header_checks     body_checks = regexp:/etc/postfix/body_checks     owner_request_special = no     smtp_tls_security_level = may     dovecot_destination_recipient_limit = 1     smtpd_sasl_type = dovecot     smtpd_sasl_path = private/auth     content_filter = amavis:[127.0.0.1]:10024     receive_override_options = no_address_mappings     message_size_limit = 0      if I do a nslookup from the server(virtualbox-ubuntuServer14.04X64) I get               root@mail:/etc/nginx# nslookup mail.ely.net     Server:     8.8.8.8     Address:    8.8.8.8#53          Non-authoritative answer:     mail.ely.net    canonical name = mail.netidentity.com.cust.hostedemail.com.     Name:   mail.netidentity.com.cust.hostedemail.com     Address: 216.40.42.5      from the host computer(ubuntu desktop 14.04x64)               main@main:~$ nslookup mail.ely.net     Server:     127.0.1.1     Address:    127.0.1.1#53          Non-authoritative answer:     mail.ely.net    canonical name = mail.netidentity.com.cust.hostedemail.com.     Name:   mail.netidentity.com.cust.hostedemail.com     Address: 216.40.42.5      and this is completely right cause is a virtualmachine and is looking at the one outside the lan now in ispconfig mail-queue logs I have this interesting thing :               Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------     C73EE221A5A 2545 Wed Aug 6 01:31:51 mailman-bounces@mail.ely.net     (lost connection with mx.netidentity.com.cust.hostedemail.com[216.40.42.4] while receiving the initial server greeting)     postmaster@ely.net      so apparently the issue here is about IPs because its looking a the real mail.ely.net host not my dummy server... so questions arise:   1. is it possible to send-receive email from/to the ouside world i.e gmail/yahoo and make it work like a personal mail server.    2. how can I manage change the conf so that i would place nicely with the outside world   3. why Im getting or how to resolve the problem of the user not found/login issues after finishing the tutorial mentioned above.


title: Restrict user access in linux

text: I'm creating a new user with the following details:               useradd -d /var/www/html/testuser.com -G users testuser      I proceed by creating a new password for the user and attempt to login via SSH, I land on /var/www/html/testuser.com but I can still go back in the directories. I want to restrict user permissions so that they can only manage the content inside the testuser.com and sibblings (so they can do all normal operations), I do not want the user to be able to navigate back in the directories and effectively have root access.


title: Can't spawn backgrounded process

text: My team's using Pallet (think Puppet in Clojure) to automate server provisioning, but running into a fairly fundamental problem: Pallet can execute arbitrary scripts directly on target VMs, but if one of those scripts happens to put a command in the background, it simply isn't executed. At least, not in the way we're trying to engineer things. We've tried this using & and screen, with the latter being the ideal, and neither works. For example, we've tried getting Pallet to execute the following script on the target VM...               touch a     touch b &     touch c      and all we see remotely is that files a and c exist. The shell (or do I mean process?) in which the main script executed simply refused to execute 'touch b'. On the other hand, if we execute this script with an ordinary terminal session on the same host, it works fine. Of course, we're attacking this from the Pallet angle. But in case that doesn't bear fruit, can someone tell me under what kinds of circumstances a shell would refuse to execute a backgrounded process, in case it gives us a clue for a workaround? We're using CentOS 6.5 64 bit, though I expect that's not relevant.


title: How to find out the bad block table offset and how to change it in u-Boot

text: I am facing a similar problem as this: Kernel does not recognize nand bad blocks marked by u-boot I'm using a friendlyARM micro2440 board that contains the s3c2440 ARM processor. u-Boot has found some bad blocks and written their positions in the bad block table, but when I boot the kernel it seems to be unable to find those bad blocks and then crashes. I wanted to try the obscure solution found by that user before, but I can't figure out how to do it: figuring out the BBT offset (maybe s3c2440's BBT offset is also an unusual value and not the one used by uboot). Also, if that's the case, how would I change u-Boot's BBT offset?


title: mailx attachment behaviour between RHL 5 and RHL 6

text: We have a line of code that does this in ksh, to send a file as an attachment in email:                     uuencode <filename> <filename.txt> | mailx someone@somewhere.com      In RHL 5.2 mailx sends "filename" through as an attachment, but in 6.3 the file content arrives in the target inbox in the body of the message.   It appears that the "6.3" mailx only wants to send an attachment if the "-a" option is used and the content is in a file. Does anyone know a way of getting the original behaviour? Also I am interested to know why this behaviour has changed.


title: XFS Tracing with Ftrace

text: I use a disk drive formatted with xfs.My OS is Ubuntu Server 12.04 LTS (kernel 3.11.0-22-generic). I would like to use `ftrace` (e.g.,`trace-cmd record -e xfs\\*`) but under `/sys/kernel/debug/tracing/events` there is no folder for xfs (only for ext2 and ext3).Any ideas why this folder is missing?


title: Operation timed out SSH to GitHub

text: I'm trying to organise my `~/.ssh/` folder, so I've created `~/.ssh/git/id_rsa` and `~/.ssh/git/id_rsa.pub` for my GitHub account. I've also created a config file, as below:               Host github.com             User git             Hostname github.com             PreferredAuthentications publickey             IdentityFile ~/.ssh/git/id_rsa      However, whenever I do `ssh -T git@github.com` I'm constantly getting the below error:               ssh: connect to host github.com port 1019: Operation timed out      My router has that port forwarded. My .ssh directory is also permission 700. What am I missing?


title: Installing openambit on Ubuntu 12.04

text: My question is in regards to installing openambit which is software for Suunto's ambit watch. I followed the installation instructions here but it didn't work. When I did:               $ mkdir libambit-build     $ cd libambit-build     $ cmake ../src/libambit     $ make     Optionally:     $ sudo make install      Everything went fine, but when I ran the `make` step:               $ mkdir openambit-build     $ cd openambit-build     $ cmake ../src/openambit     $ make     Optionally:     $ sudo make install      I was told:               dustin@dustin:~/openambit-build$ sudo cmake ~/Desktop/openambit-0.2/src/openambit/-- The C compiler identification is GNU     -- The CXX compiler identification is GNU     -- 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     -- Check for working CXX compiler: /usr/bin/c++     -- Check for working CXX compiler: /usr/bin/c++ -- works     -- Detecting CXX compiler ABI info     -- Detecting CXX compiler ABI info - done     -- Looking for Q_WS_X11     -- Looking for Q_WS_X11 - found     -- Looking for Q_WS_WIN     -- Looking for Q_WS_WIN - not found.     -- Looking for Q_WS_QWS     -- Looking for Q_WS_QWS - not found.     -- Looking for Q_WS_MAC     -- Looking for Q_WS_MAC - not found.     -- Found Qt4: /usr/bin/qmake (found version "4.8.1")     -- Found libambit: /usr/local/include, /usr/local/lib/libambit.so     -- Found UDev: /usr/include      -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.3.4")     -- Configuring done     -- Generating done     -- Build files have been written to: /home/dustin/openambit-build     dustin@dustin:~/openambit-build$ sudo make     [  2%] Generating movescount/moc_movescountxml.cxx     [  4%] Generating ui_mainwindow.h     [  6%] Generating ui_settingsdialog.h     [  9%] Generating ui_confirmbetadialog.h     [ 11%] Generating qrc_resources.cxx     [ 13%] Generating moc_mainwindow.cxx     [ 16%] Generating moc_devicemanager.cxx     [ 18%] Generating moc_settingsdialog.cxx     [ 20%] Generating moc_settings.cxx     [ 23%] Generating moc_logstore.cxx     [ 25%] Generating moc_udevlistener.cxx     [ 27%] Generating moc_confirmbetadialog.cxx     [ 30%] Generating moc_single_application.cxx     [ 32%] Generating movescount/moc_movescount.cxx     [ 34%] Generating movescount/moc_movescountjson.cxx     [ 37%] Generating movescount/moc_movescountlogdirentry.cxx     Scanning dependencies of target openambit     [ 39%] Building CXX object CMakeFiles/openambit.dir/main.cpp.o     [ 41%] Building CXX object CMakeFiles/openambit.dir/mainwindow.cpp.o     [ 44%] Building CXX object CMakeFiles/openambit.dir/devicemanager.cpp.o     [ 46%] Building CXX object CMakeFiles/openambit.dir/settingsdialog.cpp.o     [ 48%] Building CXX object CMakeFiles/openambit.dir/settings.cpp.o     [ 51%] Building CXX object CMakeFiles/openambit.dir/logstore.cpp.o     [ 53%] Building CXX object CMakeFiles/openambit.dir/logentry.cpp.o     [ 55%] Building CXX object CMakeFiles/openambit.dir/udevlistener.cpp.o     [ 58%] Building CXX object CMakeFiles/openambit.dir/confirmbetadialog.cpp.o     [ 60%] Building CXX object CMakeFiles/openambit.dir/single_application.cpp.o     [ 62%] Building CXX object CMakeFiles/openambit.dir/movescount/movescount.cpp.o     [ 65%] Building CXX object CMakeFiles/openambit.dir/movescount/movescountjson.cpp.o     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp: In member function ‘int MovesCountJSON::generateLogData(LogEntry*, QByteArray&)’:     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:230:16: error: ‘class QJson::Serializer’ has no member named ‘setDoublePrecision’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:231:16: error: ‘class QJson::Serializer’ has no member named ‘setIndentMode’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:231:30: error: ‘IndentCompact’ is not a member of ‘QJson’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:290:47: error: no matching function for call to ‘QJson::Serializer::serialize(QVariantMap&, bool*)’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:290:47: note: candidates are:     /usr/include/qjson/serializer.h:50:10: note: void QJson::Serializer::serialize(const QVariant&, QIODevice*, bool*)     /usr/include/qjson/serializer.h:50:10: note:   no known conversion for argument 2 from ‘bool*’ to ‘QIODevice*’     /usr/include/qjson/serializer.h:62:16: note: QByteArray QJson::Serializer::serialize(const QVariant&)     /usr/include/qjson/serializer.h:62:16: note:   candidate expects 1 argument, 2 provided     make[2]: *** [CMakeFiles/openambit.dir/movescount/movescountjson.cpp.o] Error 1     make[1]: *** [CMakeFiles/openambit.dir/all] Error 2     make: *** [all] Error 2     dustin@dustin:~/openambit-build$ sudo make install      [  2%] Building CXX object CMakeFiles/openambit.dir/movescount/movescountjson.cpp.o     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp: In member function ‘int MovesCountJSON::generateLogData(LogEntry*, QByteArray&)’:     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:230:16: error: ‘class QJson::Serializer’ has no member named ‘setDoublePrecision’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:231:16: error: ‘class QJson::Serializer’ has no member named ‘setIndentMode’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:231:30: error: ‘IndentCompact’ is not a member of ‘QJson’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:290:47: error: no matching function for call to ‘QJson::Serializer::serialize(QVariantMap&, bool*)’     /home/dustin/Desktop/openambit-0.2/src/openambit/movescount/movescountjson.cpp:290:47: note: candidates are:     /usr/include/qjson/serializer.h:50:10: note: void QJson::Serializer::serialize(const QVariant&, QIODevice*, bool*)     /usr/include/qjson/serializer.h:50:10: note:   no known conversion for argument 2 from ‘bool*’ to ‘QIODevice*’     /usr/include/qjson/serializer.h:62:16: note: QByteArray QJson::Serializer::serialize(const QVariant&)     /usr/include/qjson/serializer.h:62:16: note:   candidate expects 1 argument, 2 provided     make[2]: *** [CMakeFiles/openambit.dir/movescount/movescountjson.cpp.o] Error 1     make[1]: *** [CMakeFiles/openambit.dir/all] Error 2     make: *** [all] Error 2      I am not sure what is going wrong. I can post more of the output if needed as well.


title: How to get sound intensity of an audio input through terminal?

text: I want to know the intensity of the sound being heard by an audio in source like a mic or Line-in through Command line. Kinda like the progressbar under the mouse but in CLI. ![enter image description here](http://i.stack.imgur.com/QZqCS.png)               audiointensity mic0     10      Kind of like connecting a mic with amplification circuit to Arduino through an analog pin 0 and doing a analogRead(0). So, you get a value within a particular like (0 to 1024) or (0 to 100) .


title: Emacs: Switching automatically to char-mode when switching to an ansi-term window

text: Say I have multiple windows open in Emacs **24.1** and that one of those windows is an `M-x ansi-term` window with a shell. By default, when I switch to an ansi-term window, Emacs activates **Term: line run** , which prevents me from using keyboard shortcuts that work on the shell (e.g. tab completion, etc.). Is there a way tell Emacs to automatically switch to **Term: char run** when I switch to a window in Emacs with an `ansi-term` terminal?


title: Why does awk execute both actions?

text: When I run the command:                 awk '/from/ {print $7} /to/ { print $7}' erroMuitoDoido.txt      The file is:               May 19 04:44:43 server postfix/smtpd[32595]: CDAB515013: client=servidor.dominio.com.br[10.10.10.44]     May 19 04:44:43 server postfix/cleanup[18651]: CDAB515013: message-id=<20120519074443.CDAB515013@servidor2.dominio.com.br>     May 19 04:44:43 server postfix/qmgr[16684]: CDAB515013: from=atendimento@dominio.com.br, size=19590, nrcpt=1 (queue active)     May 19 04:44:50 server postfix/pipe[32596]: CDAB515013: to=userdestino@dominiodestino.com.br, relay=dovecot, delay=6.2, delays=0.02/6/0/0.14, dsn=2.0.0, status=sent (delivered via dovecot service)     May 19 04:44:50 server postfix/qmgr[16684]: CDAB515013: removed      The output is:               from=atendimento@dominio.com.br,     from=atendimento@dominio.com.br,     to=userdestino@dominiodestino.com.br,      The problem is that the line "from=atendimento@dominio.com.br," occurs twice! How can I fix this? AWK version: `GNU Awk 4.0.0`   OS: Debian 6, OpenSuse 12.1, CentOS 6.2


I really enjoying using `control+r` to recursively search my command history. I've found a few good options I like to use with it:               # ignore duplicate commands, ignore commands starting with a space     export HISTCONTROL=erasedups:ignorespace          # keep the last 5000 entries     export HISTSIZE=5000          # append to the history instead of overwriting (good for multiple connections)     shopt -s histappend      The only problem for me is that `erasedups` only erases sequential duplicates - so that with this string of commands:               ls     cd ~     ls      The `ls` command will actually be recorded twice. I've thought about periodically running w/ cron:               cat .bash_history | sort | uniq > temp.txt     mv temp.txt .bash_history      This would achieve removing the duplicates, but unfortunately the order would not be preserved. If I don't `sort` the file first I don't believe `uniq` can work properly. How can I remove duplicates in my .bash_history, preserving order? ### Extra Credit: Are there any problems with overwriting the `.bash_history` file via a script? For example, if you remove an apache log file I think you need to send a nohup / reset signal with `kill` to have it flush it's connection to the file. If that is the case with the `.bash_history` file, perhaps I could somehow use `ps` to check and make sure there are no connected sessions before the filtering script is run?


title: Status of adding Reiser4 to the Linux kernel

text: I used the Reiser4 fs for some time and would love to see it get into the mainline kernel. I would think the project can still go forward even if Hans is not able to contribute these days. Is there any mention on a mailing list or elsewhere of plans to get Reiser4 into the mainline kernel?


title: Bandwidth Management tool

text: There are tools available like `MRTG , Cacti` etc through which we can monitor network traffic on network interfaces on a host. The network traffic flow information that is provided by these tools is the total traffic that is flowing through the interface . But I want to drill down further like bandwidth classification based on application layer protocols like `HTTP , SMTP , 8080` etc. Also , would be great if the tool provides bandwidth classification based on the contributor of traffic . i.e Which IP Address are contributors to incoming and outgoing traffic . Any tools or plugins to `MRTG , Cacti` etc which provides such information


title: Remapping power key to delete

text: I have a macbook pro running Ubuntu 13.10 with FluxBox. Unfortunately, the power button is physically above the backspace where I would expect the delete key to be in. In OS X, the PowerKey program can be used to remap the power key to delete. How can I do something similar in X Windows? I disabled the power key by editing `/etc/systemd/logind.conf` and setting `HandlePowerKey = ignore` After this, I can press the power button without shutting the laptop down. Running `xev -event keyboard` reveals that the KeyPress for the power key is normally being eaten by another process:               MappingNotify event, serial 36, synthetic NO, window 0x0,         request MappingKeyboard, first_keycode 8, count 248          KeymapNotify event, serial 36, synthetic NO, window 0x0,         keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0                   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0             KeymapNotify event, serial 37, synthetic NO, window 0x0,         keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0                   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0         However by running only xterm directly from console, I was able to successfully get the keycode and remap the key.               xinit /usr/bin/xterm -- :1     xev -event keyboard | tee /tmp/junk.txt     tail -n ???? /tmp/junk.txt     MappingNotify event, serial 28, synthetic NO, window 0x0,         request MappingKeyboard, first_keycode 8, count 248          KeyPress event, serial 28, synthetic NO, window 0x600001,         root 0xa1, subw 0x0, time 720369, (146,89), root:(148,91),         state 0x0, keycode 124 (keysym 0x1008ff2a, XF86PowerOff), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 28, synthetic NO, window 0x600001,         root 0xa1, subw 0x0, time 720369, (146,89), root:(148,91),         state 0x0, keycode 124 (keysym 0x1008ff2a, XF86PowerOff), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          MappingNotify event, serial 29, synthetic NO, window 0x0,         request MappingKeyboard, first_keycode 8, count 248      At this point, it was also possible to map the key using xmodmap. I mapped it to backslash which is easier to see than delete:                xmodmap -e "keycode 124 = backslash bar"      I could get a barely functional equivalent to run by adding this to `~/.fluxbox/keys` but this is both ugly and slow enough to be unusable.                 # Remap the power off to a delete key...       XF86PowerOff :Exec xdotool key Delete      How can I use xmodmap or setxkbmap to use the power button at the same time as a normal window manager?


title: How do I install WINE in RHEL 6.3?

text: I'm a beginner in Linux and I'm having a problem installing wine I'm using RHEL 6.3 and when I use               yum install wine      it keeps giving me this               Blockquote Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.7.3)     Error: Package: wine-cms-1.4.1-1.el6.i686 (epel)                Requires: liblcms.so.1     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libz.so.1     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.6.8)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.6.15)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: gnutls(x86-32)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.6.23)     Error: Package: wine-pulseaudio-1.4.1-1.el6.i686 (epel)                Requires: alsa-plugins-pulseaudio(x86-32)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.6.2)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.6.21)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libglib-2.0.so.0     Error: Package: wine-alsa-1.4.1-1.el6.i686 (epel)                Requires: libasound.so.2(ALSA_0.9)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libGLU.so.1     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.5.8)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libGL.so.1     Error: Package: wine-ldap-1.4.1-1.el6.i686 (epel)                Requires: libldap_r-2.4.so.2     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgstreamer-0.10.so.0     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libX11.so.6     Error: Package: wine-alsa-1.4.1-1.el6.i686 (epel)                Requires: libasound.so.2     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libXext.so.6     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libSM.so.6     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.5.7)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libusb-0.1.so.4     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgobject-2.0.so.0     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libICE.so.6     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libexif.so.12     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgphoto2_port.so.0     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.6.14)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libXrender(x86-32)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.4.30)     Error: Package: wine-alsa-1.4.1-1.el6.i686 (epel)                Requires: libasound.so.2(ALSA_0.9.0rc4)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: freetype(x86-32)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgstapp-0.10.so.0     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgthread-2.0.so.0     Error: Package: wine-ldap-1.4.1-1.el6.i686 (epel)                Requires: liblber-2.4.so.2     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libXcursor(x86-32)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgphoto2.so.2     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgmodule-2.0.so.0     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2(LIBXML2_2.6.0)     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libxml2.so.2     Error: Package: wine-core-1.4.1-1.el6.i686 (epel)                Requires: libgstbase-0.10.so.0      I'v tried many things I'v installed epel and updated yum I really could use some help guys thanks in advance


title: info about processors in linux

text: hello everyone I'm currently reading `Understanding the Linux Kernel`, I found there: > Besides the fields included in each process descriptor, additional > information is needed to describe what each CPU is doing. To that end, the > scheduler can rely on the aligned_data array of NR_CPUS structures of type > schedule_data. my question is, where can I find the definition(I mean which directory and file) of `NR_CPUS` and this `schedule_data struct`, thanks in advance P.S. also it will be very helpful if somebody knows some site which can give quick reference about the place of definition of different structs and macro's from Linux Kernel


title: How to put backtrack on a partition with Windows XP

text: This is a similar question to my previous one. I now am trying to get Backtrack5 onto a separate partition of my main hard drive with windows but the site says that I need a clean hard drive. Is there anyway around this?


title: Why does Ubuntu use Debian "unstable"? How does it manage to be stable then?

text: Shouldn't Ubuntu use Debian "stable" for stability? How does it manage to stay stable by using Debian "unstable" ?


title: Get ld to pick the correct library

text: I'm trying to compile a program `prog` and link it against OpenSSL's 1.0.2 beta, built from source and installed in `/usr/local/ssl-1.0.2`. On an older system using 0.9.8, this works without too much trouble. On a more recent system with 1.0.1 installed, this requires a bit more work. I'm wondering why. # 1) On Ubuntu 10.04, with OpenSSL 0.9.8: Here are the steps I follow to compile and link against 1.0.2.               $ ./config shared --openssldir=/usr/local/ssl-1.0.2 && make && make install     $ ldconfig     $ ldconfig -p | grep libcrypto      => Only 0.9.8 files show up, so I add the path to the 1.0.2 files...               $ ldconfig /usr/local/ssl-1.0.2/lib     $ ldconfig -p | grep libcrypto      =>                libcrypto.so.1.0.0 (libc6) => /usr/local/ssl-1.0.2/lib/libcrypto.so.1.0.0      libcrypto.so.0.9.8 (libc6, hwcap: 0x0008000000008000) => /lib/i686/cmov/libcrypto.so.0.9.8      libcrypto.so.0.9.8 (libc6, hwcap: 0x0004000000000000) => /lib/i586/libcrypto.so.0.9.8      libcrypto.so.0.9.8 (libc6, hwcap: 0x0002000000000000) => /lib/i486/libcrypto.so.0.9.8      libcrypto.so.0.9.8 (libc6) => /lib/libcrypto.so.0.9.8      libcrypto.so.0.9.8 (libc6) => /usr/lib/libcrypto.so.0.9.8      libcrypto.so (libc6) => /usr/local/ssl-1.0.2/lib/libcrypto.so      And so I can compile `prog`...               $ gcc -o prog ... -L/usr/local/ssl-1.0.2/lib -lcrypto     $ ldd prog      =>                   libcrypto.so.1.0.0 => /usr/local/ssl-1.0.2/lib/libcrypto.so.1.0.0 (0x0083b000)      ... and it is correctly linked against 1.0.2. # 2) On Debian Wheezy, with OpenSSL 1.0.1: Same steps, different result.               $ ./config shared --openssldir=/usr/local/ssl-1.0.2 && make && make install     $ ldconfig     $ ldconfig -p | grep libcrypto      =>                libcrypto.so.1.0.0 (libc6, hwcap: 0x0008000000008000) => /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0      libcrypto.so.1.0.0 (libc6, hwcap: 0x0004000000000000) => /usr/lib/i386-linux-gnu/i586/libcrypto.so.1.0.0      libcrypto.so.1.0.0 (libc6) => /usr/lib/i386-linux-gnu/libcrypto.so.1.0.0      Likewise, I add the path to 1.0.2...               $ ldconfig /usr/local/ssl-1.0.2/lib     $ ldconfig -p | grep libcrypto      =>                libcrypto.so.1.0.0 (libc6, hwcap: 0x0008000000008000) => /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0      libcrypto.so.1.0.0 (libc6, hwcap: 0x0004000000000000) => /usr/lib/i386-linux-gnu/i586/libcrypto.so.1.0.0      libcrypto.so.1.0.0 (libc6) => /usr/local/ssl-1.0.2/lib/libcrypto.so.1.0.0      libcrypto.so.1.0.0 (libc6) => /usr/lib/i386-linux-gnu/libcrypto.so.1.0.0      libcrypto.so (libc6) => /usr/local/ssl-1.0.2/lib/libcrypto.so      Then I try to compile...               $ gcc -o prog ... -L/usr/local/ssl-1.0.2/lib -lcrypto     $ ldd prog      =>                   libcrypto.so.1.0.0 => /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0 (0xb7591000)      But here it is not linked against 1.0.2. The compile-time library path is correct (specified with `-L`, `gcc` would fail otherwise since some functions used in `prog` are specific to 1.0.2), but not the run-time one. # 3) How to get it working on Wheezy With or without running `ldconfig /usr/local/ssl-1.0.2/lib`:               $ gcc -o prog ... -Wl,--rpath=/usr/local/ssl-1.0.2/lib -L/usr/local/ssl-1.0.2/lib -lcrypto     $ ldd prog      =>                   libcrypto.so.1.0.0 => /usr/local/ssl-1.0.2/lib/libcrypto.so.1.0.0 (0xb7592000)      Alternatively, run `export LD_LIBRARY_PATH=/usr/local/ssl-1.0.2/lib` before running `gcc`. # What I'd like to know Using `LD_DEBUG=libs ./prog` as suggested by mr.spuratic, I found that the paths were looked up in `/etc/ld.so.cache`. I opened that file and found that the order in which .so are looked up corresponds to the output of `ldconfig -p`. So the actual question is:   * Why does the 1.0.2 file gets on top of ldconfig's list in 1) but not in 2) ? Pure randomness? Confusion due to 1.0.1 and 1.0.2 files having the same suffix? ("1.0.0") Or, said differently,   * Why are the flags added in 3) not necessary in 1) ?


title: Is my default remote shell a trouble maker?

text: By `finger tim` on the server, I learned that my default shell is some script `/usr/local/bin/bash-wrapper` whose content is:               #!/bin/bash          USERNAME=`whoami`          if ! grep ^$USERNAME$ /etc/domain-users > /dev/null; then        echo -e "You are not authorized to log into this server\n\n"     elif test -z "$2"; then        echo -e "User authorized"        /bin/bash     else #in case users are trying to send a command via ssh or use scp        $2     fi      I now understand the script is the cause of me previously being kicked out upon logging in using ssh. The problem is now gone, because I was just recently added to that file `/etc/domain-users` which `grep` is searching in. Now my questions are:   1. What does the script do if I send a command for the server shell to run in the same line as `ssh`, such as the following two questions Part 2 and Part 3?   2. Is it the cause of the failure of my copy of public key:              $ cat /home/tim/.ssh/id_rsa.pub | ssh tim@server 'cat >> .ssh/authorized_keys'     Password:      cat: >>: No such file or directory     cat: .ssh/authorized_keys: No such file or directory      I also tried `ssh-copy-id`, but it doesn't work either:              $ ssh-copy-id tim@server     Password:      /usr/local/bin/bash-wrapper: line 11: umask: 077;: octal number out of range        3. The following ssh-tunneling command doesn't run well from my local either:              ssh -f -D 9999 tim@server "if [ -f ~/.tunnel ]; then rm ~/.tunnel; fi; while [ ! -f ~/.tunnel ]; do echo > /dev/null; done"      Here is the error that I get              /usr/local/bin/bash-wrapper: line 11: if: command not found      I wonder why?   4. My login is always very slow. Is it because the `grep` takes time? Note that the file `/etc/domain-users`in which `grep` searches has 199 lines and each line is a username. Is it supposed to take long for `grep` to do its job?   5. How can I change my default shell? Thanks and regards!


title: Scrolling on very long files (1M+ lines) on Emacs

text: I was wondering if besides the basic navigation commands:               C-p : Jump backwards one line.     C-n : Jump forward one line.     C-v : Jump forward one full screen.     M-v : Jump backwards one full screen.     M-a : Go to the previous paragraph beginnings.     M-e : Go to the next paragraph end.     M-g g: Jump to a specific line      emacs provides any commands to easily scroll thousands or millions of lines. More specifically, I am looking for example for a command that I could use to move forward (or backwards) `1%` of the file (maybe a command that can be combined with `C-u` and can be used to scroll an arbitrary `%` of the file?)


title: How to install Oracle on Arch Linux?

text: I tried going through the wiki I was able to complete until here.               wget --http-user "I accept www.opensource.org/licenses/cpl" --http-password "." http://www.research.att.com/~gsf/download/tgz/INIT.2011-02-08.tgz      Then, it says that the INIT package is not found. Not sure what to do next. I tried to go to Oracle and download and proceed anyways by untarring and trying to setup. It is showing many errors. I was wondering if anybody had successfully installed Oracle on Arch? **EDIT:** I tried the following in the above link:               [srikanth@myhost Downloads]$ tar -xvf oracle.tar.gz      oracle     oracle/PKGBUILD     oracle/oracle.install     oracle/ee.rsp.patch     oracle/oracledb     [srikanth@myhost Downloads]$ cd oracle     [srikanth@myhost oracle]$ ls     ee.rsp.patch  oracledb  oracle.install  PKGBUILD     [srikanth@myhost oracle]$ makepkg -s     ==> Making package: oracle 11gR1-1 (Thu Jan 19 21:54:20 CST 2012)     ==> Checking runtime dependencies...     ==> Installing missing dependencies...     Password:      error: target not found: ksh     ==> ERROR: 'pacman' failed to install missing dependencies.      and then I tried to install ksh via yaourt and aur                                                     ksh                        ---------------------------------------------------                     1) View/Edit PKGBUILD                   ---------------------------------------------------                   * b)  Build with makepkg and install with pacman.                     s)  Save build files and build.                     n)  Next package. Skip this package.                     q)  Quit without building.                   ---------------------------------------------------                        Enter a selection: [B] b     ==> Checking Buildtime Dependencies...           ==> Checking Runtime Dependencies...           ==> Making package: ksh 2011.02.08-1 (Fri Jan 20 16:38:02 CST 2012)     ==> Checking runtime dependencies...     ==> Checking buildtime dependencies...     ==> Retrieving Sources...     ==> ERROR: INIT.2011-02-08.tgz was not found in the build directory and is not a URL.     aurbuild: could not build ksh with makepkg.     Build directory retained at /var/tmp/aurbuild/build/ksh     You can visit the directory, fix the problem, and run makepkg.      [srikanth@myhost oracle]$ yaourt -S ksh               ==> Downloading ksh PKGBUILD from AUR...     x PKGBUILD          ( Unsupported package: Potentially dangerous ! )     ==> Edit PKGBUILD ? [Y/n] ("A" to abort)     ==> ------------------------------------     ==> n          ==> ksh dependencies:          ==> ksh conflicts:      - pdksh-5.2.14-6          ==> Continue building ksh ? [Y/n]     ==> -----------------------------     ==>      ==> Building and installing package     ==> Making package: ksh 2011.02.08-1 (Thu Jan 19 21:57:07 CST 2012)     ==> Checking runtime dependencies...     ==> Checking buildtime dependencies...     ==> Retrieving Sources...     ==> ERROR: INIT.2011-02-08.tgz was not found in the build directory and is not a URL.     ==> ERROR: Makepkg was unable to build ksh.     ==> Restart building ksh ? [y/N]      Please suggest. I came across this INIT package. Which package should I download for Arch Linux 64 bit?


title: Launching a terminal emulator without knowing which ones are installed

text: I need to write a script that will launch a terminal emulator and run a particular command in it. Since I don't know which terminal emulators have been installed on the target system, how could I find which terminal emulators have been installed? I've looked at this thread. However, I'm not really very inclined to make a hardcoded check, and I'm searching for a generic solution. I've come up this _very_ dirty hack, but I'm really not sure how this would fare: `termdetect`:               #!/bin/bash          IFS=:     for i in $PATH; do       find "$i" -type f -exec isterminal {} \;     done      `isterminal`:               #!/bin/bash          if [[ ! -z "$1" ]]; then       if [[ "$(head -c 4 "$1")" == $'\x7fELF' ]]; then         if ! grep editor "$1" > /dev/null; then           if grep -E '(vte_terminal_|libutempter|rxvt_)' "$1" > /dev/null; then             echo "$1"           fi         fi       fi     fi      Is there an easy generic solution that I'm perhaps missing? Or do I have no other way than to scour binaries for hints or use a hardcoded list?


title: Why is my ext4 filesystem recognizable only on the machine it was formatted on?

text: Xubuntu liveCD 11.04 running on "bad machine" with mdadm RAID1 array with an unrecognizable ext4 filesystem: To rescue some files, I installed a new hard drive and formatted it to ext4. I copied 300GB worth of files retrieved from bad machine data scraping onto the newly formatted ext4 drive. I powered down the machine and removed the HDD, connected HDD to an ubuntu "good machine". Good machine doesn't recognize the ext4 filesystem. Trying to mount, dmesg reports:               EXT3-fs (sdd1): error: can't find ext3 filesystem on dev sdd1.     EXT4-fs (sdd1): VFS: Can't find ext4 filesystem     EXT4-fs (sdd1): VFS: Can't find ext4 filesystem      So I put the drive back in the bad machine, and the filesystem is recognized and mountable. Experimenting, I formatted another new drive to ext4 on good machine, then installed the drive on bad machine. Bad machine doesn't recognize new drive formatted by good machine. What could cause bad machine to speak it's own ext4 language? Can the ext4 filesystem that bad machine is creating be corrected on good machine so the data can be copied onto good machine? ## Edit 0 As requested by @bersh, command output on "bad machine":               # cat /proc/filesystems     nodev   sysfs     nodev   rootfs     nodev   bdev     nodev   proc     nodev   cgroup     nodev   cpuset     nodev   tmpfs     nodev   devtmpfs     nodev   debugfs     nodev   securityfs     nodev   sockfs     nodev   pipefs     nodev   anon_inodefs     nodev   devpts             ext3             ext2             ext4     nodev   ramfs     nodev   hugetlbfs     nodev   ecryptfs     nodev   fuse             fuseblk     nodev   fusectl     nodev   pstore     nodev   mqueue             btrfs             iso9660     nodev   overlayfs             squashfs      and the next one:               # lsmod|grep ext     #      (no output) ## UPDATE 1 I realized I have been doing something wrong... The raid array is partitioned, I've been assembling the entire /dev/sda disk with mdadm when I should be assembling individual partitions: mdadm -A /dev/sda1 /dev/md5 and mdadm -A /dev/sda2... That doesn't answer the question though. because the non-raid ext4 partition was unrecognized on the good machine, and even if I correctly assemble the raid array, I might not be able to transfer it to a different machine and the different machine be able to recognize the ext4.


title: What are the pros/cons of deb vs. rpm?

text: For whatever reasons, I've always used RPM based distros (Fedora, Centos and currently openSUSE). I have often heard it stated that deb is better than rpm, but when asked why, have never been able to get a coherent answer (usually get some zealous ranting and copious amounts of spittle instead). I understand there may be some historical reasons, but for modern distros using the two different packaging methods, can anybody give the technical (or other) merits of one vs. the other?


title: Dispatcher script of network-manager no longer works

text: Soon after upgrading to networkmanager 0.9.8, I got the following message when it starts, > Dispatcher failed: (32) Unit dbus-org.freedesktop.nm-dispatcher.service > failed to load: No such file or directory. See system logs and 'systemctl > status dbus-org.freedesktop.nm-dispatcher.service' for details. And I noticed that all my dispatcher scripts (located in `/etc/NetworkManager/dispatcher.d`) are dead. The permission of each script is set to `700`, owned by root. I've already run the name with `pkgfile` and `locate`, no output. The file doesn't really exist, so where can I find it?


title: ESC key causes a small delay in terminal due to its Alt+ behavior

text: My terminal setup is gnome-terminal + tmux + zsh with vi bindings. In applications like vim or even in the zsh's command line vi editing mode, I need to frequently hit the `ESC` key but there is a small delay before the effects of this key take place. See GNU Screen makes Vim ESC key slow After some experimentation, I found that hitting `ESC` key and immediately another key (say `b`) has the same effect as hitting `Alt+b`. I don't know why this is the case (probably for legacy reasons when there was no `Alt`? I don't know). Either way, I have two `Alt` keys and I don't want this behaviour with my `ESC` key. I have tried with `C+[` and its the same problem with that too. I'm not sure who is responsible for this, gnome-terminal or tmux or my OS itself (Ubuntu Natty). Any ideas on how to address this would be great. **Update** : I checked without tmux on a different terminal (LXTerminal) and the delay is present there too.


title: Cannot adjust brightness via Fn key

text: I just set up a new Arch with Gnome 3.2. Until now, everything seems to work fine, except for the brightness adjustment. When I try to adjust the brightness from within the Gnome settings or with `Fn`+`☼↑`, the screen flickers for some seconds and afterwards the brightness stays the same (`Fn` variant) or has changed (Gnome settings). It seems like some other part of the system insists on keeping the brightness as is, there is a fight and this other part wins. **edit** : The Hardware is a Samsung N130 Netbook with an Intel 945GME graphics controller. **update** : The culprit of this manifests itself as this line in `/var/log/messages`:               samsung_laptop: SABI set command 0x01 failed with completion flag 0xaa and data 0xff      Some research led to this, which says that a patch for the problem is on its way into the 3.2 kernel.


title: Copying one file to multiple directories

text: I have a file that I want to copy to another 60 directories. The best way I can think of doing this is by making a bash script that has instructions to every folder like this:               cp script.sh /home/user/dl/*/111/23     cp script.sh /home/user/dl/*/111/23     cp script.sh /home/user/dl/*/111/23     and so on...      The * is a number starting at 1 and finishing at 60 There has to be a better way than this.


title: How can I reliably "hold" a package in Debian?

text: I have a package in Debian that has been manually patched (not ideal, I know) that I must hold at its current version so upgrades don't overwrite the patched changes (I will manually inspect and apply security updates). As I understand it, there are a few ways to approach this:   * apt-pinning (see `apt_preferences(5)`)   * `aptitude hold`   * `dpkg --set-selections`   * setting it with `dselect`? I've read that one hold won't affect another (so, for example, using `aptitude hold` won't prevent `apt-get` or `dselect` from upgrading the package). What needs to be done to 100% ensure that Debian's tools will never upgrade the package unless I remove the hold?


title: How to report number of files in all subdirectories?

text: I need to inspect all sub-directories and report how many files (without further recursion) they contain:               directoryName1 numberOfFiles     directoryName2 numberOfFiles


title: Prompt for confirmation for every command

text: I'm writing a pretty ad-hoc install script for some thing. No much control constructs, basically just a list of commands. I'd like the user to confirm each command before it gets executed. Is there a way to let bash do that, without prefixing every command with a shell function name?


title: Raspbian: how ifplugd works on lo and other interface

text: On my raspbian, I'm wondering why `ifplugd` (link detection daemon for ethernet devices) is also running on the `lo` the loopback interface.   The `ps` command displays:   `/usr/sbin/ifplugd -i lo -q -f -u0 -d10 -w -I` There is no reason why `ifplugd` runs on `lo`, is it possible to configure it to start on all interfaces but `lo` ?


title: Portforwarding: router nat vs iptables

text: I would like to host some services on my pc and make them available from internet. (I'm aware of the security implications, it's more like a test for now). I don't have experience with iptables but I would like to use it and learn at the same time. Now I'm having NAT enabled on my router. Can the router and iptables cause conflicts? I mean both can manage port forwarding, so if I want to open some ports, should I enable NAT on my router and open them through iptables or disable nat on my router and manage everything from iptables? What's the best practise?


title: How can I configure grub (or a different bootloader) to use modifier keys?

text: To clarify, I am wanting to dual boot Windows and a Linux distribution. I already know how to set my laptop up to do that. However, I don't want the grub menu to display on boot. I would like for it to automatically boot Windows by default, unless a modifier key is pressed on boot (ctrl for instance). If the modifier key is pressed, it will boot the Linux distro. Is this possible?


title: How to handle a mass rpmbuild for a new distribution?

text: How could I define and initiate a mass rpmbuild for a coresystem of a new distro? Which requisites beyond rpmbuild-dir are needed?


title: How to make gvfs mount fat/vfat drives with 8.3 names set to lowercase on automatic mount?

text: Use case: when USB flash or SD card is plugged in, the filesystem is mounted. It is mounted by `gvfsd`. But if the filesystem contains files in legacy 8.3 format (like digital cameras often save file names on fs), then the file names are automatically transformed to upper case. So, the files on filesystem appears like FILENAME.JPG. How to make `gvfs` automatically mount FAT/VFAT drives so that the file names would appear in lowercase even if they are saved in the 8.3 format?


title: Why are bash_completion scripts persistently in environment?

text: I accidentally typed the command `export` into my console emulator (running Bash) instead of `export -p`, and now all the bash_completion scripts are persistently in my environment, even surviving reboot. I'd like to undo that but haven't been able to figure it out after some hours. I got as far as finding them in /etc/bash.bashrc but don't see what is sourcing that, and in any case still can't figure out how or why `export` with no args can do such damage. This is under Knoppix, in the non-root `knoppix` account. When I `su -` the root account has no such problem. [update: I don't know what I'm talking about. By "environment" I meant the output of the `set` Bash builtin, which was where the functions were showing. I should be using `env`. Anyway, what happened was that I have been using `set` in my Makefiles to test the generation of certain values, and I was surprised to suddenly see all those functions in the output. Then after reboot I checked from the command line and still saw them, not thinking to check from the Makefile (from which they no longer show, not being exported. So, problem solved; they were obviously in my `set` output all along, just hadn't noticed them before until accidentally typing `export` and seeing them in my `make set` output. Still it seems there's a mismatch in the documentation of bash to the behavior; `export` with no names is supposed to return a list of exported variables, not export everything.)]


title: How to view a list of previously run mysql queries in a live feed format?

text: How do i view the last run queries in mysql in a live feed format? I want to leave my terminal window open and just have mysql queries pop up on the screen whenever something is run. I know I can do it with the tail command, but im not sure where the mysql logs are stored. i can also do mysqladmin proc, but that doesnt give me a continuous live feed.


title: What's the best way to have a 169.254.169.254 address local to my laptop?

text: I want to emulate the Amazon EC2 metadata service on my local system for testing. In EC2, this runs on `169.254.169.254`. I understand that this is the designated range for pseudorandom local addresses on DHCP failure, but Amazon in their wisdom are also using it for this purpose, so I need to do the same thing. I'm using F19 Alpha. In earlier Fedora, I could simply make a virtual interface on the loopback device, like `lo:0` and assign that a static address using the normal `ifcfg-` scripts. Now, that fails with " _Error: Connection activation failed: Device not managed by NetworkManager or unavailable_ ". (I'm running NetworkManager, but previously I was doing this underneath it.) Is finding some way to continue what I was doing with `lo:0` the right approach (and if so, how?), or is there a better way?


title: Skype window doesn't show on Debian 7.0 with Openbox

text: I'm running Openbox on Debian, and I don't use any panels or docks because I don't really need them. I installed Skype (from here: http://www.skype.com/en/download-skype/skype- for-linux/downloading/?type=debian32), but after starting it via terminal, it's window doesn't show up at all. Why is that?


title: Determine whether kernel built-in driver supports a device

text: I'm trying to find a way to accurately determine whether all the hardware on some system has a valid driver installed either via a kernel module or built- in to the kernel. I'm working with RHEL 5.5 on a Dell Optiplex 990. I know that lspci is a good starting point, but it's not reliable because it could be manually updated and new drivers don't always update it. I know that I can look look at /lib/modules/$(uname -r)/modules.pcimap to find out whether there is a driver module for the device base on the ID, but what about built- in drivers? I've installed a new kernel and I'm trying to find out whether the built-in agpgart-intel module supports the host bridge with vendor:device ID 8086:0100. Also, is there a proper procedure for updating the pci.ids list when updating the kernel? I know I could just update everything using update-pciids or by downloading the list from the internet, but doesn't it make more sense to only include IDs supported by the current install?


title: How do I prevent ssh remote login from breaking dbus?

text: I'm running openSUSE 11.3 on my workstation at work under KDE, I don't have root access to it. The default shell has been set to `tcsh`. When I am logged in at my workstation and log in remotely from my MacBook running OS X 10.6 using `ssh`, like so:               ssh -X -C user@workstation.edu      everything works fine; however, once I'm done, I get DBUS errors on my workstation session whenever I try to launch anything with a GUI, including, unfortunately, the logout dialog box from the task bar panel. I'm getting tired of killing `startkde` just to logout in these situations. Online I've found a lot of instructions for connecting to an existing dbus session using ssh, but I'd like to do the opposite, leave the existing dbus session completely untouched by the ssh remote login session. If I do               ssh -X -C user@workstation.edu dbus-launch konsole      that works, so it's only the interactive login shell that's breaking dbus. How should I modify `~/.cshrc`? Keep in mind that I don't have permission to modify `/etc/cshrc`, `/etc/login`, etc. I can list the contents of those files here, if necessary. Thanks Update: Here is a big tar file with all the scripts I could find: http://dl.dropbox.com/u/17203983/cshrc.tgz


title: How to convert a pdf to 4-up in landscape mode (ideally using ghostscript)?

text: I have pdf slides in landscape mode and would like to create a new pdf file containing the slides 4-up (in landscape mode again) like this:               -----------------     |   1   |   2   |     -----------------     |   3   |   4   |     -----------------      I know that there is `pdfjam` (which can be used like this `pdfjam --fitpaper true --nup 2x2 --delta '1mm 1mm' --scale 0.98 infile.pdf`), but it does not preserve hyperlinks -- `gs` does, though. I am wondering how one could use `gs` to achieve the task (?) Alternatively, I mainly use 4-up to print slides. I couldn't manage to use `lpr` for achieving this. If someone has an idea for that, this would be interesting as well.


title: How to install exactly the same packages on another computer in openSUSE?

text: _Another computer can be as well virtual machine. I cannot make disk clone because of hardware differences and settings._ I have computer A, installed and running, I also have computer B. I will install the same OS on B, so I would get the same base system. Then by hand I will add the same repositories as on A. But the last stage is beyond me -- how to install the same packages as on A? Note, that the version has to match, not only package name. Of course I am looking for automatic way, not installation manually one by one. In effect I should get completely different hardware configuration, clean settings (no old passwords, etc), but identical software selection. ## Question How to do it? ## Background The packages (per version) are available but are not the latest ones. The point of this is to make a "copy" of running system, upgrade packages on computer B (copy), test if it works, if yes, then upgrade A. With every new OS version I am hit by many regression bugs, and I have to test it more methodically, than test-live & panic. > openSUSE 11.4


title: Parallelizing a for loop with very large number of iterations

text: I want to parallelize a for loop where the number of iterations in the loop can be very large such as 10^6. So ,it will be better if I can create threads rather than process. How to do it? The code is as follows               N=$1          for (( i=0; i < $N; i++ )); do              ./random >> output /* in each iteration one random number is appended to                               a file "output" */                                          done


title: Downloading DeviantArt : Favourites, Groups, Gallery...

text: Is there any command-line Linux tool for downloading user favourites (including subfolders), selected users galleries, groups ? (Preferably with ability to run in incremental mode, to update rip from time to time with new entries without reloading all currently loaded stuff) I mean tool with DenvianArt web page parsing (web scraping) capabilities. So result will be a tree of direcotries with picture files in maximum available resolution:               userX_galleries/         gallery1/           pic_1_PICNAME.jpg           pic_2_PICNAME.png           (...)           pic_n_PICNAME.jpg         gallery2/           pic_1_PICNAME.jpg           pic_1_PICNAME.png           (...)           pic_n_PICNAME.png         (...)      Or something like that.


title: Closing all Nautilus windows from terminal

text: How can I close all opened Nautilus (explorer) windows from the terminal?


title: 200ms latency between TCP send and tcpdump only with large messages

text: In our REHL server, latency between application send and tcpdump log is _always_ very large for large messages, about 200 milliseconds (see below 697572-488690=208882 microseconds), whereas latency for small messages is very small, just a few microseconds. I think none of the TCP timers can explain the 200ms delay. This kind of latency is usually because of the Nagle's algorithm for small messages, which is not the case here since the high latency is only for large messages. # With a large message: IBM MQ trace logs extracts:               12:13:12.488685     4172.1      RSESS:000001 ----{  ccxSend     12:13:12.488688     4172.1      RSESS:000001 -----{  cciTcpSend     12:13:12.488690     4172.1      RSESS:000001 ------{  send     12:13:12.488697     4172.1      RSESS:000001 ------}  send rc=OK     12:13:12.488711     4172.1      RSESS:000001      Sending 1138 bytes     [large message]     12:13:12.488714     4172.1      RSESS:000001      RetCode (OK)     12:13:12.488716     4172.1      RSESS:000001 -----}  cciTcpSend rc=OK      tcpdump extracts:               12:13:05.884715 IP (tos 0x0, ttl  49, id 60415, offset 0, flags [DF], proto: TCP (6), length: 68) otherHost.otherPort > ourHost.ourPort: P, cksum 0x7673 (correct), 2893948259:2893948287(28) ack 1576932354 win 1024                           ....     12:13:05.884718 IP (tos 0x0, ttl  64, id 60352, offset 0, flags [DF], proto: TCP (6), length: 40) ourHost.ourPort > otherHost.otherPort: ., cksum 0xcd9c (correct), ack 2893948287 win 5768     12:13:12.697572 IP (tos 0x0, ttl  64, id 60353, offset 0, flags [DF], proto: TCP (6), length: 1064) ourHost.ourPort > otherHost.otherPort: P, cksum 0x0059 (incorrect (-> 0x6a5a), 1576932354:1576933378(1024) ack 2893948287 win 5768     [first packet of large message]     12:13:12.708367 IP (tos 0x0, ttl  49, id 61060, offset 0, flags [DF], proto: TCP (6), length: 40) otherHost.otherPort > ourHost.ourPort: ., cksum 0xe024 (correct), ack 1576933378 win 0     12:13:12.708865 IP (tos 0x0, ttl  49, id 61061, offset 0, flags [DF], proto: TCP (6), length: 40) otherHost.otherPort > ourHost.ourPort: ., cksum 0xdc24 (correct), ack 1576933378 win 1024     12:13:12.708869 IP (tos 0x0, ttl  64, id 60354, offset 0, flags [DF], proto: TCP (6), length: 154) ourHost.ourPort > otherHost.otherPort: P, cksum 0xfcca (incorrect (-> 0xa1fb), 1576933378:1576933492(114) ack 2893948287 win 5768     [second packet of large message]     12:13:12.716154 IP (tos 0x0, ttl  49, id 61062, offset 0, flags [DF], proto: TCP (6), length: 40) otherHost.otherPort > ourHost.ourPort: ., cksum 0xdc24 (correct), ack 1576933492 win 910     12:13:12.717202 IP (tos 0x0, ttl  49, id 61063, offset 0, flags [DF], proto: TCP (6), length: 68) otherHost.otherPort > ourHost.ourPort: P, cksum 0x71e5 (correct), 2893948287:2893948315(28) ack 1576933492 win 1024     12:13:12.717209 IP (tos 0x0, ttl  64, id 60355, offset 0, flags [DF], proto: TCP (6), length: 40) ourHost.ourPort > otherHost.otherPort: ., cksum 0xc90e (correct), ack 2893948315 win 5768      # With a small message (less context in extracts):               15:15:33.133940     4215.1      RSESS:000001 ------{ send                    15:15:33.133954     4215.1      RSESS:000001 ------}  send rc=OK     ...     15:15:33.133966     4215.1      RSESS:000001      Sending 512 bytes     [small message]     15:15:33.133969     4215.1      RSESS:000001      RetCode (OK)      tcpdump:               15:15:33.133949 IP (tos 0x0, ttl  64, id 37357, offset 0, flags [DF], proto: TCP (6), length: 552) ourHost.ourPort > otherHost.otherPort: P, cksum 0xfe58 (incorrect (-> 0x2dd8), 1566021015:1566021527(512) ack 2491002247 win 5768     [small message]      # System and drivers versions: Linux 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux Red Hat Enterprise Linux Server release 5.3 (Tikanga)               # /usr/sbin/ethtool -i bond0     driver: bonding     version: 3.2.4     firmware-version: 2          $ cat /proc/net/bonding/bond0     Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)     Bonding Mode: fault-tolerance (active-backup)     Currently Active Slave: eth2          # /usr/sbin/ethtool -i eth2     driver: e1000e     version: 1.2.10-NAPI     firmware-version: 5.12-2      # Next steps? Without finding the root cause for this issue, I am thinking of:   * just trying to upgrade bonding  or e1000e drivers. By the way, in order to check if any bonding bug could be involved, does anybody know where the bonding driver versions and release notes are?   * asking the other side to set a bigger TCP window since there is no issue when only one packet has to be sent for a message. In addition, that would decrease latency by 10 milliseconds, the time between first and second packet for a large message. Does anybody has any other idea? Is there any way to get trace logs for bonding or e1000e drivers?


title: Why isn't the ls command listing huge filesizes?

text: In my Redhat Linux, I am getting the following error when executing the `ls` command.               # ls     ls: sugar.sql: Value too large for defined data type


title: Printing from Linux guest with Windows host

text: I have a wireless printer set up on my Windows host, and I want to use it from my Linux guest. I got a "add a printer" window open, but when I click on "New", I get a few options, e.g. set up via Samba. What would be the easiest way to be able to set up my environment so that I can seamlessly print from my Linux guest? I'm using Windows 7 and SLED 11 (SUSE Linux Enterprise Desktop).


title: Every time I run Azureus it wants to restart because of an upgrade

text: I am using Fedora 16. Every time I run Azureus, it says that it just completed an important update and needs to restart. How can I fix this? Obviously restarting it is not helping.


title: Spell check comments in vim

text: I'm a C/C++ professional programmer who makes lots of spelling mistakes in comments. I want to configure vim such that the spell-checker only looks for misspelled words within comments. If necessary I'm willing to add special symbols around the comment that vim can look for to know where to check, such as:                int main(){          /*<--C_S              This is comment line in main function ..             C_S-->*/      }      If the plugin can work without the `C_S` symbols that'd be even better. I want the spell-checker to highlight any spelling mistakes it finds within comments. Does this already exist? Or is it easy to write myself?


title: Installation on debian 5 32-bit without being a root

text: I am new to Linux and I am trying to install Skype and Google Chrome on my desktop. It runs Debian 5 32-bit. I downloaded the packages from the web but I have no idea how to install them. I have looked on the internet but as expected "double-clicking" doesn't work. It is very frustrating! Help will be much appreciated! Thanks!


title: Multi-monitor Xorg nVidia on Ubuntu 10.10 without root?

text: Here at work we just set up a Ubuntu Terminal Server, All of our workstations have multiple monitors, of different sizes, 2-3 screens and varying nVidia video card models, but they all are nvidia. I at least have been using Twin- View. But I don't want to have to log in every day and set up Twin-View with `nvidia-settings` first thing. Is there a way to set up Twin-View from a configuration file? or possibly a startup script? I don't have root access to the TS, however if we could find a one size fits all `xorg.conf` configuration that makes multi-monitor just work on every machine then I might be able to convince the TS admin.


title: Using sed, how to format one word per line, removing white space

text: I'm trying to replaces patterns and cleanup a file containing multiple words to get one word per line. The result is achieved using this command line:               sed -e '/^[[:space:]]*$/ d' \             # remove empty line         -e 's/^[[:space:]]*//' \              # remove white space at the beginning         -e 's/[[:space:]]*$//' \              # remove white space at the ending (EOL)         -e 's/[[:space:]][[:space:]]*/\n/g' \ # convert blanks between words to newline         -e '$a\'                              # add a newline if missing at EOF         -e .....                              # replace other patterns.      (the last expression was found in How to add a newline to the end of a file?) The idea is to process the file (eg. replaces some pattern) and format the file at the same time with only one small sed program. I'm sure its possible to use other sed features to reduces the expression. Regards


title: Disadvantages to having www-data able to log in

text: I run a tiny web server basically just for hosting small data projects and files. This server has a public IP address. I would like to be able to FTP in and upload files directly to `/var/www/*`, and so I'm considering allowing the `www-data` user to have a password and log in directly. This would also avoid my having to change file ownership every time I do anything in a web directory (which I'm currently doing as root, so there's a security risk there also). Is there any security risk to allowing the www-data user to log in? If so, what's the best alternative?


title: Pidgin will not transfer files

text: Anytime someone tries to send me files over YIM or AIM when I am using Pidgin 2.7.5 on Arch Linux, it fails, telling me that they cancelled, and telling them that I cancelled. The same computer using Pidgin on Windows manages to transfer these files successfully. Is there some sort of checklist for these issues? (Previously asked on SuperUser, where it didn't have any answers, and I recently put a bounty on it here: http://superuser.com/questions/172551/pidgin-will-not-recieve-files)


title: xorg memory leak

text: I've read this question but it doesn't seem to be the same issue, as the memory leak there is an order of magnitude smaller than mine and seems to be caused by Nvidia drivers.. Here's my `top` output at the moment:               top - 03:51:03 up 7 days, 11:09, 11 users,  load average: 0.76, 0.62, 0.64     Tasks: 257 total,   2 running, 255 sleeping,   0 stopped,   0 zombie     ...     MiB Mem:  7967.691 total, 7733.668 used,  234.023 free,  126.688 buffers     MiB Swap: 8171.996 total,  602.707 used, 7569.289 free.  917.934 cached Mem            PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                1137 root      20   0 3408440 2.621g 526784 S   3.6 33.7 505:06.61 Xorg       After about a week of uptime, xorg eats up 2.5g of memory, things start getting pushed on to swap, and I have to restart as the machine gradually becomes unusable. I've checked the output of `xrestop` and it doesn't account for all of the memory used -- adding up everything there comes out to about 300m, which I'd be happy to put up with. I'm using Xubuntu 14.04 "trusty," with `xmonad` on top of `xfce4`. I have an AMD video card so I use `fglrx`. Shutting down everything I have open doesn't reduce `xorg`'s memory usage. On startup, it takes up only a few megabytes. Restarting is a hassle -- what can I do to reduce `xorg`'s memory usage?


title: How do I install opkg installer on a system that doesn't have it

text: The system I am using has no package installer in the root fs image. How do I install opkg itself? I can't find a link to the x86 binaries.


title: Disk quota exceeded; truncate not bringing quota back down

text: **Resolved** : See "However" at the end of the question for details. I've managed to hose my login to a Unix box. I don't have an easy way of contacting the administrator, so I'd like to resolve it myself ideally. I don't have root access (that would be too easy). Per the title, I've managed to create a large file through an app spamming stdout, which I now can't remove. `rm -f` doesn't work, nor does `cat /dev/null >| $file`, nor `truncate -s 0 $file`. Errors are akin to the following, for everything I've tried.               tr08[~]$ cat /dev/null >| wordlist.txt     -bash: wordlist.txt: Disk quota exceeded      Output from `quota` is unhelpful:               tr08[~]$ quota -v     Disk quotas for user meand (uid 8650):          Filesystem  blocks   quota   limit   grace   files   quota   limit   grace     tau:/uspac/mc10/m10mr                            0       0       0               0       0       0      I'm at a loss on what to do next. Google only gave me `truncate` and `cat \dev\null`, so any advice or suggestion would be gratefully received. Output requested in the comments:               tr08[~]$ uname -a     Linux tr08.ecs 2.6.30.10-106a.fc11.x86_64 #1 SMP Tue Sep 21 11:11:58 BST 2010 x86_64 x86_64 x86_64 GNU/Linux     tr08[~]$ mount | grep /m08ad     tau:/uspac/mc10/m10mr on /auto/complb/m10mr type nfs (rw,nosuid,intr,sloppy,addr=163.1.88.228)      **However** : I'm not sure what happened, but when I logged in to get the details Gilles requested in the comments, I tried an `rm`, which worked just fine. `quota -v` is now producing no output, either. I've no idea whether this is due to some admin intervention or some other cunning trickery, but it all appears sorted now.


title: Why would I keep home directories in /var/home?

text: As far as I understand, the traditional place for home directories is beneath `/home`. Some Linux variants seem to keep them in `/var/home`, what's the reason for that?


title: Recursively replace string in files

text: I want to replace the backslash in the string `page_path\example_filename.txt` with a forward slash. I also want to be able to run this on a large file system and have it recursively search all directories. I found someone on the web who said to use `grep`, `xargs`, and `sed` but I wasn't able to get it to work. I've been trying different variations on delimiters and escape characters, but didn't get it. Here is the command I was trying to run:   `grep -lr -e 'page_path\\\' * | xargs sed -i 's/page_path\/page_path//g'` Thanks in advance.


title: Is there a difference between sudo su - root and sudo -u root -H /bin/bash?

text: Like title says, is there a difference between these two commands :               sudo su - root     sudo -u root -H /bin/bash      I'm using GNU/Linux, if that makes a difference.


title: What is the difference between root and chroot?

text: Is there any different between `root` and `chroot` in Linux? Can anyone please explain them?


title: What is the difference between : and true?

text: In `bash`:               $ type :     : is a shell builtin     $ type true     true is a shell builtin      Looks like they are the same, but they don't give the same system trace:               $ strace :     strace: :: command not found     $ strace true     execve("/bin/true", ["true"], [/* 82 vars */]) = 0     [snip]     exit_group(0)                           = ?      I tried diffing `strace bash -c : 2>:.txt` and `strace bash -c true 2>true.txt`, but couldn't find any differences between them except for the memory locations. In `dash`:               $ type :     : is a special shell builtin     $ type true     true is a shell builtin      OK, so they are not the same. `help :` and `help true` aren't very useful, and they return the same in `bash` and `dash`. Is there any practical difference at all between them, except that `:` saves three bytes and makes scripts less readable?


title: Cheap thin client setup with Puppy linux?

text: Looking through the Puppylinux pages today, I wondered if it could be used to setup a low-cost thin client, that booted from a USB flashdrive or something. Considering these points:   * Low speed CPU such as P4/Dualcore is fine (cheaper)   * No HDD needed (saves $100)   * No SATA / IDE ports on motherboard needed (cheaper) So does this allow for a cheap thin client build? Are there any motherboards that cost like $100 for a basic linux experience? Do you get low-cost motherboards or mini-computers that could work well as thin clients with a tiny OS like puppylinux?


title: How do I get Wicd to use other drivers in Debian 7.2 Xfce?

text: I have an old laptop with Debian Xfce 7.2 with a wireless-n pcmcia card. NetworkManager and Wicd have the same issues with Wi-Fi, especially with authentication. The card works perfect on Ubuntu distros (though Ubuntu distros are too slow on this old laptop). I saw a post on Google+ where a guy copied a `/lib/firmware` from Arch Linux to his Debian machine and his Wi-Fi problems stopped. I tried the same thing except from Xubuntu to Debian, but it didn't work. Any way to make this work?


title: Count the number of characters in all files

text: A file **foo** contains a list of filenames. Devise a single statement that stores in a variable **count** the total character count of the contents of these files.


title: Invert *only brightness* for monitor

text: When using notebook in darkness it is more convenient to have the screen mostly black, compared to the default mostly white. The issue of inverting colors was discussed here frequently. One have a choice of either use the `xcalib -i` to invert the colors, or adjust color scheme of the individual OS components. Unfortunately the later option is unavailable for many applications, and is generally painful to set up. Here is a "typical" Linux Desktop. ![A typical Linux Desktop with typical mostly-white color scheme](http://i.stack.imgur.com/7Z4X7.jpg) Here is an effect of inverse: `xcalib -i` ![Simple inverse](http://i.stack.imgur.com/HalH4.jpg) The colors are also inverted, i.e. messed up. But what about inverting only the brightness channel? We need to first convert the picture into LAB or HSB/V color space, and then **invert only the brightness channel**. This results in correct colors, while enjoying overall darkness and high contrast: ![Picture with inversed the brightness channel](http://i.stack.imgur.com/mrXi7.jpg) **The question: are there any prospects of achieving this effect with a custom color profile?**


title: Using AWK to monitor changing values every 60 seconds

text: Does any one have an easy way of doing this using `awk`, maybe associative arrays? One other thing is there is a delay of 60 seconds between these two input streams and any time a value on the right hand side changes I will take an appropriate action. These two input streams are output from a system command and not files. Input 1:               Direct Reads      1000023     Sequential Scans  2043     Table Scans       32749 Input2:               Direct Reads      1005679     Sequential Scans  2043     Table Scans       32749 Desired output:               Changed monitor element     Direct Reads: Increased by 5656 in 60 seconds.


title: Error message on terminal despite using 2> symbol

text: Why does this command show error message despite using 2> symbol?                   cat < foo 2>bar         bash : cannot open foo : No such file or directory


title: After upgrade, X button in titlebar no longer closes xterm

text: In theory, pressing the close button ![kwin close button](http://i.stack.imgur.com/oyC4x.png) should close an xterm. It did before I did an `aptitude upgrade`. (I'm running Debian testing). But now it doesn't—clicking the X does nothing—but only for _some_ xterms. In particular, if I launch an xterm from the KDE quicklaunch thing, or the K menu, those xterms are closeable. If, however, I launch it from a keyboard shortcut (khotkeys), then that xterm is not closeable. Further, this is recursive: if I launch an xterm from an xterm, its closeable if its parent is. This doesn't happen in general. It's only for xterm. I've tested starting these apps from an uncloseable xterm, and they are all closeable:   * gvim   * xclock   * xditview   * dolphin   * konsole Interspersing another program in there breaks the chain (e.g, starting an xterm from konsole):   * xterm (uncloseable) → xterm (unclosable) → xterm (uncloseable) → …   * xterm (uncloseable) → konsole (closable) → xterm (closable) → … I've checked my kwin Window Rules, I do not have any for xterm.


title: Triggering Bash Before Killed

text: I just made some kind of service code. Check this out:               do_start() {         while true         do             if [[ $(pgrep -fl loopsvn.sh | wc -l) -gt 2 ]]; then                 echo "Already use by another process..."                 exit             else                 echo "Press [Ctrl+C] to stop..."                 sleep 1             fi         done     }          do_stop() {         killall loopsvn.sh     }      My question, how can I start some other process before it is killed?   My plan was like this:               do_restart() {          cat loopsvn.sh > svntmp.sh          chmod +x svntmp.sh          do_kill          exec svntmp.sh #HOW CAN I DO THIS LINE AFTER do_kill     }      this script is one-instance process, so after kill, it triggers other script to execute.


title: Multi-line replace

text: I spent ages trying to figure this out. As it happens, I don't need to do it any more; I found another way. But for the sake of my sanity, I'd like to know the answer anyway. It's quite easy to use `sed` to replace a marker with some piece of text. What I can't figure out is how to make `sed` insert a huge block of text, with complex formatting such as multiple lines, tab characters, etc. How do you do that? Is `sed` the best thing to use or what?


title: Why does pipe not work with cat and locate?

text: I am trying to perform this:               locate pg_type.h | cat      But this command simply does nothing different than locate pg_type.h What should I change ? I want to perform `cat pg_type.h` wherever `pg_type.h` may be.


title: Why does top report the incorrect CPU usage?

text: I have a machine with `Intel(R) Xeon(R) CPU E5520` visible as 16 logical cores (8 with HT). If I run something to eat CPU time (single threaded) top correctly reports 100% CPU usage for the process but only around 3-4% total usage.               Cpu(s):  3.6%us,  0.0%sy,  0.0%ni, 96.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.1%st            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      1567 www       20   0 65632   84    4 R  100  0.0   0:05.96 burnMMX      Surely the reported usage should be ~6.25% (1 of 16 cores).   * Is it incorrect because it's a virtual machine?    * How could I calculate a correct value?


title: Why can't I redirect a path name output from one command to "cd"?

text: I am trying to get `cd` to accept a directory name redirected to it from another command. Neither of these methods work:               $ echo $HOME | cd     $ echo $HOME | xargs cd      This does work:               $ cd $(echo $HOME)      Why does the first set of commands not work, and are there others that also fail this way?


title: Do you feel strongly about using package managers vs. installing manually?

text: Up until recently, I tried to stay away from installing stuff manually from tars on my Fedora 16 but the experience I had with Tomcat 7 out of the yum repo changed that. The app was littered with config errors as it came out of the repository. Some packages are clearly better installed and configed manually. Do you have a personal philosophy on this and guidelines when you use the package manager vs. when you install manually?


title: add groups from external file

text: I want to write a script which add groups to the system, specified in `groups.txt` file.   content of **groups.txt** :   > group01 : computer   >  group02 : electronics   >  group03 : IT   >  .   >  .   >  .   >  .   >  group13 : instrumentation   >  group14 : EOF any help would be appreciated ?


title: ifconfig: more different device items than physical NICs/sockets

text: I have a simple router for home users (D-Link DIR-300) with embedded Linux (kernel 2.6.21) and a bunch of networking tools. Inspecting the internals of of this system through telnet, I've got this output (slightly modified and stripped; `lo` and `ifbN` skipped) for the `ifconfig -a` command:               br0       Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2E               inet addr:192.168.5.1  Bcast:192.168.5.255  Mask:255.255.255.0               RX bytes:94887799 (90.4 MiB)  TX bytes:1042490563 (994.1 MiB)          br8       Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2E               RX bytes:974053699 (928.9 MiB)  TX bytes:0 (0.0 B)          eth2      Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2E               collisions:0 txqueuelen:1000               RX bytes:2150801235 (2.0 GiB)  TX bytes:2142220936 (1.9 GiB)               Interrupt:3          eth2.1    Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2E               RX bytes:17544 (17.1 KiB)  TX bytes:994732248 (948.6 MiB)          eth2.2    Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2E               RX bytes:0 (0.0 B)  TX bytes:72669 (70.9 KiB)          eth2.3    Link encap:Ethernet  HWaddr CB:B2:55:9C:4D:2E               RX bytes:96947373 (92.4 MiB)  TX bytes:1045811045 (997.3 MiB)          eth2.4    Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2E               RX bytes:0 (0.0 B)  TX bytes:72669 (70.9 KiB)          eth2.5    Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2F               inet addr:ex.te.rn.al  Bcast:ex.te.rn.255  Mask:255.255.255.0               RX bytes:2024079220 (1.8 GiB)  TX bytes:99321148 (94.7 MiB)          eth2.5.35 Link encap:Ethernet  HWaddr CB:B2:32:9C:4D:2E               ... PROMISC ...               RX bytes:984221760 (938.6 MiB)  TX bytes:22318 (21.7 KiB)      Physically there are 5 ethernet sockets, but as it could be seen from the above info there are 2 hardware NICs (CB:B2:32:9C:4D:2E and CB:B2:32:9C:4D:2F) and this appears logically: LAN and WAN. Maybe I'm wrong even with this, but `eth2.5` seems to be the only _normal_ case (its own IP/MAC). Other 8 generates difficulties understanding what's going on there: all 8 records have the same MAC (CB:B2:32:9C:4D:2E), only `br0` has an assigned IP, `eth2` seems to be special with `txqueuelen:1000` and an interrupt (others don't have interrupts, even `eth2.5`), `eth2.2` and `eth2.4` are identical with the same amount of TX bytes and they don't recieve bytes, `br8` is just receiving bytes. So, how does this networking _magic_ work? many different device names, same MAC, different properties   What are the relations between NICs, MAC addresses, device names?


title: bash value of $LINE is not showing when defined like val=`$LINE`

text: I have the following bash script for some reason $LINE value is not coming on val=. I can see the line from file is read can be display by each $LINE but when defined in the val.. is not showing.                 #/bin/bash       while read LINE       do            echo "Processing:" $LINE            val=`ldapsearch -h localhost -w test -z 0 -x -b 'dc=test,dc=org' -D "cn=admin,dc=testing,dc=com" id=$LINE | grep val`            echo $LINE "," $val       done < inputfile.txt      any idea what I am doing wrong here.


I have a question concerning linux commands. How do I count all the files that begin with letters from a to g?


title: How to view commandline of processes executed in last 10 seconds

text: Is there a view to log and list down the processes executed in last 10 seconds ? I especially want to trace the command line.


title: Where is the error page location of squid proxy server?

text: I'm using squid proxy sever on my ubuntu 12.04 LTS. Where is the error page location so that I can customize it..


title: How to extract specific file(s) from tar.gz

text: How can we extract specific files from a large tar.gz file? I found the process of extracting files from a tar in Untar only a certain number of files from a large tarball but, when i tried the mentioned command there, i got the error: `$ tar --extract --file={test.tar.gz} {extract11}` `tar: {test.tar.gz}: Cannot open: No such file or directory` `tar: Error is not recoverable: exiting now` How do i extract a file from tar.gz then?


title: How can I monitor disk io?

text: I'd like to do some general disk io monitoring on a debian linux server. What are the tools I should know about that monitor disk io so I can see if a disk's performance is maxed out or spikes at certain time throughout the day?


title: Difference between executing multiple commands with && and ;

text: What's the difference between executing multiple commands with `&&` and `;`? Examples:               echo "Hi\!" && echo "How are you?"      and               echo "Hi\!"; echo "How are you?"


title: How to override the Gnome 3 SSH handler?

text: I would like to be able to click on SSH links that look like `ssh://user@servername` and have a gnome-terminal open that runs SSH inside of it. After reading up on the XDG stuff I did the following: I created a shell script in $HOME/bin/ssh-terminal with the following:               #!/bin/sh     dest=${1#ssh://}     gnome-terminal -e "ssh $dest" &      This works from the command line. I created $HOME/.local/share/applications/ssh-terminal.desktop with:               [Desktop Entry]     Type=Application     Name=SSH Terminal     Exec=ssh-terminal %u     Icon=utilities-terminal     StartupNotify=false     MimeType=x-scheme-handler/ssh;      I ran `update-desktop-database ~/.local/share/applications/` Now when I try to run `xdg-open ssh://user@hostname` I get the following error:               $ xdg-open ssh://buildbot@10.16.50.74     gvfs-open: sftp://buildbot@10.16.50.74/: error opening location: The specified location is not mounted      I don't _want_ to open it as a sftp mount and I cannot seem to find where that is set! Where do I go from here?


title: calculate sum of squares using shell script in perl/awk

text: I have 2 files as below. **file1**               0.34     0.27     0.32      **file2**               0.15     0.21     0.15      Now, I would like to calculate the sum of squares between each column. For example,               [(0.34 - 0.15)^2 + (0.27 - 0.21)^2 + (0.32 - 0.15)^2 ] / 3      Where **3** is the total number of lines in the file. I will be having same number of lines in both the files. I have come up with the below bash script which works perfectly fine, but I want to know if there is some other easier way.               #! /bin/bash        sum=0.0     while true; do       read -r lineA <&3       read -r lineB <&4       if [ -z "$lineA" -o -z "$lineB" ]; then         break       fi     diff=$(bc <<< "scale=5; $lineA - $lineB")     square=$(bc <<< "scale=5; $diff*$diff")     sum=$(bc <<< "scale=5; $sum+$square")     done 3<file1 4<file2     filelen=`wc -l file1 | cut -f1 -d' '`     final=$(bc <<< "scale=5; $sum/$filelen")     echo "$final"      Is there a simpler way in `awk` or `perl`? **EDIT** I had 2 million rows in my input file and the input file actually contained scientific numbers like below.               3.59564e-185      My script as well as the suggested answers failed on scientific numbers. However, I could make my script in the question work when I changed the scientific numbers to `10^` notation. I converted my input file as below.               sed -e 's/[eE]+*/\*10\^/' file1 > file1_converted     sed -e 's/[eE]+*/\*10\^/' file2 > file2_converted      Now, the suggested 2 answers failed giving me the error message as `Nan`. My script seemed to work but for 2 million rows it is taking a long time to execute. Is there any efficient way to make it work?


title: Can't load my PAM module - how to diagnose?

text: I've written a `PAM` service module, and added it into `lightdm` by editing `/etc/pam.d/lightdm`. But `lightdm` complains (in `/var/log/auth.log` on Ubuntu 14.04):               Sep  9 14:16:48 Ubuntu-build lightdm: PAM unable to dlopen(pam_my.so): /lib/security/pam_my.so: cannot open shared object file: No such file or directory      When I look at what's happening via `strace()`, contrary to the log message it _is_ finding and opening my `PAM` module, and starting to inspect it, but then it gives up and keeps searching for it in other directories, ultimately complaining it couldn't find it. Here's some sample output:               12230 open("/lib/x86_64-linux-gnu/security/pam_my.so", O_RDONLY|O_CLOEXEC) = 4     12230 read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\f\0\0\0\0\0\0"..., 832) = 832     12230 fstat(4, {st_mode=S_IFREG|0644, st_size=17728, ...}) = 0     12230 mmap(NULL, 2105544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7fe087ebe000     12230 mprotect(0x7fe087ec0000, 2093056, PROT_NONE) = 0     12230 mmap(0x7fe0880bf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x1000) = 0x7fe0880bf000     12230 close(4)                          = 0      In a working case (e.g. `pam_unix.so`) instead of the `close()` it continues with another `mmap()` and then proceeds. I've looked in all the logs in `/var/log/*` and can't find any more information to tell me what `PAM` is unhappy about. I don't even know what source I could look at to diagnose what's going wrong. The module appears to be built correctly. I've read the `Module Writers Guide` and _think_ I'm following all the right rules. Any clues on how to proceed to diagnose this? I also tried touching `/etc/pam_debug` but that didn't provide any useful log messages.


title: uemacs 4.0.15 strange key bindings

text: Playing around with uemacs I noticed that some of the default alternative key bindings are set to the Fn key in combination with a different key (for example, an alternative for 'help' is set to 'FNh', i.e. press Fn and h). From what I know, using the Fn key as a meta key is not possible (since doing the command 'xev' and pressing 'Fn' does not generate any keycode). Is there a work around for using Fn in uemacs?


title: How to create a tar.gz file from a folder excluding a folder

text: How do I exclude a file or folder while creating a tar.gz file with tar command?


title: pam_tacplus.so and sshd: skip user validation?

text: I'm trying to implement tacacs authentication on a freebsd box as a client. The box is actually a network appliance that SHOULD have this config built into its cli/ui but doesn't. Since it's built on freebsd, it has the pam_tacplus.so library built in. My problem is that I wish to authenticate to our tacacs server, but I don't wish to configure local accounts on the appliance. Here's the pam.conf file:               su      auth        sufficient  pam_rootok.so     su      auth        sufficient  pam_unix.so          login   auth            required        pam_unix.so     login   account         required        pam_unix.so     login   password        required        pam_permit.so     login   session         required        pam_permit.so          ftpd    auth            required        pam_unix.so          sshd    auth            sufficient      pam_tacplus.so  template_user=testuser           sshd    auth            required        pam_unix.so     sshd    account         required        pam_unix.so     sshd    password        required        pam_permit.so     sshd    session         required        pam_permit.so          telnetd auth            required        pam_unix.so          passwd  password        required        pam_unix.so     no_warn try_first_pass nullok          other   auth            required        pam_unix.so      The tacacs server's ip address is stored in /etc/tacplus.conf and since I see failures in the tacacs server's log, I believe communication is successful. Additionally, I can establish TCP session to server on port 49. When I try to log in via ssh as jimbob, here's what I see in the /var/log/auth.log:               <auth.info> Lab-2 sshd[4952]: Invalid user jimbob from 10.0.0.1     <auth.info> Lab-2 sshd[4952]: input_userauth_request: invalid user jimbob     <auth.info> Lab-2 sshd[4952]: Failed none for invalid user jimbob from 10.0.0.1 port 52069 ssh2     <auth.info> Lab-2 sshd[4952]: Failed publickey for invalid user jimbob from 10.0.0.1 port 52069 ssh2     <auth.info> Lab-2 sshd[4952]: Postponed keyboard-interactive for invalid user jimbob from 10.0.0.1 port 52069 ssh2     <auth.info> Lab-2 sshd[4952]: Postponed keyboard-interactive/pam for invalid user jimbob from 10.0.0.1 port 52069 ssh2     <auth.err> Lab-2 sshd[4953]: error: ssh_msg_send: write      After searching around, this seems to apply. This, however, talks about NSS, which is controlled by nsswitch.conf, which doesn't exist on this system. There doesn't appear to be a tacacs plugin for NSS; I'm not sure that it would matter, in my case, if there were. So, is there a way to skip checking the local passwd file for a user before getting to the pam_tacplus.so library? I'm guessing that if there were, the template_user= option would kick in and try to use 'testuser,' which DOES exist as a localuser:               pw user show testuser     testuser:*:1003:1003::0:0:User &:/home/testuser:/usr/bin/bash


title: Problem in installing Google voice and video plugin for Gmail

text: I just downloaded Google talk plugin for voice and video (for audio/video chat in gmail). I am using RHEL6. I downloaded the plugin (64 bit, rpm format). While installing it an error comes which says ![enter image description here](http://i.stack.imgur.com/wMEu4.png) and then installation stops. What is this? There is already newer version installed then why not it is installing ? What is wrong?