Why does System V traditionally symlink /bin to /usr/bin?

This systemd wiki page about the /usr merge, under Myth #6, states that `/bin` has traditionally been a symlink to `/usr/bin` on System V UNIX. What is the motivation for this? For backwards compatibility it makes sense, but I don't understand why it was like this in the early days. (Or, am I misunderstanding? Did early UNIX versions distinguish between `/bin` and `/usr/bin`, and System V changed that by merging them?)


Pasting the content of xclip onto gedit

> **Possible Duplicate:**   >  Copy file to xclip and paste to Firefox I would use the following command to copy the output of `uptime` to the clipboard:               uptime | xclip      Then I can paste the copied uptime to the console by clicking the middle button of mouse. But when I go to an application like "gedit", there is no _Paste_ option available there. How can I copy a text into clipboard so that it could be pasted onto something like "gedit"?


Insert text in specific lines of a file?

How can insert some text in specific lines of a file? What is most simplest method that I can use? (bash, sed, awk?) What I want to do, might be simple, but I don't know where I should start. It's takes too much time for me to try to do this manually (I have very a lot of files that I have to change for Excel/Calc later use). Here is my input file example:               4.06     4.05     5.04     4.06     34.50     56.06     45.33     36.44      And I want something like this (insert text before line 1 and 5):               Exp1         4.06     4.05     5.04     4.06     Exp2     34.50     56.06     45.33     36.44      How can I do this?


Open 2 instances of the same program

I have a SSH server running in my home computer, with `X11Forwarding` enabled. I would like to connect to my computer from another computer and run some graphical programs. The problem is, that if a particular program is already running in my home computer, then it won't run again in my remote computer. All it does is gain focus in the home computer. I believe this problem can be solved if I could find a way to open 2 instances of the same program. I know that if I connect to another user, or run the program from another user in my local computer than I would be able to run the same program twice, once in each user. So I believe a solution would be to simulate a run of the program as another user. Problem is, I have only 1 user account, and I do want to run the programs - remotely, and locally from that particular user (which has access to my files and settings). What is the simplest way to accomplish it? (I'm running Ubuntu)


Can I deactivate the broadcom driver if I have a Realtek wireless card?

I am trying to get my wireless working on ubuntu 12.04. If I run lshw I see this output, indicating a Realtek wireless card.                      *-network UNCLAIMED                 description: Network controller                 product: Realtek Semiconductor Co., Ltd.                 vendor: Realtek Semiconductor Co., Ltd.                 physical id: 0                 bus info: pci@0000:03:00.0                 version: 00                 width: 64 bits                 clock: 33MHz                 capabilities: bus_master cap_list                 configuration: latency=0                 resources: ioport:3000(size=256) memory:f0400000-f0403fff      If I run "Additional Drivers" I see that it has a Broadcom driver installed and activated. Will this driver interfere with a Realtek driver? The wireless is not working on my computer so I need to install an additional driver. is there any good reason to activate or deactivate the broadcom driver?


Using If statment

I'm trying to use an If/else statement in bash. I'm confused which is the correct syntax.                 if [ "$NUMBER_dcn" -gt $NO ]       then       dir_dcn='/mnt/md0/capture'       fi      or                  if [ "{$NUMBER_dcn}" -gt $NO ]       then       dir_dcn='/mnt/md0/capture'       fi      NUMBER_dcn is populated using               NUMBER_dcn=$(find /mnt/md0/capture/ -maxdepth 1 -name "*.pcap" |wc -l)      Are both of them correct because one of them is giving me an "integer expression expected" error.


How can I copy all users .bash_history files into my home directory?

I am running as root. I want to copy all the users on the system's .bash_history files into my home directory. I can do this to combine all of them into one, but then I can't tell who's commands are who's.               find /home/ -maxdepth 2 -iname ".bash_history" -type f -exec cat {} >> ~/combined.txt \;      I would like to either put the user names between each of the files in the `combined.txt` file, or I would like to copy the files in this type of structure:               ~/user-bash/john.txt     ~/user-bash/mary.txt     ~/user-bash/bob.txt     ~/user-bash/larry.txt     ~/user-bash/root.txt      How can I accomplish either one (or both) of these?


Automating web requests using curl?

I have some "corporative" systems I have to use at work. Some of them are terrible, with frames, pop-ups and such. I was thinking about automating some stuff using curl or something like that. I need login, click on hyperlinks, set some data, and them do some post. Is it possible to use curl? Or am I'm going to be better using something like Selenium?


What scripting language or platform to use for web page downloads and screen interaction?

> **Possible Duplicate:**   >  Does anybody here have experience in automating some tasks in web > applications using curl? Here is what I need to do? Wondering what platform is most suited - easy to understand and easy to code in. I may have to outsource it as this may be way above my skill level. **Some background:** I have access to some information databases and websites through my library. The way the databases and websites are accessed is by first loading a library webpage. Entering my library card number in the dialogbox and clicking on the Submit link. Then opens the authenticated (I presume by cookies or such) webpage for the service where I want to obtain data from. **What I want to achieve:** I want to create a compilation of suitably named Pdf files in a folder. Alternatively, and preferably, would like to create one PDF file, which contains all the pages saved, which pages are hyper linked from an index page in the One PDF file. These pages are to be sourced from multiple websites. Access to the sites is either free, or with a password or Library based access (which requires as far as I can tell screen based interaction). Also, on one of these websites which can be accessed via the library based access, the webpage address in the address bar does not change each time I go to a different page (terrible). So the many pages that I want downloaded for offline review, do not lend themselves to a simple Wget kind of command. As far as I can tell, it needs some way on clicking the right tabs on the website, so that the page loads, and once the page loads, it needs to be printed as a PDF file with a suitable name, and compiled into the One PDF file. **Wondering what platform to use to have this mini application / script developed?** Can somebody help me decide on what platform is ideally suited for this kind of application? Ideally, I would like the solution to be function calling oriented, so that if I have to add a webpage after a month of having this developed, I do not have to go running to the developer for such "configuration" changes. The platform does not have to be Unix, although I think using a Unix platform creates the maximum flexibility. I can run it off my Mac, or off a host online, or on my Raspberry Pi :) Thank you!! * * * Update: I just heard from an IT savvy friend that http://seleniumhq.org/ or http://scrapy.org/ may be good options. Will study them also.


What command line tools are available for testing Web Service?

> **Possible Duplicate:**   >  Does anybody here have experience in automating some tasks in web > applications using curl? There are a number of GUI based tools to test Web Service (e.g. soapUI) Is there any our command line driven tool that can be used to test a Webservice. Not just the connectivity, but also capture and compare the result returned by a web service


Accidental deletion of /lib directory in Fedora 15

I accidentally deleted the /lib directory on my Fedora 15 machine and I'm not sure how to go about fixing this. Any help in figuring out how to restore the directory along with symbolic links would be greatly appreciated.


Fedora 16 using systemd kernel boot parameters to change 'runlevel'

It says in the fedora documentation that you can append this line to the boot options to change the *.target that loads temporarily at boot.               systemd.unit=rescue.target      Nothing seems to happen it still boots into a graphical environment, is there any reason this might be happening? I don't want to find a substitute for this command, I would really like to know why this one is not working. Thanks in advance.


Dangers of shopt

In another question it was suggest that I use               shopt -s extglob      To fix a problem. I get the impression that these type commands are to be used sparingly, perhaps because they can have ill effects with other scripts. Can anyone speak to this?


Why is zsh (oh-my-zsh) completing directories that don't exist?

**UPDATE 3** I've worked out that these annoying autocomplete options are actually _usernames_. I.e. they exist in `/etc/passwd` I have users such as _kadmin_admin and _kadmin_changepw and many others starting with an underscore. This may be specific to OSX. Oh-my-zsh is autocompleting with these usernames when it can't find any other matches. I tried adding these usernames to the "Don't complete uninteresting users" list in `~/.oh-my-zsh/lib/completion.zsh`, but that didn't work. I'm not sure why? Is there anyway to stop oh-my-zsh from autocompleting usernames? * * * I'm getting frustrated by some weird behaviour in either ZSH or oh-my-zsh. I'm not sure which would be causing it. The autocomplete seems to be searching some weird directories that I don't want it to. They appear to be some SVN directories, that I know nothing about and have no idea why they would be in the path. (I don't even use SVN) This behaviour only seems to occur if there are no other matches in the current directory - it must then look in some other path that I have no idea about. **Example:** _NOTE: There is nothing in my home dir that matches`mi`_               →  ~  cd mi<tab>     →  ~  cd _kadmin      I.e. it turns `mi` into `_kadmin`. I have no idea why it is matching that directory. If I try to actually change into that directory, I get an error anyway (as it is not the full directory name):               →  ~  cd _kadmin     cd:cd:10: no such file or directory: _kadmin      If I keep pressing `<tab>` then it will match the full directory name:               →  ~  cd mi<tab><tab><tab>     →  ~  cd kadmin_admin     →  ~_svn     →  ~_svn pwd     /var/empty      I have no idea what is going on there. I have no idea what kadmin_admin is. And why when I change into it, why would I now get a directory name of `~_svn`, and then if I `PWD` it shows `/var/empty` This is my path:               /Users/asgeo1/.rvm/gems/ruby-1.9.3-p194/bin:/Users/asgeo1/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/asgeo1/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/asgeo1/.rvm/bin:/usr/local/php54/bin:/Users/asgeo1/Projects/dotfiles/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin      Nothing obvious in there that I can see. Please someone shed some light on this. It's quite frustrating me! **EDIT:** Seems someone has had a similar issue before: Stop tab completion suggesting 'messagebus' There are no answers on there though :( **UPDATE:** This is the cd function which oh-my-zsh applies:               →  ~  which cd     cd () {         if [[ "x$*" = "x..." ]]         then                 cd ../..         elif [[ "x$*" = "x...." ]]         then                 cd ../../..         elif [[ "x$*" = "x....." ]]         then             cd ../../..         elif [[ "x$*" = "x......" ]]         then                 cd ../../../..         else                 builtin cd "$@"         fi     }


awk - streamline this script

