find/grep outputs two lines for each file it finds match

I search my code base to find string patterns and list all the files where the pattern is found but only the file and not the lines on which it is found:               find . -name *.java -exec grep -l 'someText' {} \; -print 2>/dev/null      However, it outputs two lines for each file found. Why does that happen and how should I modify the command to list unique file names?


Make apt-get update and upgrade automate and unattended

I have about 7 Debian servers I manage, and I would like to set them to automatically update themselves. So, I created a script as such:               #!/bin/sh     apt-get update     apt-get upgrade      and placed it on the `root`'s crontab list. Unfortunately, it always hangs on the Upgrade section, asking if I'm sure I want to upgrade. Because it's a cron job, I don't see the output until it emails me saying it's failed. Is there a way to have it skip that prompt, and just do the upgrade automatically?


Shell script not working to open LimeChat through the terminal

I created a shell script that I will execute in the morning to open up all the apps that I want **startup.sh**               #!/bin/sh          open /Applications/Firefox.app &     open /Applications/Messages.app &     open /Applications/iTerm.app &     open /Applications/Screenhero.app &     open /Desktop/LimeChat.app &          exit 0      The other apps work. But not the LimeChat application. I get this error:               The file /Desktop/LimeChat.app does not exist.      It does not show up in my applications folder, it only shows up in the desktop Desktop. And here it is very clearly on my desktop. ![screenshot](http://i.stack.imgur.com/fYzgh.png)


GPT + BIOS legacy + LVM - how to make right GRUB partition

I'm preparing to install Arch Linux on my netbook (Samsung N130). I want to use GUID Partition Table. I have BIOS (not UEFI) on my motherboard. I want also to use LVM. On Arch Linux Wiki, I've red that GRUB must have a separate partition on the first sectors of my hard drive. And in that connection (GPT + LVM) I can't find any informations about how to do it. Can You help me? Ps. I'm writing from Fedora 20 LiveUSB - after installing Arch, I want also to install Fedora.


Programmatic way to install xkb keyboard layout

I have a new keyboard layout that is working so far. I want to ship this to users who most probably will have minimal knowledge of Linux. Trouble is to install this layout I have to do a lot of copy paste inside the files in `/usr/share/X11/xkb` directory. Here are the steps that I am needing to perform.   * Add the keyboard layout to /usr/share/X11/xkb/symbols/in   * Add the language to base.xml   * Add the language to evdev.xml   * Add the layout to base.lst How do I make it so that user double clicks on the layout file and it is installed. I am familiar with shell scripting, so I could do some file manipulation using awk or sed. But, I am not sure I should be doing that.


Cannot execute binaries in Ubuntu : file not found

When I try to run any executable file a `file not found` error occurs. Sometimes it says nothing but doesn't do anything. For example, when I execute `./blah-blah.bin` it fails finding the file when it is clearly there. When I execute `./blah-blah-file-2.sh`, it is silent. Note 1: files have +x.   Note 2: root also cannot execute.   Note 3: everything from /usr/bin executes.   Note 4: I can't try it from GUI, I have only access to its console. What's the problem? Upd: suddenly some commands (e.g. `ls`) begin fail with a `file not found`. They worked yesterday...


How can I have pulseaudio always load a USB soundcard as the same sink every time I boot?

I have 9 identical soundcards connected via USB to a PC running various audio rendering servers. Each card is loaded in /etc/pulse/default.pa by disabling module-udev-dectect and manually loading module-alsa-card with device_id=[0-8] and card_name=various descriptive names e.g. sink_a. These audio rendering servers need to connect to pulse sinks with the name corresponding to the function they provide (e.g. server_a needs to connect to sink_a, not sink_b,c,d...etc. so that audio is routed played on card_a to room_a) The problem is that the cards change their device_id every boot, so if sink_a was device_id=0 on one boot, it might be device_id=1 on the next, causing playback through the wrong physical card. What can I do to ensure that cards loaded with descriptive names in default.pa remain the same physical device on EVERY boot?


Simple server that triggers script and responds

I need to have a very simple server running that can:   1. Take rest call. It triggers a script when a call is made   2. The script checks if database is running or not.   3. If running then reply back to client as `Success` else reply back as failure I do not wish to use apache or any other major web server. Even simple scripts running on port will do. I am aware of `python -m SimpleHTTPServer` but I guess it only provides file access. I can write a simple Java program that runs on a port and replies, but I am looking some simple solution


Installing newest Wine in Debian Wheezy

edit: solved by installing Ubuntu again. I've need to newest wine. How could I install it into my Debian Wheezy? If I try from there Gdebi says that I must have `libc6 2.17` or greater. Is there any way install it?


Shell command to get all the files from a complex directory structure

I'm looking for a shell command in order to get all the files in a complex directory structure. By complex directory structure I mean that there's a root folder with more than 150 subfolders and for each subfolder there are minimum 3 subfolders.


Delete files in directory without erroring if it's already empty

