title: Installing Debian on an SSD

text: Does the Debian installer work out of the box for SSDs? I.e. I heard that you need to align the partitions to 32bit virtual clusters (is it actually true?). Are there any other things I need to take into account while installing Debian on SSD? I already have some general pointers on running from an SSD: Optimal SSD configuration In this question I would just like to ask about the actual installation procedure.


title: Debian on 64 bit Intel Core 2 Quad

text: I just ordered a new SSD, and so I am planning to reinstall my Debian system. I have an Intel Core 2 Quad CPU (Q9450). Does it make sense to install the 64bit version (I have just 4GB of RAM, plus 1GB on the graphics card if it makes any difference, but I am considering increasing this amount). Which architecture should I choose? Also I am using the proprietary nvidia drivers, do they work at all and are they stable on the 64 bit systems?


title: Linux SSH logging via PUTTY

text: I have Linux console, managed from Windows. Can login to Linux console from `MSTSC` service of Windows, as `xrdp` is installed on Linux.   However I cannot login via Putty with SSH connection. It's displaying error as 'Access denied'. This error started to occur after I abruptly stopped the execution of `rsync` operation with `Ctrl`+`C` which I started from Putty. Logging in as user: root   Operating System: Fedora 13 What might have gone wrong?


title: Use EncFS to encrypt files so that a particular user or process can access them, but root cannot

text: I have a process which I would like to have access to an encrypted file system. This is very easy to do with EncFS, but this requires a user mounting the encrypted file system, therefore giving any user who has access to the mounting user access to the data, e.g. root. Is it possible to have the process mount the file system so that only it has access to the data? If not, is there another way to prevent those who do not know the passphrase from accessing the data?


title: How can I match a ttyUSBX device to a usb serial device

text: option driver correctly matched USB ID and loads driver for this device. For example               # lsusb     Bus 001 Device 002: ID 19d2:0031 ONDA Communication S.p.A. ZTE MF636     Bus 001 Device 003: ID 12d1:14ac Huawei Technologies Co., Ltd.      It also creates ttyUSBX devices for managing the hardware               crw-rw---- 1 root uucp 188, 0 Jul  4 13:48 /dev/ttyUSB0     crw-rw---- 1 root uucp 188, 1 Jul  4 13:49 /dev/ttyUSB1     crw-rw---- 1 root uucp 188, 2 Jul  4 13:35 /dev/ttyUSB2     crw-rw---- 1 root uucp 188, 3 Jul  4 13:37 /dev/ttyUSB3     crw-rw---- 1 root uucp 188, 4 Jul  4 13:37 /dev/ttyUSB4     crw-rw---- 1 root uucp 188, 5 Jul  4 13:37 /dev/ttyUSB5     crw-rw---- 1 root uucp 188, 6 Jul  4 13:37 /dev/ttyUSB6     crw-rw---- 1 root uucp 188, 7 Jul  4 13:37 /dev/ttyUSB7      However, I have more then one usb serial devices and I want to know which ttyUSB is for which USBID. Ex. /dev/ttyUSB1 -> 19d2:0031 Do you know any point where I can get this information?


title: Why doesn't NTP increase polling interval when using a GPS/PPS receiver and internet servers?

text: I have a Debian system that is used as an NTP server. It queries several servers on the internet and also has a GPS receiver with PPS output for precision timekeeping. If I don't use the GPS receiver, NTP gradually increases the polling interval from the initial interval of 64 seconds up to the default maximum of 1024 seconds, typically within an hour or two. This is normal behavior and generally considered polite since it minimizes the amount of queries made to the internet servers while still keeping the local clock in sync. However, when I connect the GPS receiver and add the appropriate lines to the `ntp.conf` file to allow NTP to use it as a source, the behavior changes: even though I have not changed any of the individual `server` entries for the internet servers, their polling interval does not increase and remains fixed at 64 seconds even after days go by. The PPS signal keeps the local clock well-disciplined (`ntpq -p` reports an offset of 0.000 ms with a jitter of 0.002 ms, with all the internet servers within about 2 ms), while the tally codes in `ntpq -p` confirm PPS discipline and show, as expected, that most of the internet servers are selected as "truechimers" while there are occasionally a few outliers. **In short** : everything appears to be working normally as expected, with the exception that the polling intervals for the internet servers do not increase. Why not? I can manually force the polling interval longer by putting, for example, `minpoll 10` in the `server` lines for the internet servers, but I'd much rather have NTP auto-manage the polling interval of internet servers when PPS is enabled, just like it does when PPS is not used. I currently have NTP set to check the PPS driver with `minpoll` and `maxpoll` of `4` (16 seconds). However, I have tested the configuration without the forcing `minpoll` or `maxpoll` on any `server` line, including that for the PPS driver. Here is the relevant portion of my `ntp.conf` file:               # Drift file     driftfile /var/lib/ntp/ntp.drift          # PPS Driver (check every 16 seconds)     server 127.127.22.0 minpoll 4 maxpoll 4     fudge 127.127.22.0 refid PPS          # Internet servers. Use iburst to get quick sync on startup.     # Server is located in Switzerland, so choose Swiss or German     # primary time servers and members of the Swiss NTP pool.     #     # At least one "prefer" server is needed for PPS to work properly.     # See <http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver22.html>     # "This driver is enabled only under one of two conditions..."     server ntp.metas.ch iburst prefer     server ptbtime1.ptb.de iburst prefer     server ptbtime2.ptb.de iburst prefer     server ptbtime3.ptb.de iburst prefer     server 0.ch.pool.ntp.org iburst     server 1.ch.pool.ntp.org iburst     server 2.ch.pool.ntp.org iburst     server 3.ch.pool.ntp.org iburst


title: Serial Communication on DD-WRT stty config not sticking

text: I am attempting to control a serial device (in this case a projector) using a Fonera router with DD-WRT on it. I've got the serial port on the fonera wired through a level shifter and then into my projector's serial port. I've made the following stty command to configure the serial device according to my needs:               stty 19200 -F /dev/tts/0 cs8 -crtsdts -parenb -cstopb -ixon clocal echo      The projector's documentation says it should be a 19200 baud rate, 8-bit length, No parity, one stop bit, and "None" for X on/off. However when I run that command and then run               stty -F /dev/tts/0 -a      to list the config, I get different results:               root@DD-WRT:/dev# stty -F /dev/tts/0 -a     speed 115200 baud; rows 24; columns 80;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;     swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;     min = 1; time = 0;     -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff -iuclc -ixany -imaxbel     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke      Notice the speed is wrong. What am I doing wrong?


title: cd ${DIR_PATH} returns 'No such file or directory'

text: OS = `MacOS 10.8.5`/`Darwin Kernel Version 12.5.0`. In my `.bash_profile` I have:               export DIR_PATH=~/concrete/path      At the terminal               >echo ${DIR_PATH}     ~/concrete/path      Also explicit cd works:               >cd ~/concrete/path     >pwd     /Users/myuserid/concrete/path      But when I do               >cd ${DIR_PATH}     -bash: cd: ~/concrete/path: No such file or directory      What is the problem?


title: How can I fake sending -time when sending email with Mutt?

text: Suppose a student is two hours late in returning an assignment. Now the assignment needs to travel a long way in internet so there is a good excuse that it got lost in somewhere or got jammed (well ok, fails but one always needs to find good reasons to return things a bit late in a funny way). Now is there some way you can make it look like the email was sent much earlier than it was actually sent? Look I have strict timelines like 23.59, I am uncertain which clocks they use the measure that -- sending or arrival time and in which time-zone. Could I change the time-zone so my email becomes "on time"?


title: How to install patterns and packages at the same time?

text: How can I install package patterns (e.g. "C/C++ development tools") and packages (e.g. "mercurial") at the same time? Currently, two commands are necessary; for example, the installation instructions I wrote for `sketch- frontend` are,               sudo zypper install -t pattern "devel_C_C++" "devel_java"     sudo zypper install java-1_6_0-openjdk-devel mercurial      [ link ]. _(motivation)_. It's true one only needs two commands, but on machines with slower internet connections (or slower processors), not having the second command automatically continue is annoying. Also, the user _does_ need to be prompted for package resolution, so just adding the `\--non-interactive` flag is not an option. Thanks!


title: MySQL permission denied error even after setting security context for SELinux on VM

text: I have MySQL installed on CentOS (detail versions given below). My OS is a VM machine and not a physical machine, the directory `/data/mysql` is a local disk (virtual). I suspect I might need to do some extra steps in a virtualized environment. This link has some information on SELinux & virtualization but not sure how to include it for MySQL. MySQL works fine with the data directory in `/var/lib/mysql` but the moment I move it to another directory on different disk it stops working. Whereas different directory on the same disk works. If I disable SELinux, MySQL works with different disk. SELinux is restricting different drive. I tried the solution given in the following two links   * SELinux and MySQL   * Re: Moved datadir and now get: ERROR! The server quit without updating PID file In particular the following two commands:               $ semanage fcontext --add --type mysqld_db_t '/data/mysql(/.*)?'     $ restorecon -r /data/mysql      When I run:               $ ls -dZ /data/mysql      I get the following:               drwxr-xr-x. mysql mysql unconfined_u:object_r:mysqld_db_t:SystemLow       Still I keep getting: > /usr/sbin/mysqld: Can't change dir to '/data/mysql/' (Errcode: 13 - > Permission denied) Is there anything else I need to do?   * MySQL : mysql Ver 14.14 Distrib 5.6.14, for Linux (x86_64) using EditLine wrapper   * OS : CentOS release 6.4 (Final)


title: ssh connection hangs when looking up a SERVFAIL domain

