title: How to insert a first column to many files + how to convert unix time to normal time

text: There are many-many files in a directory that has e.x.: the following content: INPUT:               root    1324711901     sshd    1272725792      And I'm searching for a solution how to convert the content of the files to this: OUTPUT1:               filenameXXX.txt root    1324711901     filenameXXX.txt sshd    1272725792      OUTPUT2:               filenameXXX.txt root    Sat Dec 24 08:31:41 CET 2011     filenameXXX.txt sshd    Sat May  1 16:56:32 CEST 2010      So two things needed in two phases:      INPUT -> "filenameXXX.txt " before the first column -> OUTPUT1      OUTPUT1 -> convert unix times to normal times -> OUTPUT2      How to do this using bash OR sed OR perl? [don't need in all only 1 is enough :D]      ehh..and I need it in two part [so two one-liner]:   - INPUT to OUTPUT1   - OUTPUT1 to OUTPUT2      Field separators are "\t"-s [tabs]!


title: Ignoring files that find cannnot search or open?

text: I searched for big files using this command on HP Unix:               find . -type f -size +100000000c -exec ls -lrt {} \;      The result came out somthing like this:               -rw-rw-rw-   1 qa1wrk32   test       169263642 Oct 27 12:28 ./rgs/test/qa1wrk32/DB/Dmp/intrefbl01_20111027_Backup_for_qa1ref32_CNSTRNO.dmp.gz     -rw-rw-rw-   1 qa1wrk32   test       173779937 Oct 24 16:33 ./rgs/test/qa1wrk32/DB/Dmp/qa1ref32_20111024_Backup_before_Refresh.dmp.gz     -rw-rw-rw-   1 qa1wrk32   test       105020030 Oct 31 09:53 ./rgs/test/qa1wrk32/DB/Dmp/qa1app32_20111031_R112_Before_CopyBan_from_INT01_to_ENV32_for_LISA_CNSTRNO.dmp.gz     find: cannot open ./rgs/test/maes32/master/.ssh     find: cannot open ./rgs/test/qa1oln32/.ssh     find: cannot open ./rgs/test/qa1oln32/local_tlg/bin/.adm     find: cannot search ./rgs/test/qa1wrk91/mail      I don't want the lines of output where find fails to search or open or anything else. Is there a way to filter them out? Better yet, can I make `find` search for files with some set of permissions?


title: Recovering an ext4 filesystem with corrupt journal

text: I have a hard drive that seems to have developed some kind of hardware problem in the journal. This prevents the drive from being loaded. Running `mount -r -t ext4 /dev/sda5 /mnt/root` results in the following kernel spew:               [ 1420.671055] ata1.00: exception Emask 0x0 SAct 0x1000000 SErr 0x0 action 0x0     [ 1420.673862] ata1.00: irq_stat 0x40000008     [ 1420.676600] ata1.00: failed command: READ FPDMA QUEUED     [ 1420.679326] ata1.00: cmd 60/40:c0:a8:9d:0a/00:00:08:00:00/40 tag 24 ncq 32768 in     [ 1420.679326]          res 41/40:40:e1:9d:0a/00:00:08:00:00/00 Emask 0x409 (media error) <F>     [ 1420.685014] ata1.00: status: { DRDY ERR }     [ 1420.687858] ata1.00: error: { UNC }     [ 1420.761064] ata1.00: configured for UDMA/133     [ 1420.763863] sd 0:0:0:0: >[sda] Unhandled sense code     [ 1420.766653] sd 0:0:0:0: >[sda]       [ 1420.769364] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     [ 1420.772104] sd 0:0:0:0: >[sda]       [ 1420.774780] Sense Key : Medium Error [current] [descriptor]     [ 1420.777491] Descriptor sense data with sense descriptors (in hex):     [ 1420.780249]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00      [ 1420.783175]         08 0a 9d e1      [ 1420.785972] sd 0:0:0:0: >[sda]       [ 1420.788730] Add. Sense: Unrecovered read error - auto reallocate failed     [ 1420.791545] sd 0:0:0:0: >[sda] CDB:      [ 1420.794331] Read(10): 28 00 08 0a 9d a8 00 00 40 00     [ 1420.797242] end_request: I/O error, dev sda, sector 134913505     [ 1420.800072] ata1: EH complete     [ 1420.800077] JBD2: Failed to read block at offset 2748     [ 1420.812529] JBD2: recovery failed     [ 1420.815275] EXT4-fs (sda5): error loading journal      I barely understand what this means, but it sure looks like a hardware problem preventing the journal from being loaded. Is there anyway to work around this? Can the journal, say, be relocated to a different offset while leaving the rest of the drive mostly intact? I have no intention of continuing to use the drive; I just want to mount it so I can copy a few crucial files.


title: Setting default brightness level on startup for all run levels