As part of a deployment script, I want to dump some cached stuff from my temp directory. I use a command like:               rm /tmp/our_cache/*      However, if `/tmp/our_cache` is empty (fairly common when pushing many changes in quick succession to our testing server), this prints the following error message:               rm: cannot remove `/tmp/our_cache/*': No such file or directory      It's not a big deal, but it's a little ugly and I want to cut down the noise- to-signal ratio in the output from this script. What's a concise way in unix to delete the contents of a directory without getting messages complaining that the directory is already empty?


Looking for a list of modules that are used during boot sequence

I'd like to use _deferred init calls_. This function allows to load modules in userland, that should actually be loaded during the boot sequence. Just for testing I'd like to modularize as many entries as possible of the startup. For applying this method the `module_init()` in those modules has to be renamed to `deferred_module_init()`, easy so far. Now my question is: where can I find all these files with `module_init()`? Because I already wrote a bash script, that replaces this string with the defered_module_init in the whole kernel source - unfortunately it covers some other functions too, which made it impossible to compile the kernel afterwards. Is there a directory or a list with the modules that should be used during startup? I found that passing `initcall_debug` to the kernel command line generates a list with the modules, that then can be viewed with this command, that tells me the name of the module               dmesg -s 128000 | grep "initcall" | sed "s/\(.*\)after\(.*\)/\2 \1/g" | sort -n      But it looks like these names are spread all over the kernel source :/. Is there an easy way to catch all of these entries, so that i can apply my bash script to replace that specific string? Doing this by foot seems like a job that can take forever. Here's a sample output:               286 usecs [    0.910000] initcall arc4_init+0x0/0x1c returned 0        287 usecs [    0.910000] initcall aes_init+0x0/0x1c returned 0        288 usecs [    0.900000] initcall crypto_wq_init+0x0/0x4c returned 0


Where does rsyslog keep facility local0?

I added to rsyslog.conf a lines               ModLoad imudp     UDPServerRun 514     local0.* /var/log/dlink.log      With tcpdump I can see the packets from dlink somethimes local0 somethimes local1 even local2. Nothing appeared in /var/log/ dir. Which steps i missed to log my network device? I tried local1 local2 point to the same log file, but this didn't make the trick.


d-link dongle does not work

hello guys i've been searchin on the web but with no succes so im here im runnig wheezy with lxde . my dongle get listed when i run lsusb and it gives this then after a few seconds if i type again lsusb i dont see it               Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 041: ID 04e8:6881 Samsung Electronics Co., Ltd      Bus 001 Device 071: ID 07d1:3c06 D-Link System DWA-111 802.11bg Wireless Adapter [Ralink RT2571W]      i found out on the web that its natively supported but in reality it does not work with network manager and when i run dmesg i get this               [  997.166739] usb 1-3: New USB device found, idVendor=07d1, idProduct=3c06     [  997.166746] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=4     [  997.166751] usb 1-3: Product: 802.11 bg WLAN     [  997.166754] usb 1-3: Manufacturer: Ralink     [  997.280045] usb 1-3: reset high-speed USB device number 20 using ehci_hcd     [  997.446605] usb 1-3: device firmware changed     [  997.446652] phy881 -> rt2x00usb_vendor_request: Error - Vendor Request 0x09 failed for offset 0x0000 with error -19.     [  997.446679] phy881 -> rt73usb_init_eeprom: Error - Invalid RT chipset detected.     [  997.446684] phy881 -> rt2x00lib_probe_dev: Error - Failed to allocate device.     [  997.446859] usb 1-3: USB disconnect, device number 20     [  997.465142] scsi 5:0:0:0: Direct-Access     SAMSUNG  GT-S5570 Card    0100 PQ: 0 ANSI: 2     [  997.467643] sd 5:0:0:0: Attached scsi generic sg2 type 0     [ 997.469861] sd 5:0:0:0: [sdb] Attached SCSI removable disk     [  997.560054] usb 1-3: new high-speed USB device number 21 using ehci_hcd     [  997.726618] usb 1-3: too many configurations: 60, using maximum allowed: 8      and of course i followed the wiki http://wiki.debian.org/WiFi/rt73 but still nothing's workin PS: the DONGLE its tested on a widows box and workin thanks in advance


How to stop Fetchmail marking messages as read

When `fetchmail` checks my IMAP inbox, it downloads any unread messages and removes the message 'unread' flag on the mail server. Is there a way to have `fetchmail` download new messages **without** marking them as read? I use `procmail` to automatically process new mail messages and run scripts based upon mail rules, so I want the messages downloaded, but would prefer it if the "new message" flag was preserved on messages I have not yet read in my e-mail client. This is my `.fetchmailrc` file:               poll mail.domain.com protocol IMAP         user "user@domain.com"         password 'password'         folder 'INBOX'         keep         ssl         mda "/usr/bin/procmail -f %F"


Qemu 2.0 Windows guest - mouse stops working (vnc) when using usb-passthrough

I have installed Qemu 2.0 on an Ubuntu Server 14.04 LTS computer. I use Qemu to run multiple virtual machines. One of them is using Windows 8.1 Pro (x64) and is used for back-ups. The guest runs fine without any problems. But when I start passing through an usb-device (external hard drive) the mouse (keyboard still works fine) stops working on the vnc client. Reconnecting to the vnc-server does not work. Only a guest reboot will fix this issue. It appears that this 'bug' only starts when I make the vnc client inactive (clicking somewhere else on another program/service) on the local computer where i run the vnc client from. When I get back (make it active again) to the vnc client/viewer, the mouse stops working/does not respond anymore. It only happens when I use usb2 controller-mode and only when I add a new usb passthrough device. As long as I don't connect/pass through that usb-device, the mouse still works. But I need this usb2 controller in order for my external hard drives to work properly. If the guest is on and I connect the external usb hard drive to reproduce this bug, I also notice that if I remove the device then the mouse starts working again. It's like the guest thinks the device is in place of the mouse input device. Still, the hard drive is working fine once it's connected, only the mouse is not. I can't find any related problems on the internet and I hope someone here can help me solve this problem.


How to Test if a file has characters in it?

So i have a part of this code and U want it to output "No such player" if only the names file is empty, i've tried using the test -s command but it gives an output of 0 even if the file is empty or not. how would i go about solving this issue.                      if [ $Target = m -o $Target = M ]            then            cut -c12-26,31-43 ./emplist > names            grep $Name ./names            if            **[ -s  names ]**            then               :            else            echo "No such player"            fi      Basically i want it to output the names w.o outputting " no such player" if there are names in the file. and out put " no such players" if there are no names in the file.


Is there a way to boot linux directly from MBR?

Inspired by UEFI, I want to skip the stage of the bootloader (grub, lilo, syslinux) and boot linux directly. Is this possible? Cant I just boot the kernel directly, or have a minimalistic bootloader that fits in the MBR?


Why does rsyslogd not honor the following lines in rsyslog.d

This is somewhat related to my previous question here. I have three files in `/etc/rsyslog.d` which is included from `/etc/rsyslog.conf`:   * `00-iptables.conf`   * `50-default.conf`   * `postfix.conf` The first one is one that I created. My assumption is/was, that due to the naming it will be included before `50-default.conf`, but I also tried putting the filter lines directly into `50-default.conf` and remove my custom file (`00-iptables.conf`).               :msg, startswith, "ipt:" /var/log/iptables.log     & stop      Replaced `~` with `stop` as running `rsyslogd` with `-N1` as described on the man page and in the troubleshooting steps gave a warning, saying `~` is deprecated in favor or `stop`, which means the available (official!) documentation seems to be outdated/lagging behind. Now the idea here is that any message prefixed with `ipt:` will go into the named log file and no other log file will receive these lines (I tried also `contains` instead of `startswith`). That is in particular `syslog` and `kern.log` mentioned in `50-default.conf` shouldn't receive those messages anymore:               auth,authpriv.*            /var/log/auth.log     *.*;auth,authpriv.none     -/var/log/syslog     kern.*                     -/var/log/kern.log      I read the rsyslog documentation, but documentation for the property-based filters (also here) isn't exactly the most enlightening. The example given in the documentation (also found elsewhere) and their Wiki gives a similar example:               # From documentation     *.* /var/log/allmsgs-including-informational.log     :msg, contains, "informational"  ~     *.* /var/log/allmsgs-but-informational.log     # From Wiki     :syslogtag, startswith, "MSWinEventLog#011" /var/log/messages;fixsnareFormat     & @192.168.1.8;fixsnareForwardFormat     & ~      While the example from the documentation isn't as close to my two-liner, it still explains the meaning of the `~` better. What am I doing wrong? Bonus points if someone can answer whether there is a way to combine selectors and properties. E.g.:               :msg, startswith, "ipt:" kern.* /var/log/iptables.log      NB: I use version 7.4.4 of `rsyslog`. And yes, I did `service rsyslog restart` after the changes and then waited for it to take effect. * * * ### Edit Some more info. When running the daemon in debug mode (`RSYSLOG_DEBUG=LogFuncFlow RSYSLOG_DEBUGLOG=~/rsl.log $(which rsyslogd) -f /etc/rsyslog.conf -d`), I can see that the ruleset after optimization looks like this, which seems to indicate it's exactly the way I want it (leading prefix stripped for brevity):               ruleset 'RSYSLOG_DefaultRuleset' after optimization:     ruleset 0x214a640: rsyslog ruleset RSYSLOG_DefaultRuleset:     PROPFILT        Property.: 'rawmsg'        Operation: 'contains'        Value....: 'ipt:'     THEN       ACTION 0x215c070 [builtin:omfile:/var/log/iptables.log]       STOP     END PROPFILT     PRIFILT 'auth,authpriv.*'     pmask:  X  X  X  X FF  X  X  X  X  X FF  X  X  X  X  X  X  X  X  X  X  X  X  X  X       ACTION 0x215e840 [builtin:omfile:/var/log/auth.log]     END PRIFILT     PRIFILT '*.*;auth,authpriv.none'     pmask: FF FF FF FF  X FF FF FF FF FF  X FF FF FF FF FF FF FF FF FF FF FF FF FF FF       ACTION 0x215f030 [builtin:omfile:-/var/log/syslog]     END PRIFILT      I should also add that from the behavior I see, I can deduce that the filter has an effect, as it clearly writes into the file `/var/log/iptables.log` as expected. However, the messages aren't dropped as expected after writing them to that particular file. Here's an example line the way it ends up in all of `kern.log`, `syslog` and `iptables.log` as opposed to only the latter. Details have been redacted for privacy reasons:               Jun  1 02:23:01 hostname kernel: [70025.211497] ipt:drop IN=eth0 OUT=virbr0 MAC=dd:cc:bb:aa:99:88:77:66:55:44:33:22:11:00 SRC=9.8.7.6 DST=1.2.3.4 LEN=60 TOS=0x00 PREC=0x00 TTL=47 ID=59201 DF PROTO=TCP SPT=47626 DPT=23 WINDOW=4380 RES=0x00 SYN URGP=0


what is the original command to create a file?

we can create a file by a lot of commands:               cat > foo.txt          echo 'This is a test' > foo.txt          touch foo.txt          vi foo.txt (or any text-editor)      my questions are:   * What is the original command to create a file when they first created Linux (Unix)?   * Is there any differences if I used any of the command above to create a new file?


command like wc but with tee behaviour

I want to backup a database using `psql` and `COPY` command. here is my script:               psql "user=${USERNAME} host=${HOSTNAME} dbname=${DBNAME} password=${PASSWORD}" -c \     "COPY (SELECT * FROM tbl) ORDER BY id ASC) TO STDOUT WITH CSV HEADER;" | \     bzip2 -z -f --best -c > /home/${DBNAME}-${FILENAME}.csv.bz2      Also I want to know how many lines are copied from database but psql does not have such feature. so I need external command. I need something like this:               psql ... | wc -l | bzip2      Is there any solution? The only solution I have found is to use fifo:               mkfifo /home/backup.fifo     psql ... | tee /home/backup.fifo | bzip2      Now from another terminal window I can use `wc`:               wc -l /home/backup.fifo


bottomless tee?

I was just playing around in the terminal and I did this:               printf 'some string\n' | {         tee /dev/fd/3 | {             : && sed 's/some/string/'         }     } 3>&0      I was really surprised when I was met with a screen full of:               string string     string string     string string     ...      It went on pretty much forever. I pared it down some, and to better demonstrate, maybe try this:               echo | tee /dev/fd/0 | sed =      For me, it presents output like:               <num>     #blank     <num+1>     #blank     ...      And so on. The few times I've tried it by the time I could hit `CTRL`+`C` I was at line 200k+. I tried this in `bash`, `dash`, `sh`, and `zsh` and all present the same results. What is going on there? How are the file-descriptors passing over that `|pipe` between, what I thought were, separate processes? Is this reliable and/or expected behavior? Are there other ways to generate this effect? For reference:               echo '#blank' | {         uname -r         readlink -f /dev/fd/0         tee /dev/fd/0     } | sed '=;5q'      ### OUTPUT               1     3.14.6-1-ARCH     2     /proc/24925/fd/pipe:[5851017]     3     #blank     4     #blank     5     #blank


How can I get this java command to act on each file found by a find command?

I have this command inside a Bash shell script, the intention of which is to apply a java command, htmlcompressor, to each HTML file found in a directory:               find $DIR -type f -name '*.html' -exec java -jar $BASEDIR/Upload/htmlcompressor-1.5.3.jar --remove-intertag-spaces {} \;      However, while the output at the command line seems to indicate that it is finding each file and doing something with it, it's not actually writing the results to the files. According to the documentation for htmlcompressor, the usage is this: > Usage: java -jar htmlcompressor.jar [options] [input] So there's supposed to be an input file at the named at the end, but I thought the `find` command took care of that. Seems I'm wrong about that, though. What can I do to make it actually act on the files I find?


Shell script to detect PDFs with non-ASCII contents

I need a shell script to detect valid PDFs. That is, I need to retain only plain ASCII PDFs. Other PDFs which contain non-ASCII contents and malicious scripts need to be deleted. How could I go about doing that? Is there any script available to do it?


searching multiple strings in multiple files inside a directory and printing the string and corresponding file name where it was found

I have around 500 strings and I want to search for the files which contain them inside a directory and get the file names which contain the strings. So far I've been using:               find -name 'LYFNRE.*' -exec grep -f file1.txt {} \; -print      but the problem is a string can be found in many files so it is difficult to find which strings are present and which are missing due to the huge output. Can you help me in printing the strings with their corresponding file names where they were found.


Rosetta Stone for Linux Distributions?

Is there is something like a Rosetta Stone for the different Linux Distributions? Perhaps a site where you can look up a commands, configuration files or problem solutions for a specific task organized as translations of ones of another distribution (you know well). For example you know Debian based distributions well and you want to know the Fedora equivalent to               dpkg -S /bin/bar      or               dpkg --get-selections > foo     dpkg --set-selections < foo      or               apt-cache search foobar --names-only      etc. There is a Rosetta Stone for different Unices, but it is not that detailed and does not really differentiates between different Distributions.


GNU Parallel slows down

I'm learning GNU parallel usage and did the following:               $ for i in {1.txt,2.txt}; do time wc -l $i; done     100 1.txt          real    0m0.010s     user    0m0.000s     sys     0m0.010s     10000012 2.txt          real    0m0.069s     user    0m0.050s     sys     0m0.018s      Then reran the above command with `parallel` but it slowed things down. Why?               $ for i in {1.txt,2.txt}; do time parallel --nonall wc -l $i; done     100 1.txt          real    0m0.325s     user    0m0.192s     sys     0m0.042s     10000012 2.txt          real    0m0.305s     user    0m0.220s     sys     0m0.043s


How to change speed limit of running trickle instance

I started a program throttled using trickle as `trickle -d 10 -u 5 program`. Now I want to change change the throttling speed to `-d 50 -u 40`. How can I change it without closing the program ? `tricklectl` sounds well but I can't use it. In the manual they says it will be ready soon but I can't see any development for the last 10 years. So I think someone else should have made it. I'm also interested in editing the .c code but I have little knowledge in C .


Perform floating point arithmetic in shell script variable definitions

I understand `bash` and some other interpreters only perform arithmetic for integers. In the following `for` loop, how can I accomplish this? I've read that `bc` can be used but am not sure how to use `bc` in this situation.               total=0     for number in `cat /path/to/file`; do             total=$(($total+$number))     done     average=$(($total/10))     echo Average is $average      file:               1.143362     1.193994     1.210489     1.210540     1.227611     1.243496     1.260872     1.276752     1.294121     1.427371


Can sed remove 'double' newline characters?

I have a document with a lot of empty lines. How can I remove them when there are 2 or more together. I tried `sed "s/\n\n//"` file but it didn't work. No error.


Run Xdotool on multiple users at once

When running Xdotool on user `one` (cron):                * * * * * export DISPLAY=:0 && xdotool mousemove 10 10      and I switch to user `two` for several hours, and back to user `one`, I find out Xdotool not running while I'm not viewing their user's window. How to make Xdotool running no matter what user's window I'm viewing?


Copying files from command line to clipboard

In a GUI file manager it is possible to select a few files, press Ctrl-C (which supposedly copies come info about the files to clipboard), then navigate to another folder and press Ctrl-V, which will then copy the files into that directory. As an experiment, after copying files in the file manager, it is possible to switch to a text editor - pressing Ctrl-V there pastes a list of absolute filenames. The reverse process (copying a list of files from a text editor and pasting them to a file manager) does not work, which is supposedly due to different target atoms The goal of the exercise is to be able to copy some files from command line, for example               find ${PWD} -name "*.txt" | xclip <magic parameters>      then switch to a file manager and copy them all to a directory using File->Paste. So, the question is: What parameters of `xclip` (or other program) do I need to specify so file manager recognizes the selection as a list of files and enables its Paste menu item? Alternatively, is there a low-level tool which would allow to inspect the contents of X selection and see what data it currently contains?


X11/Xlib.h: No such file or directory

I am trying to install tcl and tk on my linux server.I don't have the root password,So I am installing them in my home directory.I am using below method for installing it manually.               cd ~/tcl8.5.11/unix     ./configure --prefix=/home/cnel711 --exec-prefix=/home/cnel711     make     make install          cd ~/tk8.5.11/unix     ./configure --prefix=/home/cnel711 --exec-prefix=/home/cnel711 --with-tcl=/home/cnel711/tcl8.5.11/unix     make     make install      I was able to install tcl without any problem ,but I am facing problem while installing tk. `configure` for `tk` worked fine ,I am facing problem while using `make`.I am getting this error.               X11/Xlib.h: No such file or directory      I found out this file was missing on the server.So,I downloaded `libX11-devel` from here.Again,I installed it in my home directory.Then I exported the path to the header files and when I use `which` command to find Xlib.h,it locates ths file.               >which Xlib.h     ~/include/X11/Xlib.h      Now, when I try to install `tk` again `configure` works fine as usual but I get the same error again while using `make` `X11/Xlib.h: No such file or directory`. Please help me out,what possibly is going wrong here ?


What is the difference between a job and a process?

What is the difference between a "job" and a "process"?


How to install Fedora from an ISO on a USB?

I have a Fedora 14 x86_64 iso image and I want to install it using a USB stick. How do I get this stick to boot up, and use the image to start the installation? I'm running Debian.


How to mount external hard disk every time the server is restarted?

I have a server which the date will be backup to a external windows server hard disk which is mounted. But problem is every time the server is restarted I will need to mount the disk manually. How do I setup such as it will be mounted on server startup?


How to know list of applications installed in my server?

I got one LINUX server in which Oracle LINUX 5 is installed. I have installed MySQL 5.1.73-community version. Now, I have to configure the variables. When I checked available memory through `cat /proc/meminfo` command, I got below output:               MemTotal:      1927692 kB     MemFree:        446620 kB     Buffers:        619140 kB     Cached:         214340 kB     SwapCached:          0 kB     Active:         649660 kB     Inactive:       725232 kB      Now, it seems that system has only 2GB memory (RAM) in which only 0.4 GB is free. Can I know what are other applications have been installed in this machine?


Forward Autocorrect to a script

> **Possible Duplicate:**   >  How do I get bash completion for command aliases? I wrote a series of scripts to make package management a little more intuitive for me. However, I can no longer tab complete for package names. Is there a way I can forward the results of a tab completion to a script? Sample- package-install:               #!/bin/bash          apt-get install $*


Prevent hacking the grub.conf using a 'live rescue' from a live linux iso

It happened that I had set the grub password in grub.conf. But, using a live linux iso, I was able to delete the password from the grub.conf. Please read the steps for the same mentioned in this link: http://gofedora.com/how-to- recover-crack-root-password-grub-locked/ Instead of editing menu.lst, I edited the grub.conf. Rest all steps same My question is: Is there a way to prevent such a hack. When I tried rescuing, the system showed a message that if it is not able to rescue (i.e. if it fails mounting the HDD under the directory: /mnt/sysimage), do I want to continue/skip/abort. So, I feel that there must be a concrete way of preventing such hacks by doing something with the mounts/boot etc, which shall prevent mounting into /mnt/sysimage. Any help would be valuable Edit: PS: Please re-consider this environment for a virtualised environment where the actual VM in VSphere is a linux VM, and I need to disable/delete the CD/DVD-Rom and network boot from BIOS. After doing all that stuff, I want to re-package the VM into .ovf and check whether the new ovf has the BIOS restrictions or not.


How to rotate video?

I have many videos taken from Nokia N73 that are getting played on my laptop (after transferring from phone to laptop) horizontally. How to make them play vertically. I have read this link. but the issue is this link talks of mp4 file & mine is avi. Regarding my mp4 video file I ran:               ffmpeg -i infile.mp4 -vf "transpose=1" -an -vcodec mpeg4 outfile.mp4      It worked for mp4 but I lost my sound from the video. Also after getting rotated, the area on screen on which the video is running has shrinked (one can call it frame size or so). Now it has become more narrow vertically. Is this how it will be?


MAME saving but not restoring games

**Background** I discovered Ms. PacMan some time ago, but you don't see many of that game in arcades. Then I did find out about `mame` (version 0.145), available on my Linux (Ubuntu) machine and about running Ms. PacMan and that works. **Problem** When I save a game (so I don't have to start from the beginning every time (so to improve more difficult levels) and then restore the game, the game in MAME resets and I have to start from the beginning. I have read here about games being updated to support save state and also somewhere that saving was removed from MAME .100. I also tried to compile an older MAME version 0.99 (which should support saving), but it has no Linux support. And AdvanceMAME (1.2) does not compile because of configuration file problems that don't seem easy to solve. **Question** Should I try harder to get an old MAME compiled, or is this saving of Ms. PacMan not going to work on Linux anyway?


Number of files not containing given string

I read the question about how to find out the number of files that contain a certain string. This is possible with `grep -l "string" * | wc -l`. Is it possible to invert this, finding the number of files **not** containing the target string? I tried adding the `-v` option, but this doesn't seem to output the right result.


Unable to mount CDROM on Solaris 10

I have problem with using CDROM on Solaris 10. When I mount any ISO using VMware, ISO is not being visible under Solaris.   1. When I go to CDROM there is nothing inside:              --- 134 # cd /cdrom     --- 135 # ls -lart     total 9     drwxr-xr-x   2 root     root           2 Jan  3 10:36 test     drwxr-xr-x   3 root     nobody         3 Jan  3 10:36 .     drwxr-xr-x  29 root     root          32 Jan  3 15:03 ..        2. I can try to mount CDROM manually, for example using the following command:              --- 136 # mount -F hsfs -o ro /dev/dsk/c0t0d0 /cdrom/test          mount: No such device          mount: cannot mount /dev/dsk/c0t0d0      This is because I can't find information abount the physical name of my CDROM - in the following format: c1t1d0, c1t2d0, c2t1d0 etc.   3. IOSTAT command gives me results:              --- 137 # iostat -E     sd0       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 26.84GB <26843545088 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd2       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 21.47GB <21474835968 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd4       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 107.37GB <107374181888 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd5       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR00 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0     sd6       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR01 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0          --- 138 # iostat -En          c1t0d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 26.84GB <26843545088 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     c1t2d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 21.47GB <21474835968 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     c1t1d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 107.37GB <107374181888 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd5              Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR00 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0     sd6              Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR01 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0        4. When trying to use script which was found on Stackoverflow I have resutls:              --- root@solaio03 : /cdrom     --- 139 # iostat -x|tail -n +3|awk '{print $1}'>/tmp/f0.txt.$$     iostat -nx|tail -n +3|awk '{print "/dev/dsk/"$11}'>/tmp/f1.txt.$$     paste -d= /tmp/f[01].txt.$$     rm /tmp/f[01].txt.$$     --- root@solaio03 : /cdrom     --- 140 # iostat -nx|tail -n +3|awk '{print "/dev/dsk/"$11}'>/tmp/f1.txt.$$          --- root@solaio03 : /cdrom     --- 141 # paste -d= /tmp/f[01].txt.$$     sd0=/dev/dsk/c1t0d0     sd2=/dev/dsk/c1t2d0     sd4=/dev/dsk/c1t1d0     sd5=/dev/dsk/sd5     sd6=/dev/dsk/sd6     nfs1=/dev/dsk/solaio03.sys.net:vold(pid747)        5. And now my final question: Is there anybody which can give me any advice what should I do?


Getting information from sysfs

I'm creating a script for polling information about network interfaces. For this I get some data from `/sysfs`. Everything went fine until I wanted to clarify all possible states of an interface (Which are they btw? I'm aware for now only about `up`, `down` and `unknown`). I went through `/usr/src/linux/Documentation/sysfs-rules.txt` and found this: > Accessing /sys/class/net/eth0/device is a bug in the application Is there a reason for this? Could someone explain me if I'm doing something wrong by getting information from `/sysfs`? I don't iterate through all interfaces in `/sysfs` but get all network interfaces with `getifaddrs(3)`. Perhaps there is another method to get iface status? Thanks.


updating BIOS without MS Windows (or a floppy drive)

I'm running Kubuntu 12.04. I need to update my motherboard BIOS. The Arch Linux Wiki says, "By far the easiest way to make a bootable FreeDOS USB Stick is using unetbootin." So I did that. Using UNetbootin I succeeded in installing FreeDOS 1.0 (fdboot.img) on the USB stick. Now, however, I am having a hard time figuring out though how to add files so that I can access them from FreeDos. The Arch Linux wiki says, "Finally, you may copy everything you want to flash there (BIOS, firmwares, etc)." I did that and then I rebooted into FreeDos. The files were no where to be found. I had a "A:>" prompt with only FreeDos system files. No other drives were available and the files I had copied to the root of the USB stick could not be found. BTW, my BIOS image is 4.0 MB in size.


When I want to run ffmpeg I get the following error: `ffmpeg: error while loading shared libraries: libtheoraenc.so.1: cannot open shared object file: No such file or directory` This is output of `ls \usr\lib -l | grep libtheora`:                    -rw-r--r--  1 root   root    419238 Jan  5  2010 libtheora.a     -rw-r--r--  1 root   root       935 Jan  5  2010 libtheora.la     lrwxrwxrwx  1 root   root        19 Jan  5  2010 libtheora.so -> libtheora.so.0.3.10     -rw-r--r--  1 root   root    145636 Jan  5  2010 libtheoradec.a     -rw-r--r--  1 root   root       948 Jan  5  2010 libtheoradec.la     lrwxrwxrwx  1 root   root        21 Jan  5  2010 libtheoradec.so -> libtheoradec.so.1.1.4     -rw-r--r--  1 root   root    334696 Jan  5  2010 libtheoraenc.a     -rw-r--r--  1 root   root       954 Jan  5  2010 libtheoraenc.la     lrwxrwxrwx  1 root   root        21 Jan  5  2010 libtheoraenc.so -> libtheoraenc.so.1.1.2           What should I do to solve the problem? Edit: in line: `libtheoraenc.so -> libtheoraenc.so.1.1.2` I can't find libtheoraenc.so.1.1.2 in /usr/lib(packages libtheora and libtheora-dev are installed) output of `locate libtheoraenc.so.1.1.2` is: /usr/lib/libtheoraenc.so.1 /usr/lib/libtheoraenc.so.1.1.2 But I can't find this files in /usr/lib!


What is the tool that allows me to specify arbitrary directories using **

I once saw a colleague uses a tool which allows to use ** to represent any directories. For example: if a file called `myfile.java` sits deep inside:               src/main/com/mycompany/product/store/myfile.java      A command in the parent of `src` directory:               ls **/myfile.java      can list the file. Can anyone tell me what tool it is? What package I need to use on `Ubuntu` to achieve this?