text: Scenario: I am browsing the internet through an `ssh -D` port-forwarding tunnel, both browsing (http, https, ...) connections and domain lookup queries are done using this `SOCKS 5` local proxy. The problem happens when I click a link to a domain that has a problem with its nameservers, at this point the ssh connection just stalls, all sockets using this proxy are paused, even the interactive shell session (ssh connection) is paused for about half a minute. Any idea on how to solve this issue (while still using the ssh connection to resolve the domain names)? Commands below are executed on the server, with an example domain that has this issue.               aularon ~ $  time dig kjdecor.com ANY          ; <<>> DiG 9.9.2-P2 <<>> kjdecor.com ANY     ;; global options: +cmd     ;; connection timed out; no servers could be reached          real    0m21.207s     user    0m0.008s     sys 0m0.009s     aularon ~ $  time nslookup kjdecor.com     ;; connection timed out; no servers could be reached               real    0m21.095s     user    0m0.005s     sys 0m0.008s


title: Mouse shortcut to copy the path to a file in the Gnome file manager

text: Is there a Linux equivalent of the Windows Shift+Right-click sequence? I use this a lot on files and directories to get the 'hidden' "Copy as path" option in the pop-up menu. It saves a lot of typing (and typos) when using the command line. I'm hoping that Linux has something similar, so I can go to the 'Files' window in a GUI (Gnome3 in my case) and just copy a file or directory location as a path and then paste it in a terminal window. This function would be especially handy in Linux given the heavy reliance on the terminal! Is this possible?


title: How can I get my external IP address in bash?

text: I need to find my external IP address from a bash script. At the moment I use this function:               myip () {          lwp-request -o text checkip.dyndns.org | awk '{ print $NF }'     }      But it depends on `perl-libwww`, `perl-html-format`, `perl-html-tree` installed. What other ways can I get my external IP?


title: How to get IP Address using shell script?

text: Want to get the IP address using Shell script. Without knowing the eth0 or eth1 or eth2 How to get the particular IP address. I am not interest to get localhost address, want to get **private IP address**.


title: How to forward port after tunneling

text: Today I have read this question and answer (How does reverse SSH tunneling work?). I tried it out and it worked perfectly however I want to know one thing. Say I have a web server running on port 8000 and I forward that port to my receiving server. How do I then forward the port the receiving server gets to others on the network. E.g.: I have a Server 1(Ubuntu Server running with full port forwarding and no firewall). I have another server 2 (running WITH a firewall and without port forwarding). I use SSH tunnelling to put my web server onto Server 1 from server 2. How can I let clients who can connect to server 1 connect to the tunnelled service from server 2 via server 1 Client 1 Cannot Connect to Server 2 but can connect to server 1.


title: Globally replace Vi with Vim on Fedora

text: On Debian-based systems the alternatives system handles both the `vi` and `vim` executable. So if `vim` is installed and you execute `vi`, you also get `vim`, which I find very nice, because I absolutely hate classic `vi`. On Fedora 17 "Beefy Miracle", the alternatives system obviously doesn't handle none of the two. But there is a profile file in `/etc/profile.d/vim.sh` which adds a shell alias to make `vi` execute `vim`. For some reason it does not do that for system users, including root. But even if I set up an alias for all users manually, when I call `sudo vi` I'm starting classic `vi` instead of `vim`. That's probably because sudo doesn't start a shell or profile files are only executed in interactive shell sessions. What I'm looking for now is a way to uninstall classic `vi` completely to make a symlink that even survives system updates. How can I remove classic `vi` but not `vim` on Fedora 17? Or is there even a better way? **Update** : With `yum provides vi` I found out that `vi` is provided by the package `vim-minimal`. But I can't simply remove it because it automatically removes the package `sudo` with it. Even if I do remove it, and try to install `sudo` again afterwards, `vim-minimal` is then again installed as dependency. **Update** : As requested, output of `rpm -qf /usr/bin/vi`:               vim-minimal-7.3.444-1.fc17.x86_64      And `ls -l /usr/bin/vi`:               -rwxr-xr-x. 1 root root 782248 13. Feb 2012  /usr/bin/vi


title: Configure the fields of the Rmail summary

text: How do I configure the fields of the Rmail summary? The code is in `rmailsum.el`, but I just can't find the place! For example, the first column in the Rmail summary seems to indicate... mail number? I can't say I need this information ;) so how do I specify not to show it? Or, if there is no such option, can you find the place that actually prints it, in the code?


title: Can I use hdparm -B254 -S240 /dev/sda?