text: Laptop: Toshiba R630   OS: Linux Mint 14 Cinnamon I have seen various articles (http://askubuntu.com/questions/151651/brightness-is-reset-to-maximum-on- every-restart) on adjusting brightness. But my laptop seems to have more than one way to adjust brightness using /sys fs.               /sys/class/backlight$ ls -l     total 0     lrwxrwxrwx 1 root root 0 Feb 24 11:56 acpi_video0 -> ../../devices/pci0000:00/0000:00:02.0/backlight/acpi_video0     lrwxrwxrwx 1 root root 0 Feb 24 12:18 intel_backlight -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight     lrwxrwxrwx 1 root root 0 Feb 24 12:18 toshiba -> ../../devices/LNXSYSTM:00/device:00/TOS6208:00/backlight/toshiba        1. why is there more than one way? what is the difference between them?   2. which is the preferred way to set initial brightness for all run levels?   3. how does toshset get installed? i dont remember installing myself. Does Mint install based on identified manufacturer? > >     $ dpkg -l | g toshset >     ii  toshset                                     1.76-4 > amd64        Access much of the Toshiba laptop hardware interface >   >     $ dpkg -L toshset >     /. >     /etc >     /etc/pm >     /etc/pm/sleep.d >     /etc/pm/sleep.d/novatel_3g_suspend >     /usr >     /usr/share >     /usr/share/doc >     /usr/share/doc/toshset >     /usr/share/doc/toshset/supported-models.txt >     /usr/share/doc/toshset/README.IrDA >     /usr/share/doc/toshset/copyright >     /usr/share/doc/toshset/README.video >     /usr/share/doc/toshset/toshiba-acpi >     /usr/share/doc/toshset/toshiba-acpi/2.6.28 >     /usr/share/doc/toshset/toshiba-acpi/2.6.28/Makefile >     /usr/share/doc/toshset/toshiba-acpi/2.6.28/toshiba_acpi.c >     /usr/share/doc/toshset/toshiba-acpi/2.6.28/install.sh >     /usr/share/doc/toshset/toshiba-acpi/2.6.26 >     /usr/share/doc/toshset/toshiba-acpi/2.6.26/Makefile >     /usr/share/doc/toshset/toshiba-acpi/2.6.26/toshiba_acpi.c >     /usr/share/doc/toshset/toshiba-acpi/2.6.26/install.sh >     /usr/share/doc/toshset/README >     /usr/share/doc/toshset/changelog.Debian.gz >     /usr/share/doc/toshset/README.Debian >     /usr/share/man >     /usr/share/man/man1 >     /usr/share/man/man1/toshset.1.gz >     /usr/share/man/man1/toshsat1800-irdasetup.1.gz >     /usr/sbin >     /usr/sbin/toshsat1800-irdasetup >     /usr/bin >     /usr/bin/toshset >


title: service killed at ssh hangup

text: If I use `ssh` to run some command in background, that command gets killed as soon an ssh hangs up:               ssh localhost -t "bash -c '(for i in 1 2 3 4 5; do sleep \$i;done)&'"; ps x|grep sleep      This will not show any running sleep process. (But it would, if I do the ps inside the ssh command.) However if I manually log in, run it it background and logout, the command keeps running.               ssh localhost     bash -c '(for i in 1 2 3 4 5; do sleep $i;done)&';exit     ps x|grep sleep      Why is the first command killed? Why not the second one? (NB: This problem arose when I tried to start a service with `service tomcat start` which worked fine after a manual login, but no service was running after invoking directly in the ssh command.) * * * No, this is not a duplicate of ssh + nohup does not work. I am not talking about nohup and I am not trying to use `jobs` instead of `ps`.


title: Using variables to store terminal color codes for PS1?

text: In my `.bashrc`, I use ANSI terminal color codes to colorize various bits. It looks like this:               PS1='\u@\h:\w\[\033[33m\]$(virtual_env)\[\033[32m\]$(git_branch)\[\033[0m\]$ '      where `virtual_env` and `git_branch` are bash functions that output stuff on stdout. Now, to make it easier to read and modify, I'd like to store the color codes in variables and refer to them, instead of embedding them directly into `PS1`. So I have a bunch of variables like this:               GREEN="\[\033[32m\]"     YELLOW="\[\033[33m\]"     RESET="\[\033[0m\]"      I'd like to be able to write something like:               PS1='\u@\h:\w${YELLOW}$(virtual_env)${GREEN}$(git_branch)${RESET}$ '      But this doesn't work -- the color codes show up in the prompt, like they're escaped. The colors work correctly if I use double quotes instead for `PS1`, but then the prompt only changes when I do `source ~/.bashrc`. I've tried other things I've seen people do -- using `printf`, using single quotes for the colors, putting the `\\[` and `\\]` in `PS1` instead of the color variable, but nothing seems to work. How can I use variables for the color codes?


title: Error when tryhing to rebuild an RPM

text: I just use Linux for a LAMP server. I'm currently installing Apache 2.4 on CentOS 6.4 (x64). How do I resolve this error below?               rpmbuild: arguments to --root (-r) must begin with a /     [root@microtrack src]# rpmbuild --rebuild /distcache-1.4.5-23.src.rpm     error: cannot open /distcache-1.4.5-23.src.rpm: No such file or directory


title: I can't print blank lines when reading values from a text file using awk in a bash script

text: `awk` is behaving very strangely in my script. I am trying to read values from a text file (see `file.txt` below). `awk` is ignoring blank spaces in my script, but when I test the `awk` statement on its own (in a test script for bugging) it provides the correct output. Here is `file.txt`:               cain     jon     chris          johny     anthony          jose      Here is my `awk` statement: `awk '{print $1}' file.txt` This is the output when the `awk` statement is in my script:               cain     jon     chris        johny     anthony         jose      This is the output when the `awk` statement is isolated in my test script:               cain     jon     chris          johny     anthony          jose      I tried using `\n` as a delimiter but I get the same result. Why is `awk` behaving differently in my script and when it is isolated? Let me know if further explanation is required.


title: How do I make Powertop's suggestion's permanent?

text: When I run Powertop, and look at the Tunables screen, about twenty things are listed as Bad. I can toggle these to Good by pressing enter, and when I do so, projected battery lifetime _doubles_. How can I make these changes persist? (I'm on Fedora 18, by the way, with Powertop 2.2)


title: How do I troubleshoot this boot issue?

text: I have a Lenovo x120e that is not booting properly. When I turn it on, it just opens to a blank screen. The machine is running Ubuntu 10.04. **Main Details:** I shut the lid of the computer while it was running, and then opened it later and noticed that I couldn't get it out of suspend / hibernate mode. I subsequently powered it down by holding the power button. Now when I turn it back on, it just opens to a blank, black screen, as if it is still in suspend / hibernate. **Other Details:**   1. The 10.04 operating system was installed while this HD was in another laptop. Since I moved the HD into this machine, I have been booting another OS.   2. I never updated the drivers in this operating system to work with this machine. (Does this matter for this particular situation / problem?) **What I have tried so far:** I found the `REISUB` method here but I don't have a `SysReq` button. **What are my next steps to troubleshoot / solve this issue?** Note: This question was also posted on askubuntu but I didn't get an answer there that fixed the problem.


title: Is their a 'friction free' way to convert RAID1 to RAID5?

text: What's the best way to convert Linux software RAID 1 array to RAID 5? ( I have already bought the 3rd Hard Disc !)


title: How to find hidden partition of a USB in linux

text: I have a USB, which has a protected partition. I think this USB has hidden partitions, which I can't see them. `$ fdisk -l /dev/sdb`:               You must set cylinders.     You can do this from the extra functions menu.          Disk /dev/sdd: 0 MB, 18432 bytes     8 heads, 63 sectors/track, 0 cylinders     Units = cylinders of 504 * 512 = 258048 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xea168bf5             Device Boot      Start         End      Blocks   Id  System     /dev/sdd1   *           1           1          15+   1  FAT12     Partition 1 has different physical/logical beginnings (non-Linux?):          phys=(0, 1, 1) logical=(0, 0, 2)     Partition 1 has different physical/logical endings:          phys=(998, 7, 63) logical=(0, 0, 32      * * * `$ ls -l /dev/sdd*`:               brw-rw----. 1 root disk 8, 48 Jul  4 13:07 /dev/sdd     brw-rw----. 1 root disk 8, 49 Jul  4 13:07 /dev/sdd1      * * * `$ parted /dev/sdd`:               Warning: Unable to open /dev/sdd read-write (Read-only file system).  /dev/sdd has been opened read-only.     Warning: Unable to open /dev/sdd read-write (Read-only file system).  /dev/sdd has been opened read-only.      * * * I used `hdparm -r0 /dev/sdd`, too, but **NOTHING HAPPENED!** **Question:** How can I find hidden partitions and mount them for copying files?


title: pipe and log STDOUT at the same time

text: Some programs output very detailed data, for readability I use `awk` to filter them.               ./output_many_things | awk '{print $1 "\t" $2}'      But I don't want to miss anything. Could I redirect the complete output to a log file, but output the `awk`ed data to screen?


title: SSH: public key authentication without authorized_keys file

text: I have a lot of ssh public key logins on a Linux server, e.g.:               Jul 25 11:41:01 host sshd[24594]: Accepted publickey for root from xxx.xxx.xx.xx port 33374 ssh2      This is strange for me since there's no `authorized_keys` file in the `/root/.ssh` directory. The `AuthorizedKeysFile` option in `/etc/ssh/sshd_config` has the default value of `.ssh/authorized_keys`. I wonder how is it possible to login to the server using public key authentication?


title: What does "Invalid argument" mean in Solaris?

text: -bash-3.00$ ./p4 -V     -bash: ./p4: Invalid argument      What does "Invalid argument" mean in Unix? **More details:**   1. p4 is an executable in the current directory.   2. p4 actually refers to perforce. The option -V is supposed to display the version details.   3. Solaris 10 is the OS.   4. p4 has executable permissions (chmod +x p4)   5. The official documentation wasn't very helpful in my case.


title: iptrace for linux: how can I trace full packet contents?

text: I normally use `iptrace` on our AIX servers to get packet traces but have recently found out that this doesn't work for other 'nix systems - namely Centos. Does anyone know what the analog would be? I've tried the following, but none seem to work as I expect:               697  sudo /usr/sbin/tcpdump -w test.pcap -i eth0     1010  sudo /usr/sbin/tcpdump port 80     1012  sudo /usr/sbin/tcpdump port 80 -i eth0     1015  sudo /usr/sbin/tcpdump -A port 80 -i eth0     1017  sudo /usr/sbin/tcpdump -w ~/capture.pcap port 80 -i eth0      I can see the header data in wireshark, but I can't seem to see the _actual_ packet data.


title: LightDM shows a black screen in my Arch Guest VM

text: I'm trying to get LightDM to work but for some reason it just shows up a black screen when I get to the user selection screen, GDM works fine though. I followed the ArchWiki doc and it's strange since it didn't involve any complex configuration:   1. Installed lightdm from yaourt (no errors)   2. On `/etc/inittap` changed `d:3:initdefault:` to `d:5:initdefault:` and `x:5:respawn:/usr/sbin/gdm -nodaemon` to `x:5:respawn:/usr/sbin/lightdm >& /dev/null` Not sure if it's something related to virtualbox or the actual install. Thanks in advance!


title: at command - totally stuck

text: I'm trying to perform a one-liner using `at`. Basically, I want to send an SMS at some point in the future. Here's my command to send an SMS:               php -r 'include_once("/home/eamorr/open/open.ie/www/newsite/ajax/constants.php");sendCentralSMS("08574930418","hi");'      The above works great! I receive my sms in a couple of seconds. Now, how can I get `at` to run this command in future? I tried               php -r 'include_once("/home/eamorr/open/open.ie/www/newsite/ajax/constants.php");sendCentralSMS("08574930418","hi");' | at now + 2 minutes      But this sends my command immediately! I want to send the message in 2 minutes' time!


title: Change password in headless mode

text: I am building a script to fully automate a VPS setup, and I need to change the root password. I would like to avoid typing it as the script is running through SSH. Is there a way to redirect an arbitrary value to the input of `passwd` command? **EDIT** I know for `passwd < passwd_file.txt` containing the password twice... I would like to know if there is a more elegant way as it seems a little bit clumsy to use a temp file for this purpose.


title: Provide user name when using vim with scp

text: I was reading about SSH here http://blogs.perl.org/users/smylers/2011/08/ssh- productivity-tips.html and found that you can use `vim` to directly modify a file on a remote server that you can `ssh` into. Like:               vim scp://testserver/path/filename      And it works perfectly except that I need to provide a **username** (because I have a different user name on the server). How can I do that? (vim asks for the password, but uses my local username)


title: How do I less a filename rather than an inode number?

text: I have a piece of software that rotates its log files when it restarts. However, during development, I am restarting it a lot, so I would like to monitor the latest log file at any time. If I start `less` normally - `less program.log` - and hit `Shift-f` to tail, when the log file is rotated, I carry on monitoring the old log file. I assume this is because the inode number stays the same and `less` has an open file handle to that inode. Is it possible to monitor the latest activity on whatever log file is currently called `program.log`? Specifically, I am working on Sun OS, so a solution that works there would be ideal.


title: List files in a directory with a certain extension

text: I created a file called `~/usrlibs.txt`, which contains the number of files that begin with `lib` and end `.a` found in the `/usr/lib directory`. I tried:               ls -l /usr/lib/lib .a | wc -w > ~/usrlibs.txt       But this command is not working correctly. What am I missing?


title: find command throws errors when inside function

text: I can run the following command in bash without any errors:               $ find /d/Code/Web/Development/Source/ \( -name '*.cs' -o -name '*.cshtml' \) -exec grep -IH UserProfileModel {} \;      I wrote a function in .bash_aliases to quickly run this command:               search() {         local file_type file_types find_cmd opt OPTARG OPTIND or pattern usage              usage="Usage: search [OPTION] ... PATTERN [FILE] ...     Search for PATTERN in each FILE.     Example: search -t c -t h 'hello world' /code/internal/dev/ /code/public/dev/          Output control:       -t    limit results to files of type"              if [[ $1 == --help ]]; then             echo "$usage"             return         fi              file_types=()         while getopts ":t:" opt; do             case $opt in                 t)                     file_types+=("$OPTARG")                     ;;                 ?)                     echo "$usage"                     return                     ;;             esac         done         shift $((OPTIND-1))              if (( $# == 0 )); then             echo "$usage"             return         fi              pattern=$1         shift              if (( $# == 0 )); then             echo "$usage"             return         fi              find_cmd=(find "$@" '\(')         or=""         for file_type in "${file_types[@]}"; do             find_cmd+=($or -name \'*.$file_type\')             or="-o"         done         find_cmd+=('\)' -exec grep -IH "$pattern" {} '\;')              "${find_cmd[@]}"     }      However, the function throws an error:               find: paths must precede expression      If I change the last line to `echo "${find_cmd[@]}"`, it prints the exact same command as above:               $ search -t cs -t cshtml UserProfileModel /d/Code/Web/Development/Source/     find /d/Code/Web/Development/Source/ \( -name '*.cs' -o -name '*.cshtml' \) -exec grep -IH UserProfileModel {} \;      I don't understand why it would work when run in the console but fail when run inside a function. Also, if I simplify the function to just the command it works:               search() {         find /d/Code/Web/Development/Source/ \( -name '*.cs' -o -name '*.cshtml' \) -exec grep -IH UserProfileModel {} \;     }      I am editing .bash_aliases in Notepad++, but I have made sure the line endings are Unix format. # Edit Per F. Hauri's advice below, I enabled debugging. Apparently this is the command that's actually being executed:               find /d/Code/Web/Development/Source/ '\(' -name ''\''*.cs'\''' -o -name ''\''*.cshtml'\''' '\)' -exec grep -IH UserProfileModel '{}' '\;'      I'm not sure what to make of this information. Removing the escape character before the parens cause it to throw a different error:               find: missing argument to -exec


title: How can I prevent my wifi driver from going catatonic?

text: I'm using a Lenovo T430s with an `Intel(R) Centrino(R) Ultimate-N 6300` wireless chipset. On certain wireless networks, I experience frequent wifi lockups, which require me to reload the wireless module thusly:               modprobe -r iwlwifi     modprobe iwlwifi      The main clue, aside from lost connectivity, that I need to do this is that dmesg shows:               [ 9351.591170] iwlwifi 0000:03:00.0: Queue 11 stuck for 2000 ms.     [ 9351.591178] iwlwifi 0000:03:00.0: Current read_ptr 153 write_ptr 161     [ 9351.591182] iwlwifi 0000:03:00.0: On demand firmware reload     [ 9351.592001] ieee80211 phy0: Hardware restart was requested     [ 9351.592149] iwlwifi 0000:03:00.0: L1 Enabled; Disabling L0S     [ 9351.599072] iwlwifi 0000:03:00.0: Radio type=0x0-0x3-0x1        1. What causes this?   2. Is there any way to prevent this? I'm using Linux kernel 3.2.0-4-amd64 from Debian wheezy.


title: how to delete temp and log files with terminal on vps?

text: I'm kinda pretty new to this but anyone know how to delete any temp and log files or these kind of files on vps with terminal? I'm runnin debian on the vps. I'm troubled since I can't locate those files.


title: How to know when a device is ready

text: I have firewire mixing console and I wrote an udev rule which calls a script to set up the whole audio chain (alsa -> pulseaudio -> jackd -> firewire) as soon an the console is switched on. Now I noticed that, while `jackd` gets started, it dies a few seconds later. I captured its output an it contained an error message. For testing I faked the udev event via `udevadm trigger` and everything worked fine. This made me believe, that it just takes some time between the the moment the (real) udev event fires and when the device is actually ready. My faked udev event did not suffer from this problem, because the console was switched on and /dev/fw1 was present and ready all the time. Indeed, adding a `sleep 2` to my script solved the problem, but I am not happy with this solution. It looks fragile, because under heavy load I might need three or four seconds. And beeing too generous with `sleep` my pile up a lot of unnecessary latencies. So - is there any way to know when a device is actually ready?


title: Guest addition already installed in Linux mint

text: I have recently installed Linux Mint 14 on a VirtualBox VM and it seems that guest additions are already installed. I did not install them. How is this possible? Does Linux Mint know that it is running inside a VM and install them itself?


title: Gibberish Characters in Redhat

text: On one RHEL Server I installed Arabic Language support but if browse some Arabic or Urdu Language sites it is showing gibberish characters. So I downloaded some fonts and copied them under `home/.fonts` and for system wide I copied them under `/usr/share/fonts/`. And refreshed the `fc-cache` but still fonts are not rendering. Any Suggestions on it??


title: Allow world access to directory under 0750 directory

text: I prefer to keep my `/home/dotancohen/` directory as permissions `0750`. However, I do need Apache to access `/home/dotancohen/someProject/public_html/`. I know that I could configure the home directory as `0755` and all subdirectories other than `~/someproject/` as `___0` but that is a pain. How might I allow Apache to access the `~/someproject/public_html/` directory yet keep the home directory as `0750`? I tried to symlink `/war/www/someProject` to `/home/dotancohen/someProject/` but in any case Apache fails to get past the `0750` barrier on `/home/dotancohen/`. I suppose that I could add the `www-data` user (Apache) to the `dotancohen` group, but I feel that is giving it too much power. Alternatively, I could keep the web files in `/var/www/someProject/` but due to other reasons I prefer to keep them under my home directory.


title: Disable daylight saving time in Debian Linux

text: I do not want my system to use daylight saving time.               root@ali-debserver:~# cat /etc/timezone     Asia/Tehran          root@ali-debserver:~# cat /etc/default/rcS     #     # /etc/default/rcS     #     # Default settings for the scripts in /etc/rcS.d/     #     # For information about these variables see the rcS(5) manual page.     #     # This file belongs to the "initscripts" package.          # delete files in /tmp during boot older than x days.     # '0' means always, -1 or 'infinite' disables the feature     #TMPTIME=0          # spawn sulogin during boot, continue normal boot if not used in 30 seconds     #SULOGIN=no          # do not allow users to log in until the boot has completed     #DELAYLOGIN=no          # be more verbose during the boot process     #VERBOSE=no          # automatically repair filesystems with inconsistencies during boot     #FSCKFIX=no      I could not solve this problem permanently with `ntp` or `tzdate`. How do I disable daylight saving time?


title: DBUS interface to decrypt a LUKS device?

text: In modern DEs, like KDE or XFCE, you can mount a LUKS device after entering the password. Now I want to do this without the file manager, with two steps,   1. Decrypt the device   2. Mount the disk with `udisks` command For the first step, there should be a dbus interface involved, any ideas? Or correct me on how the file managers do that without root permission ... (P.S I'm not asking for a `sudo` solution, although I could do that, but I prefer a dbus solution)


title: Using a bridge, an LXC container can't ping router, but the host OS can

text: I've got a virtual machine running under virtualbox, and in that virtual machine I've got an LXC container I'm trying to bridge to virtualbox's NAT interface:               -------------      -----------      -----------      ----------      ----------     | LXC       | ---> | Host OS | ---> | Virtual | ---> | Laptop | ---> | Router |     | Container |      | Linxu   |      | Box     |      |        |      |        |     -------------      -----------      -----------      ----------      ----------     eth0 10.1.0.35     br0 <-> eth0     NAT GW:          192.168.1.33    GW:     gw 10.1.0.2        br0 10.1.0.5      10.1.0.2/16                      192.168.1.1                        gw 10.1.0.2          Ping 10.1.0.2      ping 10.1.0.2      FAIL               OK      I cannot ping from the LXC container to the virtualbox gateway, but I can from the Host OS. Note: running `tcpdump` on the host OS, I can sing pings being sent from the container to the router, and the reply from the router to the container, but `tcpdump` on the container shows no traffic. **LXC eth0**               eth0      Link encap:Ethernet  HWaddr 00:16:3e:ed:82:b8               inet addr:10.1.0.35  Bcast:10.1.255.255  Mask:255.255.0.0               inet6 addr: fe80::216:3eff:feed:82b8/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:585 errors:0 dropped:0 overruns:0 frame:0               TX packets:588 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:58003 (58.0 KB)  TX bytes:56447 (56.4 KB)      **Host OS:**               root@ubuntuserver:/# ifconfig     br0       Link encap:Ethernet  HWaddr 08:00:27:ca:5f:7a               inet addr:10.1.0.5  Bcast:10.1.255.255  Mask:255.255.0.0               inet6 addr: fe80::a00:27ff:feca:5f7a/64 Scope:Link               UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1               RX packets:2012 errors:0 dropped:0 overruns:0 frame:0               TX packets:882 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:158794 (158.7 KB)  TX bytes:139083 (139.0 KB)          eth0      Link encap:Ethernet  HWaddr 08:00:27:ca:5f:7a               UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1               RX packets:2968 errors:0 dropped:0 overruns:0 frame:0               TX packets:2404 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:281188 (281.1 KB)  TX bytes:312109 (312.1 KB)          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:180 errors:0 dropped:0 overruns:0 frame:0               TX packets:180 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:14376 (14.3 KB)  TX bytes:14376 (14.3 KB)          vethStvXMU Link encap:Ethernet  HWaddr fe:9a:36:3a:84:1c               inet6 addr: fe80::fc9a:36ff:fe3a:841c/64 Scope:Link               UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1               RX packets:557 errors:0 dropped:0 overruns:0 frame:0               TX packets:554 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:53465 (53.4 KB)  TX bytes:55003 (55.0 KB)               root@ubuntuserver:/# brctl show     bridge name     bridge id               STP enabled     interfaces     br0             8000.080027ca5f7a       no              eth0                                                             vethStvXMU


title: Tmux: showing sessions on bottom row

text: I'd like to see all tmux sessions on the bottom row of the screen, presented the way tmux presents all windows in the current session. Basically a sticky version of the <prefix>s menu. So the bottom of the screen would include sessions in one row and just above it, the regular row of current session windows. Any way to achieve it?


title: Forget a hashed executable location in bash interactive shell

text: I often run into the case where I'm working inside a Python virtualenv, and I want to run an executable Python program (e.g., bpython). I run it, forgetting that I have not installed it in my virtualenv so it won't do the right thing. Then, I install bpython in my virtualenv, but if I try to run the new version, bash "remembers" the old one and calls it instead. To be more concrete:               (venv)$ bpython            (whoops, system-level bpython!)     (venv)$ which bpython     /usr/local/bin/bpython     (venv)$ type bpython     bpython is hashed (/usr/local/bin/bpython)     (venv)$ pip install bpython      (venv)$ which bpython     /Users/lorin/.virtualenvs/venv/bin/bpython     (venv)$ type bpython     bpython is hashed (/usr/local/bin/bpython)      How do I tell the bash prompt to "forget" that the location of bpython is `/usr/local/bin/bpython` for that session?


title: How to enable and disable X11 outside of init

text: We have an embedded version of Meego Linux running on an x86 chip-set that currently uses X11 as the window technology. For various reasons we want to remove X11 from the mix (along with mutter, we are using clutter as a graphic toolkit). However, our main web browser needs to run in a X11 window. So far we have kept to using X11 for this reason. But we would like to run clutter just on the OpenGL layers. I could start up X11 through running `init 5` but would like to do it in a more gentle fashion. Is there a way of starting and exiting X11 for this? Thanks. Update to answer questions - 4/05/2012:   1. startx does not appear to be on the system...? Not sure how X starts without this. There is no .xsession either.   2. You want to start X, and then exit immediately? Yes and No. Only want to exit X once the browser exits.   3. Do you want the X window to display directly on the screen? In terms of the browser, yes. The browser is the only app that uses X11, and it is a full screen application (i.e. no 'window' type of scaling, moving, etc.)   4. Do you need a specific web browser, or will any do? Yes, Very specific version.   5. Do you need to run the browser and clutter at the same time? No. Once the browser has been launched, it takes full control until exited.


title: Best way to continue stopped move (mv) by merging directories?

text: I have moved (mv) a pretty large directory on my NAS (Linux based), but had to interrupt the procedure. Not being a regular Linux user, I though I could just continue and merge the rest later in.               mv /oldisk/a /newdisk      Procedure is alfway done, so rest of /oldisk/a still exists, and /newdisk/a with the already copied files is already present. I have no idea which files have been already copied. BTW, under /oldisk/a, of course, are plenty of sub directories. What would be the best way to move / merge the remaining files to /newdisk/a ?


title: Restricting sound control

text: I need to restrict users so that they cannot output sound from built-in speakers. They should plug their headphones to hear any sound. They should be able to control headphone volume level, but not built-in speakers. I need a command-line solution for automation purposes. Is this possible (on Ubuntu 12.04)?


title: Should I disable hyperthreading when concerned about performance of single-threaded applications?

text: I use a i5-2410M processor, which is setup to do hyperthreading by default on my laptop. Considering that this is a 2-core processor, this means it can do 4 threads at a time. This also means that single-threaded applications only use a maximum of 25% of processing power, and I would rather have them max at 50% instead. Will disabling hyperthreading have adverse effects (this is a development machine and runs a desktop)? Am I even reading **`top`** properly?


title: open /dev/fb0: No such device

text: I installed fbi framebuffer to view images on TTY terminals (outside X). When I do:               fbi image.jpg      it outputs the following error: > open /dev/fb0 no such device Yet when I run `ls /dev/fb*`, I can see that I have a directory `/dev/fb` and a character device `/dev/fb0`.


title: Write In A File at Specific Location

text: I am trying to create a script that will add a user to the `UserDir enabled` list or will remove it from `UserDir disabled` list in `userdir.conf`. For the sake of my question, let's say I have the following file:               Lorem ipsum     Lorem ipsum         List 1 enabled     Lorem ipsum     Lorem ipsum         List 2 disabled     Lorem ipsum      What I would like to do is when I run my script with the following `./script enabled user` is to modify my file to:               Lorem ipsum     Lorem ipsum         List 1 enabled user     Lorem ipsum     Lorem ipsum         List 2 disabled     Lorem ipsum      Afterwards, if I do `./script disabled user` it will remove user from List 1 and add it two list 2. Thus, the output of the file would be:               Lorem ipsum     Lorem ipsum         List 1 enabled     Lorem ipsum     Lorem ipsum         List 2 disabled  user     Lorem ipsum      My question is not about how to write this script, it is about **how to add/delete text into/from a file at a specific location**. **Off-topic question:** Is there a better way to add/remove users in the UserDir list of the apache2?


title: After upgrading the kernel, the sound no longer works

text: I have updated the Linux kernel on my system to `Linux 3.11-2-amd64 #1 SMP Debian 3.11.10-1 (2013-12-04) x86_64 GNU/Linux`. Having done that, the sound no longer works. **Distribution Info** (`cat /etc/*-release`):               PRETTY_NAME="Debian GNU/Linux jessie/sid"     NAME="Debian GNU/Linux"     ID=debian     ANSI_COLOR="1;31"     HOME_URL="http://www.debian.org/"     SUPPORT_URL="http://www.debian.org/support/"     BUG_REPORT_URL="http://bugs.debian.org/"      When I run the comand `lspci | grep -i audio` it prints the following:               00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler HDMI Audio     00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)      When I try to do a test of my sound with the command :                LC_ALL=C speaker-test -l 3 -t sine -c 1      I get the following:               speaker-test 1.0.27.2          Playback device is default     Stream parameters are 48000Hz, S16_LE, 1 channels     Sine wave rate is 440.0000Hz     ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied          Playback open error: -111,Connection refused      What should I do? **UPDATE:** When I runt the command `alsactl init` it prints:               Found hardware: "HDA-Intel" "ATI R6xx HDMI" "HDA:1002aa01,00aa0100,00100200" "0x1025" "0x0740"     Hardware is initialized using a generic method      So when I try to run: `pulseaudio -D` it prints:               E: [pulseaudio] main.c: Daemon startup failed.      **aplay -l**               **** List of PLAYBACK Hardware Devices ****     card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: Generic_1 [HD-Audio Generic], device 0: ALC271X Analog [ALC271X Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0      **aplay -L**               default         Playback/recording through the PulseAudio sound server     hdmi:CARD=Generic,DEV=0         HD-Audio Generic, HDMI 0         HDMI Audio Output     sysdefault:CARD=Generic_1         HD-Audio Generic, ALC271X Analog         Default Audio Device     front:CARD=Generic_1,DEV=0         HD-Audio Generic, ALC271X Analog         Front speakers     surround40:CARD=Generic_1,DEV=0         HD-Audio Generic, ALC271X Analog         4.0 Surround output to Front and Rear speakers     surround41:CARD=Generic_1,DEV=0         HD-Audio Generic, ALC271X Analog         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=Generic_1,DEV=0         HD-Audio Generic, ALC271X Analog         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=Generic_1,DEV=0         HD-Audio Generic, ALC271X Analog         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=Generic_1,DEV=0         HD-Audio Generic, ALC271X Analog         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers      **dmesg | grep sound**               [    8.838666] input: HD-Audio Generic HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.1/sound/card0/input7     [    9.395442] input: HD-Audio Generic Headphone as /devices/pci0000:00/0000:00:14.2/sound/card1/input10     [    9.395704] input: HD-Audio Generic Mic as /devices/pci0000:00/0000:00:14.2/sound/card1/input11      **lsmod**               Module                  Size  Used by     cpufreq_userspace      12525  0      cpufreq_stats          12777  0      cpufreq_powersave      12454  0      cpufreq_conservative    14184  0      parport_pc             26300  0      ppdev                  12686  0      lp                     17074  0      parport                35749  3 lp,ppdev,parport_pc     bnep                   17431  2      rfcomm                 36903  0      bluetooth             215917  10 bnep,rfcomm     binfmt_misc            16949  1      nfsd                  255063  2      auth_rpcgss            51036  1 nfsd     oid_registry           12419  1 auth_rpcgss     nfs_acl                12511  1 nfsd     nfs                   143940  0      lockd                  79321  2 nfs,nfsd     fscache                45230  1 nfs     sunrpc                211258  6 nfs,nfsd,auth_rpcgss,lockd,nfs_acl     fuse                   78616  1      loop                   26609  0      uvcvideo               78960  0      videobuf2_vmalloc      12816  1 uvcvideo     videobuf2_memops       12519  1 videobuf2_vmalloc     videobuf2_core         35029  1 uvcvideo     videodev              105100  2 uvcvideo,videobuf2_core     media                  18303  2 uvcvideo,videodev     joydev                 17063  0      acer_wmi               30174  0      snd_hda_codec_realtek    41059  1      arc4                   12536  2      sparse_keymap          12818  1 acer_wmi     ath9k                  94801  0      radeon               1166155  3      ath9k_common           12687  1 ath9k     ath9k_hw              390315  2 ath9k_common,ath9k     ath                    21417  3 ath9k_common,ath9k,ath9k_hw     mac80211              416244  1 ath9k     ttm                    69419  1 radeon     drm_kms_helper         35647  1 radeon     drm                   227730  5 ttm,drm_kms_helper,radeon     snd_hda_codec_hdmi     35769  1      snd_hda_intel          39672  7      snd_hda_codec         142551  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel     kvm                   354353  0      i2c_piix4              12623  0      cfg80211              377915  3 ath,ath9k,mac80211     snd_hwdep              13148  1 snd_hda_codec     snd_pcm                84096  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     snd_page_alloc         17114  2 snd_pcm,snd_hda_intel     pcspkr                 12595  0      psmouse                82028  0      evdev                  17445  24      serio_raw              12849  0      k10temp                12618  0      snd_seq                48834  0      snd_seq_device         13132  1 snd_seq     snd_timer              26614  2 snd_pcm,snd_seq     i2c_algo_bit           12751  1 radeon     snd                    60869  23 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_hda_codec,snd_hda_intel,snd_seq_device     wmi                    17339  1 acer_wmi     rfkill                 18978  6 cfg80211,acer_wmi,bluetooth     i2c_core               24084  6 drm,i2c_piix4,drm_kms_helper,i2c_algo_bit,radeon,videodev     acpi_cpufreq           17299  0      mperf                  12411  1 acpi_cpufreq     soundcore              13026  1 snd     processor              28326  3 acpi_cpufreq     video                  17844  1 acer_wmi     ac                     12668  0      battery                13101  0      button                 12944  0      ext4                  457329  1      crc16                  12343  2 ext4,bluetooth     mbcache                13034  1 ext4     jbd2                   82560  1 ext4     sg                     29971  0      sd_mod                 44300  3      crc_t10dif             12348  1 sd_mod     microcode              30309  0      ehci_pci               12472  0      thermal                17468  0      thermal_sys            27268  3 video,thermal,processor     ohci_pci               12808  0      ohci_hcd               25977  1 ohci_pci     ahci                   25096  2      libahci                27121  1 ahci     ehci_hcd               44263  1 ehci_pci     xhci_hcd               89949  0      libata                169120  2 ahci,libahci     usbcore               154086  6 uvcvideo,ohci_hcd,ohci_pci,ehci_hcd,ehci_pci,xhci_hcd     scsi_mod              178166  3 sg,libata,sd_mod     usb_common             12440  1 usbcore     r8169                  60070  0      mii                    12675  1 r8169      **grep -i pulse /var/log/syslog**               Dec 20 13:43:39 Demian pulseaudio[3565]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 13:43:39 Demian pulseaudio[3565]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 13:43:41 Demian pulseaudio[3631]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 13:43:41 Demian pulseaudio[3631]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 13:46:52 Demian pulseaudio[3731]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 13:46:52 Demian pulseaudio[3731]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 13:46:54 Demian pulseaudio[3735]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 13:46:54 Demian pulseaudio[3735]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 15:59:58 Demian pulseaudio[3736]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 15:59:58 Demian pulseaudio[3736]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 15:59:59 Demian pulseaudio[3739]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 15:59:59 Demian pulseaudio[3739]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 16:00:57 Demian pulseaudio[3945]: [pulseaudio] pid.c: Daemon already running.     Dec 20 16:11:57 Demian pulseaudio[3762]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 16:11:57 Demian pulseaudio[3762]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 16:11:59 Demian pulseaudio[3767]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 16:11:59 Demian pulseaudio[3767]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 16:13:47 Demian pulseaudio[3973]: [pulseaudio] pid.c: Daemon already running.     Dec 20 18:06:15 Demian pulseaudio[3911]: [pulseaudio] module-x11-publish.c: PulseAudio information vanished from X11!     Dec 20 20:15:22 Demian pulseaudio[3726]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 20:15:22 Demian pulseaudio[3726]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 20:15:24 Demian pulseaudio[3731]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 20:15:24 Demian pulseaudio[3731]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 20:20:36 Demian pulseaudio[3673]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 20:20:36 Demian pulseaudio[3673]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 20:20:37 Demian pulseaudio[3705]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 20:20:37 Demian pulseaudio[3705]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 21:36:34 Demian pulseaudio[3643]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 21:36:34 Demian pulseaudio[3643]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 21:36:36 Demian pulseaudio[3713]: [pulseaudio] authkey.c: Failed to open cookie file '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 21:36:36 Demian pulseaudio[3713]: [pulseaudio] authkey.c: Failed to load authorization key '/var/lib/gdm3/.config/pulse/cookie': No existe el fichero o el directorio     Dec 20 21:37:22 Demian pulseaudio[3950]: [pulseaudio] pid.c: Daemon already running.


title: How to control the permission of an application

text: I don't want the application have the permission to read some files that is my personal information, can I do it by setting the permission? I hear that AppArmor, is it easy to use? How to get it in openSUSE 12.3


title: switch to an existing Terminal Emulator using command (wmctrl) or shortcut key

text: It's rather hard to do it. wmctrl needs to know the window title in order to operate on it, but it is damn hard to know the title of any terminal emulator, be it gnome-terminal, rxvt, xterm... Because   * Often .bashrc specify PS1 to change window's title to current path.   * editor like VIM changes window's title to the current file.   * command line tools like mosh love to change window title.   * ssh into another machine, usually the shell (bash) on the remote host changes the title. So if you remove title-changing part of PS1 you need to do it to every computer you may connect to -- a long list of which for any seasoned sysop.   * Even if you run GNU Screen in a terminal, the session inside screen can still change the title of the outter terminal emulator. fluxbox exceptionally allows referring to a window by other properties of the X-window (xwininfo) than title. but switching to fluxbox is too big a change for this small need. In short, there seems to be no way to know the title of the terminal emulator window ... or, is there one?


title: aptitude produces output twice

text: For quite a while, I get a double output of some messages from aptitude. Here’s an example:               > sudo aptitude install mpw     Couldn't find package "mpw".  However, the following     packages contain "mpw" in their name:       stumpwm      Couldn't find package "mpw".  However, the following     packages contain "mpw" in their name:       stumpwm      No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 1019 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.      Still, this doesn’t happen with every message:               > sudo aptitude install mpv     No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 1019 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.      This is my aptitude version:               > aptitude --version     aptitude 0.6.8.2 compiled at Nov  5 2012 06:20:41     Compiler: g++ 4.7.2     Compiled against:       apt version 4.12.0       NCurses version 5.9       libsigc++ version: 2.2.10       Ept support enabled.       Gtk+ support disabled.       Qt support disabled.          Current library versions:       NCurses version: ncurses 5.9.20130608       cwidget version: 0.5.16       Apt version: 4.12.0      How can I fix that? I almost forgot: I noticed that the doubled messages are exactly errors as far as I can tell. So maybe this has to do with stderr? This is on a debian testing/unstable.


title: How to calculate percentages in LibreOffice Calc?

text: I am currently calculating percentages in LibreOffice Calc using the function `=PART/TOTAL` where `PART` and `TOTAL` are cell coordinates of a same column. Dragging-down the formula won't do, because the coordinate of the `TOTAL` cell will change along with the PART's. Ideally, I want to process this quickly, in a way that the coordinates of the `PART` changes while the `TOTAL`'s would remain the same. How can I do that? Is there a function for this?


title: How do I change the way of switching the workspaces in Cinamon 16?

text: I'm on Linux Mint 16 Cinnamon. It's pretty annoying for me that the switcher for the workspaces is on left top corner and whenever I get the mouse cursor there **by mistake** , the workspace switcher activates. I don't like it. I want to have a switcher like in Mate - on the panel next to watch. But I don't want to install Mate only for that reason. And I want to disable the default switcher (it's called Expo mode if I recall correctly). Your thoughts?


title: Emerge ParseError with any parameters

text: I tried to install a program via emerge, it only gives me this               ParseError: Invalid token '${.CURDIR}' (not '='): /etc/make.conf: line 22 in /etc/make.conf      I understand there must be a mistake in the `make.conf`... So my question probably is: What's the regular `make.conf` file for installing programs?


title: How can I disable the mouse wheel in gnome-terminal?

text: Does anybody know if it's possible to disable mouse wheel up-down events in gnome-terminal? I have a rather twitchy mouse wheel, and every time it twitches it does a history lookup in my terminal. But I still want to be able to middle-click paste.


title: Targus USB number pad not working in Debian Wheezy

text: I am running a fresh install of Wheezy x86 and trying to connect a Targus number pad (model AKP10US) which has the USB Vendor/Model IDs of 05A4 / 9840. (FWIW the system is also running in VirtualBox) However the only keys on the number pad that seem to work are `Enter` and `Back`. For other keys, I see escape like looking strings or I just hear a sound (which sounds like a keyboard buffer full type sound). For example in Terminal when pressing `0` I see `^[[2~`, and when pressing `.` I hear the sound. (As a comparison with the number pad connected to OSX, even though OSX says `Unknown keyboard` I still get the correct keystrokes out. But on Windows 7 its different again and I only have workable `+-/*` `<tab>` and `<enter>` keys) Dumping out `dmesg` I get               [  233.313462] usb 2-2: new full-speed USB device number 3 using ohci_hcd     [  233.525221] usb 2-2: New USB device found, idVendor=05a4, idProduct=9840     [  233.525221] usb 2-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0     [  233.525221] usb 2-2: Product: USB Compliant Keypad     [  233.552503] input: USB Compliant Keypad as /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/input/input7     [  233.552669] generic-usb 0003:05A4:9840.0002: input,hidraw1: USB HID v1.10 Keyboard [USB Compliant Keypad] on usb-0000:00:06.0-2/input0      And for `lsusb -v` I get               Bus 002 Device 003: ID 05a4:9840 Ortek Technology, Inc.      Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               1.10       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0         8       idVendor           0x05a4 Ortek Technology, Inc.       idProduct          0x9840        bcdDevice            1.10       iManufacturer           0        iProduct                1 USB Compliant Keypad       iSerial                 0        bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           34         bNumInterfaces          1         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xa0           (Bus Powered)           Remote Wakeup         MaxPower               48mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           1           bInterfaceClass         3 Human Interface Device           bInterfaceSubClass      1 Boot Interface Subclass           bInterfaceProtocol      1 Keyboard           iInterface              0              HID Device Descriptor:               bLength                 9               bDescriptorType        33               bcdHID               1.10               bCountryCode            0 Not supported               bNumDescriptors         1               bDescriptorType        34 Report               wDescriptorLength      65              Report Descriptors:                 ** UNAVAILABLE **           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0008  1x 8 bytes             bInterval              13     Device Status:     0x0000       (Bus Powered)      So it seems as if Debian has found the keyboard, but it hasn't wired it up as desired. So what can I configure (no kernel compiling etc) to correctly enable this keyboard? Or is it actually working correctly and I just don't know it? **Edit** I just plugged in a full sized USB keyboard into the system and everything worked straight away except for the numbers of the numeric keypad. These behaved almost the same as above. However, once I pressed `Numlock`, even the numeric kets worked. So my guess is that the Number pad is working correctly, but that driver is not applying `Numlock` to the key codes coming from it.


title: Unable to kill sar process

text: I have a shell script to run JMeter test. Script generates the Jmeter log out put and creates sar (suppose to create sar file though it does not). Shell script is -               runtest()      {      export JMETER_HOME=/home/software/apache-jmeter-2.6      host=$1      port=$2      loopcount=$3           logfile=jmeter$(date -d "today" +"%Y%m%d%H%M%S").jtl      sarfile=sar$(date -d "today" +"%Y%m%d%H%M%S").dat          sar -o $sar_file 3 100000 >/dev/null 2>&1 &     sar_pid=$!;     echo 'sar started with pid' $sar_pid;          for ((start=1; start <= $loopcount; start++ ))     do      echo 'Iteration' $start;     $JMETER_HOME/bin/jmeter.sh -n -t ReportWebService.jmx -Jhost=$host -Jport=$port -l $logfile     done     sleep 2     echo 'killing sar process id' $sar_pid     kill -9 $sar_pid;          }          runtest localhost 8087 1      When I execute the shell script, I eventually encounter error -               sar started with pid 13191     Iteration 1     Created the tree successfully using ReportWebService.jmx     Starting the test @ Tue Apr 17 11:16:24 IST 2012 (1334641584914)     Waiting for possible shutdown message on port 4445     Tidying up ...    @ Tue Apr 17 11:16:25 IST 2012 (1334641585129)     ... end of run     killing sar process id 13191     ./temp.sh: line 22: kill: (13191) - No such process      And I don't see any ".dat" file generated for sar data. What is wrong with this shell script? Please be gentle, I am new to world of Unix.


title: How to build and publish binaries for multiple Debian/Ubuntu distributions?

text: For a proprietary piece of software I'd like to build and publish multiple versions of software for multiple distributions. E.g. 1.0, 1.1 and both versions for squeeze, wheezy and precise. The builds are run on automatically on different machines and produce distribution-specific `.deb` files. Distribution-specific in a way that they're linked to distribution-specific versions of libraries. E.g. OpenSSL 0.9.8 for squeeze, 1.0.1 for wheezy. However, these packages are built using the same version number and package name. This is what is probably the cause for the issue following. Currently I'm using reprepro with the `includedeb` command to add the binaries to the repository. This works out fine, until I add the same package version built for a second distribution. Publishing for Squeeze is fine               # reprepro -b ./repo --outdir ./wwwpub/repo includedeb squeeze /path/to/sqeezepackages/packagename-1.0.deb      But then publishing the same version of the software built on wheezy, publishing for wheezy fails:               # reprepro -b ./repo --outdir ./wwwpub/repo includedeb wheezy /path/to/wheezypackages/packagename-1.0.deb      /path/to/wheezypackages/packagename-1.0.deb: component guessed as 'main'     ERROR: '/path/to/wheezypackages/packagename-1.0.deb' cannot be included as 'pool/main/p/packagename/packagename_1.0_all.deb'.     Already existing files can only be included again, if they are the same, but:     md5 expected: e7df7cd2ca07f4f1ab415d457a6e1c13, got: 0fa924209085a5713f79e6a30649455f     sha1 expected: 947b41827bbac414baddf0648b9abecaad8de4fe, got: 1be168ff837f043bde17c0314341c84271047b31     sha256 expected: a883dafc480d466ee04e0d6da986bd78eb1fdd2178d04693723da3a8f95d42f4, got: a93dbf1e95ddc4cfa84e9cd3cfa6c9e0e14affd79812abde4bca688224430a65     size expected: 1234, got: 1235     There have been errors!      I assume my build needs a unique version number for each distribution.   * What's the easiest way to accomplish this?   * How do I add this to the current version number? Is it advised to use something like `1.1~wheezy`, `1.1+wheezy`, `1.1-1` (incrementing), `1.1+deb6`, etc.? As `jessie` is coming up and I'd like the system to recognize this during dist-upgrades, I think just using the distribution name won't work as `j` comes before the `w` and will be recognized as older by APT.   * Once determined how to build up the version number; how do I add this to my tooling? I guess I need heuristics in the `debian/control` files to have the version number specific to the distribution it's built on. And for the changelog I'll have to invoke `dch` to comply with that version number as well.


title: How to copy the output of pacman-color into a file and to display the output with the colors in the terminal

text: Originally I used `pacman`, not `pacman-color` and I copied the output into a file and I displayed the output in the terminal with the following command :               pacman -Syu | tee file.log      Unfortunately, it seems that `pacman-color` detects that the output is sent to a pipe and it deactives the colored output.   So my question is how to force `pacman-color` to display a colored output even if the output is sent to a pipe? As with yaourt : > yaourt -Syu --color | tee file.log Or maybe there is a way to do it without using pipe or `tee`?


title: Arch Linux , mount disks with thunar , without password

text: I just setup a minimal installation of Arch , installed gvfs , thunar-volman. But mounting disk requires password , this shouldn't happen. How should I work it out ?


title: How can I stream in webm format using gstreamer?

text: I have a security camera and I want to stream using something different than mjpeg. So far, I am able to stream and play in firefox/chromium using theora. These are pipelines:               gst-launch-0.10 v4l2src ! ffmpegcolorspace ! theoraenc quality=3 ! queue ! oggmux name=mux alsasrc ! audio/x-raw-int,rate=8000,channels=1,depth=8 ! queue ! audioconvert ! vorbisenc ! queue ! mux. mux. ! queue ! shout2send ip=localhost port=8000 password=hackme mount=/entrance-camera.ogg      The thing here is that I want to use webm, encoding the video in vp8. I tried using `vp8enc` instead of `theoraenc` but I get:               Redistribute latency...     notification: This doesn't look like a Speex file      I don't want audio in the stream, so I guess that could ease things a little.


title: How to install OpenSuse 11.4 through an ISO without burning it to a DVD?

text: How to install **OpenSuse 11.4** through an **ISO** without burning it to a DVD? Installation needs to be done on hardware, not on some virtual machine.               anisha@linux-dopx:~/tarBalls> uname -a && cat /etc/issue     Linux linux-dopx 3.2.1-12-desktop #1 SMP PREEMPT Thu Jan 19 16:02:50 IST 2012 x86_64 x86_64 x86_64 GNU/Linux     Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).


title: How do I boot from a liveusb using qemu-kvm?

text: I am trying to get qemu-kvm to boot from my live usb stick. Is this possible?


title: Terminal - display too small to run menuconfig?

text: I am trying to install drivers and when I try to run the command `make menuconfig` I get the error message that the "display is too small" for that command? What does this mean, and how to solve this?               desktop:~/Downloads/linux-3.3.2$ make menuconfig       HOSTCC  scripts/basic/fixdep       HOSTCC  scripts/kconfig/conf.o       HOSTCC  scripts/kconfig/lxdialog/checklist.o       HOSTCC  scripts/kconfig/lxdialog/inputbox.o       HOSTCC  scripts/kconfig/lxdialog/menubox.o       HOSTCC  scripts/kconfig/lxdialog/textbox.o       HOSTCC  scripts/kconfig/lxdialog/util.o       HOSTCC  scripts/kconfig/lxdialog/yesno.o       HOSTCC  scripts/kconfig/mconf.o       SHIPPED scripts/kconfig/zconf.tab.c       SHIPPED scripts/kconfig/zconf.lex.c       SHIPPED scripts/kconfig/zconf.hash.c       HOSTCC  scripts/kconfig/zconf.tab.o       HOSTLD  scripts/kconfig/mconf     scripts/kconfig/mconf Kconfig     #     # using defaults found in /boot/config-3.2.0-24-generic-pae     #     /boot/config-3.2.0-24-generic-pae:4351:warning: symbol value 'm' invalid for FB_VESA     Your display is too small to run Menuconfig!     It must be at least 19 lines by 80 columns.     make[1]: *** [menuconfig] Error 1     make: *** [menuconfig] Error 2


title: How race conditions affect reads and writes (that happen at the same time)

text: Let's say I open a file `a` for reading. What if an application, let's call it `aWriter` writes to this file in random intervals. Are there any possibilities of me receiving improper file contents if I try to open `a` for a read and _at the same time_ `aWriter` is writing a new line. What happens to the file and what happens to what I get from my read. Another scenario. Let's say I have a file `b` which contains 100 lines of text. I also have an application `bWriter` which writes to `b` at random times. I want to remove the first 80 lines of file `b`. Let's assume `bWriter` wants to write to `b` as I have it open, will it still be able to write? Will it give up and lose it's write? I ask because I'm writing a Perl script which ties into Syslog. I've pointed Syslog to write all logs to a file and my script needs to (every 5 minutes) read the contents of the file, do some other stuff, then remove all the lines in that file and write the old lines to an archive. I'm using the file as an intermediary step between my script and the final resting place for logs. Can anyone give me some insight on to how exactly this works?


title: How to install StackApplet on Fedora 16?

text: Is possible to install the StackApplet on my Fedora 16 (under KDE) ?


title: How does "Remote tab title format" in Konsole work?

text: Some terminal programs, in particular Konsole supports "Remote title format" which allows you to specify title for remote tabs which includes placeholders like remote host. How does this work? Where does it get the remote host from, and how does it recognize the tab is holding a remote session? It seems to work for ssh, but not for other remote shell or terminal clients, and neither does it work for screen sessions that connect to remote hosts. What's the protocol it uses to recognize the remote session?


title: How to migrate between two keyrings in gnome-keyring

text: Due to some historic reasons I have 2 keyrings. I want to merge them - what is the easiest way?


title: Change (not remove) "fortunes" in Linux Mint console

text: I don't mind the idea of quotes when I load the Mint console, however the OEM text leaves much to be desired. I'd like to update the quote text with inspirational or otherwise useful quotes. How would I go about doing that?


title: Which programming language is best to begin with as a total beginner?

text: Ok here is the deal after playing with Linux distros for best part of 4 years, I have a great urge learn some coding. However I'm a bit undecided as to which programming language to begin with. Word around is Python but is it the right choice for a guy with limited knowledge in QBASIC? If it is not too much, a link to some great noob tutorials on the suggested language will be greatly appreciated. Thanks in advance


title: can't define command which executes Explore command

text: I wanted to make an easy way to open a directory. My first try was like this:               command! RootDirRubyOpen :e ~/.rbenv/versions/2.0.0-p247<CR>      But it didn't work. "Okay then," I thought. And changed it this way:               command! RootDirRubyOpen :Explore ~/.rbenv/versions/2.0.0-p247<CR>      To no effect though. So does anybody know how to make it work and what's wrong with my versions of the command? P.S. To be frank, the first version was like this: `command! RootDir_Ruby_Open ...`


title: Copy all tags from one FLAC file to another?

text: Is there a way to copy all tags from one FLAC file to another seamlessly using a command-line tool?


title: what are the caveats of sending email via the "mail" command?

text: I want to send emails from my work computers so that I can notify myself when various long-running tasks are completed. As I understand it, the command below looks up bar.com's MX record, makes a connection to the mail server and does SMTP to send the message:               echo “Hello world” | mail -s “Hello world” foo@bar.com      What do I need to know so that I can avoid being flagged/blocked as a spammer?


title: How can I convert a pdf file from gray-scale to black-white?

text: My OS is Ubuntu 12.04. How can I convert a pdf file from gray-scale to black- white? The gray-scale pdf file comes from scanning with gray-scale option, and the black-white scale pdf is required by OCR. * * * Update: Following Marco's reply, the B-W pdf isn't good and the original file is here.


title: debian wireless networking configuration

text: When I issue the command               iwconfig wlan0 essid NAME      it sometimes takes a really long time to actually be able to view any webpages through a browser. I don't know why that is. Right now the /etc/network/interfaces file contains the following:               allow-hotplug wlan0     iface wlan0 inet dhcp         # wireless-* options are implemented by the wireless-tools package         wireless-mode managed         wireless-essid NAME2      when I boot, there's never any issue like this. I never have to wait. So I tried changing NAME2 to NAME and the same problem remained. What can I do about this? What I really want is for debian to _just_ connect automatically to either NAME or NAME2 or any open wireless connection. I'm not sure whether this requires configuration in /etc/network/interfaces or /etc/NetworkManager/NetworkManager.conf. I'm currently trying to find examples of how to configure the files. So my questions are   1. how do I make the appropriate configuration?   2. do I even need the network-manager to do this?


title: problem with installing packages

text: I get these messages when I run this command:               # yum install pcre pcre-devel php php-common php-gd php-cli php-mysql flex bison     Loaded plugins: product-id, refresh-packagekit, security, subscription-manager     Updating certificate-based repositories.     Setting up Install Process     No package pcre-devel available.     No package php available.     No package php-common available.     No package php-gd available.     No package php-cli available.     No package php-mysql available.     No package flex available.     No package bison available.     Nothing to do      How can I fix that?


title: Choppy sound when recording sound from my microphone

text: I've just installed a fresh copy of Linux Mint 15 and so far everything is working ok, but sound from my mic. While talking on skype or just recording the sound produced is very very choppy. I tried different settings from alsamixer but couldn't fix it. Also tried searching on internet how to fix it but with no luck.


title: What's the best distro/shell-agnostic way to set environment variables?

text: The question says it all. I currently use Arch Linux and the zsh, but I'd like a solution that (at minimum) works both on VTs and in xterms and also (hopefully, preferably) will continue to work if I switch distros or shells. I've heard wildly disparate answers to this question in different distros' docs. Ubuntu says "use .pam_environment". I think in Arch what they recommend depends on your shell. Currently I put everything in .profile and if a shell doesn't source that for some reason (e.g. bash if .bash_profile exists), I override that by manually sourcing it. But it seems like there must be a better way.


title: find and exec: why does this command not work?

text: I don't get why echo prints empty line (latest cygwin version):               ~/tmp >find mydor/ -name "*php"     mydor/es/c/packags.php     mydor/etns/inx.php     mydor/pacepors.php     mydor/XAE.php          ~/tmp >find mydor/ -name "*php" -exec echo {} \;     ~/tmp >find mydor/ -name "*php" -exec echo "{}" \;     ~/tmp >find mydor/ -name "*php" -exec echo '{}' \;          ~/tmp >          ~/tmp >find --version     find (GNU findutils) 4.5.11     Packaged by Cygwin (4.5.11-1)     Copyright (C) 2012 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.     This is free software: you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.          Written by Eric B. Decker, James Youngman, and Kevin Dalley.     Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)


title: sort lines according to day

text: I have a text file in following format, and I need to sort the lines according to date. Is there some simple way to do it (preferably in bash) ?               2013-May-30     2     2013-May-21     10     2013-Jun-27     8     2013-Jun-18     9     2013-Jun-09     17     2013-May-20     21     2013-Jun-10     1     2013-Jun-01     2     2013-Aug-09     6     2013-Aug-08     5     2013-Aug-07     2     ...


title: Configure eth1 to stop using dhcp

text: How do I configure eth1 (via terminal commands) to stop using DHCP. That is, if I had the ability to use the GUI, I would select the MANUAL setting.


title: Different sites on different interfaces using link aggregation

text: I read about Ubuntu Bonding and how it allows to bond multiple connections to get several advantages. My requirements is this :   1. I want two different interfaces at a time (A wifi and other Ethernet)   2. Either I should be able to route all the traffic from Chrome to Wifi and from Firefox to Ethernet or Route all the traffic from one particular site through wifi and everything else through Ethernet. Will it be possible through Ubuntu Bonding ? Anything else I can do to achieve this ?


title: number of workspaces in Gnome

text: I am using CentOS 6.4 with GNOME desktop. How can I increase/decrease number of Desktop workspaces? Are there any tools available for that operation ?


title: Allowing mobile devices via proxy on pfsense [squid + AD auth + WPAD]

text: Our pfsense serves the internet via Squid proxy + AD authentication while filtering HTTP/HTTPS access using Squidguard with WPAD enabled. So that users do not need to enter proxy manually as the WPAD functionality serves the proxy details to the user's browser. Further, I've added two rules to block defaul HTTP (80) / HTTPS (443) access to make sure users won't go to the internet without the automatic proxy detection. Now the problem is that, when I do block HTTP (80) & HTTPS (443) default services; it also blocks all the traffics along with mobile internet users too. PC's have the capability to select auto detect proxy so that WPAD will serve while PC browser requests. Now, are there any solution which I can allow mobile users to access through proxy while the default blocking to http/https stays?


title: What do different BSDs have in common?

text: ... and what are the differences between them? I formulated my question like this to make it clear I'm not interested in a flamewar of opinions, rather in an objective comparison between the different flavors of BSD Unix. Ideally I could get feedback from users who have experience in all of them. **Background** I recently discovered that there's much more to Unix than merely Linux. I use Solaris at work, it opened my eyes. Now I'm interested in new unices, I want to try a new one and I'm naturally curious about BSDs. **The problem** _I'm not asking for advice or opinions on what BSD to install_ ; I want to know the differences (and common points) between them so I can make up my own mind. The problem is that it's difficult to get proper comparisons between them. If you're lucky, you get some hasty definition like this one:               FreeBSD = Popular all-rounder.     NetBSD = Portable (runs on a lot of platforms, including a toaster)     OpenBSD = Security above anything else.      _(It might be true, but it's not really useful. I'm sure FreeBSD is portable and secure as well ...)_ If you're unlucky you get caught in one of those inevitable Unix legends about projects splitting, forking, rebranding on intellectual/moral grounds, how Theo de Raadt is an extremist and how MacOS X and FreeBSD had a common ancestor over 20 years ago. Fascinating, but not really informative, is it? **The BSDs** The BSDs I am interested in are:   * FreeBSD   * OpenBSD   * NetBSD and optionally   * Dragonfly   * Darwin   * ... **My questions** In order to understand the differences better, here's a list of somewhat related questions about the different distributions (can we use this term?). If you present your answer under some form of tabular data, you are my all- time hero!   * Do they use the same kernel?   * Do they use the same userland tools? (what are the differences, if any?)   * Do they use the same package/source management system?   * Do they use the same default shell?    * Are binaries portable between them?   * Are sources portable between them?   * Do they use different directory trees?   * How big are their respective communities? Are they the same order of magnitude?   * How much of the _current_ development is common?   * What are the main incompatibilities between them? I don't know how easy those questions are to answer, and how relevant to the StackExchange format this question really is. I just never came across a simple document listing the differences between BSDs in a clear way, useful for fairly experienced users to look at and make a choice easily.


title: How do I copy all files and directories except certain ones over ssh?

text: Using the Linux command line, I use the `scp` command to copy up all the files and folders from a certain directory. However, I don't like to consume wasted bandwidth for copying up things I rarely change like my `tiny_mce` folder. What's the trick to copy up everything but skip a short list of folders?


title: Yanking URLs in w3m

text: I have been using w3m for a couple of weeks and am convinced that it is my preferred text browser - with one exception. Is there any way to yank URLs to the clipboard _without using the mouse_? I have looked through the manual and, using the default keybindings, there doesn't appear to be any documented way to do this. Has anyone developed a script to work around this?


title: How to find tty from which a particular cmd "scp" is executed

text: How can I find out who executed a particular command and which terminal was used to run it? * * * _Original_ : how can i know particular cmd is executed by whom and to know about my terminal


title: scp without replacing existing files in the destination

text: How do I copy an entire directory into a directory of the same name without replacing the content in the destination directory? (instead, I would like to add to the contents of the destination folder)


title: SCP from one server to another without password prompt

text: What is the best way of doing SCP from one box to the other without prompting for password? There are two servers:   * Server A (10.152.2.10): `/home/oracle/export/files.txt`   * Server B (10.152.2.11): `/home/oracle/import/` If I want to transfer the files using `scp` from server A to server B without being prompted to enter a password [running this from Server A, `/home/oracle/export/`]               scp files.txt oracle@10.152.2.11:/home/oracle/import      This would prompt me for a password upon entering the command. I understand that a keygen is required to be generated and copied to Server A. Thus [at server A]:               ssh-keygen -t rsa      This gives me two files stored in `/home/oracle/.ssh`:               id_rsa     id_rsa.pub      1. Am I supposed to copy the two files (`id_rsa`, `id_rsa.pub`) over into server B `/home/oracle/.ssh` ? While doing some google search on this, some articles mentioned about appending/concatenating this to authorized_keys. 2. Am I supposed to create this file on my own? I seem to be confused on what is the right way to do this. Btw, the two servers are running Suse Linux Enterprise Edition 9...


title: How can I prevent Control+Alt+D from logging me out (of Gnome 2.22 on Debian 5)?

text: I was using Emacs, and typed Control+Alt+D in order to run Emacs' "down-list" command. I was dismayed to see, however, that I was instantly logged out; I assume this is some Gnome keyboard shortcut. I looked under System/Preferences/Keyboard shortcuts, and saw nothing pertinent; I then ran gconf-editor and searched through it for , and still saw nothing pertinent. So ... how to I disable this feature?


title: What forms of discretionary access control are there?

text: I know it's kind of an unguided question, but just so I have a broader sense of how things are I was interested in getting a reasonably complete list of discretionary access controls available on Unix platforms and their adoption. I'm mostly interested in Linux DAC systems but any *nix platform should be interesting and/or applicable to my skillset going forward. I'm already aware of the following:   * **Traditional Unix Octal Permissions** the Owner/Group/World bits we all love. Plus the sticky bit and the setuid and setgid bits.   * **POSIX ACL's** Octal-style permissions and file/directory-based mask settings (as opposed to being dependent on a `umask` system setting) set using the `setfacl` command. Available on most proprietary unix systems, *BSD, and the Linux kernel since the early 21st century.   * **richacl** Linux-only patchset that hasn't been incorporated into the vanilla kernel yet. Implements NFSv4 access controls on local files. I won't include systems like SELinux since those are more MAC-oriented than something accessible to regular users.


title: Analyze system logs with logwatch --range other than just "yesterday"

text: The manpage of `logwatch` says: > The format of the range option is: --range "date_range [period]" > > Parameter date_range (and optional period) must be enclosed in quotes if it > is ... > > Examples: > > --range today --range yesterday --range '4 hours ago for that hour' --range > '-3 days' --range 'since 2 hours ago for those hours' --range 'between -10 > days and -2 days' --range 'Apr 15, 2005' --range 'first Monday in May' > --range 'between 4/23/2005 and 4/30/2005' --range '2005/05/03 10:24:17 for > that second' but none of those options work on my Debian Squeeze machine. How do you use the `\--range` option correctly?


title: How can I return a specific error code at this point in my TCL script?

text: I have a TCL expect script that runs a scp command for uploading a config file to my DNS server:               #!/usr/bin/expect -f          set config "~/dnsmasq.conf"          spawn /usr/bin/scp "$config" root@192.168.1.1:/etc/dnsmasq.conf          expect {         -re ".*yes.*no.*" {             exp_send "yes\r"             exp_continue         }         -re ".*password.*" {             exp_send "$password\r"             expect {                 -re ".*denied.*" {                     exit 7                 }             }         }     }      I would like to return a specific error code if the scp utility can not be found. Currently the script exits with a status of 1. If the script exits with a status of 7, I can handle that because I know it's an access denied error. The error that shows up in the Apache log is:               couldn't execute "/usr/bin/scp": no such file or directory         while executing     "spawn /usr/bin/scp "$config" root@192.168.1.1:/etc/dnsmasq.conf"      How can I return an error code of 5 or something at this point?


title: Creating Directories: with Permissions

text: I need to create a directory that is RW to all users using chown. what arguments should I pass chown to get a file with those permissions? Or maybe there is an even better way to do it......


title: Quit VIM is slow, usually 2 seconds, it shows

text: On quit, vim shows that: > ".netrwhist" [Not edited] --No lines in buffer-- This process usually takes 2s. How to turn this thing off? --- Update --- I noticed that netrw is installed as system-wide. Use the code below to disable all of those plugins.               se nolpl     let x = &rtp     se rtp-=$VIMRUNTIME     ru! plugin/**/*.vim     let &rtp = x     unl x


title: What ~/.config refers to and how to put files there?

text: I want to set up a plugin for the Geany editor on a Debian system. It's a theme changing plugin, so I am following this manual. It says: > The simplest way to do this is to copy the contents of the archive into the > ~/.config/geany/filedefs/ folder. I don't understand this. What do they mean by `~/.config`? Is that the default directory where Geany is installed? I have its files at `/usr/lib/geany` but that doesn't seem to be location they are talking about.


title: Linux user interface programming? (esp. for Python and Fortran)

text: What are my options for programming a GUI in Linux? I have several programs in Fortran and Python that I would like to create simple UI's for. I also plan on incorporating graphics in the form of plots.


title: How do I impersonate a windows domain account user from a linux process?

text: I'm running a process on a Unix box (I think it's a recent version of Red Hat, I can check for more detailed info if relevant), under a local user. I would like to access some network resources, via a Windows domain account. How do I/Can I associate the local user with a windows domain account just for the purposes of running this one process?


title: How to install/use sshuttle on Fedora?

text: How exactly can I install/use sshuttle under Fedora? It's not in the repositories


title: How to prepare a new MicroSDXC card for use with Android?

text: After buying a 64 GB MicroSDXC card and plugging it into my Android phone, it wasn't recognized. What do I need to do to use the space on this device? Many articles suggest installing closed source Windows programs for this, but I suspect it should be easy on Linux.


title: Are .bz2 files inside /var/lib/pengine safe to delete?

text: My problem is that my `/var` partition is over 80% (total size: 4.9G). I was reviewing the files into this partition and I saw a file which has 3.4G. (`/var/lib/pengine`) I dig into that /pengine file and I saw it is full of `.bz2` extension files. I want to move these files but I would like to know if is risky or not.


Why can't I create a directory by full relative path argument? Here is what I try:               #!/bin/bash     args=("$@")     # Print the command and run it. Exit the script on failure.     run()     {             if $VERBOSE; then                     echo "$@"                     "$@"             else                     "$@" >& /dev/null             fi             result=$?             if [ $result -ne 0 ]; then                     exit $result             fi     }                     if [ ! -d ${args[0]} ]; then                             run mkdir -p ${args[0]}                     fi                          run cd ./release/                     run cp -rf ./html/ ${args[0]}      but I get:               mkdir -p ./bla/bla/cloud/     cd ./release/     cp -rf ./html/ ./bla/bla/cloud/     cp: cannot create directory `./bla/bla/cloud/': No such file or directory      So I wonder how to make script work when called like this: `./script.sh ./bla/bla/bla/`


title: How much RAM can an application allocate on 64-bit x86 Linux systems?

text: Is it true that a single application can not allocate more than 2 GiBs even if the system has GiBs more free memory when using a 32-bit x86 PAE Linux kernel? Is this limit loosened by 64-bit x86 Linux kernels?


title: Set up network to share a printer connected to one particular machine on the network

text: How do I set up my Ubuntu machine to allow other computers to print to it? The set up is: All computers are connected to the network   1. 1 dual Ubuntu/Windows 7 netbook    2. 1 multibooting Debian/Ubuntu/Windows XP desktop   3. 1 Vista laptop    4. 1 dual Windows 7/Mac desktop Printer = Brother HL-4050 CDN connected to number (1) above A solution that involves only GUI configuration tools please. I'm a native Windows user; command-line is painful to me. * * * **Edit** : I tried to use `system-config-samba` but can't seem to get printer sharing up this way? Is there a way to do it with that tool?


title: Is it possible to find out the hosts in the known_hosts file?

text: I would like to see what hosts are in my known_hosts file but it doesn't appear to be human readable. Is it possible to read it? More specifically there is a host that I can connect to via several names and I want to find out what the fingerprint I expect for it from my known hosts file. Update: I'm using OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009 A line from my known_hosts file looks something like this,               |1|guO7PbLLb5FWIpxNZHF03ESTTKg=|r002DA8L2JUYRVykUh7jcVUHeYE= ssh-rsa AAAAB3NzaC1yc2EAAFADAQABAAABAQDWp73ulfigmbbzif051okmDMh5yZt/DlZnsx3DEOYHu3Nu/+THJnUAfkfEc1XkOFiFgbUyK/08Ty0K6ExUaffb1ERfXXyyp63rpCTHOPonSrnK7adl7YoPDd4BcIUZd1Dk7HtuShMmuk4l83X623cr9exbfm+DRaeyFNMFSEkMzztBYIkhpA2DWlDkd90OfVAvyoOrJPxztmIZR82qu/5t2z58sJ6Jm2xdp2ckySgXulq6S4k+hnnGuz2p1klviYCWGJMZfyAB+V+MTjGGD/cj0SkL5v/sa/Fie1zcv1SLs466x3H0kMllz6gAk0/FMi7eULspwnIp65g45qUAL3Oj


title: Should I be backing up my SSH host keys?

text: In my automated backups, I'm not sure if I should be doing this. If the hard drive fails or if I wipe the hard disk and start over, what will be the effect of starting with a new SSH host key to my clients? Will I have to do anything special other than remove the host's name from each client's `known_hosts` file? What is the best thing to do in this case? I'm planning on wiping my computer and starting from scratch in the next few days.


title: Is there a way to tell which file (script, specifically) executed a command?

text: I'm running Slackware 13.37, and I was wondering if there was a way to tell which script executed a command. I tracked the process and its arguments, but I would like to know where the command originated from.


title: How can I lock my own account from remote ssh login with password?

text: I don't want to disable remote login with password altogether, but I want to make it so that my account is only accessible with key pair authentication (there are other users who wants to use passwords to log in). Is it possible to change this on a per-user basis, ideally without changing system settings? And to make it clear, my account has sudo access, so I don't want to lock the password.


title: Need help with this script

text: I'm supposed to write a bash script that has as an argument a path to a directory which contains a file named _checking.txt_. It needs to return the following exit codes:   * 4, if the directory doesn't exist   * 5, if that directory is not a subdirectory of /home/user5/task05/   * 6, if _checking.txt_ doesn't exist How can I write these conditionals ?


title: minimal install, still want gnome!

text: I'm at the stage of the install of Fedora 15 where I choose what software to install. I want less so I'm going for "minimal" and "Customize now". What do I need to tick to get the machine to boot gnome at startup? Last time I chose minimal gnome did not load and I got stuck at terminal (or whatever you wizards call it).


title: How did the system settings directory on UNIX come to be named /etc?

text: > **Possible Duplicate:**   >  What does etc stand for? And why isn't it named /cnf or /syscf or /cfg? No one I have ever asked has been able to tell me, not that I have access to any of the minds that created UNIX. When I was a youngster, I saw the /etc and assumed it was for 'et cetera', namely, other files that had no place elsewhere, and I used it for that in a few of my early Linux installs (cringeworthy, I know) in the mid-90's. I continued learning and trying to do better, and I have, since. But the mystery remains, and even the FSSTND does not seem to contain this info. Anyone?


title: What is the meaning of /etc (as acronym)

text: > **Possible Duplicate:**   >  What does etc stand for? What does it mean? All I can think is _etcetera_. By my teacher told me that there is a more appropriate meaning.


title: Using calibre from the command line

text: Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being                   ebook-meta ebook_file --tags rhubarb      but for a range of files, but all by the same author so just need the tag of his/her name? This is used to help in indexing and sorting out books on a Kindle.


title: Chakra overriding Arch?/ Is this possible?

text: My Arch installation didn't go well so can I install Chakra project to override the Arch installation?? By just installing Chakra in the same partition with Arch? Is it possible? How hard is the Chakra installation?


title: What does Conky update interval update and how to tune it?

text: As I understand, `conky_update` reloads the whole conky window every time. So, if I have rss fetching there and some scripts running they all rerun every few seconds. Is this right? Can I make the rss fetching part be very infrequent (say, every 10 hours), but other parts with few-seconds updating? Relevant part from my .conkyrc:               update_interval 2.0          TEXT     ${if_match ${desktop_number}==4}     ${font GE Inspira:size=12}${color White}${alignc}Recent Blog Posts${color}${font}     ${color White}${hr 1}${color}     ${execp python ~/Documents/rss.py}     ${color White}${hr 1}${color}     ${endif}       rss.py merely scans an rss feed and gets blog post titles & dates from it.


title: What is the difference between binary file and .exe file?

text: Can anyone distinguish the difference between binary file and .exe file?


title: Internet bandwidth mysteriously drops under Linux, but is fine under Windows

text: I can't seem to download files from the internet on my laptop with Mint/Ubuntu, due to strange bandwidth fluctuations. I'm able to browse the web with Firefox with no problems, `apt-get update` and `dist-upgrade` work normally, both my Firefox, Deluge and Transmission have standard settings, I haven't tweaked anything. Yet every time its the same story: a file starts downloading either via direct download or torrent; initial speed is around 1MB/s and several MBs are downloaded. Then the speed decreases gradually until it reaches 0. After some interval (5-20min) it again rises to around 800MB/s, downloads 1-2 MBs and then decreases to 0. After a while, in case of direct download almost nothing is downloaded and often I get an error window that say could not download the file. The same files are downloaded within 5-10min via my desktop with win7. Any ideas as to what may be the cause?


title: How to logout from su-ed root at certain time

text: Suppose, the user does `su`, switching to `root`               $ su     Password:      bash-4.2# crontab -l      How can I logout all such users from `root` at a certain time? ### What I tried I know, that using this command:               bash-4.2# ps -A -u root | grep bash      2303 tty1     00:00:00 bash      2548 pts/0    00:00:00 bash      3040 pts/0    00:00:00 bash      3080 pts/2    00:00:00 bash      we can get all the Bash shells, owned by `root`. But how can I select the one that was generated by `su`? When I ran `echo $$` in the su-ed shell, it gives this:               bash-4.2# echo $$     3040      Then I tried:               bash-4.2# kill 3040      But it didn't kill the `root` shell. Plus if I create a `cron job echo $$` it won't give the necessary PID. So, this won't work. Now I'm stuck.


title: Ubuntu / Mint brightness 0 by default on login

text: Every time I boot up Ubuntu or Mint, after choosing an OS from GRUB menu, before logging in, screen brightness is set to 0. What is the reason behind that? I always end up manually turning on the brightness in order to see the logo and then login screen. It does not happen in other distros like Debian. I encounter this in Ubuntu 12.04, 13.10, Mint 15 and Mint 16. computer specs: Laptop Lenovo g500; intel celeron 1005M 1.9G; RAM 4GB; integrated graphics; win8/mint16 dualboot


title: pure shell complex substitution in variable

text: However it may be impossible, I hope I'm just bad man reader =) Is there any way to substitute text in variables on several patterns at time or even using back reference? For example, I have `FILE=filename.ext` and I want to change it to `filename_sometext.ext`. But I don't know that file extension is `.ext`. All I know about it is that extension is after last dot. So I can do it in two steps:               EXT=${FILE##*.}     FILE=${FILE%.*}_sometext.$EXT      Can I do it on one step (smth like `${FILE/.\\(*\\)/_sometext.\1}` [that doesn't work])? By the way I need to do it in pure shell without `sed`/`awk`/etc. My shell is `ksh`, but if there is way to do it with bashisms I'd like to know it too.