Mount Android phone file system on Linux manually

How can I bind my Android file system to my Linux machine, and modify it? When I plug in my Android device, it seems to use one USB interface but I couldn't find whre the mount point is. I checked `/mnt` but there is nothing.


Enabling Numeric Keypad

I have trouble with the numeric keypad (`NumLock` keys) being unusable while typing. While I don't think it's GUI specific, this happens both in Gnome and KDE. Sometimes it works in TTY, other times it fails. If I press the `NumLock` key nothing happens, and the response is the same. I cannot use any of the keys except `Ins`, which repeats text after `Backspace` is used. EDIT: xev output, on `NumLock` press/release               KeyPress event, serial 33, synthetic NO, window 0x2800001,         root 0x101, subw 0x0, time 389867, (311,217), root:(319,313),         state 0x0, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 33, synthetic NO, window 0x2800001,         root 0x101, subw 0x0, time 389867, (311,217), root:(319,313),         state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False


Restrict applications to access certain hardware (webcam, microphone...)

If I tell applications like VLC or Audacity to record from my webcam or microphone, they just wake the hardware if sleeping and do their work without my interference. Although this is a good thing, I've always wondered, due to privacy concerns: is there a way to restrict applications access to a hardware device? Many times I need to run non-free software, and **most of them from companies I know I shouldn't trust**. While writing this, I came up with the idea of using something like SELinux or AppArmor to restrict access to `/dev/something`. Is this possible? Could there be a better or easier way? Also, is there any more hardware besides the webcam and microphone that I should be concerned about (in terms of privacy)?