text: According `man hdparm`, `-B254` does not permit spindown. -B(1--127)`permits spindown. But`-B127 -S240` will makes **Load_Cycle_Count** increase too fast about 4/minute. How to set up hdparm parameter? I use laptop computer.


title: How to change the language for date command?

text: I'm using `vnstat` together with `conky`. To show the monthly traffic I'm mixing `vnstat` and `grep` to find the month. The command to collect the data is               ${execi 3600 vnstat -m -i wlan0 | grep "$(date "+%h")" | awk '{print $3 $4}'}      but the problem is that `vnstat` returns the month in English (Dec for December) and `date` returns it in Portuguese (Dez for Dezembro). So my command is not working for the monthly traffic. Any help?


title: Pulseaudio and Pavucontrol very unstable

text: I've recently installed ArchLinux on my desktop, together witht the GNOME3 Desktop. I installed pulseaudio and pavucontrol, which both seem to be very unstable. First I couldn't get my headset to work, but after changing the settings, and reverting the changes, that seemed to be fixed. I still have a problem with Pavucontrol though. When I open pavucontrol, it usually takes a few seconds to connect to the pulseaudio server, and it'll only work for say a minute and then it'll simply crash without further notice. Often it has to reconnect to the pulseaudio server at random intervals, while using the program. Further, when I move the slider to adjust my volume, the sample being played is played very quickly, and when playing sound in Firefox through flash, it'll get played fast as well. Some sounds (not flash) will simply not get played at all, or get played for a second and than simply stopping. Is there a way I can fix this? What is causing this issue? Is it Pavucontrol, Pulseaudio, Alsa or even the kernel? * * * When I create a new (console-)session, and login as root, my headset volume will be terribly loud. (I press tab and the standard beep will play through the whole house, just from my headset). Adjusting alsamixer volumes has no effect on this. * * * **UPDATE:** After a reboot my headset simply stopped working. It is detected by Pulseaudio, but no sound can be heard. It is not muted in Alsamixer. My headset's microphone is also properly detected while plugged or not, but when it is unplugged, I can still select it (and it'll be marked as unplugged) and it'll still be receiving sounds. The sounds being received seem to be a weakened version of my internal microphone. When it is not plugged in the sound is properly received from the actual microphone. The restart also seems to have stabalized pulseaudio drastically.


title: ssh ncat keeps ncat process running after disconnect; how do I prevent that?

text: If I run the command               $ ssh othermachine ncat localhost 10000      that opens an `ssh` session to "othermachine" and pipes it into an `ncat` process. (There's something else listening on "othermachine" port 10000). Now if I disconnect the `ssh` session (with `Ctrl`+`C`) the `ncat` process on "othermachine" keeps running. How do I prevent that? I want `ncat` to die if its parent ssh exits.


title: Typical text files present on all (most) GNU/Linux systems?

text: I may need to develop some short snippets/examples involving reading text files; so I thought - why not use some files that are typically present on all (and since I sense "all" may be a stretch, then "most" is fine) Linux "vanilla" systems/distros? (primarily interested in Linux here) The only one I can think of for now is `/etc/fstab` - however, it should be owned by `root`, so I'm not sure whether that will interfere with my snippets later on - I'd like an average user to at least be able to read them (although, `fstab`'s permissions are `-rw-r--r--`, so I don't think read-only would be a problem; for instance, `cat /etc/fstab` works fine under my regular username). Another reason why I wouldn't like to use it, is because it contains potentially sensitive information... In any case, I was wondering - are there any other text-files that could be considered "standard" in typical GNU/Linux systems, that I could use for this purpose? (basically, something like example.com, but on your local filesystem)


title: Give a Root owned folder web read and write access

text: I have an Ubuntu server for a client I am working on, doing development work. I have root access and they created a new vhost `blog.domain.com` so when I log into it with WinSCP it list the files and there owners are `Root` user. So now my PHP scripts are not able to write or do anything, what can I do or change to make my PHP scripts be able to read and write in this directory as they need?


title: Checklist for a painless distro-migration for a workstation: what should I keep in mind?

text: I have long been frustrated and unsatisfied with the setup I have at work. I have been running OpenSuSE 11.3 with great joy, but as it phased out of official existence I tried out 11.4, got lots of bugs, jumped on 12.1 with great expectations only to run into the madness that is Gnome3. I have been using Mint 12 since then, but I feel it has certain odd bugs, even though I keep all packages up-to-date. I am considering Mint 13 or possibly switching back to OpenSuSE with XFCE, perhaps even trying out Fedora. Problem is that I can not keep fiddling around with my PC for days, in the middle of projects. I am not a guru but by no means a complete newbie to the tux world either. I have migrated to a different distro a couple of times before but I find it to be rather tricky business. You take backups of everything, repartition the hdd to make sure the old setup is not destroyed in case the new distro doesn't work, so you can at least boot into the old one etc. Is there a way to make the switch as painless and seamless as possible? How can I avoid losing my data both as documents etc, but also preferences/settings that I have fixed over the months/years?


title: CNAME: Mail address gets rewritten

text: I have a problem with receiving mails. I do not know if my server or the server of the sender is wrong configured. I have a domain daniel-marschall.de which has following DNS RR:               daniel-marschall.de.    86400   IN  CNAME   viathinksoft.com.      The domain viathinksoft.com has the MX RR to "mail.viathinksoft.com":               viathinksoft.com.   85651   IN  MX  0 mail.viathinksoft.com.      mail.viathinksoft.com runs Postfix, Cyrus and Debian Linux. When I send an email to webmaster (at) daniel-marschall.de e.g. using GoogleMail, the user "Daniel Marschall" at our system receives the email, which is correct. But when the server "startcom.org" sends an email to webmaster (at) daniel- marschall.de , the email gets "hard redirected" to webmaster (at) viathinksoft.com which is a different mail account. The relevant parts of the email headers are:               Received: from viathinksoft.de ([unix socket])          by viathinksoft.de (Cyrus v2.2.13-Debian-2.2.13-19+squeeze3) with LMTPA;          Tue, 06 Nov 2012 02:15:02 +0100     Received: by viathinksoft.de (Postfix, from userid 5001)         id AD83016CE112; Tue,  6 Nov 2012 02:15:01 +0100 (CET)     Received: from mta1.startcom.org (apache-7.startcom.org [192.116.242.7])         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))         (No client certificate requested)         by viathinksoft.de (Postfix) with ESMTPS id 90F5116CE107         for <webmaster (at) viathinksoft.com>; Tue,  6 Nov 2012 02:14:55 +0100 (CET)     Received: from localhost (com.internal.startcom.org [192.168.0.180])         by mta1.startcom.org (8.13.8/8.13.8) with ESMTP id qA61EbIS010233         for <webmaster (at) daniel-marschall.de>; Tue, 6 Nov 2012 03:14:37 +0200     From: ...     To: webmaster (at) viathinksoft.com (<-- WRONG!!!)      As you can see, the email was initially intended for "webmaster (at) daniel- marschall.de", but now it has the field "To: webmaster (at) viathinksoft.com", so my MTA dropped the mail to the owner of viathinksoft.com . I think the sender's MTA thinks that "CNAME" RR means that the address needs to be rewritten, but as far as I know, CNAME is only a soft redirect on DNS basis and should not force the MTA to rewrite the domain name. Or am I wrong? PS: The log entries are showing that my server already has the wrong address when the mail is incoming:               $ cat /var/log/mail.log | grep '90F5116CE107'     Nov  6 02:15:00 viathinksoft postfix/smtpd[18184]: 90F5116CE107: client=apache-7.startcom.org[192.116.242.7]     Nov  6 02:15:00 viathinksoft postfix/cleanup[19928]: 90F5116CE107: message-id=<c76cb951ea724270c94ff1b0e8d4de4e (at) startcom.org>     Nov  6 02:15:00 viathinksoft postfix/qmgr[9843]: 90F5116CE107: from=<certmaster (at) startcom.org>, size=1583, nrcpt=1 (queue active)     Nov  6 02:15:01 viathinksoft postfix/pipe[20419]: 90F5116CE107: to=<info (at) viathinksoft.de>, orig_to=<webmaster (at) viathinksoft.com>, relay=spamassassin, delay=6.2, delays=5.5/0/0/0.76, dsn=2.0.0, status=sent (delivered via spamassassin service)     Nov  6 02:15:01 viathinksoft postfix/qmgr[9843]: 90F5116CE107: removed


title: concatenate .out files

text: Can I combined multiple .out files with the cat command in bash or csh? Additionally I want only the header of first file to be concatenated and I was thinking of using the tail function for that. Anyone know if this is possible or of a way to do this?


title: Chromium with ~20 opened tabs freezes my laptop

text: As the title says, when I have about 20 opened tabs of Chromium I see the hard disk starts writing and everything start to freeze. I have to 'killall' Chromium. Previously I had installed google-chrome and the same was happening. Is it normal or it could be a bug? Someone experienced the same? My laptop is a Acer Aspire E1-571G with i5 processor 2.6GHz 8GB ram. gentoo distro with gnome as graphical system **UPDATE** : a big shame on me because I found out I didn't activate _HIGHMEM64_ config on my kernel (I don't know why) so I was running with ~2 Gb of ram instead of 8..


title: How to include %CPU usage in a notification?

text: I have the following script:               #!/usr/bin/env bash          sleep_period=8m          while true; do       if ps -eo %C --sort -%cpu | head -2 | awk 'NR==2 { exit !($1>8); }'; then           notify-send 'CPU alert!' '......'           xdotool key shift       fi       sleep ${sleep_period}     done      But I don't know how to get the notification to print the % CPU value instead of `'......'`. I'm using Lubuntu 13.10, fully updated.


title: Open ports for local samba server with iptables

text: I can't seem to connect from Windows 7 to my network share on Ubuntu (Samba). Why won't this work? Heres a bit of information, that would perhaps be useful.               user1@computer:/etc$ sudo iptables -L -n          Chain INPUT (policy ACCEPT)     target     prot opt source               destination          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.10            tcp dpt:8080     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.11            tcp dpt:80     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.12            tcp dpt:80     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.2             tcp dpt:22     ACCEPT     tcp  --  0.0.0.0/0            10.0.0.13            tcp dpt:80          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination                    user1@computer:/etc$ sudo netstat -tulpn | egrep "samba|smbd|nmbd|winbind"          tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      8350/smbd     tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      8350/smbd     tcp6       0      0 :::445                  :::*                    LISTEN      8350/smbd     tcp6       0      0 :::139                  :::*                    LISTEN      8350/smbd     udp        0      0 10.0.0.255:137          0.0.0.0:*                           7833/nmbd     udp        0      0 10.0.0.1:137            0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.45.255:137      0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.45.250:137      0.0.0.0:*                           7833/nmbd     udp        0      0 0.0.0.0:137             0.0.0.0:*                           7833/nmbd     udp        0      0 10.0.0.255:138          0.0.0.0:*                           7833/nmbd     udp        0      0 10.0.0.1:138            0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.xx.xxx:138      0.0.0.0:*                           7833/nmbd     udp        0      0 xxx.xxx.xx.xxx:138      0.0.0.0:*                           7833/nmbd     udp        0      0 0.0.0.0:138             0.0.0.0:*                           7833/nmbd


title: How to pipe the result of a grep search into a new vi file

text: I'm using `grep -e Peugeot -e PeuGeot carlist.txt` to search through carlist.txt and pull out some items and I presumed that `grep -e Peugeot -e PeuGeot carlist.txt | vi` would pipe it through for me but this is what I get:               Vim: Warning: Input is not from a terminal     Vim: Error reading input, exiting...     Vim: preserving files...     Vim: Finished.      Any advice on how this should be done is very appreciated


title: Mageia - how do I setup a KVM for Windows gaming?

text: Okay so I setup a KVM using Virt-Manager, Iset it to 7443 out of 8GB RAM, Got it to emulate my CPU fully, everything worked fine, but I cant get my GPU to unbind from the host to the guest, So is there any script that is around to help? I will post below all error codes I have encountered while attempting to create the machine.                Error starting domain: unsupported configuration: host doesn't support passthrough of host PCI devicesTraceback (most recent call last):  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper    callback(asyncjob, *args, **kwargs)  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 127, in tmpcb    callback(*args, **kwargs)  File "/usr/share/virt-manager/virtManager/domain.py", line 1260, in startup    self._backend.create()  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 866, in create    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)libvirtError: unsupported configuration: host doesn't support passthrough of host PCI devices      That above is when I attempt to run the KVM with a PCI device, no matter the device it still happens. My lspci output               [root@localhost xdroidie626]# lspci00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 04)00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)00:1f.0 ISA bridge: Intel Corporation Z77 Express Chipset LPC Controller (rev 04)00:1f.2 SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Barts XT [Radeon HD 6870]01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Barts HDMI Audio [Radeon HD 6800 Series]      Virsh output               [root@localhost xdroidie626]# virsh nodedev-dumpxml pci_0000_01_00_0<device>  <name>pci_0000_01_00_0</name>  <path>/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0</path>  <parent>pci_0000_00_01_0</parent>  <driver>    <name>radeon</name>  </driver>  <capability type='pci'>    <domain>0</domain>    <bus>1</bus>    <slot>0</slot>    <function>0</function>    <product id='0x6738'>Barts XT [Radeon HD 6870]</product>    <vendor id='0x1002'>Advanced Micro Devices, Inc. [AMD/ATI]</vendor>  </capability></device>[root@localhost xdroidie626]# virsh nodedev-dettach pci_0000_01_00_0error: Failed to detach device pci_0000_01_00_0error: invalid argument: neither VFIO nor kvm device assignment is currently supported on this system      And the output Virsh gives when I attempt to unbind the device               [root@localhost xdroidie626]# virsh nodedev-dettach pci_0000_01_00_0error: Failed to detach device pci_0000_01_00_0error: invalid argument: neither VFIO nor kvm device assignment is currently supported on this system      I do apologise about the small amount of information but I dont know what to do next. All I want the KVM for is to run games via windows, adding to that I can snapshot back if need be (Virus etc) My specs for the system are as posted   G1 Sniper M3 Z77 motherboard   i5 2500 3.3Ghz CPU   AMD 6870 1GB   8GB RAM   Samsung 840 SSD 120GB 500GB 7200.12RPM drive Any solutions to the errors posted, and to my entire problem?


How to make grub2 always boot into Windows by default? I'm using Fedora 20. I tried following a guide online, and it worked for a while, but was reverted by a kernel update. I'd like grub2 to default to Windows for good. Please write 'my solution will survive a kernel update' in your answer.


title: Cache all gpg subkey passwords at once? Prevent need for multiple gpg password entry?

text: Can I enter my gpg password just once and unlock all my sub keys (signing, decryption, authentication)? At the moment, I need to enter my gpg password three times (for signing, for decryption, for authentication). This is inconvenient. I tried to come up with a shell script.               #!/bin/bash     set -x     set -e     set +o history          signing_key=77BB3C48     encryption_key=CE998547          tempfile="$(mktemp)"     echo "test" > testfile          unset passphrase || exit 1     read -sp 'Enter password. ' passphrase ; echo          exec 3<<<"$passphrase"          gpg2 --no-tty --use-agent --batch --yes --passphrase-fd 3 --sign-with "$signing_key" --clearsign "$tempfile"     gpg2 --no-tty --use-agent --verify "$tempfile.asc"          gpg2 --no-tty --use-agent --yes --armor --recipient "$encryption_key" --encrypt "$tempfile"          exec 3<<<"$passphrase"     gpg2 --no-tty --use-agent --batch --decrypt --passphrase-fd 3 "$tempfile.asc"      But unfortunately, that way passwords gnupg-agent doesn't cache the password. Can this be fixed? System information:   * When not using that shell script, I have no issues with gnupg-agent. When I manually sign / decrypt a file in shell, pinentry asks for password twice, then caches it until reboot.   * Using Debian Wheezy.   * gpg version: `dpkg -l | grep gnupg`               ii  gnupg                                        1.4.12-7+deb7u3                    i386         GNU privacy guard - a free PGP replacement     ii  gnupg-agent                                  2.0.22-3                           i386         GNU privacy guard - password agent     ii  gnupg-curl                                   1.4.12-7+deb7u3                    i386         GNU privacy guard - a free PGP replacement (cURL)     ii  gnupg2                                       2.0.22-3                           i386         GNU privacy guard - a free PGP replacement (new v2.x)      I've asked on gnupg-users mailing list a while ago, but no reply. Perhaps this answer can help? Perhaps `gpg-connect-agent` is required?


title: closing the unwanted file descriptors

text: I am trying to understand how pipes work . This code snippet is from some website . So my understanding of the program goes like this : When we do `pipe(fd)` then `fd[0]=3` and `fd[0]=4` ( assuming only `0`,`1` & `2` are open till now ) . Now we fork the parent and then if a child is not created then we have error and it exits . But if it child is created successfully , are the file descriptors copied to the child , I mean is `fd[0]=3` and `fd[1]=4` for the child process also ? `fd[0]` and `fd[1]` are file handles to which files ( we have not specifically specified ) ? Let us suppose that we want child to read from parent then , parent should close `fd[0]` and child should close `fd[1]` but why ? What will happen if we do not close them ? And I didn't understand `On a technical note, the EOF will never be returned if the unnecessary ends of the pipe are not explicitly closed.` . > If the parent wants to receive data from the child, it should close fd1, and > the child should close fd0. If the parent wants to send data to the child, > it should close fd0, and the child should close fd1. Since descriptors are > shared between the parent and child, we should always be sure to close the > end of pipe we aren't concerned with. On a technical note, the EOF will > never be returned if the unnecessary ends of the pipe are not explicitly > closed.                   #include <stdio.h>         #include <unistd.h>         #include <sys/types.h>              main()         {                 int     fd[2];                 pid_t   childpid;                      pipe(fd);                      if((childpid = fork()) == -1)                 {                         perror("fork");                         exit(1);                 }                      if(childpid == 0)                 {                         /* Child process closes up input side of pipe */                         close(fd[0]);                 }                 else                 {                         /* Parent process closes up output side of pipe */                         close(fd[1]);                 }                 .                 .         }      I am newbie in learning OS , forgive me if my question is silly . Thanks in advance !


title: initiate ssh connection from server to client

text: We can easily connect via `ssh` to the remote machine that has public IP. But now I have a remote machine without public IP, and I need to connect to it from my machine that does have public IP. So that, remote machine should initiate this connection (add a client). I need it because there is my grandfather on computer without public IP, and he needs help with his system sometimes. In similar situation on Windows I've used VNC connection (by TightVNC), TightVNC server has an option "Add a client": user just entered client's IP (i.e. my public IP), my client is already in "listening mode", and when "server" adds a client, connection is initialized. So, is it possible to perform the same trick with SSH connection?


title: What is the term "Usage"?

text: I am seeing this a lot in the scripts. Is "usage" a command in unix ? I tried googling it but got ambiguous results. Here is an example `: ${1?"Usage: $0 ARGUMENT"}`


title: Sharing a project tree between environments

text: To save space and time I copied a large project tree on a network drive as hard links, i.e.               cp -a -r --link proj proj_B      (background: it's huge, needs to be rebuilt from two incompatible environments, and doesn't have good support for specifying intermediate and product locations. So this was a quick hack to get a rebuild in environment "B": after copying clean and rebuild from "proj_B/obj". Both environments are under LinuxMint 16) The problem with this approach is that edits won't be (reliably) shared between these trees, e.g. saving an edit to "proj/foo.cpp" will leave it pointing to a new inode and "proj_B/foo.cpp" will still point to the old one (maybe from the loss-avoidance pattern of "save temp; mv orig temp2; mv temp orig; rm temp2"). For sharing source I guess I need symbolic links for the source directories (but not simply a symlink of the project root, since the binary directories need to be kept apart), e.g. something like:               cp -a -r --symbolic-link proj proj_B      followed by unlinking the binary directories (except that recursive symlink copying fails with "can make relative symbolic links only in current directory". But something similar could be done with "find -exec", or just capitulating and writing a script) But before doing that I wanted a sanity check: is there a better tool for this all along (e.g. some warlock-grade combination of rsync flags)? Or is this sharing approach doomed to end in tears and lost data and I should resign myself to using two copies (and lots of cursing when I find I forgot to push/pull latest changes between them)?


title: Resizing LVM within a in KVM-based VPS

text: I have a VPS (based on KVM, not sure which storage technology) for about two years now. It's mainly a learning machine, a utility proxy, or a seldom-used VPN gate, or whatever--no real work, no problem with downtime for few days. So after I purchased it two years ago, I partitioned it using LVM with result like this:   * one 10GiB physical disk   * two partitions: /boot and LVM, together eating 100% of the disk space   * on the LVM partition, several "normal" partitions like /, swap and /home Now I have purchased additional space from the ISP. They did their magic so after reboot, there is another 10GiB of unpartitioned space. I'm not exactly sure what is the correct next step. What I did in hope I'll see what are my options is that I went and booted into a SysResCD , but the GParted version provided does not support LVM. (New SysResCD shipped with GParted, with LVM support, already exists.) Anyway, since I hear that LVM is supposed to make things _easier_ , I suspect that this is not the correct way in the first place. (Actually I even suspect that using LVM _within_ KVM might have been crazy idea in the first place, since well, at this moment, it might well looks like: partitions in LVM in KVM in another LVM on a set of physical disk in RAID...) So what to do next: should I ask ISP to provide new SysResCD and continue what I started? Or is it easier now to simply move everything out of the LVM and fix the installation?


title: Is it safe to use a bash script to create a daemon?

text: I would like to create an entirely automated box (based on something like a Raspberry-Pi or OLinuXino card). My box would run a Debian based system with a read-only filesystem and a ramdisk (to avoid SD card corruptions). I would like to create a script that automatically connects to a remote server (via ssh) each time the box is switched on or plugged to a network. To do so, I think my simplest solution is to create a shell script running as a daemon. This daemon will have to stay alive until the box is shut down or disconnected from network. The script should be able to reconnect when network is up or box restarts. The question: do you think a shell script is safe enough to perform this ? Or should I better use another (and safer) programming language (PERL, C, ...) ?


title: Run program after finish ssh connection

text: How do I connect to ssh debian and running a program and let it continue to run after you finish my connection through ssh.


title: What scopes can shell variables have?

text: I just ran into a problem that shows me I'm not clear on the scope of shell variables. I was trying to use `bundle install`, which is a Ruby command that uses the value of `$GEM_HOME` to do its work. I had set `$GEM_HOME`, but the command ignored that value until I used `export`, as in `export GEM_HOME=/some/path`. I read that this makes the variable somehow "global" (also known as an **environment variable** ), but I don't understand what that means. I know about globals in programming, but not across distinct programs. Also, given that my setting such variables applies only to the current shell session, how would I set them for, say, a daemonized process? **What scopes can shell variables have?**


title: How can I change my workspace switcher in Cinnamon?

text: In Cinnamon, you can move your pointer to the top left corner of the screen to activate the desktop switcher. This would be awesome...if I wasn't left- handed. I throw the pointer up there most of the time. It's massively frustrating. Is there a way to switch it to the top-right of the screen?


title: apply specific command for each git repository

text: I want compress all the git repositories on my computer (say in `~`). I.e., for each directory `{}`, that contains directory or file (in case of submodules) named `.git`, I want to execute `git gc --aggressive --git- dir={}`. I tried the following:               /bin/find /c/libs/boost/ -name '.git' -print -exec git --git-dir=dirname {} gc --aggressive \;      but output consist of plenty of `fatal: Not a git repository: 'dirname /c/libs/boost/.git'` etc. What should I do to use `dirname` command correctly? Or something else to achieve desired effect?


title: Crontab Triple Redirect

text: I have a very basic understanding of redirects, but I have come across a cronjob with redirects which I do not understand.               00 19 * * 1-5 /apps/app/scripts/doit.sh a np cron > /apps/app/scripts/doit.log > /dev/null 2>&1      I see three redirects. I was going to write down my best guess here, but I can't form a full picture. I would appreciate it if someone helped me understand in STDOUT and STDERR terms. My shell is ksh:               :> ps -p $$       PID TTY          TIME CMD     23947 pts/0    00:00:00 ksh


title: Printing through a Samba server without recording the password in plaintext

text: I need to access a printer through a Samba server. In CUPS, I could make it work by entering a device location such as `smb://username:password@hostname/printer_name`. However, it would mean for my password to be retained in cleartext in a configuration file, which I would like to avoid (even though it is not accessible to regular users). Is there a way to record my password through the KDE wallet, or to make the Samba server ask for a password everytime?