I have a text file. On odd number lines, it gives new dimensions of key elements of a building that I'm constructing. On even number lines, the old dimensions are given. My aim is to process this file and output for each element the difference. Basically, it means subtracting old from new values. I'd like to do this with awk because I'm interested to do so. Here's a typical pair of lines from the text file which has 4 columns:               groundwall-rvsd 0.0     21.8    0.00     groundwall-orig 0.0     20.2    0.00      Here's the script I've put together. It's done the work I need to do but it feels like a clunker.               awk 'BEGIN{OFS=FS="\t"}     {if(NR%2==1){foo[NR]=$1 OFS $2 OFS $3 OFS $4}else{bar[NR]=$1 OFS $2 OFS $3 OFS $4}} END      {for(i=1;i<=NR;i++){if(i%2==1){split(foo[i], foosplit, OFS );split(bar[i+1], barsplit, OFS);split(foosplit[1], elemt, "-");      print elemt[1] OFS foosplit[2] - barsplit[2] OFS foosplit[3] - barsplit[3] OFS foosplit[4] - barsplit[4]}}}' file.txt      Any suggestions about a better solution? The output looks like this               groundwall  0   1.6 0


Are double "if" statements allowed in shell scripts

In C language we can use `if(a==b&&a==c)` we can make a double and statement is that possible in unix, to be specific in a shell script?


Add a path in $PATH globally for every user

Do we have anyway to add a path globally so that each user gets it in $PATH. I want to add path of ANT so that each user doesn't need to add it in his $PATH variable.


Gigabit network connection in Ubuntu issue with new hardware

Probably its typical issue, but I couldn’t found the answer. Sometime ago I had mini-ITX server worked on ZOTAC IONITX-G-E. It was managed by Ubuntu 10.10. I setuped Gigabit network with this server. I installed one additional network card (Planet ENW-9700. It's PCI-E x1 card) because it did some routing, that's why I need two network cards. I used DGS-1005D as Gigabit switch. It worked fine, Planet network card had Gigabit network connection. When I used it, network speed was ~40-50Mb\s. After that a month ago I decided to do upgrade, because that system wasn't enough for me. I bought new Asus P8H77-I motherboard with Intel i3-3225. I installed it in the same box instead of Zotac motherboard and installed Ubuntu Desktop 12.10. But somehow network card doesn't work as Gigabit connection. Distance between server and switch is 6-7 meters. I googled for it, and found some similar topics for Realtek NIC(this motherboard uses Realtek 8111F). So, based on some manuals I download latest Realtek drivers from this page, compiled them and installed. I disabled previous one RTL8169 driver that used before. But after that there is no Gigabit connection. I tried to force it by               sudo ethtool -s eth0 speed 1000 duplex full autoneg on      but it didn't do anything. Connection speed remained 100Mb\s. Here is ethtool eth0 output                Settings for eth0:         Supported ports: [ TP ]         Supported link modes:   10baseT/Half 10baseT/Full                                 100baseT/Half 100baseT/Full                                 1000baseT/Full         Supported pause frame use: No         Supports auto-negotiation: Yes         Advertised link modes:  10baseT/Half 10baseT/Full                                 100baseT/Half 100baseT/Full                                 1000baseT/Full         Advertised pause frame use: Symmetric Receive-only         Advertised auto-negotiation: Yes         Speed: 100Mb/s         Duplex: Full         Port: Twisted Pair         PHYAD: 0         Transceiver: internal         Auto-negotiation: on         MDI-X: Unknown         Supports Wake-on: pumbg         Wake-on: g         Current message level: 0x00000033 (51)                                drv probe ifdown ifup         Link detected: yes      Could you please suggest anything? I have the last option to install Planet NIC PCI-E x1 into PCI-E x16 slot and use it as before, but I don't want to occupy the only one PCI-E slot


Why does this pipeline get SIGTTIN?

When I run the command `for i in *.log; do cat "$i" | sort; done | more`, the pipeline gets a `SIGTTIN` signal and is stopped.               bash$ for i in *.log; do cat "$i" | sort; done | more     ### (one screenful of output...)     --More--     ### (press Space)     [1]+  Stopped                 for i in *.log;     do         cat "$i" | sort;     done | more     bash$ echo $?     149     # indicates SIGTTIN(21)      (I substituted a simple `cat` for a more elaborate and complex `awk` script.) I don't see why a `SIGTTIN` is generated, as no process reads from tty, except `more`, which is not in the background. Can someone explain what's going on here?


Perform commands on selected items in Midnight Commander

How can I perform a command on the selected items ? for example calling vim, or gimp for the 5 text or image files selected. I tried to make use of the inlined command line at the bottom, but it doesn't take my selection into account


Trouble sending command to detached Screen session

I would like to send a command to a screen session and if possible get the output. My attempt at sending a command to a screen session is as I found on this website and lots of others, but it doesn't seem to work:               root@server [~]# screen -X "script -a -c 'ls -l' /tmp/command.log" && cat /tmp/command.log     cat: /tmp/command.log: No such file or directory     root@server [~]#       Note there is only 1 Screen session running, so I have omitted -S and -p (tried it with those too and no effect). For example:               root@server [~]# screen -p 0 -X stuff "script -a -c 'ls -l' /tmp/command.log" && cat /tmp/command.log     cat: /tmp/command.log: No such file or directory


Replacing identical NIC cards creates eth1 instead of using eth0 in Ubuntu

I changed out a NIC card that was the exact same make and model. The setup process for Ubuntu 11.04 was very seemless and easy so I figured it would be smart enough to setup up the replacement card. However, it gave the replacement card a new name of `eth1` where all my scripts make reference to `eth0`, not to mention everywhere else in the OS `eth0` may exist. Am I forced to track down every `eth0` reference and change it to `eth1` or is there a way to rename the replacement card back to `eth0`?


Where do background jobs go?

From gnome-terminal I know the ability to suspend a job with C-z, and then send it to the background. When I close the terminal the process does not end. Where is the job being managed from, or is it lost?


How to download all images whose size>100kb in a webpage?

I want to download images contained in some web pages, but only those that are larger than 100 KB. So far I've been downloading all the images and then deleting the small ones, but it's not very efficient. Is there some way to ignore the small ones when downloading?


How to use localhost in browser instead of localhost:10088?

Installed zend-server CE. I would like to use this port (10088). But anytime I enter localhost I should enter localhost:10088, because localhost doesn't work. In the hosts file I tried to enter 127.0.0.1 localhost. In this case localhost:10088 works, localhost - doesn't. If I do 127.0.0.1:10088 localhost both ways don't work.


How do I echo a command and include line returns?

I am writing a bash script, and on a condition I'd like to output `ps aux --sort -rss` However, when I write :               echo `ps aux --sort -rss`      everything is on one huge line. How do I run it so it outputs like it normally does in a terminal?


Make sense of this strace output

Can anyone make sense of this `strace` output?               [pid 25302] read(34, "}B\311\204\n\250\347$\220\266kRb\304a^^\2504\303k\235\227T\223\16\231\306\277\254\256\306", 32) = 32      It's from a Linux system running a Java application via Tomcat. It's trying to read something, but instead of a filename, it has this odd string. This is where I believe the application fails, and it is the one part I don't understand.


Consistent network interface name ubuntu using pci slot

One can set consistent interface naming via mac address by modifying `/etc/udev/rules.d/70-persistent-net.rules`.   * Can you establish consistent interface naming by PCI slot number? (I tried but failed)   * Is there any other method to define consistent interface naming rather than MAC address? I am using Ubuntu 14.04. * * * Modifying `70-persistent-net.rules` per pci slot did not work in the case I had a 4 port NIC plugged into the top most pci slot: > $ lspci -D | grep -i ether               0000:04:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)     0000:04:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)     0000:05:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)     0000:05:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)     0000:0b:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection     0000:0c:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection      This is the file I used: `/etc/udev/rules.d/70-persistent-net.rules`               # This file was automatically generated by the /lib/udev/write_net_rules     # program, run by the persistent-net-generator.rules rules file.     #     # You can modify it, as long as you keep each rule on a single     # line, and change only the value of the NAME= key.               # PCI device 0x8086:0x10d3 (e1000e)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="aa:bb:cc:dd:ee:ff", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"          # PCI device 0x8086:0x10d3 (e1000e)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:aa:bb:cc:dd:ee", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"          SUBSYSTEM=="net", ACTION=="add", KERNELS="0000:04:00.0", NAME="eth2"     SUBSYSTEM=="net", ACTION=="add", KERNELS="0000:04:00.1", NAME="eth3"     SUBSYSTEM=="net", ACTION=="add", KERNELS="0000:05:00.0", NAME="eth4"     SUBSYSTEM=="net", ACTION=="add", KERNELS="0000:05:00.1", NAME="eth5"      Now if I plug in a two port NIC in the same slot:               0000:02:00.0 Ethernet controller: Intel Corporation 82580 Gigabit Fiber Network Connection (rev 01)     0000:02:00.1 Ethernet controller: Intel Corporation 82580 Gigabit Fiber Network Connection (rev 01)     0000:06:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection     0000:07:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection      You can see the PCI slot numbers changed.


Korganizer can't store new items

I have a Kubuntu recent installation (13.04, raring) and all was well until three days ago, when out of the blue, Korganizer stopped storing new items that I was entering in it. When I try to enter a new task, it acts appropriately and shows it and I can edit it, etc. However, when I close Korganizer and re-open it, everything newly entered has disappeared. Things that were entered four days ago or before that are all visible with no problems. Help!


did a " sudo go-wrx" on / ... oops, broken

OK, I was trying to set up ssh to work properly, and a website said it was really picky about permissions, and to use `go-wrx` on `~/.ssh`, and that `/` and `/home` need to have at least go-w permissions. on them. I saw that `/` did not have any write permissions, so i ran `go-wrx` on `/`. I should've read about what that command does first, because now my install is broken. the gui is slowly breaking the more things I click on (basically any time it tries to load anything from the filesystem). from terminal, a `cd` to anywhere gives a permission denied error, and a `sudo` anything gives `bash: /usr/bin/sudo: Permission denied`. If I have to do a reinstall, I will, but I have a few files on there in `/var/www` that I _have_ to save. Is there anyone out there who know how to fix this, or at least get to the files?


Solaris11: Alternative to xVM Hypervisor?

AFAIK, support for the xVM Hypervisor - basically Xen - has been dropped in Solaris 11. Is there an alternative/replacement for it? How does it compare to Xen? Obviously there is zones if you want to run Solaris, and there is VirtualBox if you want a virtual computer in a separate program. But is there anything similar to Hypervisor/Xen?


red-green color blindness compatible vim theme