VST plugin integration into ALSA?

I have "headless" (e.g. no graphical front-end) VST plugin that I would like to embed into my ALSA setup to continuously filter my sound. I remember that there used to be a `LADSPA` plugin which itself embedded/used VST plugins, but I can't seem to find it anymore. Is there a way to use a VST plugin directly with ALSA? `jackd` is not much of an option here as it hangs too often on the target (Raspberry) when in real- time mode.


What effects does restarting sshd have on existing ssh sessions?

I've made some changes to the sshd_config. As I understand it, now I need to restart the sshd service. What happens to existing ssh sessions for the users? Any pointers to documentation I need to read?


How to specify attachment encoding in mutt command line?

I'm trying to send an email with attachment from a perl script. First, I create the attachment (an xml file):               open(XMLFILE, ">:utf8", $xmlfile);     print XMLFILE "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";     print XMLFILE "<data>\n";     #print XMLFILE "...\n";     print XMLFILE "</data>\n";     close (XMLFILE);      I also tried `open(XMLFILE, ">", $xmlfile);` with `binmode XMLFILE, ":utf8";`. Then I send the email like this:               open(MUTT, "|/usr/bin/mutt -s \"TestSubject\" -a $xmlfile \"test\@example.com\"");     binmode MUTT, ":utf8";     print MUTT ("TestBody");     close (MUTT);      Nevertheless, both the text part and the attachment have `Content-Type: text/plain; charset=iso-8859-1`. I also tried `open(MUTT, "|/usr/bin/mutt -e \"set file_charset=utf-8\" -a $xmlfile ...`, but this gave me an `Error in command line: file_charset: unknown variable`. What am I doing wrong?


Can we Bring Up eth1 after removing e1000e modules?

I am trying to setup TCP in RTnet. I am not sure whether its possible. I read that RTnet is not supporting TCP. Is that so? So now I am trying to setup rteth0 as server and eth1 as client. To setup rteth0, I removed e1000e modules and I am actually able set up both rteth0 and rteth1. But I need to setup only rteth0 and want eth1 as a non-real time port. How can I do that?


get the Xth argument in each line

I would like to get the second argument in a line of output. For example:               ps aux      gives me an output that contains the cpu-usage %CPU in the third column. How can I filter the output so I have only that column? I tried               ps aux | cut -f 3      but that's not working see also: Filtering the Xth element in a row?


No response from remote host for Nagios check_snmp_mem.pl plugin

Trying to setup memory usage monitoring for Nagios using the `check_snmp_mem.pl` from Nagios SNMP plugin. I could not even get it working from the command line, I mean I go to `/usr/lib/nagios/plugins` and run the script, it gets a "No response from remote host" error.               [root@nagios plugins]# ./check_snmp_mem.pl -H rhel01 -C public -N -w 90,20 -c 99,30     Argument "v6.0.1" isn't numeric in numeric lt (<) at ./check_snmp_mem.pl line 319.     ERROR: Description table : No response from remote host "rhel01".      Any SNMP configurations required on the monitored server?


How to match a literal '*' with sed?

I have this line in my file called test.php               'dbs_password' => 'a8b*cyP0',      and want to replace into:               'dbs_password' => 'password-here',      So I use this `sed` command with syntax:               $ sed -e "s:'dbs_password' => 'a8b*cyP0',:'dbs_password' => 'password-here':" -i test.php      However it doesn't change/get replaced. I would appreciate it if anyone could share some knowledge on the proper way to use `sed` for this such kind of code?


Home key acting strange in bash (tty and X) on long input strings

When I hit `Home` if my current input is short enough (say, <36 characters), it works fine. However, when I've typed a longer command and then want to go back to the beginning, it seems like it does its job, but the command isn't **displayed** right anymore. It looks as if I'm not in the beginning but about 10 characters off. Although if I type "blindly", it works fine, but it looks like a total mess, as if the whole input is shifted to the right, but not redrawn. So I type over it, but "in fact" not, because the place I'm "erasing" is "actually" 10 characters to the right. Accordingly, if I try to erase the command, the first 10 characters are still displayed, but if I hit `Enter` it just displays another prompt as if the previous input was empty. I know it's not the best explanation ever, but the point is that bash recognizes it and tries to do the right thing, but often fails. I reproduce this both in tty and in a terminal in an X session. When I hit `Ctrl`+`V` and then `Home` I see different sequences (`^[OH` in X, `^[[1~` in tty), but both seem to be in my `/etc/inputrc`:               # do not bell on tab-completion     #set bell-style none          set meta-flag on     set input-meta on     set convert-meta off     set output-meta on          $if mode=emacs          # for linux console and RH/Debian xterm     "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\e[5~": beginning-of-history     "\e[6~": end-of-history     "\e[7~": beginning-of-line     "\e[3~": delete-char     "\e[2~": quoted-insert     "\e[5C": forward-word     "\e[5D": backward-word     "\e\e[C": forward-word     "\e\e[D": backward-word     "\e[1;5C": forward-word     "\e[1;5D": backward-word          # for rxvt     "\e[8~": end-of-line          # for non RH/Debian xterm, can't hurt for RH/DEbian xterm     "\eOH": beginning-of-line     "\eOF": end-of-line          # for freebsd console     "\e[H": beginning-of-line     "\e[F": end-of-line     $endif      `echo $TERM` shows `linux` in tty and `xterm` in X session. It's > GNU bash, version 4.2.24(2)-release (i686-pc-linux-gnu) Anyone have clues about this?


Cannot execute command at GNU screen startup

I want to do something similar to what's written here without using zsh (I use bash), but if I try to start screen with               screen 'cd /home/cataldo/Programs'      I get the following error:               Cannot exec 'cd home/cataldo/Programs': No such file or directory      Without qoutes after exec it does not work either. Double quotes make no difference. Using bash -c "cd .." does not work. It might be some permission problem or screen executes commands as a special user at startup? Thank you very much for your help!               screen --version     Screen version 4.00.03jw4 (FAU) 2-May-06          cat /etc/debian_version      6.0.3


What is the `editor` command in bash?