title: How can I make awk on Busybox treat the entire input with NULL character in between as a single record?

text: I wrote a base64 encode script for my Busybox system.               #!/bin/sh     base64encode()     {     /usr/bin/awk -- '     function asc(char,l_found)     {             l_found=0;             for (i=0;i<=255;i++){             if (sprintf("%c",i)==char) l_found=i;             }             return l_found;     }          function base64_and(var,x,l_res,l_i)     {             l_res=0;             for (l_i=0;l_i<8;l_i++){                     if (var%2==1 && x%2==1) l_res=l_res/2+128;                     else l_res/=2;                            var=int(var/2);                     x=int(x/2);             }             return l_res;     }          function base64_lshift(var,x)     {             while(x>0){             var*=2;             x--;             }             return var;     }          function base64_rshift(var,x)     {             while(x>0){             var=int(var/2);             x--;             }             return var;     }          BEGIN{     BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";     result="";     }          {             while (length($0)>0){     printf "Source: %s Length: %i\n",$0,length($0);                     if (length($0)==1){                             byte1=asc(substr($0,1,1));                             byte2=0;                             byte3=0;                     }                          if (length($0)==2){                             byte1=asc(substr($0,1,1));                             byte2=asc(substr($0,2,1));                             byte3=0;                     }                          if (length($0)>=3){                             byte1=asc(substr($0,1,1));                             byte2=asc(substr($0,2,1));                             byte3=asc(substr($0,3,1));                     }                          base1=base64_rshift(byte1,2);                     base2=base64_lshift(base64_and(byte1,3),4)+base64_rshift(base64_and(byte2,240),4);                     base3=base64_lshift(base64_and(byte2,15),2)+base64_rshift(base64_and(byte3,192),6);                     base4=base64_and(byte3,63);     printf "byte1=%i byte2=%i byte3=%i\n", byte1, byte2, byte3;     printf "base1=%i base2=%i base3=%i base4=%i\n", base1, base2, base3, base4;                     if (length($0)==1){                             result=result substr(BASE64,base1+1,1);                             result=result substr(BASE64,base2+1,1);                             result=result "==";                             $0="";                     }                          if (length($0)==2){                             result=result substr(BASE64,base1+1,1);                             result=result substr(BASE64,base2+1,1);                             result=result substr(BASE64,base3+1,1);                             result=result "=";                             $0="";                     }                          if (length($0)>=3){                             result=result substr(BASE64,base1+1,1);                             result=result substr(BASE64,base2+1,1);                             result=result substr(BASE64,base3+1,1);                             result=result substr(BASE64,base4+1,1);                             $0=substr($0,4);                     }     printf "Result=%s\n", result;             }                  printf "%s",result;     }     '     }     base64encode      But when there are NULL characters in the input, awk will seperate the input into different records and make the script output incorrectly. For example:               root@unknown:/tmp/test# echo -e "Hello \0 World!"|./base64encode.sh     Source: Hello  Length: 6     byte1=72 byte2=101 byte3=108     base1=18 base2=6 base3=21 base4=44     Result=SGVs     Source: lo  Length: 3     byte1=108 byte2=111 byte3=32     base1=27 base2=6 base3=60 base4=32     Result=SGVsbG8g     SGVsbG8gSource:  World! Length: 7     byte1=32 byte2=87 byte3=111     base1=8 base2=5 base3=29 base4=47     Result=SGVsbG8gIFdv     Source: rld! Length: 4     byte1=114 byte2=108 byte3=100     base1=28 base2=38 base3=49 base4=36     Result=SGVsbG8gIFdvcmxk     Source: ! Length: 1     byte1=33 byte2=0 byte3=0     base1=8 base2=16 base3=0 base4=0     Result=SGVsbG8gIFdvcmxkIQ==     SGVsbG8gIFdvcmxkIQ==root@unknown:/tmp/test#      While from Linux, we can tell the output was not correct because the above input was divided into two records and the NULL character in between is not processed.               [root@hp8 ~]# echo -e "Hello \0 World\!"|base64     SGVsbG8gACBXb3JsZFwhCg==     [root@hp8 ~]#      Can anyone please tell me how I can make the awk on my Busybox treat the entire input with NULL character in between as a single record?