I am looking for a vim theme accessible to users with red green color blindness. In particular, the red text on a dark terminal background all but disappears. Do any of you know of a good theme? Or have resources useful for designing one?


GRUB on USB Drive -- adding OSes

**Some Background:**   * Coming from a largely Windows background (though I'm familiar with Ubuntu, etc.) and using a Windows 7 machine to complete this task   * Have gotten GRUB installed successfully to the MBR of the USB drive (8 GB FAT32 drive):   * Have created a basic structure on the drive: /boot/grub, /boot/img, /boot/kernel **Question:** I have some basic, beginner questions, but ones that I've had trouble finding answers to through Google / StackExchange, etc.   * I understand that the /boot/img/[SystemName] folder will store the image for a specific system, which may use various (or the same) versions of linux kernels stored in the /boot/kernel directory (at least, that's how I'd like to set it up)   * However, most of these systems just have a kernel in their directories called "linux" (not stating the version). I can search out which kernel these all use, but what's the bst place to get the kernels themselves to copy to /boot/kernel?   * After I get the kernels, I imagine the rest is mostly copying the device to /boot/img/ and creating the proper entry in menu.lst, correct? I can do that on a system by system basis once I can get the kernels to refer to. **Overall Goal:** I'm attempting to create an 8GB usb flash drive that will allow me to boot multiple OSes from a GRUB boot menu. To add or subtract OSes, I would like only to have to copy the appropriate files to a /boot/img/[SystemName] and a /boot/kernel folder as appropriate and then edit the menu.lst file. So, this first step is about finding the kernels that many of these OSes share, as I'm hoping to reduce duplication. I might be confused as to how the process works or terminology, but I promise I've worked in IT generally for 7+ years. Appreciate any help that you can give!


How does google still know my real IP address with Squid?

I'm using Squid proxy with the configs setup so that it would not be detected as proxy. It work with http://www.whatismyip.com/, but when searching for what is my ip on google. Google still show my true IP, how is this possible? How can I configure Squid to truly mask my ip? Thanks in advance.


How to separate numerical values from identifiers

I'm currently writing a shell script that seperate values from their identifiers (retrieved from grep). For example, if I grep a certain file I will retrieve the following information:               value1 = 1     value2 = 74     value3 = 27      I'm wondering what UNIX command I can use to take in the information and convert it to this format:               1 74 27      Appreciate any help


Test if telnet port is active within a shell script

I am trying to create a script to test whether it is possible to login via telnet. I do not want to really log in; therefore, expect is not needed. I just want to see if I am able to get a login prompt. This is being done from a Linux system so I have been trying to use `nc`:               nc 192.168.10.5 23 -w 1 | grep -q login      if [ $? -eq 1 ]     then         echo "console is down"     fi      The problem is that this is causing my console to lock up. It seems like the `-w` is not really dropping the connection. I also tried using telnet but I am not able to break the connection from within the script. Trying               \echo "\035" | telnet 192.168.10.5      breaks before I get a login prompt.


Transmission-daemon service spontaneously stops

I've installed, configured and ran transmission-daemon on my CentOS 6 machine using               service transmission-daemon start      This works nicely, and I can see the web interface on `http://server.ip:9091` as I need to. The problem is, that several minutes later, it spontaneously stops. Never says anything, without warning or error message. This happens even when I have no torrents active at all (as in, none on the list). I have no idea what's wrong, and the error logs I thought of (which probably isn't much) show nothing. How can I diagnose the causes for this? Has anyone else experienced a similar problem? ## EDIT               After the suggestion Martin gave me, I got the log. It goes like this:     [03:07:02.182] Transmission 2.13 (11501) started (session.c:624)     [03:07:02.182] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:789)     [03:07:02.182] RPC Server Serving RPC and Web requests on port 9091 (rpc-server.c:962)     [03:07:02.182] DHT Generating new id (tr-dht.c:384)     [03:07:02.182] Using settings from "/var/lib/transmission/.config/transmission-daemon" (daemon.c:483)     [03:07:02.182] Saved "/var/lib/transmission/.config/transmission-daemon/settings.json" (bencode.c:1683)     [03:07:10.182] Port Forwarding State changed from "Not forwarded" to "???" (port-forwarding.c:95)     [03:07:18.188] Searching for web interface file "/var/lib/transmission/.local/share/transmission/web/index.html" (platform.c:526)     [03:07:18.188] Searching for web interface file "/usr/share/transmission/web/index.html" (platform.c:526)     [03:07:24.189] DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:241)      It hangs on that last one until it dies. Now I've looked into this question, but my settings file is already owned by `transmission`, and even changing the permissions on the file to `775` didn't seem to have any effects. Any ideas?


Asus Eee Netbook Distribution

> **Possible Duplicate:**   >  What are suitable distros for the Asus EEE PC 701 4G? In our school we have Asus Eee Netbooks working with Lubuntu 11.10. The problem is that we need a new distro, because the touchpad isnt working and the newer version doesn't include the driver! Do you have suggestions for an appropriate distro?


Installing OpenGL in fedora 14

I am trying to install OpenGL on my Fedora. But first I am confused with some concepts. I am using ATI Radeon 5470 card and I downloaded the driver from the official website. Here is the link I want to ask **Q1:** is this equivalent to OpenGL? **Q2:** How to uninstall the driver I have installed. PS: I used `sh ati-driver-installer-11-11-x86.x86_64.run` in the command line. A GUI pops up and after several clicks. The driver is installed, which is quite simple. **Answer Q2 by myself:** For the second question: There is a script installed on my system               sudo sh /usr/share/ati/fglrx-uninstall.sh


How do I rsync only some files in some directories

I'm trying to sync all `*.jpg` files from `/var/www/data/models/days/` + some other directories from `/var/www/data` root. I do: ` rsync -az --delete --include='/models' --include='*.jpg' --exclude='*' $SRC::/var/www/data /var/www/data ` but it doesn't sync anything. What am I doing wrong? NOTE: I don't want to change the source or target to include /models/days as I need some other directories with the same filename matching (`*.jpg`).


Where is boost installed on Debian?

I currently don't have a lot of internet quota so I didn't want to install the latest boost libraries. Instead I installed Boost 1.49 using the Synaptic Package Manager and my Debian DVDs. Now that boost (seems to be) installed, how I can I include the headers and link to the binaries when I compile my code? Do I still have to compile boost or is it already compiled for my machine? I can run `bjam`, which produces this: > warning: No toolsets are configured. warning: Configuring default toolset > "gcc". warning: If the default is wrong, your build may not work correctly. > warning: Use the "toolset=xxxxx" option to override our guess. warning: For > more configuration options, please consult warning: http://boost.org/boost- > build2/doc/html/bbv2/advanced/configuration.html > > error: error: no Jamfile in current directory found, and no target > references specified. Not surprisingly, it doesn't find what it's looking for. The link given takes me to a configuration page that doesn't seem to contain what I'm looking for. In Windows, I would unzip the files to `C:/Program Files/Common Files` and then run `bootstrap` followed by `b2 ...` to compile boost for my PC. These instructions seem to assume that we already know **where** boost actually is...


set verbose prints unrelated extra lines

Using `set -x` causes my shell to print unrelated stuff. For example:               $ set -x     ++ printf $'%157s\r'     $ echo 'hello'     + echo hello     hello     ++ printf $'%157s\r'      The lines starting with '++' are extra. How can I remove those extra lines?


How to save mails in Unix?

I wanted to save mail in unix in some directory, as we do in outlook (files are saved with .msg extensions). Is there any workaround for doing this.


Cannot remove Opensolaris from dual boot Windows 7 laptop

I've tried repairs using the Recovery discs, then System Restore, but this problem continues. The Windows Boot Manager reports:               File:         \boot\memtest.exe          Status:        0xc000000f          Info:          The application is missing or corrupt      How can I solve this problem?


How do I run a windows executable in linux shell script?

I have an executable program (no source code, just the compiled executable) that was made in windows (.exe extension). It doesn't use any graphics... it simply reads and writes files. I want to be able to run it in a linux shell script so that I don't have to switch operating systems to get my output. Is there a way to use or convert the executable for linux operating systems?


terminal text editor with Windows like hotkeys

As a Windows user (please forgive me) interacting with GNU\Linux through SSH I am looking for a terminal-based text editor that has similar hot keys to most Windows text editors which I have grown extremely used to (the same hotkeys I use when editing this text in any browser on Windows). (Or I suppose a way to customise an existing editor).   * Cut: `Ctrl`+`X`   * Copy: `Ctrl`+`C`   * Paste: `Ctrl`+`V`   * Undo: `Ctrl`+`Z`   * Redo: `Ctrl`+`Y`   * Save: `Ctrl`+`S`   * Select all: `Ctrl`+`A`   * Jump one word right: `Ctrl`+`→`   * Jump one word left: `Ctrl`+`←`   * Select right: `Shift`+`→`   * Select left: `Shift`+`←`   * Select word right: `Ctrl`+`Shift`+`→`   * Select word left: `Ctrl`+`Shift`+`←`   * Select line up: `Shift`+`↑`   * Select line down: `Shift`+`↓`   * Jump to start of line:`Home`   * Jump to end of line: `End` And for kicker:   * Delete line: `Shift`+`Del`   * Copy and paste line: `Ctrl`+`C`+`V`


Is it possible to x-forward windows apps to linux if windows PC running Xming?

I have been digging around looking for an answer to my question but have no been able to come up with anything. I know that xming server allows you to transparently run linux applications on windows through ssh window forwarding, but can it do the opposite and connect from the linux box to the windows box and display the windows apps in linux using this protocol? I am thinking this is a one way ticket but I was hoping it was possible.


Can't round the corners of menus for gtk?

I've been searching everywhere on how to round the corner of the right-click context menus. Every other widget in GTK can have rounded corners but context menus for some reason. Why is it that this is much more difficult than any other widget? I've tried modifying the css styles for Ambience in gtk- widgets.css, but the rounding attributes do not apply. Why isn't there any rounding support for context menus? I've read that I have to enable rgba support for context menus, so how would I go about doing that?


find command in cygwin giving parameter format not correct

I am using cygwin in my windows machine. I am trying to do a find and it is giving parameter format not correct. Why is that?               $ ls     bootstrap.jar     catalina-tasks.xml     catalina.bat     catalina.sh     commons-daemon-native.tar.gz     commons-daemon.jar     cpappend.bat     digest.bat     digest.sh     setclasspath.bat     setclasspath.sh     shutdown.bat     shutdown.sh     startup.bat     startup.sh     tomcat-juli.jar     tomcat-native.tar.gz     tool-wrapper.bat     tool-wrapper.sh     version.bat     version.sh          $ find . -name "version.sh"     FIND: Parameter format not correct        * Should I install anything while installing cygwin or am I doing something wrong?


sudo - impersonating a user

I am trying to use the sudo command and sudoers file correctly so that I can run a command as another user. I have my sudoers file set up as follows:               beans ALL = (root,apache) NOPASSWD: /opt/renovations/var/script-*.sh      root, apache, and beans are part of the group beans.   Also /opt has 755 permissions, while the /opt/renovations directory and it's sub-directories are owned by the beans user and group. The command I'm trying to run as beans is:               sudo -n -u apache -i /opt/renovations/var/script-test.sh        -n: is so that I'm not prompted for a password, as this will be run by a cron   -u: is so that I can impersonate the apache user   -i: is so that I simulate a login, and my .profile is loaded. I need this so that I access the environment variables in .profile.  The problem is that when I run the sudo command, I get the following message: > sudo: sorry, a password is required to run sudo I've tried running this both on AIX and Ubuntu, but the problem is on both systems. This works if I run:               sudo -n -u apache /opt/renovations/var/script-test.sh      But without the -i, my environment does not contain all of the environment variables that I need to be there. Is there something I need to update in my sudoers file so that this is possible?


similar content Project access from a single file

I create three different project which are access different three different database. Except that all project files are same. so, I want that in a project folder all project files and in other two only database connection file. In previous I listen it's possible. How I do this?


Remove duplicate fields in a given column (after ID check)

I'd like to remove from a given column ($2 in the example) the duplicate fields (comma separated), but only if the ID column ($1 in the example) is the same. Input:               A    1,2,3,4     A    8,9,10,11     A    2,3,4,11,12     B    4,5,6,7     B    6,8,9,10      Expected output:               A    1,2,3,4     A    8,9,10,11     A    12     B    4,5,6,7     B    8,9,10


How do I delete a file in a read-only directory?

I've got a directory and a file in it, with the directory marked as read-only:               $ mkdir directoryname     $ touch directoryname/filename     $ chmod a-w directoryname      I cannot delete the file, even if pass the `-f` flag to `rm`:               $ rm -f directoryname/filename     rm: cannot remove `directoryname/filename': Permission denied      Is there a way to force `rm` to delete this file? Obviously, I could temporarily give `directoryname` write permissions, but I'm looking for a more convenient way. I believe the underlying `unlink` syscall fails in the same way. Is there a way to get around that?


Install grub on LV container for VM

I'm having difficult time installing grub in LVM LV container for a VM. This is the partition table:               # parted /dev/mgtvg/linux2os print     Model: Linux device-mapper (linear) (dm)     Disk /dev/dm-7: 129GB       Sector size (logical/physical): 512B/512B     Partition Table: msdos           Number  Start   End     Size    Type      File system  Flags      1      1049kB  6469MB  6468MB  primary   ext3         boot      2      6469MB  11.8GB  5369MB  primary   xfs      3      11.8GB  17.2GB  5369MB  primary   xfs      4      17.2GB  129GB   112GB   extended               lba      5      17.2GB  22.6GB  5369MB  logical   xfs      Partition one contains the root file system (there is no /boot). Attempting to install grub:               # grub --device-map=/dev/null                   GNU GRUB  version 0.97  (640K lower / 3072K upper memory)           [ Minimal BASH-like line editing is supported.  For the first word, TAB        lists possible command completions.  Anywhere else TAB lists the possible        completions of a device/filename.]     grub> device (hd0) /dev/mgtvg/linux2os     device (hd0) /dev/mgtvg/linux2os     grub> root (hd0,0)     root (hd0,0)      Filesystem type is ext2fs, partition type 0x83     grub> setup     setup          Error 1: Unrecognized device string     grub>       This is the `grub.conf` file from the LV containing the VM:               default=0     timeout=5     splashimage=(hd0,0)/grub/splash.xpm.gz     hiddenmenu     serial --unit=1 --speeed=19200     terminal --timeout=8 console serial     title CentOS (2.6.32-279.22.1.el6.x86_64)             root (hd0,0)                kernel /vmlinuz-2.6.32-279.22.1.el6.x86_64 ro root=/dev/sda1             initrd /initramfs-2.6.32-279.22.1.el6.x86_64.img     title CentOS (2.6.32-279.el6.x86_64)             root (hd0,0)                kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=/dev/sda1             initrd /initramfs-2.6.32-279.el6.x86_64.img      What else do I need?


I need to install Linux without a DVD, USB, Netboot, or Unetbootin

So now I'm having some annoyance on my old server. I'm pretty sure that both CD drives are messed up, as I can't boot from either one. The motherboard is WAY too old to boot from USB. Unetbootin isn't working. I selected the .iso (tried both Debian and Lubuntu), selected 'Hard Drive' instead of USB Flash, and when I booted and selected Unetbotin's option I was presented with > Windows could not start because of a computer disk hardware configuration > problem. Could not read from the selected boot disk. Check boot path and > disk hardware. Please check the Windows documentation about hardware disk > configuration and your hardware reference manuals for additional > information. I'm way too clueless to install it with netboot. Are there any ways to install some kind of Linux distro from XP, but actually overwrite Windows? I tried Puppy Linux's one, but I got an error message and couldn't boot into it. I had to seriously consider seeing if my DVD+RW was sharp enough to kill myself with. Edit: Well, I don't know the type of motherboard, but neither of the CD drives have been able to read any media -- let alone boot from it. I can't set a USB port (with a bootable flash drive inserted) in the boot order.


How to use diff while doing wget?

Let's say there is a site www.songs.com, I download songs from that site using wget -r. Then,say , 3 days later, there has been an update on the site and new songs have been added. > Is there any way I download only new songs using wget? As it stands, if I give command > wget - r It will download the whole website.


Convert perl script to bash

The following script it's about monitoring some logs, the $timestamp is at log at every line that something happens.               Example:     03:19:13.4 Begin summary update for ads.doc.inventory.InventoryItemSummary     03:19:33.9 CronServer:: DailyJob ads.tools.UpdateSummaries@17c5d6cf failed with exception ads.util.AppError: Cannot create UnitName from keys: Each     ads.util.AppError: Cannot create UnitName from keys: Each     at ads.db.DBObjectDefault.createFromKeys(DBObjectDefault.java:42)     at ads.db.DBTable.createFromKeys(DBTable.java:227)     at ads.db.DBValue.getValue(DBValue.java:621)     at ads.dbmanager.DBObjectsManager.initObjects(DBObjectsManager.java:400)     at ads.dbmanager.DBObjectsManager.reload(DBObjectsManager.java:447)     at ads.dbmanager.DBObjectsManager.loadFromStore(DBObjectsManager.java:497)     at ads.doc.inventory.InventoryItemSummary.refreshSince(InventoryItemSummary.java:173)     at ads.db.DBSummaryTable.refreshAll(DBSummaryTable.java:67)     at ads.tools.CronServer$DailyThread.run(CronServer.java:271)     [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.ConnectException: Connection refused; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.ConnectException: Connection refused]     at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:354)     at org.apache.soap.rpc.Call.invoke(Call.java:248)     at ads.support.SupportCall.call(SupportCall.java:56)     at ads.tools.SupportThread.run(SupportThread.java:101)     03:46:42.5 Periodic support request failed: ads.support.SupportException: Error opening socket: java.net.ConnectException: Connection refused     06:31:36.1 Upload failed: java.io.FileNotFoundException: c:/tmp/cygwin1.dll (No such file or directory)     08:01:08.0 connect from /172.22.3.28      I have this perl script               #!/usr/bin/perl          use strict;     use warnings FATAL => qw(all);          my $timestamp = qr/^\d+:\d+:\d+/;          my $block = "";     my $exception = 0;     while (<STDIN>) {          if ($block) {     # $_ is the current input line in perl.         if ($_ =~ $timestamp) {             print "\n\n***EXCEPTION***\n$block" if $exception;             $block = "";             $exception = 0;         }     # This isn't actually a second regexp, it's a substring search.     # But you could use a regexp.         $exception = 1 if (index($_,"Exception") >= 0);         $block .= $_;         next;     }     $block = $_ if ($_ =~ $timestamp);     }      and I want to convert it to bash script. Here's what I've done so far but didn't work, #!/bin/bash               timestamp=^[0-9][0-9]\:[0-9][0-9]\:[0-9][0-9]\.[0-9]          block=""          exception=false          except=.*Exception.*          while read line     do          if [[ -z $block ]] ;        then              if [[ $line =~ $timestamp ]]            then                      if [[ $exception=false ]]                    then                          echo "\n\n***EXCEPTION***\n$block"                 fi     block=""     exception=false         fi              if [[ $line =~ $except ]]            then                 exception=true         fi          block=$block$line          fi          if [[ $line =~ $timestamp ]]        then         block=$line     fi          done      Any help with that?


Comparing text files using Bash and AWK

I have two text files, and I want to compare their corresponding values according to their rows and columns. By comparing, I mean to check if the values are equal and echo if the values are the same or not. Here are the files: `file1.txt`               Name  Col1  Col2  Col3       -----------------------     row1  1     4     7             row2  2     5     8              row3  3     6     9         `file2.txt`               Name  Col1  Col2  Col3       -----------------------     row2  1     4     11             row1  2     5     12      Here are the constraints:   * compare only the rows that exist (that is, since row3 exists in file1.txt, but not in file2.txt, no comparison is needed)   * Must use AWK   * The rows may be out of order in the files   * No double arrays since my version of AWK doesn't support it I am thinking of something like this:               awk 'NR>2 {next}     {         for (i=2;i<NR;i++)              #For each row of file1.txt         {                  for(j=1;i<NF;j++)           #For each column of file1.txt             {                  // Check if row and column of file1.txt is equal to row and column of file2.txt.             }          }     }     ' file1.txt file2.txt      How do you compare values of two different text files? Let me know if more explanation is needed. All I'm asking for is a general structure using AWK. Hopefully I can figure out the rest.


Processes lose attachment to shell when started via bash -x

Normally, if I run `emacs &` and then close the shell, emacs will exit. However, if I run `bash -x foo.foo` (where `foo.foo` is a script that runs `emacs &`), then emacs will remain open even when I exit the shell. Is there a way to make all processes close when the shell exits, even when the processes were started via a call to `bash -x`?


vsftpd does not allow chrooted users write to directory

I installed vsftpd on ubuntu 12.04 and chrooted local users, in order not to let them see the other parts of system. but when a local user wants to login into ftp it gives out this error:               500 OOPS: vsftpd: refusing to run with writable root inside chroot()      Why is this happening? And what is the problem to let the chrooted users to write into the directory? Do I have to compile my vsftp with extra arguments? Why aren't the included in the main package?


How to remove metapackage entirely in Debian

Is there any way to remove meta package and all its packages? Subset of metapackage is packages which don't depend on metapackage by all means. That's why if remove one metapackage only the package's subset of metapackage is not removed. For example metapackage `apache2` consists some packages which will be installed if install `apache2`. I used the `apt-get install apache2` command in shell and `synaptic` and I installed some packages. Now if I remove metapackage `apache2` via `apt-get autoremove apache2` command or `synaptic` I remove `apache2` package only and other packages which are a subset of the metapackage are not removed. In my opinion the best way is to remove all packages within the metapackage. How to resolve the issue?


How to configure SSL in apache?

I have installed apache in RHEL 6. Everything is working fine. What all changes and configurations should be done to use https://localhost:443/. If I change the "Listen 80" to 443 it is throwing an SSL connection error "Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error."


How can I go forward in a file? What is the oposite of ctrl+O

If I jump to a file e.g. by `gf` I know that I can do `ctrl+O` to go back.   But how do I go forward? I.e. what is the opposite of `ctrl+O` so as to go forward to the file I was earlier to which I jumbed to via `gf`?


What does the expression $(<"dir/file") mean in bash?

In a bash script I cannot post here I see the following expression:               $(<"dir/file")      From what I understand the expression `$(...)` evaluates a command inside (as when using backticks), but what is the role of the angle bracket used inside the round bracket?


Restoring default ip rule

I accidentally issued `ip rule flush`, now the default ip rule are all gone, which is,               32766:  from all lookup main      32767:  from all lookup default      Anyone know how to add them back?


How to install cpp in RHEL 6.3?

I want to install gcc in RHEL 6.3, but it has cpp dependencies.   So I go to cpp rpm download page, but it has no rpm for 6.3 version:   ![enter image description here](http://i.stack.imgur.com/I1Urm.png) Is there any other way to install cpp in RHEL 6.3?


Calculating CPU time of process in RHEL 5.3

For a process management,I would need to remove a process that exceeds a certain amount of CPU time, for example 1 hour.In PS command ,it has TIME parameter shows the total CPU time of a process .So is this the correct way to take the CPU time of a process? Also is there any other commands that could be used in calculating CPU time of process.


Increase %e precision with /usr/bin/time shell command

When I run the time command in shell `time ./myapp` I get an output like the following:               real    0m0.668s     user    0m0.112s     sys     0m0.028s      However,when I run the command `\time -f %e ./myapp` I lose precision and I get:               2.01s      If I use the `%E` command I also lose precision in the same way. How do I change it to have more precision again, but still only have the seconds being outputted? I based my research in this Linux / Unix Command: time  and on this question


read only access to all files in a specific sub-folder

I have got a specific folder located in "/home/.../reboot/". I have a series of users that require read-only access to the ever changing files within. My problem is that the same users are not authorized to view any of the parent directory files. Right now, the only thing I have in place is that their starting folder is at "/home/.../reboot/" by changing the etc/passwd file; and I need to block all access to other folders. How could I only give them access to this directory?


When does "apt-get install" ask me to confirm whether I want to continue or not?

Sometimes "apt-get install" asks me `"Do you want to continue [Y/n]?"`:               root@T43:~# apt-get install chmsee     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       libchm1     The following NEW packages will be installed:       chmsee libchm1     0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.     Need to get 192 kB of archives.     After this operation, 848 kB of additional disk space will be used.     Do you want to continue [Y/n]?       Am I correct that this happens only if `"The following NEW packages will be installed:"` line has other packages(probably dependencies) listed than the one(s) I specified as an argument to `"apt-get install"`?


Autofs home folders from solaris 11

I'm having trouble since 2 days with autofs. I have a Solaris 11 Server. There I share the folder /export/home with the following command: share -o rw -d „Freigabe von /export/home“ /export/home My Client is a Fedora 17. On Fedora I created the folder /ahome, where all home folders should be mounted with autofs. I gave permissions 777 to /ahome. After that I configured the /etc/auto.master and added               /ahome auto.homes      Than I created the file /etc/auto.homes               read1 192.168.0.3:/export/home/read1     read2 192.168.0.3:/export/home/read2      After that I restart autofs with               systemctl restart autofs.service      Both Users (read1 and read2) exist on both systems with the same UID and GID. But when I cd to /ahome/read1 and make an ls on Fedora I get the following error.               ls: cannot open directory .: Permission denied      In /var/log/messages               Mar 30 23:43:34 fe-19 pulseaudio[1474]: [alsa-sink] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.     Mar 30 23:43:49 fe-19 dbus-daemon[582]: ** Message: No devices in use, exit     Mar 30 23:45:31 fe-19 systemd[1]: Cannot add dependency job for unit mdmonitor-takeover.service, ignoring: Unit mdmonitor-takeover.service failed to load: No such file or directory. See system logs and 'systemctl status mdmonitor-takeover.service' for details.     Mar 30 23:45:32 fe-19 automount[1100]: umount_autofs_indirect: ask umount returned busy /ahome     Mar 30 23:47:49 fe-19 dbus-daemon[582]: (packagekitd:1508): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed     Mar 30 23:55:03 fe-19 systemd[1]: Cannot add dependency job for unit mdmonitor-takeover.service, ignoring: Unit mdmonitor-takeover.service failed to load: No such file or directory. See system logs and 'systemctl status mdmonitor-takeover.service' for details.     Mar 30 23:55:03 fe-19 automount[1933]: umount_autofs_indirect: ask umount returned busy /ahome      Please, Can anybody help me? I start hating autofs


Retrieve countries timezones

What is the best way to retrieve the current time zones of a number of countries, on a daily basis? (that would take into account DST changes, of course)   * Reliably   * If possible the Linux way (i.e. either using internal resources, or a Linux website API) _(I'm on Ubuntu 10.04)_


How to fetch and process mail in order to execute commands?

I administer a home server, and sometimes when I'm out I need to execute some simple commands on the server. 3G + SSH is not an option because it's too expensive from my phone (here in Argentina). It is easier to send an SMS to my mail account. ** I want to fetch the mails I send to my server, and process the text surrounded by ** as bash commands. What approach would you recommend?


Bash and Tab Auto-complete

I recently put Fedora Core 15 on my system, and I've had a behaviour change that I can't figure out. Using Tab-Complete in the BASH shell works fine except when I use the $HOME variable. If I type `cd $HOME/d``TAB`, it will auto-complete to the proper directory (doc), but it also inserts a preceding `\`, so the result is `cd \$HOME/doc`. This then fails, as such a path does not exist. The error is > bash: cd: $HOME/doc: No such file or directory If I don't use Tab-Complete it works, as $HOME still points to the proper directory. Where did this extra `\` come from, and how do I make it go away?


How to use third party notification area with gnome shell

I'm using gnome-shell 3.0.2 on Arch Linux and I want to use AWN's notification area plugin. However when I try to activate the plugin it complains that there's already a notification area running. This is expected, of course, except that I can't find a way to disable gnome- shell's notification area. In gnome 2 I'd just right click on the notification area and select "remove from panel" - how do I do the equivalent in gnome- shell, so I can use awn's notification area (or any other third party notification area)?


How to auto-restart squid on ubuntu!

I have a Ubuntu Home edition set-up as DHCP and Squid proxy, but whenever I reboot my system, I have to restart squid in order for others to start browsing! Is there anyway I can make squid to restart automatically on each reboot, yet it is started when the system boots but I have to restart it once! Also, I have to enter this command for eth0 to redirect traffic through squid!               sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128


Extracting the contents of a zip file with overwrite all mode in centos 5

How can I `Unzip` a `Zip` file which contains different directories and sub directories with the overwrite mode ?   I mean i want the zipped contents to overwrites any existing files (be it old be it new). I have read about `Unzip` command , but it seems it doesnt overwrite any sub directories.


How do I use implicit FTP over TLS

using any FTP client (I'm on Ubuntu 12.04 and tried using lftp), I want to be able to make an implicit TLS connection on a FTP server, but I can't quite manage to successfully connect(All I get is : "'ls' at 0 [Delaying before reconnect 29]


Grsecurity: best strategy sought

If a server is run with Linux hardened with Grsecurity (say, Gentoo Hardened), what is the best time to enable Grsecurity RBAC? Automatically by some boot script, or manually after booting?


Formatting the output: Underlining

I wrote the following function in `ksh` that prints its first argument to the screen and underlines it with the appropriate ammount of `-` character:               print_underlined () {         word=$1          echo $word              i=${#word}         while [[ i -gt 0 ]]; do             printf "-"             (( i = $i - 1 ))         done         printf "\n"     }      example:               $ print_underlined foobar     foobar     ------     $      I wonder if there is a simpler and more elegant way to display an underlined word to the screen. For the record I am using:   * Solaris 10   * ksh88


How do I prevent less from clearing the screen on exit?

I often pipe commands to `less` in order to read through the output (e.g. compiler errors).               MyCommand | less      This is great because it makes trawling through large amounts of output easy, but when I exit `less` the output is gone. How can I make the output still visible after quitting less? This question differs from Is there a way in bash to redirect output and still have it go to stdout? because that question relates to output to a text file via `tee`, which, as far as I know, doesn't provide a facility to split output between `less` and `stdout`.


How to compact a directory

Every so often, some application runs wild and fills a directory with a huge amount of files. Once we fix the bug and clean up the files, the directory stays big (>50MB) even though there's only 20-30 files in it. Is there some command that compacts a directory without having to recreate it? Bonus points: does a huge empty directory affect access performance of that directory? I'm assuming it does, but maybe it's not worth bothering. It seems slower to do `ls` on such a directory.


List of installed programs without running a program in the system

My Linux Mint 15 broke and there seems to be no way to fix it. I cannot boot it so I haven't got access to the terminal. What I'm going to do is make a backup of `/home` with a flash disk running Mint (done that) and reinstall Mint -> restoring `/home`, but I'd like to get a list of installed programs so I can reinstall them. I know:               dpkg --get-selections      exists, but that requires running the program from within the system, which I can't do because I can't boot it. Is there any way to get the list or send the command from the Mint from the flash disk?


Permission issues when doing system backup using rsync

I'm trying to backup my linux system (arch linux on a laptop) to a remote computer on the same network using ssh (or NFS). I use rsync extensively to backup my /home directory to the remote computer over ssh and NFS with no issues whatsoever. What I want to do is run the rsync command on the laptop within a script and copy all of the contents of / (excluding some directories of course, that I already have figured out) to the remote computer. The issue I'm having is about permissions. I have disabled root login on the ssh server (openssh, running on an ubuntu server 12.04 computer) and I disabled password authentication and enable rsa key login so I can run the backup scripts automatically using cron on the laptop. Now, for me to able to copy all of the system's files under /* (on the laptop) I need to run rsync as root. Doing that introduces a problem since I'm not able to access the ssh server as root. If I try to do it over NFS i get another permision problem since the root user isn't allowed to access the NFS mount, as my regular user is. I'm writting here so I can get suggestion on how to solve this problem. I would prefer to do it over ssh since it usually works a lot faster for me, but I'm willing to use NFS or even samba (haven't tried that one) if no other thing works.


Let Transmission running on the server, independently of SSH session

This question has been reworded, previous one was a duplicate of Execute remote commands, completely detaching from the ssh connection I want to access to a computer through SSH, run both Iceweasel and Transmission, use Iceweasel to find some torrents, add the torrents to Transmission, close Icewasel, close my SSH session and let Transmission running on the server. I'm running Transmission using `nohup`, but if I close Transmission, it closes on the server. If I exit the session, it closes as well.


Is there a way to control the mouse wheel resolution in Debian?

I am using Debian 6.0.4. The mouse wheel scrolls way to much for it to be any use. Is there any way to configure how much "scrolling" is done with with one mouse wheel turn? Thanks! Update: My keyboard and mouse are wireless, connected to a USB port in a KVM which is connected by USB to the computer (and it even works :-) ). `xinput --list` output:               ⎡Virtual core pointer                       id=2    [master pointer  (3)]     ⎜↳ Virtual core XTEST pointer               id=4    [slave  pointer  (2)]     ⎜↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0 id=9    [slave  pointer  (2)]     ⎜↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0 id=10   [slave  pointer  (2)]     ⎜↳ Justcom Technology USB KVM Switch        id=12   [slave  pointer  (2)]     ⎣Virtual core keyboard                      id=3    [master keyboard (2)]     ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]     ↳ Power Button                              id=6    [slave  keyboard (3)]     ↳ Power Button                              id=7    [slave  keyboard (3)]      ↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0  id=8    [slave  keyboard (3)]     ↳ Justcom Technology USB KVM Switch         id=11   [slave  keyboard (3)]      `xinput --list-props 9` output:                 Device 'Microsoft Microsoft® 2.4GHz Transceiver v8.0':         Device Enabled (128):   1         Device Accel Profile (254): 0         Device Accel Constant Deceleration (255):   1.000000         Device Accel Adaptive Deceleration (257):   1.000000         Device Accel Velocity Scaling (258):    10.000000         Evdev Reopen Attempts (246):    10         Evdev Axis Inversion (259): 0, 0         Evdev Axes Swap (261):  0         Axis Labels (262):  "Rel X" (136), "Rel Y" (137), "Rel Misc" (263)         Button Labels (264):    "Button Left" (129), "Button Middle" (130), "Button Right" (131), "Button Wheel Up" (132), "Button Wheel Down" (133), "Button Horiz Wheel Left" (134), "Button Horiz Wheel Right" (135), "Button Side" (249), "Button Extra" (250), "Button Unknown" (247), "Button Unknown" (247), "Button Unknown" (247), "Button Unknown" (247)         Evdev Middle Button Emulation (265):    2         Evdev Middle Button Timeout (266):  50         Evdev Wheel Emulation (267):    0         Evdev Wheel Emulation Axes (268):   0, 0, 4, 5         Evdev Wheel Emulation Inertia (269):    10         Evdev Wheel Emulation Timeout (270):    200          Evdev Wheel Emulation Button (271): 4         Evdev Drag Lock Buttons (272):  0


Bluetooth was working but just stopped?

I recently upgraded to the latest FGLRX driver on my MacBook Pro and I noticed that Bluetooth was having some issues afterward. I tried reinstalling bluetooth and bluez, but it didn't seem to fix things. Before the FGLRX upgrade, it was working just fine. Unfortunately, it's a really big hassle to downgrade from FGLRX, and I don't have the time to spend in getting it back to 11.12. I do have `etckeeper` installed and I've checked out the revision before I did any changes, restarted bluetooth, and it's still giving me the same error in syslog when I try to connect my keyboard:               $ tail -f /var/log/syslog | grep "blue"     Jan 30 11:56:31 work-macbook bluetoothd[9457]: Refusing input device connect: No such file or directory (2)     Jan 30 11:56:31 work-macbook bluetoothd[9457]: Refusing input device connect: No such file or directory (2)      I have no idea what file it's looking for. Is there a way for me to either:   1. Revert all of my changes and just get Bluetooth working again.   2. Enable Bluez logging to be able to see what it's unable to find? This is super weird. Can anyone help me debug this?


Photoshop in Wine won't open, gives "File not found" error

Ever since moving to Linux Mint 14, Photoshop CS 2 in Wine has been unreliable. It ran a couple times after my first install, but now it has settled into never running, and instead, it just returns an error saying "File not found". ![file not found](http://i.stack.imgur.com/oleup.png) I tried re-installing, and also installing into a custom directory, but that hasn't helped. I tried restarting the Wine server with `wineserver -k`, and rebooting, but neither helped. I get the same error if I try to run `Photoshop.exe` from the command line, even if I'm in the directory where the file is and I can see it listed when I run an `ls` command. So I don't think this is a matter of the `Photoshop.exe` file not being found, it is some system file or Wine setting. How can I get past this error and have Photoshop running consistently?


Kernel logs on power failure

I was wondering if it was possible to have a logging program document a random power failure. Clearly it won't have any time to log when the power fails, but is there a way to recognize a power failure occurred when it reboots after the failure? I know Red Hat (and Linux in general) has some pretty good logs (`/var/log`) but I don't think it has any native logging program that could handle a power failure. If there is no logging program I was also debating changing the boot scripts. The BIOS is set for it to always be powered on; so if a power failure occurs, it automatically reboots. ### The only time the system will be off is if a power failure happens; it will never be manually shut down. Therefore, I was thinking of adding something (simple as a `mail` command) to the boot scripts because every boot after the very first boot marks a power failure. Unfortunately, I don't know which file or location or the actual syntax of such a command would be.


how to ping & use specific network card

> i have 3 network cards , 1 Lan (wired) , 1 wireless network card & 1 is > wireless usb > > how do i ping from specific network card ? > > & how do i use specific network card for specific application example               i want to ping google from wlan1      example for specific application               i want to use firefox or transmission from wan1      Lan ip 192.168.0.2 > Working Properly ![enter image description here](http://i.stack.imgur.com/td6ug.jpg) pin -I wlan1 google.com ![enter image description here](http://i.stack.imgur.com/jYW2m.jpg) > **`route -n`**               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0     169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0     172.16.221.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8     192.168.0.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0     192.168.0.0     0.0.0.0         255.255.255.0   U     2      0        0 wlan1     192.168.48.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1      > one@onezero:~$ **ip route**               default via 192.168.0.1 dev eth0  proto static      169.254.0.0/16 dev eth0  scope link  metric 1000      172.16.221.0/24 dev vmnet8  proto kernel  scope link  src 172.16.221.1      192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.2  metric 1      192.168.0.0/24 dev wlan1  proto kernel  scope link  src 192.168.0.3  metric 2      192.168.48.0/24 dev vmnet1  proto kernel  scope link  src 192.168.48.1       @Khaled               one@onezero:~$ ping -S 192.168.0.2  hotmail.com     PING hotmail.com (65.55.72.135) 56(84) bytes of data.     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=1 ttl=236 time=391 ms     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=2 ttl=236 time=296 ms     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=3 ttl=236 time=393 ms     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=4 ttl=236 time=352 ms      * * *                ping -S 192.168.0.3  hotmail.com     PING hotmail.com (65.55.72.183) 56(84) bytes of data.     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=1 ttl=236 time=312 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=2 ttl=236 time=457 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=3 ttl=236 time=298 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=5 ttl=236 time=330 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=6 ttl=236 time=300 ms      Now Lastly the application issue


How do services in Debian work, and how can I manage them?

In Windows I have the services manager, where I see all system services, that can be started through Windows itself, I set up the user it uses, the rights management is in there, and I can pass variables and some other information to the services, I can name them, and I can create duplicates services of one program and so on. So I have a main management tool in Windows. How can I do the same in Linux? How can I trigger to run "svnserve" at startup, or how can I configure services to be running in a special context. How can I view all "programmed" services?


Shorewall "ERROR: Ordinary users may not start the /etc/shorewall configuration" in Cygwin

I am using Cygwin on Windows 7 and I have installed Shorewall 4.5.21.5.   When I try to start shorewall in Cygwin, it gives me error:               $ shorewall start     ERROR: Ordinary users may not start the /etc/shorewall configuration      I tried running Cygwin using Run as Administrator but that didn't work. I have searched everywhere but haven't found a fix yet.


Linux Confereneces with a Focus on Power Management Issues

The organization where I work is looking for conferences taking place in 2014 (worldwide) revolving around Linux, with a focus on power management issues on Android. Do you have any recommendation for such a summit? I know Linux Con ,Embedded Linux and Linux Plumbers all have specific sessions related to these issues, but is there anything (can be small scale) more focused?


sar -P ALL command AIX 6.1

What is the meaning of `-` in the `cpu` column below? Is it average of all CPU cores?               bash-3.00$ sar -P ALL 2 2     AIX tinapp1 1 6 00F6F78B4C00    11/27/13     System configuration: lcpu=4  mode=Capped     19:02:54 cpu    %usr    %sys    %wio   %idle   physc     19:02:56  0       13      15       0      72    0.30               1        0       1       0      99    0.23               2        0       0       0     100    0.24               3        0       0       0     100    0.23               -        4       5       0      91    1.01     19:02:58  0       12      15       0      73    0.29               1        2       1       0      97    0.24               2        0       0       0     100    0.23               3        0       1       0      99    0.23               -        4       5       0      91    1.00     Average   0       13      15       0      72    0.30               1        1       1       0      98    0.24               2        0       0       0     100    0.24               3        0       1       0      99    0.23               -        4       5       0      91    1.01     bash-3.00$ sar -P ALL 2 3     AIX tinapp1 1 6 00F6F78B4C00    11/27/13     System configuration: lcpu=4  mode=Capped     19:03:02 cpu    %usr    %sys    %wio   %idle   physc     19:03:04  0        9      11       0      80    0.28               1        1       1       0      99    0.24               2        0       0       0     100    0.24               3        0       0       0      99    0.24               -        3       3       0      94    1.00     19:03:06  0        9      10       0      81    0.28               1        0       1       0      99    0.24               2        0       0       0     100    0.24               3        0       1       0      99    0.24               -        3       3       0      94    1.00     19:03:08  0       12      16       1      70    0.30               1        0       1       0      99    0.23               2        0       1       0      99    0.23               3        0       0       0     100    0.23               -        4       5       0      91    1.00     Average   0       10      13       0      77    0.29               1        0       1       0      99    0.24               2        0       0       0     100    0.24               3        0       0       0      99    0.24               -        3       4       0      93    1.00


Use git submodule foreach with function

My indention is to have a script that updates all git submodules according to which branch is given. If there's no such branch for a submodule, master is used. This is what I have now:               #!/bin/bash -x          if [ -z $1 ]; then         echo "Branch name required."         exit     fi          function pbranch {         exists=`git show-ref refs/heads/$branch`              if [ -z $exists ]; then             branch="master"         fi              git co $branch         git pull origin $branch     }          branch=$1          git submodule foreach pbranch      But when running this script, the error is thrown:               oleq@pc ~/project> git-fetchmodules major     + '[' -z major ']'     + branch=major     + git submodule foreach pbranch     Entering 'submodule'     /usr/lib/git-core/git-submodule: 1: eval: pbranch: not found     Stopping at 'submodule'; script returned non-zero status.      My guess is that `git submodule foreach` utilizes eval (according to the documentation), which I don't use correctly in this context. There are billions of examples of how to use this command with "inline callback" but I couldn't found a single one with the callback in form of the function. Any idea how to solve this?


How to find what thing make a cycle in systemd

when boot with systemd, my system display this message:               systemd[1]: Found ordering cycle on basic.target/start     systemd[1]: Walked on cycle path to sysinit.target/start     systemd[1]: Walked on cycle path to local-fs.target/start     systemd[1]: Walked on cycle path to udevd.service/start     systemd[1]: Walked on cycle path to basic.target/start     systemd[1]: Breaking ordering cycle by deleting job local-fs.target/start      I cannot find any solution for this Any suggestions please


Rename directory from within directory?

How would I rename a directory from within that directory? For example:               ~/tmp $ rn tmp2     ~/tmp2 $       I can do that with: cd .. && mv tmp tmp2 && cd tmp2, but not sure how to make it into one command.


Xinput device disable doesn't work for all mouses

There are 2 mouses connected to one computer and I want to disable them. I tried to do it using xinput. It works for one mouse (OM), but it doesn't for second (SIGMACHIP Usb Mouse). Second mouse is disabled only for a moment and after about minute it works again. Both mouses are on USB. I checked it on 3 different computers and it acts the same (ubuntu 12.04). Is there other way to disable mouse for lets say 2 hours and then turn it on again?               adm@l:~$ xinput     ⎡ Virtual core pointer                      id=2    [master pointer  (3)]     ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]     ⎜   ↳ SIGMACHIP Usb Mouse                       id=10   [slave  pointer  (2)]     ⎜   ↳ OM                                        id=9    [slave  pointer  (2)]     ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]         ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]         ↳ Power Button                              id=6    [slave  keyboard (3)]         ↳ Power Button                              id=7    [slave  keyboard (3)]         ↳ Logitech Logitech USB Keyboard            id=8    [slave  keyboard (3)]     adm@l:~$ xinput set-prop 9 "Device Enabled" 0     adm@l:~$ xinput set-prop 10 "Device Enabled" 0


shebang line not working with cr-lf

Why are the shebang parts of the following elementary scripts not working:               $ cat hello.sh     #! /bin/sh     echo Hello     $ ./hello.sh     bash: ./hello.sh: /bin/sh^M: bad interpreter: No such file or directory          $ cat hello.py     #! /usr/bin/env python3     print("Hello")     $ ./hello.py     : No such file or directory      whereas calling the interpreter manually is working:               $ sh hello.sh     Hello     $ python3 hello.py     Hello      * * * **NOTE:** I wanted to search for this on unix.SE but I didn't find a direct answer, and solved my problem myself. I thought I'd share what I learnt Q&A-wise for others since I have seen http://stackoverflow.com/help/self- answer. But since I'm new to unix.SE, I initially did not have 15 reputation to get the "Answer your own question" option (though I have more reputation at other SE sites) and hence posted the answer along with the question. Now I have edited it and made it a separate answer. (This note should provide the context for the comments below.)


Arch Linux Live USB no longer booting UEFI

My Lenovo laptop is running Arch Linux with a UEFI GPT partition table. One day I powered up my laptop, but couldn't get passed the Lenovo boot screen. I used a USB stick to boot up and reinstall Arch. However after this I still couldn't get passed the Lenovo boot screen. I tried to reinstall it again using the same USB stick and ended up with two entries in my UEFI boot menu. I formatted the GUID partition to FAT32 using GPARTED live USB which deleted them. However I can no longer use my Arch UEFI USB stick to boot up. I get to the bootloader menu on the USB stick but after the timeout I get a blank screen.


Recovering data from a damaged hard-drive: the "freezer trick"

I'm currently in the business of recovering data from a damaged---and dying--- hard-drive (check this question for background info). The drive was dropped while the system was running; and while foolishly I was trying to run `testdisk` on it, I started hearing---what I assume is---the "click of death". Now I have read in several places about the "freezer trick" (e.g. on AskDifferent, on Unix SE, on AskUbuntu). The crux of it is as follows (but do read the full instructions!):   * Place the damaged hard drive inside of a ziploc freezer bag, so that no moisture gets in. (Use two or even three bags, and note that the bags do NOT need to be isotherm.)   * Place the wrapped hard drive in the freezer   * Leave the hard drive in the freezer for at least 12 hours    * Then connect the drive to the computer and start copying data   * At some point, the hard drive will fail again. When it does, redo the procedure until all data is copied or the drive dies. (As per Harddrive in the freezer ever work for you? on SuperUser, two alternative-medicine remedies to try before freezing are: (1) "Place the hard drive on a smooth surface. Grab the ends and physically spin the whole unit around", "just spinning the unit sharply along the axis of the blades" and (2) "In situations where the head has crashed, you can temporarily get it up and running by turning the drive upsidedown. Keep the drive upsidedown while you back up your files.") **Question** : Is **freezing** a legitimate strategy to rescue data from a dying hard-drive? Or is this simply a fancy way to definitively brick your disk? And if this is legit, should one attempt it _before_ trying `ddrescue`, _after_ trying `ddrescue`, or should I combine the "freezer trick" with `ddrescue` (and an associated log file)?


How to cycle clients

I want to be able to cycle clients within a single tag (screen). I know I can swap clients by using `awful.client.swap.byidx` but that moves focus rather than the client. Say I have three windows:               +---------+-----+     |         |     |     |         |  2  |     |         |     |     |   1     +-----|     |         |     |     |         |  3  |     |         |     |     + --------+-----+      And I want to cycle each one into the "1" spot. So "1" would go to "2", "2" would go to "3", and "3" would go to "1". Does that make sense I know I've seen something like this, but can't find it now.


How to randomly sample a subset of a file

Is there any Linux command one can use to sample subset of a file? For instance, a file contains one million lines, and we want to randomly sample only one thousand lines from that file. For random I mean that every line gets the same probability to be chosen and none of the lines chosen are repetitive. `head` and `tail` can pick a subset of the file but not randomly. I know I can always write a python script to do so but just wondering is there a command for this usage.


Find and Replace in wordpress postings

I have a wordpress blog with 93 posts on it, in which I want to replace `[bash]` with `<pre>` but how do I do it please? I need to go through all the posts changing `[bash]` to `<pre>` in each one, but the `[bash]` doesn't appear in every posting but it is in quite a few, too many to do it by hand with one post after another, I'd rather do it in batches if possible. I believe the posts are stored in a MySQL database, but I can't remember why I believe so!


download multiple files from sourceforge

Is there any way to download / mirror a folder structure with **many** files from sourceforge using wget/curl/similar tool? I've seen some examples using rsync or scp but I think that works only for SF project owners (cause it needs login, password and filesystem path).


How to install Empathy on CentOS 6.0?

I'm a very new CentOS user. I came from Ubuntu. I need to install Empathy on my CentOS PC. Can anybody explain how to do that?


Winscp giving error for delete, move etc

I can login via winscp to my server I can move around the folder but when I try to delete or even download or upload files it keep showing me this error.               General failure (server should provide error description).     Error code: 4     Error message from server: Failure     Request code: 3      I tried this command df -h               Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/VolGroup00-LogVol00                           112G   47G   60G  44% /     /dev/sda1              99M   37M   57M  40% /boot     tmpfs                 3.0G     0  3.0G   0% /dev/shm


pager program like less, able to repeat top N lines

Is there any way to make `less` program repeat first line (or first 2 lines) on every displayed page? Is there any other pager program which can do this? This would be a killer-app for database table browsing, think `mysql` or `psql` or `gqlplus`... For those of you who don't get the idea, see the screenshot in the bottom of this page. I want to repeat header line + horizontal ascii bar.


VIM jump from one xml tag to the closing one

Is there a shortcut to jump from , e.g `<XX>` to `</XX>` ? I already give it a try with '%' , but it doesn't work for this situation.


How to disable IPv6 on OpenBSD?

I'm sure that in my network I will not use IPv6 only IPv4. So according to the KISS principle I will need to disable it. How can I do it? OS is OpenBSD 5.1.


Is there any handy command line tool to manage Cron jobs?

Would someone suggest any handy command line (NOT web) tool or script which adds, enables and disables Cron jobs? I am looking, for example, for the following (or similar) behavior:               sh manageCron.sh -idJob 'job1' -addJob '* * * * * <do some job>'     sh manageCron.sh -dissableJob 'job1'       crontab -e command is good for manual editing of crontab file, but I need to automate.


How do I run a program only once per day, while accounting for variable uptime and possible failure of program?

I need to run a command once, but only once, per day, until it succeeds. Continuous uptime cannot be expected, and program success cannot be guaranteed. This program requires network access, but not every time I start my computer with network access. My program will exit with, e.g -1 unless it succeed ( which returns 0 ).


Is Native Language Support (NLS) kernel support still necessary?

Does ext4 / cifs system need kernel NLS support ? I'm not sure if it's being handled by user-space program (decoding / encoding) ?


What is the difference between kernel drivers and kernel modules?

When I do a `lspci -k` on my Kubuntu with a 3.2.0-29-generic kernel I can see something like this:               01:00.0 VGA compatible controller: NVIDIA Corporation G86 [Quadro NVS 290] (rev a1)         Subsystem: NVIDIA Corporation Device 0492         Kernel driver in use: nvidia         Kernel modules: nvidia_current, nouveau, nvidiafb      There is a kernel driver `nvidia` and kernel modules `nvidia_current`, `nouveau`, `nvidiafb`. Now I wondered what might be the difference between Kernel drivers and Kernel modules?


Reading two files into an IFS while loop -- Is there a way to get a zero diff result in this case?

I have a text file full of several hundred lines of sequences like this:                        b 29.         b 52.         c 84.         c 83.         c 94.         c 93.         c 61.         b 38.         c 81.         c 92.         c 28.         c 37.         c 27.              lara@batcuter:~/.asd/a-new-way-of-studying-go$ wc -l game7         271 game7      and the following script, which separates a text file into two files, one of which consists of odd-numbered lines and one of which consists of even- numbered lines, then reads both files into a while IFS loop, printing a line from each at a time:               #/bin/bash     #testing liquor-where-twin-twas-born          awk '{print>"line-"NR%2}' $@          while IFS= read -r lineA && IFS= read -r lineB <&3; do       echo "$lineA";       echo "$lineB"      done <line-1 3<line-0      which unfortunately gives something not quite the same as the input file, due to the fact that one file was one line longer than the other.                        lara@batcuter:~/.asd/a-new-way-of-studying-go$ testing-liquor game7 > test         lara@batcuter:~/.asd/a-new-way-of-studying-go$ diff test game7         270a271         > b 7.           Obviously, since the file is 271 lines long, splitting it in half yields two files, one of which is 136 lines, and one of which is 135 lines. I need to fix the IFS while loop to return zero differences. At first, I thought using `read ... || read ...` would help. But actually, that just bloated the output, inserting more than a single a newline between each entry, and shaving off the last line (the line that ended up in the file with the odd number of lines), as did all the other solutions I tried.


Is really need Internet connection after installed all pkgs?

I know when you want to Install any new pkg then internet connection is required .right now I am using Ubuntu 12.04 I have Internet connection. using following command I installed one pkg.(e.g vlc player)                $sudo apt-get install vlc      Installed successfully. after that I **remove/purge** pkg then internet connection disconnect and tired installing same pkg again using                $sudo apt-get install vlc        Installed successfully. so my question is when you install any pkg that time internet is required but for this scenario why not required? any concept behind that? I searched on Google but not getting specific answer.


Start and stop bluetooth service automatically as rfkill switch changes

I would like to start / stop bluetooth service automatically when I turn on / off rfswitch, is that possible ?


SSHD Password Feedback (Show Asterisks for Characters)

Is it possible to have SSHD show asterisks for the password characters much like `pwfeedback` does for sudo? I am using CentOS 6.5. For example: ![if I type something here, show *****](http://i.stack.imgur.com/IA6oi.png)


Create a fake read only device like file with incrond

I need to generate UUID with `uuidgen` (not through any function call, but external command, because processes which will read the file cannot call any APIs or external commands directly). My idea is to create an `incron` job which regenerates content of file on read (`IN_ACCESS` operation). So that whenever the file, monitored by `incrond` is read, a script overwrites its content with new UUID:               #!/bin/sh     /usr/bin/uuidgen > file_to_be_monitored_and_read      My questions:   * Is there another way to create such a device like file?   * What problems can arise if multiple processes try to read from the file in about the same time? Will `incrond` and script be able to regenerate the content quickly enough?


trac ldapplugin ERROR: LDAP error: Operations error

on version 0.10.4 on centos 32 bit using python 2.4 i am trying to install and use ldaplugin to assign permissions to users and groups in AD. i have followed this guide http://trac-hacks.org/wiki/LdapPlugin#Configuration and have the following settings apache               <LocationMatch "/trac/[^/]+/">             AuthType Basic             AuthName Trac             AuthBasicProvider ldap             Order allow,deny             Allow from all     #        AuthLDAPURL "ldap://echo.uk.domain.com akutan.usa.domain.com/ou=Sites,dc=domain,dc=com?sAMAccountName"             AuthLDAPURL "ldap://echo.uk.domain.com akutan.usa.domain.com/ou=Sites,dc=domain,dc=com?userPrincipalName"             AuthLDAPBindDN cn=Administrator,cn=Users,dc=domain,dc=com             AuthLDAPBindPassword ******             AuthzLDAPAuthoritative off             require valid-user     </LocationMatch>      trac.ini               [notification]     always_notify_owner = true     always_notify_reporter = true     always_notify_updater = true     mime_encoding = base64     smtp_always_bcc =     smtp_always_cc = sharif.uddin@domain.com     smtp_default_domain = domain.com     smtp_enabled = true     smtp_from = trac@domain.com     smtp_password =     smtp_port = 25     smtp_replyto = support@domain.com     smtp_server = hero.uk.domain.com     smtp_subject_prefix = __default__     smtp_user =     use_public_cc = false     use_short_addr = false     use_tls = false     #ignore_domains = domain.com                    [ldap]     enable = true     global_perms = true     host = echo     basedn = dc=domain,dc=com     #user_rdn = ou=sites     #group_rdn = cn=users     store_bind = true     bind_user = Administrator@domain.com     bind_passwd = ******                    [trac]     permission_store = LdapPermissionStore               [logging]     log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s               [components]     webadmin.* = enabled     ldapplugin.* = enabled     ldapplugin.api.ldappermissiongroupprovider = enabled     ldapplugin.api.ldappermissionstore = disabled     ticketdelete.* = enabled     tracopt.ticket.deleter = enabled      Error I receive is               Trac[paradox:api] ERROR: LDAP error: Operations error     Trac[paradox:api] ERROR: LDAP error: Operations error


Replace all files except one with rsync

I'm currently using `rsync` as follows               rsync -az --delete ...      What option can I use with `rsync` to replace all destination files that already exist except for one specific file that should not be replaced if already exists? Sure, if the file doesn't exist at the destination, it should be put there.


Dropbox/Copy.com & Truecrypt

I have a partition that contains all my personal stuff, which is mounted at boot under `/home/myuser/foo`. I would like to synchronize it on the cloud via Dropbox or Copy.com, but I don't trust them, so I have to encrypt the data in some way. I'm a Truecrypt newbie, but, as I understood, it creates a "volume" when opened, and the data is clear only in ram, which is great. The problem is that this volume is seen as a single file by the Dropbox/Copy.com client, so when I change something, as little as a text file, it will attempt to upload again the whole encrypted "volume". There is some way to encrypt my data and upload it in security?


SSH through router to internal file server

This is a real beginner question, I know. But I really don't seem to be able to wrap my head around the terminology to get what I want working. And since I want to do this on a router that 40-50 people rely on for internet, my usual approach of breaking things until it works is also not going to work. So here's what I want to do. I have a router (a Debian box with shorewall) with a static IP `cable.example.com`. I have an internal fileserver assigned `192.168.0.3`. I can currently `ssh` into the router, and from there `ssh` into the filesever. However, I want to make the fileserver available externally for both myself and others with a typical `sftp` client. Could someone at least give me an idea of what I'm looking for? Tunneling out, tunneling in, port forwarding, iptables – they all seem to describe what I want to do, but I can't get a firm idea of how to get it to work.


Force a specific frequency from my wireless card

How can I make my wireless card emit a specific frequency (the ones that it is capable of physically)? I am aware that a kernel module can help (please correct if I am wrong) but am looking for something like a command line tool. How can I find the exact upper and lower limits? As the driver interacts with the device, hence kernel should have access to this information (although I understand this could be a soft limit. Is there a way to get the hard limit as I would like to avoid digging into the manufacturing details) [Motive: Disrupt functioning of remote control at home (I know I can just take out the cells, but I want to do this in a grand way :P)]


how to enable sound support in linux kernel without recompile?

I have recently compiled linux kernel 3.2. But at time of compiling in make menuconfig, I had disabled sound support. Now, I want to enable it without recompile it. I don't want to use stock kernel or direct kernel image, I always wanted to use compiled kernel.


Virtual mouse is ignored by xorg when loaded

I'm trying to run virtual mouse driver from book "Essential Linux Device Drivers" but when I'm load this module into kernel using insmod in /var/log/Xorg.0.log I see:               [   757.212] (II) config/udev: Adding input device  (/dev/input/event10)     [   757.212] (II) No identifier specified, ignoring this device.      How can I force Xorg to don't ignoring this device? or what I must add to kernel module code?


relation between unity on ubuntu and unity game engine?

I am just curious to know if there is any kind of relation between Unity(the latest shell interface for gnome in ubuntu) and the Unity game engine, apart from having the same name ? I'm no expert in any of these. I saw my friends developing gesture recognition based software using Unity game engine and I use Ubuntu 12.04(uses unity interface) for everything.


Debian Netinst - why apt is downloading Libre Office when I'm installing Gnome?

I have Debian. I was installing it from netinst to save disk space and network transfer (small partition, UMTS connection). I decided to install Gnome. When I typed: `apt-get install gnome` it started downloading big things like Libre Office, Gimp... I really don't like it.   1. Why Debian developers assume I need Libre Office or Gimp when I'm installing Gnome? Or I missed something?   2. How can I install Gnome and only REALLY required packages?