I was looking for a command that would hopefully open the current user's favourite text editor, because I am writing out some instructions with commands in a blog. I was expecting a command like `edit`, and I found `editor`. For me, it started vim in the terminal, which is close to what I wanted; I use vim-gtk. I started searching for a way to make editor use vim- gtk and found this question that explains an `$EDITOR` environment variable, but I am not sure if that is even related to the `editor` command. I tried `man editor`, but that just pulled up the vim manpage. How can I make `editor` use a text editor of my choice, or should I be using a different command?


Linux mint 15, synaptic can't download all repository indexes

I'm using Linux Mint 15, and started getting these errors from synaptic update manager. I did not change anything in the system, one day it just started to throw these errors. My network works OK, all websites load without any problems. How can I track the cause of the issue? ![Synapctic error](http://i.stack.imgur.com/GtfjQ.png)


How does SMART work for scsi device?

After going through the man pages of `smartctl`, `smartd` and `smartd.conf`, I am no clearer on how S.M.A.R.T. is supposed to work on a scsi device. I have a default configuration file that says:               DEVICESCAN -H -m root -M exec /usr/libexec/smartmontools/smartdnotify -n standby,10,q      The above does not work for my case as DEVICESCAN is not able to detect my scsi disk on RAID 1 configuration. I ran the following command and it says that the next internal SMART test will run in 47 minutes time:               # smartctl -d scsi -A /dev/sg1     === START OF READ SMART DATA SECTION ===     Current Drive Temperature:     34 C     Drive Trip Temperature:        68 C     ....     Vendor (Seagate/Hitachi) factory information       number of hours powered up = 11183.48       number of minutes until next internal SMART test = 47      From the man page of smartd, I understand that the default interval between disk checks is 30 minutes. Now, my question is, how does the 47 minutes come about? Also, from the man page of smartd.conf, there are actually very few options that are valid, namely the `-l self-test` (even -H is for ATA only). Do I have to explicitly schedule a self-test (short or long) prior to the disk check? For the above question, my point is, if I just have the following in my config:               DEFAULT -d scsi -l selftest -m root -M exec /usr/libexec/smartmontools/smartdnotify     /dev/sg1     /dev/sg2      would it be of any use at all? **Extra Info:** I am using Dell PERC H200 RAID controller on two Seagate ST3300657SS disks.


pg_dump version mismatch on Debian

I'm running PostgreSQL on Debian Unstable/Sid. I've got the current versions (9.1) of `postgresql`, `postgresql-client`, `postgresql-client-common` (143) installed. The problem I'm having is trying to run `pg_dump`. I'm getting this error:               pg_dump: server version: 9.1.9; pg_dump version: 9.0.6     pg_dump: aborting because of server version mismatch      I can't seem to figure out how to get a newer version of `pg_dump`. It seems to be coming from the `postgresql-client-common` package, and I've trying running `apt-get --reinstall` on it, but that didn't get me a newer version of pg_dump. How do I work around this? Or where can I find a package with a newer version of `pg_dump`?


Is there a way to lock terminal's title?

Sometimes there're lots of different sessions opened in own terminal's tabs and it's rather desirable to have theirs initial titles (named by session name) locked since local title tweaks make those sessions indistinguishable. It's obvious that controlling all the bits and pieces of remote software running is too wide task to be accomplished in reality, so the most suitable way would be setting a knob prohibiting any further changes to a title. I doubt there's such a knob, but who knows?


Why doesn't `head -c 2 /dev/hwrng` work?

I have an Atmel 97SC3201 in my computer and set the following in the kernel:   * CONFIG_HW_RANDOM_TPM   * CONFIG_TCG_TPM   * CONFIG_TCG_ATMEL `/dev` has `tpm0` and `hwrng`, but running this command returns the following:               head -c 2 /dev/hwrng      output:               head: error reading ‘/dev/hwrng’: Input/output error      In `dmesg` these messages appear:               tpm_atmel tpm_atmel: A TPM error (2048) occurred attempting get random      additional tries yield these messages:               tpm_atmel tpm_atmel: A TPM error (6) occurred attempting get random      Any ideas why this fails or better, how to get it working?


urxvt not loading xft font from ~/.Xdefaults

Some basic details:               archlinux 3.9.3-1     xmonad 0.11     urxvt 9.18      I can get urxvt to load my desired font manually using:               urxvt -fn "xft:Ubuntu Mono"      However, I'm unable to get this font to load through ~/.Xdefaults - Here's what I have at the moment:               Xft*dpi: 96     Xft*antialias: true     Xft*rgba: rgb     Xft*hinting: true     Xft*hintstyle: hintslight          URxvt*transparent: true     URxvt*shading: 40     URxvt*saveLines: 12000     URxvt*foreground: White     URxvt*background: Black     URxvt*scrollBar: false     Urxvt*font: xft:Ubuntu Mono     Urxvt*boldFont: xft:Ubuntu Mono      All other urxvt settings load fine, except the font. I've tried many different combinations like: `xft:Ubuntu Mono:pixelsize=14:style=regular` etc, but nothing seems to work. I've tried `xrdb -merge ~/.Xdefaults`, `xrdb -load ~/.Xdefaults`, and restarting X entirely. I've also tried these settings in ~/.Xresources, however urxvt seems to ignore those settings entirely. What am I missing?


How does irqbalance determine which package to use?

`irqbalance --debug` shows the following:               Package 0: Core 0, 2, 4, 6, 8, 10, 12, 14     Package 1: Core 1, 3, 5, 7, 9, 11, 13      When I run network applications, it seems like IRQs are being handled by package 1, however the `smp_affinity` for the NIC is in package 0.   1. Does `irqbalance` override `smp_affinity` configuration?   2. How does `irqbalance` decide which package to use for handling IRQs?


How to boot into FreeBSD installed in the second partition of an external drive

I have installed FreeBSD 9.1 on the second partition of an external hard disk and I'm not able to get my computer to boot from it. FreeBSD was installed using the FreeBSD memstick image dd'd onto a USB flash drive. The first partition is an ntfs partition which has my backup. When I found the need to have a FreeBSD installation, I "shrank" the first partition (in windows) to get free space to install FreeBSD and then installed FreeBSD. It never asked to install a boot manager. When I first tried to boot, it failed without any error message (maybe there was no boot manager installed). So I booted from my flash drive, and ran the command `boot0cfg -B /dev/ad1)` (ad1 refers to the external hard disk). Now on booting, it displays a menu like:               F1 Win     F2 FreeBSD     F5 First disk      and on pressing F1 or F2 I get the error message: "BOOTMGR is missing". What could the problem be? Please help me boot into my FreeBSD installation.


cp SOMEFILE .. copies to a different directory after cd'ing via a symbolic link

Consider the following setup:               ~/Desktop/Public/subdir     ~/Desktop/subdir --> ~/Desktop/Public/subdir (symbolic link)      Now I do:               cd ~/Desktop/subdir      Which leads me into the linked directory. If I now issue the command:               cd ..      I will be moved back into the `Desktop` directory. This means the cd command is context sensitive - it remembers that I entered `subdir` via the symbolic link. However, issuing the command               cp testfile ..      will copy `testfile` into `Desktop/Public`. I prefer the behavior of `cd` over the (often unpredictable) behavior of `cp`. In any case, I wonder what is the reason for this difference in behavior? Just a legacy thing or is there a good reason?


Using passwordless ssh on CentOS 6

I have a fresh install of CentOS 6 that I am trying to connect to using ssh without a password. But each time I try to login, I am asked for the password. Here are the commands in order:               ssh-keygen     ssh-copy-id -i ./id_rsa.pub user@192.168.1.20     ssh user@192.168.1.20     restorecon -r .ssh


Machine keeps backups of files that I have already deleted

I recently found out that my machine keeps backups of files that I have already deleted. For example, a file called `a.svg` that I have deleted in the past, still exists in the directory it was deleted from but with a new filename called `a.svg~`. Again, another deleted file called `README.txt` still exists with a filename `README.txt~` and so on. Moreover, you can not see directly these kind of files but only when you check "show hidden and backup files" in Nautilus or when you `ls` in a terminal. How can I disable those backup files and have my files deleted for good?


Updating CentOS by YUM command without removing previous version

I wanna update my system by yum command, after executing `yum update` it wants to update kernel to **2.6.32-431.5.1.el6** version also it wants to remove my oldest kernel version (2.6.32-279.el6). **Question:** How to prevent YUM to not remove my previous kernel versions?


Create a computer lab using Linux

I would like to know, how I can create my own Linux lab, like the universities Linux labs. I mean OK, I can install for example Fedora to all my 4 PCs, but how I can login from different computers, and be able to have access to my files from any out of the 4 PCs? In addition how can I login at all 4 using the same password? I know that it should be a server behind all that containing my files, or login info, but how all these are connected? And how I can ensure security on that lab (eg, not be able for a user to install a malware, and how I cannot for example see or copy files of other users)?


What does "cd &" mean?

I know how to change directory from terminal by typing               cd <directory>      but here's the scenario. I was using terminal to go on my git repository's folder.   * glennRepositories      * glenn-remdroid-repository Given the folder structure above, I want to switch in `glenn-remdroid- repository` because it is my repository by doing.               cd glennRepositories      Before switching in glenn-remdroid-repository, I mistakenly typed the commmand               cd &       instead of `cd *`. I used `cd *` because the folder name is long for me, sorry for being lazy. When I execute the `cd &` , the terminal replies               [1] 7519      When I execute `cd *` this is now happened               [1]+  Done                    cd  (wd: ~/glennRepositories)     (wd now: ~/glennRepositories/glenn-remdroid-repository)      Does anyone what `cd &` means and its output? Google doesn't know my question :)


soundblast live on linx mint: fatal: module snd-emu10k1 not found

I'm trying to get my soundblast live 5.1 emu10k1 (rev 7) working. It is listed in my xconf settings but the onboard sound processor is the standard (i have tried to make de soundblaster standard, but then I had no sound). I ran `alsamixer` from a terminal and there's my soundblaster live 5.1 shown as the first device, but I cannot get any sound out of it... ### screenshot from alsamixer     ![ss #1](http://i.stack.imgur.com/WgyAx.png) _original URL:https://db.tt/ukN6Qd2T_ I found a tutorial from Ubuntu which tells step by step what to do. When I'm at the point of doing a `modprobe`, this is the output in terminal:               FATAL: Module snd_EMU10K1 not found.      What can I do to make my soundblaster live working?


inotifywait different action on file or dir