title: Upstart reload does not work

text: On a virtualised Ubuntu, I used the command               $ foreman export upstart /etc/init -f Procfile -e conf/development.env -u ubuntu -a my_app -t upstart      And can now start my_app using               $ sudo start my_app      However the following command fails               $ sudo reload my_app     reload: Not running      despite both of the following working               $ sudo stop my_app     $ sudo restart my_app      Anyone have ideas on how to debug? `$ initctl list` also clearly shows my_app running


title: How to clean up unnecessary files

text: Please suggest me any particular unnecessary file that I can clean to back everything to normal condition(temporarily). (i.e. any log or archieve or anything ). My var/log has only 40MB and Home directory has 3GB of space(so I believe that's not a problem). Other than that what I can clean up to make space.               [user@host]$ df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/vg_inamivm-lv_root                            18G   17G     0 100% /     tmpfs                 1.9G     0  1.9G   0% /dev/shm     /dev/sda1             485M   71M  389M  16% /boot      I am in a debian machine. **UPDATE1:** output of `cd /; du -sxh *`               6.1M    bin     61M     boot     156K    dev     22M        etc     3.3G    home     306M    lib     18M     lib64     16K     lost+found     4.0K    media     4.0K    mnt     408K    opt     du: cannot access `proc/18605/task/18605/fd/4': No such file or directory     du: cannot access `proc/18605/task/18605/fdinfo/4': No such file or directory     du: cannot access `proc/18605/fd/4': No such file or directory     du: cannot access `proc/18605/fdinfo/4': No such file or directory     0       proc     208K    root     9.7M    sbin     0       selinux     4.0K    srv     0       sys     8.0K    tmp     536M    usr     187M    var      **Update2** Output of `ls -la /`               dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 .     dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 ..     -rw-r--r--.   1 root root     0 Aug  7 08:42 .autofsck     dr-xr-xr-x.   2 root root  4096 Mar 28 16:53 bin     dr-xr-xr-x.   5 root root  1024 Mar 28 16:54 boot     drwxr-xr-x.  16 root root  3580 Sep  9 03:13 dev     drwxr-xr-x.  69 root root  4096 Aug 23 09:19 etc     drwxr-xr-x.   9 root root  4096 Jun 29 16:10 home     dr-xr-xr-x.   8 root root  4096 Mar  7  2012 lib     dr-xr-xr-x.   9 root root 12288 Mar 28 16:53 lib64     drwx------.   2 root root 16384 Mar  7  2012 lost+found     drwxr-xr-x.   2 root root  4096 Sep 23  2011 media     drwxr-xr-x.   2 root root  4096 Sep 23  2011 mnt     drwxr-xr-x.   3 root root  4096 Mar  7  2012 opt     dr-xr-xr-x. 355 root root     0 Aug  7 08:42 proc     dr-xr-x---.   5 root root  4096 Aug 17 18:27 root     dr-xr-xr-x.   2 root root  4096 May  2 09:13 sbin     drwxr-xr-x.   7 root root     0 Aug  7 08:42 selinux     drwxr-xr-x.   2 root root  4096 Sep 23  2011 srv     drwxr-xr-x.  13 root root     0 Aug  7 08:42 sys     drwxrwxrwt.   3 root root  4096 Sep 13 03:37 tmp     drwxr-xr-x.  13 root root  4096 Mar 28 17:53 usr     drwxr-xr-x.  18 root root  4096 Mar  7  2012 var


title: How to use lockstat.txt on Ubuntu 12.04?

text: I have Ubuntu 12.04 installed on my machine. I want to use lockstat. I have looked at `Documentation/lockstat.txt` but I am not getting how to use it, if possible please help me out. I am working on a project adapting system software like the Linux kernel. I read one paper titled _"Experience on Comparison of Operating Systems Scalability on the Multi-core Architecture"_ that tells how to detect bottlenecks using bench-marking. I am following their experimental approach and am able to generate a profiling report using the profile tool, but I am not able to detect bottlenecks from this profiling report. Basically, I am not able to explore the `no-vmlinux` part, and I am not able to find `no-vmlinux` functions related to bottlenecks. Also I am not able to use _lockstat.txt_ as there is no file in `/proc/sys/kernel/lock_stat`.


title: How to make UEFI bootable usb disk from bios bootable iso

text: Suppose you have an iso image that contains a bios bootable partition. You can write this image to a usb disk In linux you could do this for example with               dd if=pmagic_2013_02_28.iso of/dev/sdc1      Your USB disk is now bootable on computers with bios. However on my UEFI system, the usb disk does not boot. How can you make it EFI bootable?


title: How to check Today's Day and Search Files

text: Problem: I need to find out today's date and search a file which contain's today's date in the name. Also another file which contains Yesterday's date. I was able to do so by something like:               TODAY=$(date +"%m%d%Y")        YESTERDAY=$(date --date="yesterday" +"%m%d%Y")     SNAPSHOT=SnapshotIR${YESTERDAY}\*.csv          for snapshotfile in $SNAPSHOT     do             if [ -f "$snapshotfile" ]             then                     SNAPSHOTFOUND="$snapshotfile"               echo Snapshot Report $SNAPSHOTFOUND is available      But there is a condition here that, if today is Monday I have to check one file which has last Friday's date and another file which has Saturday's date in their names unlike Today and Yesterday. Can anyone suggest.


title: Why does Firefox refuse to die despite killing it with pkill -9?

text: I am issuing the following command to kill Firefox on my Red Hat Linux box:               [subhrcho@slc04lyo ~]$ pkill -9 -f firefox     [subhrcho@slc04lyo ~]$       However, when I try to invoke Firefox through Applications -> Internet -> Firefox, it says: > Firefox is already running, but is not responding. To open a new window, you > must first close the existing Firefox process, or restart your system.


title: Multi kernel usage in Linux PC(UBUNTU)

text: I have 2.6.32-21-generic , 2.6.32-38-generic and 3.0.0-20-generic. My current kernel is:-               $ uname -r     2.6.32-38-generic      I want to use different kernel that is 2.6.32-21-generic. How can I do that?


title: How to change the default TTY after boot?

text: Normally when system starts you have all output printed on the TTY1, and that's ok, but I start X-server via `startx` and achieve this by the following lines in the `~/.profile` file :               if [[ $(tty) = /dev/tty4 ]]; then         exec startx &> ~/.xsession-errors     fi      So, as you can see I use TTY4 to start X-server, and I want to switch to that console automatically after the boot is done. Is there a way to do this?


title: Unrecognized Type: for length of date string

text: I am getting current date and checking for length of date if non-zero then perform some action.               now=$(date)     echo "$now"     if [[ -n "$now" ]]; then     echo "not empty"     fi      Prints this to console-               Mon Feb 17 01:51:38 CST 2014     Unrecognized Type: Mon     not empty      _if [[ -n "$now" ]]; then_ -> this line is causing shell to throw Unrecognized Type: warning, Is there something wrong with the check -n ?


title: How To Install PHP on CentOS by download packages?

text: I'm using CentOS 6.5 and I need to install PHP 4.3.11 i can't use "yum install php" because it'll install the latest version of PHP. So i use these command: wget http://museum.php.net/php4/php-4.3.11.tar.gz tar zxvf php-4.3.11.tar.gz cd php-4.3.11 make install => I got this error: "make: _*_ No rule to make target `install'. Stop." Anybody tell me what wrong i did? and how to fix it?


title: Recent install of ArchLinux not loading

text: I recently installed ArchLinux (because hey, why not) and used the Arch install script and installer located here https://github.com/helmuthdu/aui. After doing this, I got to the boot screen and it took a while, the first time it said "Loading kernel modules" and then the same message appeared again. waited for it for roughly half an hour, and it just hung there. Hardware is a Dell Inspiron 15R with intel i5, 6GB RAM, 64bit. It _is_ UEFI, if it matters. Does anyone know how to fix this so I could try and re-install it again?


title: Is there a way to add some info about time/date to TTY prompt?

text: If you have a graphical display manager, you can notice date and time there, but I haven't seen such a thing when it comes to TTY. If I want to check the current time (or date) I have to log in. It's a little bit annoying, especially in the morning. :) I know that I can add the two parameters `\t` and `\d` to `/etc/issue` file, for time and date respectively, but this solution doesn't refresh the time. I thought maybe there's a way to add a script to the /etc/issue , but I couldn't find anything useful. Is there a way to add time/date to the prompt?


title: PostgreSQL on FreeBSD - 'Kerberos 5 authentication not supported'

text: I've been trying to get a FreeBSD machine to talk to a networked postgreSQL database. I assumed that the machine had kerberos installed, as it's what I use to log in, and I was told that FreeBSD has it built in(?). I tried to connect to my remote database with `psql -h pgteach` (the alias for the server, which works fine, as I can ping the machine). I get the message               psql: Kerberos 5 authentication not supported      Googling the problem seems to suggest that I should install one of the ports for Kerberos. Does the postgresql client (version 9.1) specifically need MIT or Heimdal kerberos, or can I just add some config flags to point to the default kerberos libraries? `pg_config` returned the following lines (edited for relevance, I think). Let me know if more info is needed.               CONFIGURE = '--with-libraries=/usr/local/lib' '--with-includes=/usr/local/include' '--enable-thread-safety' '--with-openssl' '--with-libxml' '--enable-nls' '--with-gssapi' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.2' 'build_alias=amd64-portbld-freebsd8.2' 'CC=cc' 'CFLAGS=-O2 -pipe -fno-strict-aliasing' 'LDFLAGS= -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -lgssapi' 'CPPFLAGS=' 'CPP=cpp' 'LDFLAGS_SL=-lgssapi'     LDFLAGS = -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -lgssapi -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -Wl,--as-needed -Wl,-R'/usr/local/lib'     <snip>     LDFLAGS_EX =      LDFLAGS_SL = -lgssapi     LIBS = -lpgport -lintl -lxml2 -lssl -lcrypto -lz -lreadline -lcrypt -lm      **EDIT:** I _have_ to use Kerberos, as it's a univeristy-managed server. I've since tried checking the 'Use Heimdall kerberos' in `make config`, but trying to do `sudo make clean install` then complains it can't find `krb5_sendauth`. I know kerberos is installed, as kinit and klist both work fine.


title: How to search and replace strings matching a replacement list for multiple files

text: I have a file, say `map.txt`, containing a list of search strings and corresponding replacements:               search -> replacement     bigBone -> bb     fishMarket -> fm     dogCollar -> dc     ...      I need to perform search and replacement of all strings matching the above for all files recursively in a folder except symbolic links. I know how to do it one at a time like this:               $ find /some/folder -type f -exec sed -i 's/old_text/new_text/g' {} \;      How can I perform this on a massive scale using the above mapping? I have read this question, but do not quite get it.


title: Killing other user processes

text: There are certain user environments in which we have to login during certain performance testing and and kill all the process running in that environment. The environment names are like `rswrk01`, … up to `rswrk98`. and this is how we login.               sudo su - rswrk96      It doesn't prompt for any password and straightaway logs in. Is it possible to automate a script for killing all the running processes in all the environments, instead of logging in manually and killing the processes? I am not the root user by the way.               $ uname -a     HP-UX rcihp145 B.11.23 U 9000/800 3683851961 unlimited-user license


title: Sharing code between dpkg scripts

text: What is the standard way to share code between the dpkg scripts (preinst, postinst, prerm, postrm)? I can see how to share code between just postinst and prerm (by installing it as part of the package), but can't see any way to share with preinst and postrm.


title: Fedora15/Gnome3 - Exit elevated priviliges mode

text: While using Fedora 14 (Gnome2), Each time if I was doing some privileged task (ex - mounting a new hard drive), I would be prompted for password and then there would appear an icon (like keys) on the taskbar. By clicking on it, I could exit the elevated priviliges mode. I do not see any such feature - to exit priviliged mode - in F15/G3. Is it possible to do so? How?


title: Using several independent instances of Thunderbird

text: As many people, I too have several email accounts. Until now, I have been using `Thunderbird` for my main account, and either used web interface for the other accounts, or used other email clients (`Sylpheed`, `Balsa`, ...). For some reason, I never liked the idea of having separate, independent accounts integrated in one email client, perhaps because the added complexity and possibility of confusion. When I used three different email clients, I had three truly independent email accounts. The only disadvantage is, the other (non-Thunderbird) email clients never worked as well as Thunderbird. Now I am wondering whether there is a possibility to use three independent instances of `Thunderbird`, so that I don't have to use inferior email clients. I know that when `Thunderbird` is already running, I cannot start another instance. Also, any additional instance would need its own (independent) config directory. Is there any way to achieve this? I am using `Thunderbird` (`Icedove 24.6.0`) on Debian Wheezy # UPDATE: I have found this article on MozillaZine, which suggests to use the `-no- remote` option and does not mention the option `-new-instance` at all. The `man page` lists both options, but does not explain what the difference is, if `-new-instance` is implied when `-no-remote` is used, or whether they should both be used at the same time.               thunderbird -P "profile_name" -no-remote     thunderbird -P "profile_name" -new-instance      # Side note: The refered article also says, that:               Multiple instances is intended for debugging, so use it at your own risk      Well, I don't intend to use it for debugging, I want to use it for my work. What can possibly go wrong when using multiple instances? How can I mitigate that danger?


title: GNU screen: print a detached session to stdout

text: I just want to have a quick overview of my detached GNU `screen` sessions. Is it possible to dump the current content to stdout ? Something like               screen --print SESSION_NAME > file.txt


title: How to install VGA2USB in ArchLinux?