I'm trying to make a `inotifywait` script take different actions for files vs folders if it sees a close_write flag being raised in the watched directory, but cannot seem to get the checks working. In other scripts I use these kinds of checks all the time and they just_work, but there seems to be something about `inotifywait` I'm not grasping yet. This is the script in its current form:                   #!/bin/bash              dir1=/sambashares              while true; do          inotifywait -r -e close_write "$dir1" | while read f; do           #debug           echo $f           #Is it a directory?           if [[ -d "${f}" ]]; then            #debug            echo "New directory called ${f} detected"            chown -R jake:jake $f            chmod -R 775 $f            cp -R $f /media/lacie/Film           fi           #Is it a file?           if [[ -f "${f}" ]]; then            #debug           echo "New file called ${f} detected"           chown jake:jake $f           chmod 775 $f           cp $f /media/lacie/Film           fi               done         done      If I run this in a terminal to see what is happening all I get is the confirmation a close_write was detected, followed by a "setting up watches" without any other messages or any of the other code being triggered, not even the debug echo directly below:                while read f; do      :-( I'm running this on Ubuntu server 12.04 LTS 64 bit.               $ bash --version     GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)          $ dpkg -l | grep inotify     ii  inotify-tools                    3.13-3     ii  libinotifytools0                 3.13-3     ii  python-pyinotify                 0.9.2-1          $ python --version     Python 2.7.3


Running Viber as another user while using "mine" X Server's microphine and speakers

I run _Fedora_ with _GNOME_ and recently installed _Viber_ for linux. It's very good and all is working just fine. As _Viber_ is not _open-source_ software, I decided to run it as another user **to make sure that it doesn't have access to my files without my concent** , by creating a _user:group_ `viber:viber`. If I try to open from inside _Viber_ files that belong to me or any other user, it can't read them. **Goal achieved but partly.** Now, I stumbled against another problem, which is _Viber_ works only with **messages** and when I try to make a call, it says, that it **can't find neither microphone nor speakers?** It feels that I know why (I run X Server (GNOME) as _myself_ and _Viber_ as _viber:viber (user:group)_ ). **How to make _Viber_ run as `viber:viber` and at the same time, to let it use microphone and speakers, while running GNOME session as `myusername:myusername`?** SELinux solutions are also welcome but with concrete examples! _chroot_ is not the solution, as it will lead, as I understand, to the same problem as described above. ### EDIT 1: The _exec_ for running it is: `su - viber -c /opt/viber/Viber`


How do I generate an SNMP community string for MRTG?

I have trying to set up MRTG on my server, following this guide: https://help.ubuntu.com/community/MRTG I followed it as far as,   `cfgmaker <snmp_community_string>@<ip_address_of_device_to_be_monitored> > /etc/mrtg.cfg`   at this point I have no idea what my snmp community string is, I've looked around to try to find out, some places said this is issued from my ISP, so I asked the datacenter that hosts my server, they said I need to generate my own string, so I google'd that, but still nothing. I also tried public@my_ip, but then I receive this error:                   cfgmaker public@<my_ip_address>     --base: Get Device Info on public@<my_ip_address>:     SNMP Error:     no response received     SNMPv1_Session (remote host: "<my_ip_address>" [<my_ip_address>].161)                       community: "public"                      request ID: 1795983726                     PDU bufsize: 8000 bytes                         timeout: 2s                         retries: 5                         backoff: 1)      at /usr/share/perl5/SNMP_util.pm line 629     SNMPWALK Problem for 1.3.6.1.2.1.1 on public@<my_ip_address>::::::v4only      at /usr/bin/cfgmaker line 960     WARNING: Skipping public@<my_ip_address>: as no info could be retrieved          Use of uninitialized value $comment_sysdescr in substitution (s///) at /usr/bin/cfgmaker line 384.     Use of uninitialized value $sysname in concatenation (.) or string at /usr/bin/cfgmaker line 417.     Use of uninitialized value $comment_sysdescr in concatenation (.) or string at /usr/bin/cfgmaker line 417.     Use of uninitialized value $syscontact in concatenation (.) or string at /usr/bin/cfgmaker line 417.     Use of uninitialized value $syslocation in concatenation (.) or string at /usr/bin/cfgmaker line 417.      Could anyone please tell me how I generate my snmp community string for use with MRTG? I am using Ubuntu Server 13.04 with kernel 3.2.0-51-generic.


Removing user entry from /etc/passwd

I am trying to create a `sed` statement to remove `ftp` and other users which we don't need on our Redhat 5/6 servers. I am trying to create a `sed` pattern so I can find for example `ftp` and it removes the whole line. The following is what I have but it's not working:               sed '/ftp/d'  /etc/passwd


Cannot install libevent on CentOS 6.5

I'm on CentOS 6.5. Specifically, I'm running this AMI: Adobe Media Server 5 Extended. I followed these steps:               $ sudo yum groupinstall "Development Tools"     $ sudo yum install glib2-devel fuse-devel libevent-devel \         libxml2-devel openssl-devel          $ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz          $ tar -xzf libevent-2.0.21-stable.tar.gz     $ cd libevent-2.0.21-stable          $ ./configure && make     $ sudo make install          $ sudo echo "/usr/local/lib/" > /etc/ld.so.conf.d/riofs.conf     $ sudo ldconfig     $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig      Then do `libevent` and I get `command not found`. What am I doing wrong?


How do I "fix" Flash?

I'm brand new to linux and, coming from Windows, I sometimes find it quite daunting. I managed to install openSUSE and after much trial and error I discovered how to install some software, and my video driver with YaST. My problem is that when I try to play Flash games in Firefox or Chrome they flicker sporadically and Flash videos play like a slide-show. Occasionally my system hangs for approximately 5-10 minutes in full screen mode. I have no idea what's wrong. Is it Flash or the nVidia driver? I've searched the web for possible solutions and the closest I came was this forum post. At the end of the thread, the poster writes: > I revert to [nVidia] 280.13 and now it is working well, I will wait to new > fixes. Unfortunately, I don't know how to install an older version of the driver (or if it will fix my problem if I do). Please bare in mind that I've only been using openSUSE for about a week. **CPU Information**               Processor (CPU):    Intel(R) Celeron(R)     CPU 2.40GHz Speed:  2,399.96 MHz      **Memory Information**               Total memory (RAM): 969.9     MiB Free memory:    85.4 MiB (+ 321.4 MiB Caches)     Free swap:          637.2 MiB      **OS Information**               OS:                 Linux 3.1.0-1.2-default i686     System:             openSUSE 12.1 (i586)     KDE:                4.7.2 (4.7.2) "release 5"      **Display Info**               Vendor:             nVidia Corporation     Model:              GeForce 6200 (0x0221)     2D driver:          nvidia     3D driver:          NVIDIA 290.10      ## Update This problem occurs primarily with Facebook games and certain video websites. Youtube, Dailymotion, and Hulu perform well, but less known sites such as wimp.com or funnyordie.com perform poorly. I don't expect high definition video to perform very well since I only have 1GB of RAM, but most of these sites stream low quality video. I should add that I didn't experience any problems under Ubunutu 11.10 so I'm wondering if this is related to openSUSE or possibly KDE.


Lock file from being edited or deleted

I have CentOS and cPanel installed. I want to lock certain files (e.g. `.ftpquota`) from being deleted through FTP. I tried to change the ownership to `root:root` or `root:lock` but it didn't work; neither did changing the mode to 0. How can I lock the `.ftpquota` file?


What is LightDM and GDM

What is LightDM and GDM? In Linux operating system I heard both but I don't know about them and what is called? Where they are used? Are they related to display?


configuration for my wireless connection

I had connection issues so I changed some wireless configuration.   I think I solved the problem, but I still have minor issues.   First thing I had my Internet connection freeze badly,   Then after doing those configuration things changed,               modprobe rtl8187 &&     iwconfig wlan0 rate 5.5M auto fixed &&     iwconfig wlan0 rts auto &&     iwconfig wlan0 frag auto      It's now more stable and faster,   but my wireless connection still freeze(I only notice that while gaming) like   1-3 seconds every while(range from minutes to hours).   And I'm sure it's not my Internet, so I think it's my configuration.. Note:   Device: Alfa 036H   Driver: RTL8187L Did someone experience this before?   What are the right configuration for my device/driver?   and what does rts, frag and rate means?   I might be able to fix it myself, if I can understand them.


Awesome symbols and characters in a bash prompt

I just ran across a screenshot of someone's terminal: ![enter image description here](http://i.stack.imgur.com/BX5xV.png) Is there a list of all of the characters which can be used in a Bash prompt, or can someone get me the character for the star and the right arrow?


What does this hard disk error message mean: “Current Pending Sector Count …”?

I grabbed this information from Disk Utillity on Linux Mint:               Current Pending Sector Count:          Normalized: 200     Worst:      200     Threshold:  0     Value:      22 sectors      What does it mean? Is it possible to fix that error?


Why does "file foo.css" and "file bar.css" have different outputs?

For example, executing `file styles.css` outputs:               styles.css: asssembler source text      whereas `file bar.css` outputs:               bar.css: ASCII text      Even better, is there a way to convert my file `styles.css` to ASCII text?


How to sort date: YYYY.MM.DD. HH:MM?

INPUT:               b|2013.06.03. 18:47|     a|2013.06.03. 13:15|     c|2013.06.03. 13:53|      needed OUTPUT:               a|2013.06.03. 13:15|     c|2013.06.03. 13:53|     b|2013.06.03. 18:47|      How can I sort the dates correctly in ascendant order? The delimiter is the `|`. P.S.               sort -t "|" -n -k 2      is not enough, because it doesn't put the HH:MM in good order, only the YYYY.MM.DD.


Arch Linux: Unable to connect to internet post-installation reboot

So I somehow managed to install Arch Linux successfully. At the time of installation, I followed the official guide as well as this guide. During the installation, I had successfully connected to wireless by the mentioned method in the guide and was able to install packages. I issued following commands to stay connected to internet after reboot:               # systemctl enable dhcpcd.service     # systemctl start dhcpcd.service      Now when I do the first reboot, I am unable to connect to internet. I tried all the ways mentioned in both the guides. This is the screenshot of my terminal. As you can see, the command `ip link show wlp4s0` indicated that the interface is UP. But still I am not connected to the internet i.e. Ping to Google fails. I am unable to install any new packages because of this. (No pacman) What is going wrong in my steps? How should I proceed?


What is the expected performance of obnam? Or: why is it so slow?