text: How do I install VGA2USB in Arch Linux? I downloaded the driver `vga2usb-3.26.0.27-ubuntu-3.0.0-12-server_X86_64.tbz` I tried with latest kernel did not worked failed with same issue, now showing with the stable kernel, that also failed.               $ uname -a     Linux myhost 2.6.32-lts x86_64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz GenuineIntel GNU/Linux     $ lsusb | grep Epiphan     Bus 002 Device 004: ID 5555:1110 Epiphan Systems Inc. VGA2USB     $ cd /var/tmp/vga     $ ls     Config.mak      drvwrapper.o      vga2usb-3.26.0.27-ubuntu-3.0.0-12-server_X86_64.tbz     drvwrapper.c      Makefile      vga2usb_bins.o     drvwrapper.h      modules.order   vga2usb.ko     drvwrapper_lib.c  Module.symvers  vga2usb.mod.c     drvwrapper_lib.h  README      vga2usb.mod.o     drvwrapper_lib.o  v2u_id.h      vga2usb.o     $ make clean; make; make install     rm -f vga2usb.o vga2usb.ko drvwrapper.o drvwrapper_lib.o     ERROR: modinfo: could not open vga2usb.ko: No such file or directory     make -C /lib/modules/2.6.32-lts/build SUBDIRS=/var/tmp/vga modules     make[1]: Entering directory `/usr/src/linux-2.6.32-lts'       CC [M]  /var/tmp/vga/drvwrapper.o     In file included from include/linux/irq.h:29:0,                      from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper.c:21:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h: In function ‘set_irq_regs’:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h:26:2: warning: variable ‘tmp__’ set but not used [-Wunused-but-set-variable]     In file included from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5:0,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper.c:21:     include/linux/irq.h: In function ‘alloc_desc_masks’:     include/linux/irq.h:441:8: warning: variable ‘gfp’ set but not used [-Wunused-but-set-variable]       CC [M]  /var/tmp/vga/drvwrapper_lib.o     In file included from include/linux/irq.h:29:0,                      from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper_lib.c:21:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h: In function ‘set_irq_regs’:     /usr/src/linux-2.6.32-lts/arch/x86/include/asm/irq_regs.h:26:2: warning: variable ‘tmp__’ set but not used [-Wunused-but-set-variable]     In file included from /usr/src/linux-2.6.32-lts/arch/x86/include/asm/hardirq.h:5:0,                      from include/linux/hardirq.h:10,                      from include/linux/interrupt.h:12,                      from include/linux/usb.h:15,                      from /var/tmp/vga/drvwrapper_lib.c:21:     include/linux/irq.h: In function ‘alloc_desc_masks’:     include/linux/irq.h:441:8: warning: variable ‘gfp’ set but not used [-Wunused-but-set-variable]       LD [M]  /var/tmp/vga/vga2usb.o       Building modules, stage 2.       MODPOST 1 modules     WARNING: "kernel_stack" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "pv_lock_ops" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_int" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "__video_register_device" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "kthread_create_on_node" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_unlock_irqrestore" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "current_task" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irq" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irqsave" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_uint" [/var/tmp/vga/vga2usb.ko] undefined!       LD [M]  /var/tmp/vga/vga2usb.ko     make[1]: Leaving directory `/usr/src/linux-2.6.32-lts'     make -C /lib/modules/2.6.32-lts/build SUBDIRS=/var/tmp/vga modules     make[1]: Entering directory `/usr/src/linux-2.6.32-lts'       Building modules, stage 2.       MODPOST 1 modules     WARNING: "kernel_stack" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "pv_lock_ops" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_int" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "__video_register_device" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "kthread_create_on_node" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_unlock_irqrestore" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "current_task" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irq" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "_raw_spin_lock_irqsave" [/var/tmp/vga/vga2usb.ko] undefined!     WARNING: "param_ops_uint" [/var/tmp/vga/vga2usb.ko] undefined!     make[1]: Leaving directory `/usr/src/linux-2.6.32-lts'     make -C /lib/modules/2.6.32-lts/build SUBDIRS=/var/tmp/vga modules_install     make[1]: Entering directory `/usr/src/linux-2.6.32-lts'       INSTALL /var/tmp/vga/vga2usb.ko       DEPMOD  2.6.32-lts     make[1]: Leaving directory `/usr/src/linux-2.6.32-lts'     depmod -a      Then I ran               $ cp -R vga2usb.ko /lib/modules/2.6.32-lts/     $ modprobe vga2usb     FATAL: Error inserting vga2usb (/lib/modules/2.6.32-lts/vga2usb.ko): Unknown symbol in module, or unknown parameter (see dmesg)      Here's the `dmesg` output:               …     [  539.531837] Linux video capture interface: v2.00     [  539.550998] vga2usb: Unknown symbol param_ops_uint     [  539.551222] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  539.551257] vga2usb: Unknown symbol _raw_spin_lock     [  539.551377] vga2usb: Unknown symbol _raw_spin_lock_irq     [  539.551875] vga2usb: Unknown symbol current_task     [  539.551911] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  539.551992] vga2usb: Unknown symbol kthread_create_on_node     [  539.552090] vga2usb: Unknown symbol __video_register_device     [  539.552249] vga2usb: Unknown symbol param_ops_int     [  539.552286] vga2usb: Unknown symbol pv_lock_ops     [  539.552323] vga2usb: Unknown symbol kernel_stack     [  559.145304] vga2usb: Unknown symbol param_ops_uint     [  559.145530] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  559.145565] vga2usb: Unknown symbol _raw_spin_lock     [  559.145686] vga2usb: Unknown symbol _raw_spin_lock_irq     [  559.146183] vga2usb: Unknown symbol current_task     [  559.146219] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  559.146300] vga2usb: Unknown symbol kthread_create_on_node     [  559.146399] vga2usb: Unknown symbol __video_register_device     [  559.146557] vga2usb: Unknown symbol param_ops_int     [  559.146594] vga2usb: Unknown symbol pv_lock_ops     [  559.146631] vga2usb: Unknown symbol kernel_stack     [  585.067274] xdotool[4437]: segfault at 44 ip 0000000000403177 sp 00007fffe40ce2b0 error 6 in xdotool[400000+f000]     [  594.228463] vga2usb: Unknown symbol param_ops_uint     [  594.228688] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  594.228724] vga2usb: Unknown symbol _raw_spin_lock     [  594.228845] vga2usb: Unknown symbol _raw_spin_lock_irq     [  594.229345] vga2usb: Unknown symbol current_task     [  594.229381] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  594.229462] vga2usb: Unknown symbol kthread_create_on_node     [  594.229561] vga2usb: Unknown symbol __video_register_device     [  594.229719] vga2usb: Unknown symbol param_ops_int     [  594.229756] vga2usb: Unknown symbol pv_lock_ops     [  594.229793] vga2usb: Unknown symbol kernel_stack     [  644.902176] xdotool[4453]: segfault at 44 ip 0000000000403177 sp 00007fff45cb8f10 error 6 in xdotool[400000+f000]     [  704.737153] xdotool[4466]: segfault at 44 ip 0000000000403177 sp 00007fff43b9f5c0 error 6 in xdotool[400000+f000]     [  764.572142] xdotool[4478]: segfault at 44 ip 0000000000403177 sp 00007fffe4399830 error 6 in xdotool[400000+f000]     [  824.407277] xdotool[4487]: segfault at 44 ip 0000000000403177 sp 00007fffff991f50 error 6 in xdotool[400000+f000]     [  884.242253] xdotool[4497]: segfault at 44 ip 0000000000403177 sp 00007fffbcea9110 error 6 in xdotool[400000+f000]     [  944.077293] xdotool[4776]: segfault at 44 ip 0000000000403177 sp 00007fff4cfae1b0 error 6 in xdotool[400000+f000]     [  995.783886] vga2usb: Unknown symbol param_ops_uint     [  995.784110] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [  995.784146] vga2usb: Unknown symbol _raw_spin_lock     [  995.784267] vga2usb: Unknown symbol _raw_spin_lock_irq     [  995.784771] vga2usb: Unknown symbol current_task     [  995.784807] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [  995.784888] vga2usb: Unknown symbol kthread_create_on_node     [  995.784986] vga2usb: Unknown symbol __video_register_device     [  995.785147] vga2usb: Unknown symbol param_ops_int     [  995.785185] vga2usb: Unknown symbol pv_lock_ops     [  995.785222] vga2usb: Unknown symbol kernel_stack     [ 1003.912353] xdotool[4785]: segfault at 44 ip 0000000000403177 sp 00007fffb5d8d370 error 6 in xdotool[400000+f000]     [ 1063.747218] xdotool[4794]: segfault at 44 ip 0000000000403177 sp 00007fff80af4400 error 6 in xdotool[400000+f000]     [ 1123.582226] xdotool[4802]: segfault at 44 ip 0000000000403177 sp 00007ffff5cd64a0 error 6 in xdotool[400000+f000]     [ 1183.417152] xdotool[4810]: segfault at 44 ip 0000000000403177 sp 00007fff9506ca40 error 6 in xdotool[400000+f000]     [ 1243.252171] xdotool[4818]: segfault at 44 ip 0000000000403177 sp 00007fffedd0db00 error 6 in xdotool[400000+f000]     [ 1303.087203] xdotool[4826]: segfault at 44 ip 0000000000403177 sp 00007fffb3573b30 error 6 in xdotool[400000+f000]     [ 1362.922212] xdotool[4834]: segfault at 44 ip 0000000000403177 sp 00007fffd5b34790 error 6 in xdotool[400000+f000]     [ 1422.757176] xdotool[4842]: segfault at 44 ip 0000000000403177 sp 00007fff1c936e40 error 6 in xdotool[400000+f000]     [ 1482.592118] xdotool[4850]: segfault at 44 ip 0000000000403177 sp 00007fffc2dad4d0 error 6 in xdotool[400000+f000]     [ 1542.427201] xdotool[4858]: segfault at 44 ip 0000000000403177 sp 00007fffb6fb85a0 error 6 in xdotool[400000+f000]     [ 1602.262153] xdotool[4866]: segfault at 44 ip 0000000000403177 sp 00007fff25223470 error 6 in xdotool[400000+f000]     [ 1662.097132] xdotool[4874]: segfault at 44 ip 0000000000403177 sp 00007fffc06ae8d0 error 6 in xdotool[400000+f000]     [ 1721.932100] xdotool[4882]: segfault at 44 ip 0000000000403177 sp 00007fffbe0d6be0 error 6 in xdotool[400000+f000]     [ 1781.767083] xdotool[4890]: segfault at 44 ip 0000000000403177 sp 00007fffe49a21d0 error 6 in xdotool[400000+f000]     [ 1841.602127] xdotool[5352]: segfault at 44 ip 0000000000403177 sp 00007fffd66862d0 error 6 in xdotool[400000+f000]     [ 1887.974458] vga2usb: Unknown symbol param_ops_uint     [ 1887.974683] vga2usb: Unknown symbol _raw_spin_lock_irqsave     [ 1887.974718] vga2usb: Unknown symbol _raw_spin_lock     [ 1887.974839] vga2usb: Unknown symbol _raw_spin_lock_irq     [ 1887.975343] vga2usb: Unknown symbol current_task     [ 1887.975379] vga2usb: Unknown symbol _raw_spin_unlock_irqrestore     [ 1887.975460] vga2usb: Unknown symbol kthread_create_on_node     [ 1887.975559] vga2usb: Unknown symbol __video_register_device     [ 1887.975718] vga2usb: Unknown symbol param_ops_int     [ 1887.975755] vga2usb: Unknown symbol pv_lock_ops     [ 1887.975793] vga2usb: Unknown symbol kernel_stack     [ 1901.437299] xdotool[5363]: segfault at 44 ip 0000000000403177 sp 00007fffba3bf0b0 error 6 in xdotool[400000+f000]      **Follow up:** (Ubuntu 11.04 its working now, did not continued in ArchLinux later)               distro="ubuntu"     version=$(sudo uname -r)     pkgdirectory=/var/tmp/capture     mkdir ${pkgdirectory}; cd ${pkgdirectory};     if [ ! -d "${pkgdirectory}/vga" ]; then       mkdir ${pkgdirectory}/vga       cd ${pkgdirectory}/vga       wget http://www.epiphan.com/downloads/linux/vga2usb-3.26.0.22-ubuntu-2.6.38-8-generic_X86_64.tbz       tar xvfj vga2usb-3.26.0.22-ubuntu-2.6.38-8-generic_X86_64.tbz         make clean       make       make install       cp -R vga2usb.ko /lib/modules/${version}/       depmod -a       modprobe vga2usb     else       cd ${pkgdirectory}/vga       make clean       make       make install        cp -R vga2usb.ko /lib/modules/${version}/       depmod -a       modprobe vga2usb     fi


title: Suspend/resume single process to/from disk

text: On occasion, we would like to suspend memory-intensive processes on our Ubuntu and OS X servers to temporarily free up some RAM for other jobs. If all we were worried about was CPU usage, a simple `Ctrl-Z` would work. However, we need to be able to free up the RAM (by writing it to disk) and then restart the process (disk -> RAM) or in other words "hibernate" a single process. Any clues on how to do this? (Preferably from CLI.) Thanks.


title: Bluetooth doesn't show up, Linaro

text: rfkill list all      Shows:               0: fxi_c210-bt: Bluetooth          Soft blocked: no          Hard blocked: no      And hcitool dev shows nothing except:               Devices:      Bluetooth didn't work, but at some start it didn't work anymore. I already tried to restart and tried to restart the bluetooth service. Problem is on a linaro-ubuntu version.


title: How do I encrypt the main partition of a SIFT (Ubuntu 9.10 variant) install?

text: I've got SIFT (based on Ubuntu 9.10) installed on a work laptop. We're trying to encrypt the entire installation (root partition and swap), which is apparently doable using LUKS, but I'm having some trouble getting it all to work. Here's where I'm at so far: I have an unencrypted /boot partition, one unencrypted root partition, and one encrypted partition. The encrypted partition contains an exact copy of everything in the unencrypted partition. I want to switch from booting into the unencrypted partition to booting into the encrypted one. I've added a '/dev/mapper/root' to /etc/fstab and a corresponding entry in /etc/crypttab. I also added a new menu item in GRUB which should point to the encrypted partition. When I select that menu item, I get an error saying that /dev/mapper/root doesn't exist. I'm guessing there's something I'm missing here. Can anyone help? (Oh, and the SIFT install ISO doesn't include the alternate installer, so I can't do a guided encrypted setup.)


title: How can I check if swap is active from the command line?

text: How can I check if swap is active, and which swap devices are set up, on the command line?


title: Bash commands/script to remove a line from CSV with duplicate in column

text: I have a lot CSV files that I have combined. However, there are duplicates, but the entire line is not duplicated. I do have a column that I want to use as the criteria to search for a duplicate. And if there is a duplicate in that column from the entire column, then delete the rows that contain the duplicates in the columns until you have all unique values in this column. Does anyone know the best way to accomplish this in Bash, sed or awk?


title: How to exclude a list of full directory paths in find command on Solaris

text: _(Duplicated from Stack Overflow:http://stackoverflow.com/questions/7854975/how-to-exclude-a-list-of- full-directory-paths-in-find-command-on-solaris)_ I have a very specific need to find unowned files and directories in Solaris using a script, and need to be able to exclude full directory paths from the find because they contain potentially thousands of unowned files (and it's normal because they are files hosted on other servers). I don't even want find to search in those directories as it will hang the server (cpu spiking to 99% for a long time), therefore piping the find results in egrep to filter out those directories is not an option. I know I can do this to exclude one of more directories by name: `find / -mount -local \\( -type d -a \\( -name dir1 -o -name dir2 -o dir3 \\) \\) -prune -o \\( -nouser -o -nogroup \\) -print` However, this will match dir1 and dir2 anywhere in the directory structure of any directories, which is **not** what I want at all. I want to be able to prevent find from even searching in the following directories (as an example):               /opt/dir1     /opt/dir2     /var/dir3/dir4      And I still want it to find unowned files and directories in the following directories:               /opt/somedir/dir1     /var/dir2     /home/user1/dir1      I have tried using regex in the -name arguments, but since find only matches 'name' against the basename of what it finds, I can't specify a path. Unfortunately, Solaris's find does not support GNU find options such as -wholename or -path, so I'm kind of screwed. My goal would be to have a script with the following syntax: `script.sh "/path/to/dir1,/path/to/dir2,/path/to/dir3"` How could I do that using find and standard sh scripting (/bin/sh) on Solaris (5.8 and up)?


title: HPLIP spitting out raw data when I attempt to print

text: We got a new printer (HP m1212nf) as it was stated on the hplip site to be supported. Printer has been tested in windows so we know it works as well as it's network setup. Current system I am attempting to set this network printer up on is Debian 6 squeeze fully up to date. I downloaded the newest HPLIP from their site. Ran the .run file and followed directions. Installed the prerequisites and ran and hp-check to make sure all was included. hp-setup was ran where I added the printer. I tried a test page and it came out as raw pdf data. I then followed with a simple few words from gedit. Same thing, pages of rubbish. Tried a PDF file and I got 6 pages of junk(raw pdf). Not exactly sure what to do in this situation. My system does connect, but it seems the printing is getting distorted someplace. any ideaS?


title: Internet connection drop alert

text: What software is there that will play an alert (PC speaker) when there isn't any internet connectivity for 5 minutes? My switch/router seems to disconnect every few days, and I want to reset it when it happens.               PC          -- TP-Link switch/router -- FO     192.168.x.1 -- 192.168.x.2 / x.y.z.a -- a.b.c.d


title: ubuntu groups not returning all my groups

text: when I run groups in ubuntu without my username                delliott@delliott:/var/www$ groups      delliott wheel      it returns two groups I'm in. when I do                delliott@delliott:/var/www$ groups delliott      delliott : delliott wheel webusers      it returns all three groups I'm in when I run                delliott@delliott:/var/www$ whoami      it returns                delliott      which I expect and when I run                delliott@delliott:/var/www$ id delliott       it returns                uid=1006(delliott) gid=1007(delliott) groups=1007(delliott),1001(wheel),1010(webusers)      why doesn't it list all three when I just do groups with no username?


title: Arch Linux cannot boot

text: I have a WD My Passport USB 3.0 500 GB HDD I have successfully installed various OSes like Ubuntu, Pinguy, Mint etc. but so far I'm unsuccesfull in installing Arch Linux. I used the net install CD and the installation is smooth, only when I reboot and boot off my hdd I get an error saying "cannot find filep" (something along similar lines) and when I try booting again (without a reboot), I get: `error 18 and and boot cylindar size exceeds maximum value type` error. I tried `rootdelay=8` from the Begginers' Guide on the Arch Wiki and after scavenging through forums even enabled usb in the hook file while installing. I still cant boot. If its of any further help I have dual boot windows 7 and Ubuntu on my laptop. My usb is partioned as following: ![enter image description here](http://i.stack.imgur.com/bOWTW.png) here is my menu.lst http://pastebin.com/FdAiHnXZ and the errors ![enter image description here](http://i.stack.imgur.com/uFe0I.jpg) ![enter image description here](http://i.stack.imgur.com/hC6Ov.jpg)


title: xfce: Allow shutdown for non-root users

text: How do I allow shutdown for normal users in xfce? Currently, the log-out/restart/shutdown box only allows the log-out option, and having to switch to the console, logging in as root and shutting down from there is always a bit annoying.


title: Configuring Chromium Browser to load multiple plugins from /etc/chromium-browser/default file

text: How can you configure Chromium Browser to load multipl plugins (specifically; type NPAPI)?. I edited /etc/chromium-browser/default to add the pepperflash from google-chrome (CHROMIUM_FLAGS="--ppapi-flash-path=/usr/lib/chromium- browser/libpepflashplayer.so" and it is working. Now I need to add two more plugins for VMware Web Client that are not detected by default. The plugins are located in the chromium plugins folder. I appreciate any help on the issue. Thank you.


title: bash string extraction

text: I would like to extract the 2nd field from the last part of the following strings:               foo_1.103.debug_xx.ver21-inc-1          --> string extracted "debug_xx"     foo_1.103.1.0.release_32_xx.ver21-inc-1 --> string extracted "release_32_xx"     foo_1.103.1.0.release_xx.ver21-inc-1    --> string extracted "release_xx"      Any help will be appreciated.