I've been playing around with obnam these last few days, and although it looks very promising and seems to offer basically everything I ever wanted in a backup tool, I am pretty disappointed in its performance. In fact, it's so slow, I'm suspecting that obnam is not even at fault here, but something in my environment is causing it. So I'm mainly wondering, if anyone else is using obnam or knows its internals well enough to maybe identify the problem. From what I could tell so far, obnam seems to fork an individual gpg process for each file that is backed up. Judging from htop, strace, and iostat, the speed of an initial backup is mostly bounded by the constant forking, while the CPU and the drives (no networking is involved) are mostly idling below 20% utilization. My backup amounts to about 500.000 files with 170 GiB of data in total. So for each backup run, gpg is forked 500.000 times. I'm actually not even surprised that this takes almost an entire day for the initial run and over three hours for another run with most files unchanged. But is this really the performance obnam users should expect? For comparison: an incremental run of rsnapshot (same data, same machine, same drives) takes about four minutes. Granted, there is no encryption involved, but this shouldn't be _that_ significant. So, to ask plainly: Is everyone else's machine not able to run gpg (encrypting a small chunk of data) more than 50 times per second either, ultimately making obnam an almost unusably slow tool? Or is it just me? (FWIW, my machine is a Core i5-2500 with 8G of RAM and SSD drives, running Gentoo. Backup is done onto an HDD, but I couldn't observe any difference to backing up to the SSD, since it's not I/O-bound.)


How to apply Eclipse plugins installed system-wide by package manager without hurting of the user configuration files?

To make the plugins installed system-wide available, I need to re-launch eclipse after deleting the configuration files at ~/.eclipse and I will lost my settings.


Split DNS (bind9), match-clients any doesn't work?

I've been fighting with this for the last few days. A few of my entries have external and internal IP's. My internal network is 10.0.0.0/8. When I `nslookup pc1.clase.net` internally it responds with a 10.0.0.0 address but if I `nslookup pc1.clase.net` externally it still gives me a 10.0.0.0 address. I'm on Debian Wheezy. ### named.conf               include "/etc/bind/named.conf.options";     view "internal" {       match-clients { 10.0.0.0/8;};       zone "clase.net"{         type master;         file "/etc/bind/internals/db.forward.net";         allow-transfer { 10.0.0.11/8; }       };     };     include "/etc/bind/named.conf.default-zones";          zone "10.in-addr.arpa" {       type master;       file "/etc/bind/internals/db.reverse.net";       allow-transfer { 10.0.0.11/8;       };     };     };          view "external" {       match-clients { any; };       zone "clase.net" {         type master;         file "/etc/bind/externals/db.forward.net";         allow-transfer { 10.0.0.11/18;         };       };     };      ### internal/db.foward.net               $TTL    604800     @       IN      SOA     ns.clase.net. root.clase.net. (                          2 ; Serial                              604800 ; Refresh                               86400 ; Retry                             2419200 ; Expire                              604800); Negative Cache TTL     ;     @   IN  NS  ns.clase.net.     ns  IN  A   10.0.0.10     pc1 IN  A   10.0.0.12      ### external/db.forward.net               $TTL    604800     @       IN      SOA     ns.clase.net. root.clase.net. (                          2 ; Serial                              604800 ; Refresh                               86400 ; Retry                             2419200 ; Expire                              604800); Negative Cache TTL     ;     @   IN  NS  ns         IN  A   150.210.0.1     ns  IN  A   150.210.0.1     pc1 IN  A   150.210.0.22


Authenticating with x11vnc: what's the difference between -auth and -rfbauth?

I'm on xubuntu 11.10 trying to setup x11vnc server. I followed instructions here and I can connect to VNC server - but it never asks me for password! Is there a difference between these 2 options:               -auth file     and     -rfbauth passwd-file      Or why wouldn't my VNC client (remmina) ask for password. any clues? **UPDATE:** OK. - I've added **-rfbauth** option and now authentication works with that single password. I can connect and prompted for password:               x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 \     -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log \     -rfbauth /etc/.x11vnc.pass      I can connect but NOT! prompted for password:               x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 \     -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log      I don't get - what is the reason for -auth option then if not for authentication?


tmux session_name count

Let's say that I created four new `tmux` sessions (1, 2, 3, and 4). Now, I kill every window in session 2. `tmux list-session` only show that 1, 3, and 4 are active. If I create a new `tmux` session, it is named 5. _How can I make realise`tmux` that "session 2" (or just the number 2) can be recycled?_ Of course, I can rename session 5 to session 2 but that's an extra command and I am lazy. Note that I am talking here about _sessions_ and not _windows_ numbering. I know about `renumber-windows`.


org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] while running spoon.sh in ubuntu

When I am running `spoon.sh` file in Ubuntu I am getting the following error:               [santosh@sbx data-integration]$ ./spoon.sh     /home/decathlon/Pentaho-5.0.1/data-integration     org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]         at org.eclipse.swt.SWT.error(Unknown Source)         at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)         at org.eclipse.swt.widgets.Display.create(Unknown Source)         at org.eclipse.swt.graphics.Device.<init>(Unknown Source)         at org.eclipse.swt.widgets.Display.<init>(Unknown Source)         at org.eclipse.swt.widgets.Display.<init>(Unknown Source)         at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:582)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:606)         at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134)      Could anyone please help me in resolving the same?


Bash: What is the use of type (Bash builtins)?

I came across a command in Bash script in which I found:               find /var/log/abcd -type f      The above command was in context of cleaning the log files. I know what `find` does. After having seen `-type f`, I looked manual page for it. I got to see it in man page of **BASH_BUILTINS(1)** The description of -f flag under `type` command is :-               The -f option suppresses shell function lookup, as with the command builtin.      Following are my questions:   1. What is the use of `type` ?   2. What is the significance of `-f` flag?   3. What is the use of using `type` with `find` command?  **[EDIT]:-** After having read all the comments and answers till now, I would like to mention the cause for my misinterpretation of `-type option in command find` Vs `type command` . This all happened because I was assuming and till date have seen only the short options(Tests in case of the `find` command) with a **single minus sign '-'** , example, `ls -l`. Most of the times I have seen long options with **double minus sign '--'** , example, `ls --version`.


Insert variable and keep the variable

I'm on VMWare which, no matter what anyone says, responds to most unix commands. Some things are unique though, for example the fact that almost no files are persistent through reboot. Due to this I'm getting a problem with a scripted backup which is using a variable to name log files: If I manually insert               backup-$(date +%Y-%m-%d).log      into `cron`, log files will of course be named after the date they were started. However, if I insert this into `local.sh` to re-enter `cron` job at reboot;               /bin/echo "0 0 * * 1-5 ...backup-$(date +%Y-%m-%d).log      it will of course end up like this:               backup-2014-07-01.log      So the question is how do I write this to `cron`, so that it ends up as a varible instead of a date?


What is the correct way to abort an operation from the sudo password prompt?

Sometimes it amazes me the "little" things I _don't_ know about Unix. For years now I have occasionally noted that I don't actually know how to deal with the sudo password prompt cleanly. Every once in a while I sudo something only to realize that I don't actually want to run the command at all. This happens rarely enough I always forget to ask but just often enough that I remember I still haven't learned the right way to abort. Once sudo starts asking for a password it doesn't want to give up. You can't `Ctrl`+`C` it. If you give it the right password it will run the command that I've decided I want to abort. The only solution I have found is to give it wrong passwords until it gives up asking and falls back to an su prompt which actually listens to a `Ctrl`+`C`. This feels dirty to me. It's sad enough that I changed my mind about a command; not to be able to cancel it cleanly is just embarrassing. What is the proper way to tell sudo to abort the attempt while at the password prompt?


Does software installed in one distribution of linux run in another distribution of linux?

Suppose, I create seperate partition for "/usr" directory. This is the directory which contains all user programs. If I switch from one OS to other(for eg. From Ubuntu to Arch Linux or vice versa), can Arch linux run that program? Will blender that I installed on Ubuntu work on Arch Linux?


SLiM autologin to wrong wm

I configured my system to do an autologin using awesome wm. However, after an upgrade of my Debian Sid (which wasn't without difficulty because of a bug in the package of my graphic driver, I had to reinstall some packages such as SLiM before figuring out a solution.), SLiM is now using Gnome Classic as default WM. My configuration is the following, feel free to ask me more information, I'll provide anything I can. Relevant parts of `/var/log/slim.log`:               login_cmd           exec /bin/bash -login /etc/X11/Xsession %session     sessions            awesome,startxfce4,openbox,ion3,icewm,wmaker,blackbox     default_user        max     auto_login          yes


How to properly upgrade glibc?

The firmware of my NAS comes with a rather old version of `glibc`, namely 2.5. In order to cope with some precompiled binaries (despite being linked "statically", they _still_ dynamically link to glibc...) linked to `glibc` 2.15. From some simple testing in a `chroot` environment I learned simply adding the newer `libc-2.15.so` and updating the symlink `libc.so.6` will yield an unusable system; probably due to `libc-2.15.so` being linked to `ld- linux.so.3` in turn, which would of course also require the 2.15 version instead of the 2.5 one. But before I descend into too much trial and error, > what is the correct procedure to manually upgrade glibc?


Function, return value using pwd in KSH

I tried to write a small `ksh` script:               fDestExists (){         cd /tmp         read vANSWER?" >> Do you want to create a repository in pwd ? Type YES or NO"             echo "    |----> $(fGetDatum) You typed: " $vANSWER                      if [ "$vANSWER" = "YES" ]; then                     read vANSWER2?" >> Type your repository's name."                     mkdir -p $vANSWER2                     cd $vANSWER2                     echo "    |----> Logs will be coped in pwd."                     elif [ "$vANSWER" = "NO" ]; then                 echo "    |----> Logs will be coped in pwd."                     else                  echo "    |----> You typed a wrong answer; exiting."                         exit 1             fi           pwd #return     }      Several questions here.   1. How can I use pwd's value in my echo?    2. To return value, I read it was feasible using echo [yourValue] at last line. Then where you call the function, I guess I can use : $?. So how can I do the same behaviour with pwd?


diff two directories for changes and format output to use for script

I currently try to monitor two directories and subdirectories for changes in files. The directories contain the same set of files, some of them are changed. So I thought I might use the `diff` command to create a list of changed files with the line numbers and changes. I need this list to further process it by another script. Since you can use the `diff -r` option to recursively check for changes, I tried to format the output to suit my needs. I can't use the default multiline output, but want to have the following: `file_1`:               my first line     my second line     my third line      `file_2`:               my first line     my changed second line     my third line      My desired output would either look like:               file_2:2:my changed second line      or (if that is easier):               file_1:2:my second line     file_2:2:my changed second line      I managed to produce the output without the filename with the following parameters:               diff -qbBwr --unchanged-line-format="" --old-line-format=":%d:%L" --new-line-format=":%dn:%L"  file_1 file_2      which results in               :2:my second line     :2:my changed second line      But there are two problems:   * The lfmt option does not work with the recursive option `-r`   * I do not get the filename So finally the question is: Does anybody know how to `diff` two directories in a way that I get the desired output from above?


Nvidia Proprietary Driver Causing Multiple Problems

I have recently downloaded and installed `NVIDIA-Linux-x86_64-319.17.run` for my Nvidia Quadro NVS 130M Graphics Card. Installation went fine after disabling the X server and running the install from a tty. After rebooting;   * The Slim Login manager took considerably longer to process my initial username entry (8-10 seconds vs <1s)   * Any attempts to access another tty results in a system hang, from which I have to restart.   * Attempting to launch Firefox results in a system hang before displaying anything. I have done some searching around but have found nothing that has fixed my problem. I am running `archbang linux x64`, so followed the instructions detailed on their site. I am attempting `pacman -Syu` but do not think this will make much of a difference... I changed from using the nouveau drivers. I have looked through my Xorg.0.log file but didn't see anything that was glaringly obvious. If you need any more details than those provided below, please comment.


What are the methods to protect home folder files from other applications runing as the same user?

I would like to enforce the security access of some files in my Home folder. My concern is about processes running with the same privileges as me having access to those files. I've been wondering about this for sometime, because the role based security in Linux is great but weak for things running in the same role. Specially when it comes to an user account that is very active, every file laying inside the home folder is vulnerable to the user actions. For example installing a malicious Firefox plug-in, the other parts of the OS wont be touched but all the files inside the home folder can be exposed and installing a Firefox plug- in is something any user could do with out any special privilege.


Can I Change Caps Lock to Hyper/Additional Modifier?

In Arch Linux, I have Caps Lock function as an alternate Ctrl: In the console through a personal keymap, and in X through a "kbd" option in `xorg.conf`. I've already researched a little about changing Caps Lock to a Hyper modifier, and it sounded like this wasn't feasible in the console, but is there any way I can do this for X? Here's what I currently use for X:               Option "XkbOptions" "ctrl:nocaps"      Is there an `XkbOptions` option or something similar to make Caps Lock act like an additional modifier? My goal in this is to be able to create more custom keymappings in Emacs with the new modifier.


How can I mount a remote sshfs directory of an publicly inaccessible server on my inaccessible client machine?

This is an extension of the question by @Andrei > How to mount remote SSHFS via intermediate machine? Tunneling? I'm in the same situation that I want to mount a remote directory, however the difference is that both machines `A` and `B` are not publicly exposed on the internet. `A` is my local work station. **So I can neither ssh from`A -> B`, nor `B -> A`.** What I regularly do, is establish a reverse connection from `B -> C`, where `C` is a rented virtual server (VPS). A script doing this connection (and reconnecting in case of lost connection) is started via the `@reboot` key of `cron`.               user@pcB $ ssh -R 2048:localhost:22 -p<port> user@serverC      Then, to go from `A -> B` I take the intermediate route `A -> C -> B`.               user@pcA $ ssh serverC     user@serverC $ ssh -p 2048 user@localhost     user@pcB $ # okay, logged in.      I'm looking for a way to mount the directory `pcB:/home/user` on `pcA`. How do I connect to a pc through another pc using ssh is similar, but the solutions provided don't work in this scenario: the connection map in my case is `A -> C <\- B` not `A -> C -> B`.


Installing debian 7 besides windows 8

I ask this question in superuser but no one can answer my question, I hope any one can help me: I bought a VAIO laptop which Windows 8 preinstalled on it in UEFI mode. Now I want to install Debian 7 besides Windows 8 but when I entered to the Partition Setup of debian setup menu, there is a partition which named EFI partition system. My question is do I have to create another partition for debian to boot in UEFI? or EFI partition system which belongs Windows8 is enough? And if I have to create another EFI boot partition for Debian 7, What name should I choose for it? And do I have to delete EFI partition system?


How to start multiple login managers on different ttys?

How i can configure (best if its a "slim" or "gdm") login manger to start on different ttys? I want a 1 login manger on tty6, another on tty7 and next one on tty8 accessible independently. Is it possible? :)


uname shows duplicate architecture

Why does uname show x86_64 three times? This is Ubuntu 12.04.4.               $ uname -a     Linux seedbox 3.2.0-59-generic #90-Ubuntu SMP Tue Jan 7 22:43:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


Error installing arch Linux due to virtual box-guest-modules (despite not installing on virtual machine)

I'm installing Arch Linux, following the instructions at the Beginners' Guide, and got up to running `pacstrap -i /mnt base base-devel`. It finishes with the following error:               resolving dependencies...     looking for inter-conflicts...     error: failed to prepare transaction (could not satisfy dependencies)     :: virtualbox-guest-modules: requires linux<3.15     ==> ERROR: Failed to install packages to new root      What is really weird is that I'm not installing Arch in a virtual machine, I'm setting it up to dual boot on my laptop.


Testing the Success of a Congestion Algorithm

How do you test whether a particular congestion algorithm is working for you? I ask because it's not as if I can easily re-create a representative workload for most algorithms. I'm current looking at two things, but I'm open to more suggestions:   * The "segments retransmitted" from the output of `netstat -s` My current thinking is that congestion could result in dropped packets some percentage of the time so while there may not be a 1:1 relationship between a packet being dropped and the server being notified of a congestion event, there may be a loose correlation to be drawn if switching to one algorithm resulted in fewer dropped packets. Does this figure show segments that were retransmitted due to congestion or is it limited to lossy links? If so (and I'm thinking it might be the case) that might muddy the waters even more to the point of this not being a good metric to use.   * Is there a metric available to measuring the average age for TCP connections? My thinking here is that TCP connections that finish earlier (absent a spike in errors and dropped packets) might indicate that data is being pushed through with less delay.


sed, getting an error: sed -e expression #1, char 28: unterminated `s' command

When I do:               sed 's/@driver.quit/#@driver.quit' set_QA_district_name_spec.rb       I get the error shown in the title. How can I get around this error, what is wrong?


CHROOT: Unable to copy files to jailed users directory from local machine using WINSCP

I've setup a chroot environment for one of my users called **client** on my system. I'm using WINSCP to connect to my server from my machine using public key authentication. Everything works fine, I can login, see the home directory (jail directory) and cannot navigate upwards. The issue I am having at the moment is that I cannot copy files to the server from my local machine. When I do that I am getting **Permission denied : Cannot create remote file /home/client/test.txt** My server is a Red Hat server and this is my sshd configuration:                   Match User client         ChrootDirectory %h         PubkeyAuthentication yes         AllowTCPForwarding no         X11Forwarding no         ForceCommand internal-sftp      I've looked online for this and I've found some notes regarding making copies of the `bin` and `lib` folder on the client's home directory, but those solutions didn't help. All I need at the moment is for the user to be able to copy files from their local machine to my server under their chroot folder. ### EDIT #1 Here is a quick description of what I have done: I have a chrooted user (username: clientd) which I've jailed inside their home directory. This chroot directory is `/home/client/` which is owned by root. Now I need this client user to be able access the tomcat web application folder which is residing under `/mnt/datadrive/tomcat/webapps`. What I've done is:   1. chroot the user with a public key of their own to the home directory.   2. Create a folder under `/home/client` called `tomcat_ROOT` and given the ownership to `clientdev`. Now when I run the command:               $ mount --bind /mnt/datadrive/tomcat/webapps /home/client/tomcat_ROOT      The folder disappears from the directory listing inside `/home/client` if I login with client. My root user can see it but not the desired user. Here are some permission listings: Output of `ls -l /home/client/tomcat_ROOT`:               drwxr-xr-x.  6 root   root    4096 Apr 11 15:07 .        drwxrwxr-x. 12 root   root    4096 Apr 11 15:07 ..      drwxr-xr-x.  3 root   root    4096 Apr  9 22:10 webapp1      drwxr-xr-x.  4 root   root    4096 Mar 18 18:43 webapp2      drwxr-xr-x.  3 root   root    4096 Apr  9 22:11 webapp3      drwxrwxr-x. 10 root   root    4096 Apr 11 15:20 ROOT      Output of `ls -l /home/client/`:               drwx------. 4 clientdev clientdev 4096 Apr 10 21:36 .      drwxr-xr-x. 7 root      root      4096 Apr 10 22:07 ..      -rw-------. 1 client client  664 Apr 10 21:43 .bash_history      -rw-r--r--. 1 client client   18 Apr 23  2012 .bash_logout      -rw-r--r--. 1 client client  176 Apr 23  2012 .bash_profile      -rw-r--r--. 1 client client  124 Apr 23  2012 .bashrc      drwx------. 2 client client 4096 Apr 10 19:20 .ssh     drwxr-xr-x. 2 client client 4096 Apr 10 21:34 tomcat_ROOT


vim shortcut to open a file under cursor in an already opened window

In vim you can open a file under the cursor by using the `gf` command. One can also easily open that file in a new split window by hitting `<c-w> f`. This is a really nice and time saving feature. However, I can't figure out, how to open the file in an already opened split window (without creating a new one).


Make a tmux pane 80 (or so) columns wide

I'm trying to follow the 80 column rule when writing my code, my current tmux setup is split 50/50 horizontally. I like to have vim in the left-hand pane, and in the right-hand pane I have a 75/25 split where I run other things. On my side monitor 50% is 76 columns wide, but on my laptop's display it's 123 column wide. I'd like to maximize real-estate for other commands, Is there a way to set this to exactly 80 columns (or so) when I launch my workspace? I'm currently setting up my workspace with:               bind C-w source-file ~/dotfiles/scripts/tmux_work_layout      that file contains:               selectp -t 0              # Select pane 0     splitw -h -p 50           # Split pane 0 vertically by 50%     selectp -t 1              # Select pane 1     splitw -v -p 25           # Split pane 1 horizontally by 25%     selectp -t 0              # Select pane 0