Colors for menu bar and the scroll bar on emacs 24

I'd like to change the colours of the menu bar and the scroll bar of emacs 24. The instructions of EmacsWiki (the above links) do not work. This might be because I am using emacs 24. According to the page ColorTheme on EmacsWiki, emacs 24 has a new colour system, so I tried some colour themes and to modify them. (Menu bar→Options→Customize Emacs→Custom Themes) But I could not find the faces which I should customise. **Could you tell me how to change the colours of the menu bar and the scroll bar of emacs 24?** Environment: openSUSE 12.3, KDE 4.10.5, Emacs 24.2.1 (x86_64-suse-linux-gnu, GTK+ Version 3.6.4)


Recursive wget eventually starts failing with "Unable to resolve host" / "Temporary failure in name resolution"

When recursively `wget`-ting a fairly large site, after downloading 18 MB or so, `wget` starts complaining "Unable to resolve host" and/or "Temporary failure in name resolution", even though I can look up the host just fine with `host` or `dig`. On the advice of various fora, I tried:   1. commenting out the `hosts` line in `/etc/nsswitch.conf`   2. replacing potentially dodgy nameservers in `/etc/resolv.conf` with Google's `8.8.8.8` and `8.8.4.4`   3. explicitly adding the name to `/etc/hosts` It doesn't seem to matter whether or not I set `\--no-dns-cache` in the `wget` command line; the same thing happens. I can't tell if `wget` is eventually going to finish, or if it's going to stay stuck in this state. It'd be nice if it finished, since I need it to `\--convert-links`. I'm running `wget` 1.11 (compiled from source, because 1.12 and later have broken the behavior of `\--no-clobber` with `\--convert-links`, at least for my purposes) on a Linux Mint 14 system. What causes this? Is there a way to fix it?


In Unix speak what is the difference between a shell script and an executable?

I have seen this question on this site and this prompted me to ask this question . I want to know in Unix speak what is the difference between an executable and a shell script ?


Difference between environment variable and shell variable

It is said that environment variables are inherited in child processes but shell variables are not. However the following test shows shell variables are seen in child process just as environment variables. What is the difference?               > bash --version     GNU bash, version 3.2.39(1)-release (x86_64-suse-linux-gnu)     Copyright (C) 2007 Free Software Foundation, Inc.     > export TEST="ENV_TEST"    #env var     > sh -c "echo \$TEST"     ENV_TEST     > TEST="SHELL_TEST"         #shell var     > sh -c "echo \$TEST"       #shell var is seen in child process     SHELL_TEST


Shell script fails: Syntax error: "(" unexpected

I've been working on a script that automates setting up a development environment for Raspberry Pi development (step by step details that work are here). The script is linked in that article but convenience you can find it here also. Now when run this script install and sets up the environment without error but you have to enter your sudo password more than once due to sudo's time-out value by default. So I started experimenting by removing all the sudo lines and running the whole script via sudo at the command line like so:               kemra102@ubuntuvm:~$ sudo ./pi_dev_env_install.sh      This works fine as expected and gets most of the way through until this point:               ./pi_dev_env_install: 68: ./pi_dev_env_install.sh: Syntax error: "(" unexpected      Now this line worked fine previously when not running the whole script with sudo. There is nothing about this line running as sudo that should stop it working to my knowledge, does anyone have any ideas?


Indicate mute/unmute with i3status

Is there a way to indicate if the sound is set to mute or not using `i3status`? I know how to show the volume (as explained in `man i3status`), but it doesn't distinguish between mute or just 0% volume.


Trying to "locate" and then open a file

Suppose that I have a file named `filename123.txt` and it is the single file that is named so, and I can `locate` it with the command `locate filename123`. And it returns only this file. Now I want to open it with `vi`/`vim`. But I don't want to go to that location and type the `vi` command followed by filename. Here I want the result of `locate filename123` to be appended to the vi command. How can I do so? I already tried:               locate filename123 | vi      But this does not works. And this error comes in terminal:               santosh@santosh:~$ locate filename123 | vi     Vim: Warning: Input is not from a terminal     Vim: Error reading input, exiting...          Vim: Finished.                         santosh@santosh:~$


How to restore GRUB after windows XP installation?

After I've installed windows xp for dual booting, I need to restore grub of my archlinux installation. I did it a lot of times with windows 7, but this time heavens decided to torture me. I have opensuse liveKDE usb drive inserted into my laptop. My currect drive is /dev/sda with /dev/sda1 -> archlinux /; /dev/sda2 -> /home; /dev/sda3 -> windows xp. In liveKDE konsole I mount my /dev/sda1 to /mnt/arch, chroot /mnt/arch /bin/bash and run grub. Trying root (hdX,Y) I get "selected disk does not exist". So I try grub-install /dev/sda, which gives me "Not found or not a block device". I have tried other variants like grub-install.unsupported /dev/sda, which gave me "/dev/loop0 does not have any corresponding BIOS drive", arrrr! I'm out of options here, does anybody have an idea of some competent liveCD to start with. I tried Super Grub Disk, didn't work cause it froze all the time. Tried Rescatux but it does not have grub available in terminal.


Route VPN traffic through socks proxy

There is no way to set proxy on an unrooted Android, but there is an option to connect to VPN. In my network VPN connection is not allowed! so I am looking for a way to run a local VPN server on my computer and route it's traffic through a socks proxy (in a way that when I connect my android device to this VPN all my traffic routed through this socks proxy). What's the options?


Does my Ubuntu have module for USB 2.0?

I copy some files between my external HDD and Lenovo T400 laptop. The external HDD is 7 years old and has "USB 2.0" on its enclosure, and the laptop is 3 years old. The copying speed is mostly 8.3MB/sec, and no more than 10MB/sec. I wonder if there is module for USB 2.0 loaded? If not, how shall I get one? The output of `lsmod | grep hci` is               firewire_ohci 40172 0     firewire_core 56906 1 firewire_ohci.       I guess both are about firewire not USB. Note `lsmod | grep HCI` returns nothing. Thanks!


Convert formatted dates to seconds since the epoch

I have a file:               pablo tty8 Thu Nov 1 12:51:21 2012 still logged in      (unknown tty8 Thu Nov 1 12:50:57 2012 - Thu Nov 1 12:51:21 2012 (00:00)      pablo tty2 Thu Nov 1 12:50:39 2012 still logged in      pablo tty7 Thu Nov 1 12:49:45 2012 - Thu Nov 1 12:50:56 2012 (00:01)      (unknown tty7 Thu Nov 1 12:34:32 2012 - Thu Nov 1 12:49:45 2012 (00:15)      I want to replace the file in the above date for a second. I want to print:               pablo tty8 1351770681 still logged in      (unknown tty8 1351770657 - 1351770681 (00:00)      pablo tty2 1351770639 still logged in      pablo tty7 1351770585 - 1351770656 (00:01)      (unknown tty7 1351769672 - 1351770585 (00:15)      I tried this command:               gawk --posix 'function my()     {"date -d \047"$0"\047 +%s" | getline b;      gsub( /[A-Za-z]{3} [A-Za-z]{3} [0-9] ([0-9]{2}:){2}[0-9]{2} [0-9]{4}/,b );print}     { my() }' file      The above command does not work:               $ gawk --posix 'function my()     > {"date -d \047"$0"\047 +%s" | getline b;      > gsub( /[A-Za-z]{3} [A-Za-z]{3} [0-9] ([0-9]{2}:){2}[0-9]{2} [0-9]{4}/,b ); print}     > { my() }' ta     date: błędna data: `pablo tty8 Thu Nov 1 12:51:21 2012 still logged in '     pablo tty8  still logged in      (unknown tty8 1351897200 - 1351897200 (00:00)      date: błędna data: `pablo tty2 Thu Nov 1 12:50:39 2012 still logged in '     pablo tty2 1351897200 still logged in      date: błędna data: `pablo tty7 Thu Nov 1 12:49:45 2012 - Thu Nov 1 12:50:56 2012 (00:01) '     pablo tty7 1351897200 - 1351897200 (00:01)      (unknown tty7 1351897200 - 1351897200 (00:15)      How to improve the above command?


Mutt scripting: interactive dialog macro using `dialog`

I would like to do the following:   * Press a macro combination   * Enter a script of my own making (Python) which has user interaction (think: UNIX `dialog` utility for shell scripts)   * Do some processing based on the dialog response   * Run some _other_ `mutt` macro based on the dialog response (e.g. if X, do Y; else do Z) Is this possible?


Trouble RDPing to Windows 7 Service Pack 1 from Remmina Remote Desktop

After adding Service Pack 1 to my work computer, I get permissions errors when trying to RDP to work. I have no issues if I'm using the Microsoft Remote Desktop client. I'm using Ubuntu 10.10 with Remmina Remote Desktop (I'll add the version when I get home, whatever is default in the base repository). Remmina (which is really nice, btw) uses FreeRDP. I can't seem to find any other reports of this. Anybody have an suggestions? Here is the screenshot (edit: not enough rep to post image, transcribed). And yes, I ignored the fact that it works on the MS client and checked that the permissions it asks for were fulfilled. > To log on to this remote computer, you must be granted the Allow log on > through Terminal Services right. By default, members of the Remote Desktop > Users group have this right. If you are not a member of the Remote Desktop > Users group that has this right, or if the Remote Desktop Users group does > not have this right, you must be granted this right manually. I really don't want to reboot into Windows 7 or run a VM just to RDP to work. Thanks in advance.


How to move rc.conf HARDWARE section to /etc/modules-load.d/?

I've just begun moving my Arch system to systemd, and started by moving the deprecated parts of rc.conf to their respective configuration files. The rc.conf wiki article lists files for most options, and I assume I should just move the relevant lines from rc.conf to those files. But what about the HARDWARE sections? A directory is listed there: /etc/modules-load.d/.


Overriding the shade of color displayed

I have to work on systems which display some colors that are hard to read. I ssh into these systems, but don't have _management permission_ to change the colors they display. Is there any way I can override the shade's of colors in my terminal emulater? (I use `konsole`)


How to get size of a block special file?

I need to be able to determine the size of a block special file. For example, given `/dev/sda`, I need a command that will provide the size of the device. (By size I mean capacity, since this is a storage device.) * * * **Rationale:** I can store information in the device with:               echo "12345" >/dev/sda  # needs to be run as root      _(Don't run that command by the way... unless you don't care about your data.)_ However, I need to know how much data I can store on the device and I don't know how to do that.


How to escape a Whole Variable?

In the answer of thisquestion: https://superuser.com/questions/163515/bash-how-to-pass-command-line- arguments-containing-special-characters It said that we have to put an arg of a function in Doublequotes to escape the entire argument (as in `"[abc]_[x|y]"`). But what if the special character is `"` at the start (`"[abc]_[x|y]"`), we can't do the following:               program  ""[abc]_[x|y]"  anotheragument      How can I escape the `"` in this case?


How to configure Ethernet in Gentoo on s390x?

I've booted from SLES 10 SP2 CD and installed Gentoo. Now I'm trying to make Ethernet work (it is working in SLES). I found this document, but in current kernel (2.6.38.2) sysfs layout is some different, for example, there is no `parameters` file in qeth device directory, but it have separate file `portname`. After `echo 0.0.0100,0.0.0101,0.0.0102 > /sys/bus/ccwgroup/drivers/qeth/group` sysfs contains new directory `/sys/devices/qeth/0.0.0100` with few files and directories inside. File `portname` contains "no portname required". But when I'm trying to write 1 to file `online` it says:               -bash: echo: write error: No such device      I also tried to write "OSAPORT" to `portname`, 0 and 1 to `layer2` with no success. I still can not create `eth0` interface. What am I missing and how to corretly make `eth0` configured at boot time in Gentoo?


grub-install from live CD

I have removed my MBR by mistake. Now I can't boot Ubuntu, so I want to reinstall grub. I'm getting this error:               grub-install --boot-directory=/media/cab64688-2d97-4bbd-9f32-7bc0badb40a8/boot /dev/sdb     rm: cannot remove `/media/cab64688-2d97-4bbd-9f32-7bc0badb40a8/boot/grub/915resolution.mod': Read-only file system      So, the problem is that my existing Ubuntu partition is mounted read only. When I try:               sudo mount /dev/sdb7  /media/ubuntu_mpt     mount: block device /dev/sdb7 is write-protected, mounting read-only      So I failed to install grub since I'm in read only mode. Any ideas? **EDIT:** After apt-get install grub, I repeated the process and got:               Probing devices to guess BIOS drives. This may take a long time.     Unknown partition table signature     sed: can't read /media/cab64688-2d97-4bbd-9f32-7bc0badb40a8_/boot/grub/device.map: No such file or directory     grep: /media/cab64688-2d97-4bbd-9f32-7bc0badb40a8_/boot/grub/device.map: No such file or directory     /dev/sda does not have any corresponding BIOS drive.


How to inject keystrokes via a shell script?

I'm trying to inject keystrokes into the input daemon so as to simulate typing from a Bash script. Is this possible, and if so, how can I make it happen?


How to give apache web directory access to other FTP user where parent directory is restricted

I tried hard but not able to give access of web directory to other user for FTP. Below are the directories which are under directory `/var/www/html`               1) nice_call     2) poor_call     3) great_call      /var/www/html is owned by apache user as well as all above mentioned directories is also owned by apache. I just want to give read+write access to one more user named as `ftp_user` for directory `poor_call` not for other directories. I am also ready to give 777 access to directory `poor_call` to resolve this issue. Please note that I am having root access to execute any command to resolve this issue.   It will be great if someone can help on it.parent-directory


SFTP with Mysql user pass instead of PAM

Is there a way for people to log onto a debian server via sftp using just mysql database table as authentaction. IE not adding a user to the system? I know it can be done over ftp and TLS but i really dont want to use that method Thanks


symbolic link to a large file

I have a large(1 TB) file that I would like to download from the centos server via http, should I create a symbolic link to the file to the http file directory? would the link work? the file is too large to be copied over given the server hdd. if not, what are the alternatives?


Change size of system console as user

At uni, I'm using a terminal to log into a text console of some unix server. As the monitors are 17" and the console is displayed full screen, it's a bit annoying to look at the screen with the default column and row size. Is it possible, as a user, to change the size of the console, either by increasing the number of rows & columns or by even decreasing the used resolution if the monitor (i.e. adding an unused border around it)?


what is the difference between X11 and Xlib?

I am not sure if I have got it right. Xlib is a library to interact with X server. X11 is just another name for X server. Is X server just a single library? if so, why we can't access it directly? why we need Xlib? Thanks in advance


Why can't I run GUI apps from 'root': "No protocol specified"?

I installed debian onto my machine last night. Now, I don't understand why I can't run GUI apps from a terminal when running as root. For example:               sudo -i     glxgears      Generates the following output:               No protocol specified     Error: couldn't open display :0      But when I first open the terminal I can run `glxgears` from the user account. Its only after I do `sudo -i` that the problem crops up. This happens for any GUI app that I try to run. I think its probably related to X11, but I'm not sure.


How to list all the files which were not created on Thursday

I need to delete old backups but I only want to keep Thursday Backups and delete the rest of the backups. Give me some kungfu tips. I'm on RHEL if that makes a difference.


Cant create encrypted partitions during Debian installation

I am using debian 7.4 cd. When I set a partition as '/' during manual partition.It is fine. However when I then try to use it as 'physical volume for encryption'...everything works fine it erases and writes random data BUT THEN mount point '/' disappears! . And when I try to proceed with installation,it says "NO root file system is defined.Please correct this from partitioning menu" And when I try to make '/', I cant modify the partition to be used as '/' because it says-"No modification can be made.In use as physical volume for encrypted volume" I am following these instructions:http://www.debianuserforums.org/viewtopic.php?f=9&t=460


Best usb boot drives for Linux?

I am looking for a buyer's guide on usb boot drives that will be used for booting Linux distros. Specifically, I have the following concerns:   * Should I opt for USB 2.0 or 3.0?   * Are there size limitations, like 2GB vs 8GB vs 16GB?   * Are there specific brands to favor or avoid? (ie formatting issues)   * Does the physical style have any affect? Any other considerations are more than welcome. I have been considering the Kingston Digital DataTraveler SE9 16GB USB 2.0 in particular. I will likely be using UNetbootin to add the distros. This will be used to explore new distros and portable booting.


VPN error 619 - "A connection to the remote computer could not be established."

Have been trying to get this PPTP VPN working on a CentOS 6 x64 VPS for a few days but im getting: > "Error 619 - A connection to the remote computer could not be established." I did research on Google and most of the time it was due to routers not allowing VPN passthrough or whatnot, however I have another CentOS VPS setup exactly the same (used the same guide to set it up) and it works perfectly.. I did find some error messages in the "/var/log/messages" log that I looked up on Google but couldn't find any results on how to fix it. Hopefully someone else could help me out with this. > Mar 8 20:14:50 direct pppd[1507]: pppd 2.4.5 started by root, uid 0   >  Mar 8 20:14:50 direct pppd[1507]: Using interface ppp0   >  Mar 8 20:14:50 direct pppd[1507]: Connect: ppp0 <--> /dev/pts/1   >  Mar 8 20:15:20 direct pppd[1507]: LCP: timeout sending Config-Requests   >  Mar 8 20:15:20 direct pppd[1507]: Connection terminated.   >  Mar 8 20:15:20 direct pppd[1507]: Modem hangup   >  Mar 8 20:15:20 direct pppd[1507]: Exit.   >  Mar 8 20:15:20 direct pptpd[1506]: GRE: read(fd=6,buffer=611860,len=8196) > from PTY failed: status = -1 error = Input/output error, usually caused by > unexpected termination of pppd, check option syntax and pppd logs   >  Mar 8 20:15:20 direct pptpd[1506]: CTRL: PTY read or GRE write failed > (pty,gre)=(6,7)   >  Mar 8 20:15:20 direct pptpd[1506]: CTRL: Client 76.177.167.162 control > connection finished It seems to be working correctly up until "LCP: timeout sending Config- Requests"


Does named pipe modify the filesystem?

As title. If I create a named pipe and then read/write on it, is the filesystem where the named pipe resides affected? I.e. is the data buffered on the filesystem until read, or does it reside in memory only?


Fedora won't start after update

About 1 month ago I installed the newest version of Fedora, so that I had both Windows and Fedora on one machine. Today it showed me that update are available and I should restart. After installing the updates Fedora tried to boot again, but unfortunately it won't start anymore: After the loader (fedora logo) I only get a black screen instead of the login. The same happens when I chose "Fedora rescue". Fortunately Windows still works. Update: My graphic card is AMD Radeon™ HD 5000 Series.


.forward file username and folder separator

I found (I'm learning how e-mail works) a `.forward` file in a user home folder; emails should be forwarded to mailboxes of other users. Email addresses are written in `user+folder` addressing notation, but instead of a `+` sign I found `-` sign; if I would like forward a spam message to Spam folder of a `user` I would write `user+Spam@domain.com`, but I found `user- Spam@domain.com`. The file contains email addresses in form: This is an email server using Postfix.               user1-folder@domain.com`      user2-folder@domain.com       userN-folder@domain.com      Is there any difference?


Setting up diskless workstation for multiple clients

I have mostly everything working except I'm not sure how to handle /var. If I set R/W on the kernel parameter, everything works as expected.               append initrd=/images/fedora/initrd.img-2.6.38-8-generic.nfs root=/dev/nfs rw nfsroot=10.129.1.113:/admin/linux/fedora/root      However, I don't want that, I want each workstation to have its own `/tmp` and `/var`. What options do I have? The issue I'm currently facing is that Ubuntu is expecting existing directories inside `/var/lib`. I've added a line in my fstab for `/var/lib` but since it's not already there, Gnome refuses to boot. Here's my `fstab` file.               proc            /proc           proc    defaults        0       0     /dev/nfs       /               nfs    defaults          1       1     tmpfs       /dev        tmpfs   defaults    0   0     tmpfs            /tmp            tmpfs   defaults        0       0     tmpfs           /var/run        tmpfs   defaults        0       0     tmpfs            /var/lock       tmpfs   defaults        0       0     tmpfs           /var/tmp        tmpfs   defaults        0       0     tmpfs           /var/log        tmpfs   defaults        0       0     #tmpfs           /var/lib        tmpfs   defaults        0       0


Remind syntax combining a weekly event with a time range

How should I write "Every Tuesday, Thursday, Friday after 2011 Sep 13, but before Sep 28, with reminder 1 day before event". Now I got `REM Tue Thu Fri 13 Sep 2011 +1 UNTIL 28 Sep 2011 MSG Esem`, but it doesn't seem to work correctly.


Can't boot after installing FreeBSD in VMware Workstation

I'm trying to install FreeBSD 9.1-i386 in VMware Workstation. I'm following the guide in the manual on freebsd.org to do this. When I come to the partitioning part I use the guided setting and it looks as following: ![enter image description here](http://i.stack.imgur.com/y1pYv.png) After this I commit the changes and it passes all the checksums. After this it reboots, I don't know if this is normal behavior or not but I think so. Anyway, when it tries to boot I get the error below. I tried to solve it based on something I found online but it didn't work: ![enter image description here](http://i.stack.imgur.com/bp5Xy.png)


.screenrc setting to make the silence notification to stay

Is there an option for .screenrc file so that the silence message ``<c-a>`_` stays on the terminal until I press any keyboard button?


How do I pass a list of files to grep

I am using `find` and getting a list of files I want to `grep` through. How do I pipe that list to `grep`?


Does mkswap check that a partition is a swap partition before formatting it?

I checked the man page for mkswap and was left confused whether mkswap tests whether a partition is of type 82 before formatting it. Background: I am using Ubuntu 11.04, and I had just set up my swap partition to be encrypted, using ecryptfs-setup-swap, which adds a reference to the encrypted swap partition to /etc/fstab and to the actual partition to /etc/crypttab. The actual partition is referred to by the device name, /dev/sdb1 in my case. If I understand correctly, during boot, the virtual partition is created and formatted as a swap partition, generating a new UUID each time, so it cannot be specified by UUID. This leaves me concerned that if I install a new hard drive or otherwise rearrange the physical drives, mkswap would try to format the wrong partition. If it fails because the partition isn't a swap partition, then no problem, as swap is rarely used. If it succeeds in formatting the wrong partition, then big problem.


Mirror RHEL repositories

I'm attempting to install Spacewalk 1.8 with mrepo and create a mirror of RHEL 5&6 packages to use for frequently spun up development VMs. There are several guides that indicate I should use mrepo with gensystemid to register individual repositories as systems on RHN and then use the entitlements granted to my rhel systems. However gensystemid fails because /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT is not present. It's not clear to me where I get this cert, whether it is included with an official rhel install, or if it is pulled in after using rhn_register, or if this the "key" per se that you purchase with the Satellite product that allows you to mirror? Several unhelpful how-to's say it's included with CentOS and it is not, nor is it present in rhn-tools rpm.


CentOS restore firewall after `service iptables panic`

My friend and I were doing some firewall configurations and in the meanwhile he thought it was a good idea to type `service iptables panic`. Now we cannot put the firewall back on the original state (default). It blocks all connections. We have tried everything:               iptables -F service      iptables save service      iptables stop service      iptables start etc....      What can we do to restore original and clean firewall configurations?


Eval command in unix

Can someone convert this code? I got this from the web. I am new on this and don't know how `eval` works. Originally, there is a parameter from a command that is either a plus (+) sign or a minus (-) sign. But since I only need now the addition (its not in the parameter anymore), I want this to do addition automatically.               -|+) eval '(('jd2=${jd1}${5}${6}'))'     jd2date $jd2      Pardon if the way I am asking is confusing.


How do I resolve the following error during "configure: error: XSLT configuration could not be found"

When compiling Icecast 2, I get this error when I run `autogen.sh`:               $ autogen.sh     ... stuff ommitted     configure: error: XSLT configuration could not be found      What is the reason for it, and how do I fix it?


What does this error mean: "igmp[1435]: setsockopt IP_MSFILTER"?

My network connection is pretty crappy today so I looked at my router (TP-LINK TD-W8950ND) logs and can see these entries a few times every minute:               Date/Time   Facility    Severity    Message     Sep 7 22:26:16  user    notice  igmp[1435]: setsockopt IP_MSFILTER      This router runs on some kind of *nix kernel, so maybe this looks familiar to someone. I wonder if it has anything to do with my poor connection?


Interrupt process in samba share mounted folder breaks mount

I can successfully mount a Samba share on a local folder in Opensuse 12.1:               sudo mount -t cifs -o username=<username>,password=<password> //<win-box>/<share> <mountpoint>      The problem comes if i interrupt (`^C`) for example a long `cp` process in `<mountpoint>`: I get               > cp -r BIG_FOLDER/ /tmp     ^C     > ls     ls: reading directory .: Permission denied      The only solution I found is to `sudo umount <mountpoint>` then mount again. Any advice is welcome!


ssh tunnel on ssh tunnel between Windows and two Linux machines

I have the following configuration and want to establish a tunnel on a tunnel. I read already the following topic: How to put a tunnel in a tunnel? My configuration:               Notebook --> Linux Server A --> Linux Server B      Notebook: Windows XP with putty   Linux Server A and B: Ubuntu 10.10 I have a ssh connection with a tunnel from my notebook via putty to Server A. Now I want to establish a tunnel from Server A to B, so that I can connect with an IDE directly to my jboss on Server B. This is the command I tried on Server A to establish a tunnel:               ssh -t -L 8080:localhost:8080 Server B -p 8822      This won't work. Anybody an idea how to establish a working tunnel?


How to enable SSD TRIM support on Fedora 17?

I used to install Linux on HDD. It's easy. But now I have a SSD, and I want to install Fedora 17 on it. What should I do to make Fedora 17 issue TRIM commands to the SSD?


Cisco AnyConnect on Fedora

I have downloaded the setup for Cisco AnyConnect client from our client's secure web URI. This setup script was for 32 bit machine while mine is a 64 bit one. However, I managed to install the client installing 32 bit dependencies of the AnyConnect. However, now when I try to connect to VPN location, it prompts me for `"Warning: The following Certificate received from the Server could not be verified:"` and provide two options `Disconnect or Accept`. I am accepting that certificate but still AnyConnect is continuously prompting me for this certificate accpetance and after some tries it errors out to be "Timed Out". What can be the reason?


How to average time commands?

I am `time`ing some of my commands. Now to average the measures, I'd like to run and time my commands a specified number of times, and get the results with a calculated mean and standard deviation. The result would be like:               avgtime -n 100 my_command          real    0m5.388s stdev 0m0.068s     user    0m5.380s stdev 0m0.067s     sys     0m0.004s stdev 0m0.000s      Is there a UNIX tool for this? Does GNU/Linux have one?


Exim4 as smarthost with SSL?

I want to use exim4 as a smarthost to send email using an smtp mail account over ssl. I've seen the hosts_require_tls option, but I need SSL and not TLS. How should I do this?


Make awk use bash with the system() command

Is there a way to make awk use bash instead of sh when running system commands using the `system()` call? I want to use some bash-specific features such as [[ ]] and < > string comparison operators:               gawk 'BEGIN {system("if [[ \"porc\" == \"porc\" ]]; then echo yes; else echo no; fi")}'     sh: [[: not found


Bash - Split the previous commands parameters

How would one parse the previous command in bash? **Example:**               root$ ssh foo@1.2.3.4     root$ echo !$ &>/tmp/foo.txt     root$ cat /tmp/foo.txt     foo@1.2.3.4      **Goal:**   Send just the ipaddress `1.2.3.4` to foo.txt * * * I've attempted to used awk, but have not found success               #doesn't work     cat /tmp/foo.txt |awk '{print $2,$3,$4}'       I've also attempted to parse out just the digits using sed               #doesn't work     sed 's/.//p' /tmp/foo.txt      sed 's/[0-9]//p' /tmp/foo.txt      **Considerations**   1.2.3.4 will always be a number between 0.0.0.0 and 255.255.255.255   The user name `foo` can be any length   foo@1.2.3.4 is _not_ necessarily the only parameter passed into ssh (eg.. ssh 1.2.3.4 -l foo) **Resources**   http://stackoverflow.com/questions/1733692/how-to-use-sed-awk-or-gawk-to- print-only-what-is-matched   http://stackoverflow.com/questions/2777579/sed-group-capturing   http://www.grymoire.com/Unix/Sed.html Update   **Further Clarification**   The end goal will be to create a function in my .bashrc that will allow me to easily remove a conflicting ssh key.               root$ ssh foo@1.2.3.4       #some big error message warning about man in the middle attack     root$ ssh-keygen -R 1.2.3.4


I rebooted a compiled kernel 3.1.0, and those are the errors that I am getting:               linux-dopx:/usr/src/linux-3.1.0-1.2 # make install     sh /usr/src/linux-3.1.0-1.2/arch/x86/boot/install.sh 3.1.0 arch/x86/boot/bzImage \                     System.map "/boot"          Kernel image:   /boot/vmlinuz-3.1.0     Initrd image:   /boot/initrd-3.1.0     Root device:    /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part2 (/dev/sda2) (mounted on / as ext4)     Resume device:  /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part1 (/dev/sda1)     find: `/lib/modules/3.1.0/kernel/drivers/ata': No such file or directory     modprobe: Module ata_generic not found.     WARNING: no dependencies for kernel module 'ata_generic' found.     modprobe: Module ext4 not found.     WARNING: no dependencies for kernel module 'ext4' found.     Features:       block usb resume.userspace resume.kernel     Bootsplash:     openSUSE (1280x1024)     41713 blocks      Rebooting says: `Could not load /lib/modules/3.1.0/modules.dep` ## EDIT1: Here's what I did:               linux-dopx:/usr/src/linux-3.1.0-1.2 # make bzImage       CHK     include/linux/version.h       CHK     include/generated/utsrelease.h       CALL    scripts/checksyscalls.sh       CHK     include/generated/compile.h     Kernel: arch/x86/boot/bzImage is ready  (#1)     linux-dopx:/usr/src/linux-3.1.0-1.2 # make modules       CHK     include/linux/version.h       CHK     include/generated/utsrelease.h       CALL    scripts/checksyscalls.sh       Building modules, stage 2.       MODPOST 3 modules     linux-dopx:/usr/src/linux-3.1.0-1.2 # make modules install       CHK     include/linux/version.h       CHK     include/generated/utsrelease.h       CALL    scripts/checksyscalls.sh       CHK     include/generated/compile.h       Building modules, stage 2.       MODPOST 3 modules     sh /usr/src/linux-3.1.0-1.2/arch/x86/boot/install.sh 3.1.0 arch/x86/boot/bzImage \                     System.map "/boot"          Kernel image:   /boot/vmlinuz-3.1.0     Initrd image:   /boot/initrd-3.1.0     Root device:    /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part2 (/dev/sda2) (mounted on / as ext4)     Resume device:  /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part1 (/dev/sda1)     find: `/lib/modules/3.1.0/kernel/drivers/ata': No such file or directory     modprobe: Module ata_generic not found.     WARNING: no dependencies for kernel module 'ata_generic' found.     modprobe: Module ext4 not found.     WARNING: no dependencies for kernel module 'ext4' found.     Features:       block usb resume.userspace resume.kernel     Bootsplash:     openSUSE (1280x1024)     41713 blocks     linux-dopx:/usr/src/linux-3.1.0-1.2 # make install     sh /usr/src/linux-3.1.0-1.2/arch/x86/boot/install.sh 3.1.0 arch/x86/boot/bzImage \                     System.map "/boot"          Kernel image:   /boot/vmlinuz-3.1.0     Initrd image:   /boot/initrd-3.1.0     Root device:    /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part2 (/dev/sda2) (mounted on / as ext4)     Resume device:  /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part1 (/dev/sda1)     find: `/lib/modules/3.1.0/kernel/drivers/ata': No such file or directory     modprobe: Module ata_generic not found.     WARNING: no dependencies for kernel module 'ata_generic' found.     modprobe: Module ext4 not found.     WARNING: no dependencies for kernel module 'ext4' found.     Features:       block usb resume.userspace resume.kernel     Bootsplash:     openSUSE (1280x1024)     41713 blocks      ## EDIT2:               linux-dopx:/usr/src/linux-3.1.0-1.2 # make modules_install install       INSTALL arch/x86/kernel/test_nx.ko       INSTALL drivers/scsi/scsi_wait_scan.ko       INSTALL net/netfilter/xt_mark.ko       DEPMOD  3.1.0     sh /usr/src/linux-3.1.0-1.2/arch/x86/boot/install.sh 3.1.0 arch/x86/boot/bzImage \                     System.map "/boot"          Kernel image:   /boot/vmlinuz-3.1.0     Initrd image:   /boot/initrd-3.1.0     Root device:    /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part2 (/dev/sda2) (mounted on / as ext4)     Resume device:  /dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part1 (/dev/sda1)     find: `/lib/modules/3.1.0/kernel/drivers/ata': No such file or directory     modprobe: Module ata_generic not found.     WARNING: no dependencies for kernel module 'ata_generic' found.     modprobe: Module ext4 not found.     WARNING: no dependencies for kernel module 'ext4' found.     Features:       block usb resume.userspace resume.kernel     Bootsplash:     openSUSE (1280x1024)     41713 blocks      ## EDIT 3: This message is still getting shown after make install: `/lib/modules/2.6.35.13/kernel/drivers/ata': No such file or directory` I set to '[*]' the " **Generic ATA support** " under " **Serial ATA and Parallel ATA driver** ", but that's of no avail.   The kernel version is different this time, but the problem is same. ## EDIT 4:               linux-dopx:~ # lspci -vvv     00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 10)             Subsystem: ASUSTeK Computer Inc. P5KPL-VM Motherboard             Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-             Latency: 0             Capabilities: [e0] Vendor Specific Information: Len=0b <?>             Kernel driver in use: agpgart-intel          00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 10) (prog-if 00 [VGA controller])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM Motherboard             Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+             Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin A routed to IRQ 18             Region 0: Memory at fea80000 (32-bit, non-prefetchable) [size=512K]             Region 1: I/O ports at dc00 [size=8]             Region 2: Memory at e0000000 (32-bit, prefetchable) [size=256M]             Region 3: Memory at fe900000 (32-bit, non-prefetchable) [size=1M]             Expansion ROM at <unassigned> [disabled]             Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-                     Address: fee0100c  Data: 4149             Capabilities: [d0] Power Management version 2                     Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Kernel driver in use: i915          00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01)                 Subsystem: ASUSTeK Computer Inc. Device 83a1             Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+             Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0, Cache Line Size: 32 bytes             Interrupt: pin A routed to IRQ 20             Region 0: Memory at fea78000 (64-bit, non-prefetchable) [size=16K]             Capabilities: [50] Power Management version 2                     Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot+,D3cold+)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+                     Address: 00000000fee0100c  Data: 4159             Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00                     DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us                             ExtTag- RBE- FLReset-                     DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-                             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+                             MaxPayload 128 bytes, MaxReadReq 128 bytes                     DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-                     LnkCap: Port #0, Speed unknown, Width x0, ASPM unknown, Latency L0 <64ns, L1 <1us                             ClockPM- Surprise- LLActRep- BwNot-                     LnkCtl: ASPM Disabled; Disabled- Retrain- CommClk-                             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-                     LnkSta: Speed unknown, Width x0, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-             Capabilities: [100 v1] Virtual Channel                     Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1                     Arb:    Fixed- WRR32- WRR64- WRR128-                     Ctrl:   ArbSelect=Fixed                     Status: InProgress-                     VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-                             Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-                             Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=01                             Status: NegoPending- InProgress-                     VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-                             Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-                             Ctrl:   Enable- ID=0 ArbSelect=Fixed TC/VC=00                             Status: NegoPending- InProgress-             Capabilities: [130 v1] Root Complex Link                     Desc:   PortNumber=0f ComponentID=00 EltType=Config                     Link0:  Desc:   TargetPort=00 TargetComponent=00 AssocRCRB- LinkType=MemMapped LinkValid+                             Addr:   00000000fed1c000             Kernel driver in use: snd_hda_intel          00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01) (prog-if 00 [Normal decode])             Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+             Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0, Cache Line Size: 32 bytes             Bus: primary=00, secondary=02, subordinate=02, sec-latency=0             I/O behind bridge: 00001000-00001fff             Memory behind bridge: 7f900000-7fafffff             Prefetchable memory behind bridge: 000000007fb00000-000000007fcfffff             Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-             BridgeCtl: Parity- SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-                     PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-             Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00                     DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited                             ExtTag- RBE- FLReset-                     DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-                             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-                             MaxPayload 128 bytes, MaxReadReq 128 bytes                     DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-                     LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <1us, L1 <4us                             ClockPM- Surprise- LLActRep+ BwNot-                     LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-                             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-                     LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-                     SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+                             Slot #4, PowerLimit 25.000W; Interlock- NoCompl-                     SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-                             Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-                     SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet- Interlock-                             Changed: MRL- PresDet- LinkState-                     RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-                     RootCap: CRSVisible-                     RootSta: PME ReqID 0000, PMEStatus- PMEPending-             Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-                     Address: fee0100c  Data: 4129             Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 8179             Capabilities: [a0] Power Management version 2                     Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Capabilities: [100 v1] Virtual Channel                     Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1                     Arb:    Fixed+ WRR32- WRR64- WRR128-                     Ctrl:   ArbSelect=Fixed                     Status: InProgress-                     VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-                             Arb:    Fixed+ WRR32- WRR64- WRR128- TWRR128- WRR256-                             Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=01                             Status: NegoPending- InProgress-                     VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-                             Arb:    Fixed+ WRR32- WRR64- WRR128- TWRR128- WRR256-                             Ctrl:   Enable- ID=0 ArbSelect=Fixed TC/VC=00                             Status: NegoPending- InProgress-             Capabilities: [180 v1] Root Complex Link                     Desc:   PortNumber=01 ComponentID=00 EltType=Config                     Link0:  Desc:   TargetPort=00 TargetComponent=00 AssocRCRB- LinkType=MemMapped LinkValid+                             Addr:   00000000fed1c001             Kernel driver in use: pcieport          00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 01) (prog-if 00 [Normal decode])             Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+             Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0, Cache Line Size: 32 bytes             Bus: primary=00, secondary=01, subordinate=01, sec-latency=0             I/O behind bridge: 0000e000-0000efff             Memory behind bridge: feb00000-febfffff             Prefetchable memory behind bridge: 000000007f700000-000000007f8fffff             Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-             BridgeCtl: Parity- SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-                     PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-             Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00                     DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited                             ExtTag- RBE- FLReset-                     DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-                             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-                             MaxPayload 128 bytes, MaxReadReq 128 bytes                     DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-                     LnkCap: Port #2, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <1us, L1 <4us                             ClockPM- Surprise- LLActRep+ BwNot-                     LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-                             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-                     LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive+ BWMgmt- ABWMgmt-                     SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+                             Slot #0, PowerLimit 0.000W; Interlock- NoCompl-                     SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-                             Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-                     SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-                             Changed: MRL- PresDet+ LinkState+                     RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-                     RootCap: CRSVisible-                     RootSta: PME ReqID 0000, PMEStatus- PMEPending-             Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-                     Address: fee0100c  Data: 4141             Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 8179             Capabilities: [a0] Power Management version 2                     Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Capabilities: [100 v1] Virtual Channel                     Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1                     Arb:    Fixed+ WRR32- WRR64- WRR128-                     Ctrl:   ArbSelect=Fixed                     Status: InProgress-                     VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-                             Arb:    Fixed+ WRR32- WRR64- WRR128- TWRR128- WRR256-                             Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=01                             Status: NegoPending- InProgress-                     VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-                             Arb:    Fixed+ WRR32- WRR64- WRR128- TWRR128- WRR256-                             Ctrl:   Enable- ID=0 ArbSelect=Fixed TC/VC=00                             Status: NegoPending- InProgress-             Capabilities: [180 v1] Root Complex Link                     Desc:   PortNumber=02 ComponentID=00 EltType=Config                     Link0:  Desc:   TargetPort=00 TargetComponent=00 AssocRCRB- LinkType=MemMapped LinkValid+                             Addr:   00000000fed1c001             Kernel driver in use: pcieport          00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 01) (prog-if 00 [UHCI])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM,P5LD2-VM Mainboard             Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin A routed to IRQ 5             Region 4: I/O ports at d400 [size=32]             Kernel driver in use: uhci_hcd          00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01) (prog-if 00 [UHCI])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM,P5LD2-VM Mainboard             Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin B routed to IRQ 7             Region 4: I/O ports at d480 [size=32]             Kernel driver in use: uhci_hcd          00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01) (prog-if 00 [UHCI])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM,P5LD2-VM Mainboard             Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin C routed to IRQ 3             Region 4: I/O ports at d800 [size=32]             Kernel driver in use: uhci_hcd          00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01) (prog-if 00 [UHCI])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM,P5LD2-VM Mainboard             Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin D routed to IRQ 10             Region 4: I/O ports at d880 [size=32]             Kernel driver in use: uhci_hcd          00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01) (prog-if 20 [EHCI])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM,P5LD2-VM Mainboard             Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin A routed to IRQ 5             Region 0: Memory at fea77c00 (32-bit, non-prefetchable) [size=1K]             Capabilities: [50] Power Management version 2                     Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Capabilities: [58] Debug port: BAR=1 offset=00a0             Kernel driver in use: ehci_hcd          00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1) (prog-if 01 [Subtractive decode])             Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-             Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Bus: primary=00, secondary=03, subordinate=03, sec-latency=32             I/O behind bridge: 0000f000-00000fff             Memory behind bridge: fff00000-000fffff             Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff             Secondary status: 66MHz- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ <SERR- <PERR-             BridgeCtl: Parity- SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-                     PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-             Capabilities: [50] Subsystem: ASUSTeK Computer Inc. Device 8179          00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)             Subsystem: ASUSTeK Computer Inc. P5KPL-VM Motherboard             Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Capabilities: [e0] Vendor Specific Information: Len=0c <?>          00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01) (prog-if 8a [Master SecP PriP])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM Motherboard             Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx+             Latency: 0             Interrupt: pin A routed to IRQ 3             Region 0: I/O ports at 01f0 [size=8]             Region 1: I/O ports at 03f4 [size=1]             Region 2: I/O ports at 0170 [size=8]             Region 3: I/O ports at 0374 [size=1]             Region 4: I/O ports at ffa0 [size=16]             Kernel driver in use: ata_piix          00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA IDE Controller (rev 01) (prog-if 8f [Master SecP SecO PriP PriO])             Subsystem: ASUSTeK Computer Inc. P5KPL-VM Motherboard             Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin B routed to IRQ 7             Region 0: I/O ports at d080 [size=8]             Region 1: I/O ports at d000 [size=4]             Region 2: I/O ports at cc00 [size=8]             Region 3: I/O ports at c880 [size=4]             Region 4: I/O ports at c800 [size=16]             Capabilities: [70] Power Management version 2                     Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Kernel driver in use: ata_piix          00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01)             Subsystem: ASUSTeK Computer Inc. P5KPL-VM Motherboard             Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-             Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Interrupt: pin B routed to IRQ 7                 Region 4: I/O ports at 0400 [size=32]             Kernel driver in use: i801_smbus          01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 01)             Subsystem: ASUSTeK Computer Inc. Device 8136             Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+             Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0, Cache Line Size: 32 bytes             Interrupt: pin A routed to IRQ 19             Region 0: I/O ports at e800 [size=256]             Region 2: Memory at febff000 (64-bit, non-prefetchable) [size=4K]             Expansion ROM at febc0000 [disabled] [size=128K]             Capabilities: [40] Power Management version 2                     Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Capabilities: [48] Vital Product Data                     Unknown small resource type 05, will not decode more.             Capabilities: [50] MSI: Enable+ Count=1/2 Maskable- 64bit+                     Address: 00000000fee0100c  Data: 4151             Capabilities: [60] Express (v1) Endpoint, MSI 00                     DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <128ns, L1 unlimited                             ExtTag+ AttnBtn+ AttnInd+ PwrInd+ RBE- FLReset-                     DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-                             RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+                             MaxPayload 128 bytes, MaxReadReq 512 bytes                     DevSta: CorrErr- UncorrErr+ FatalErr- UnsuppReq+ AuxPwr+ TransPend-                     LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 unlimited, L1 unlimited                             ClockPM- Surprise- LLActRep- BwNot-                     LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-                             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-                     LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-             Capabilities: [84] Vendor Specific Information: Len=4c <?>             Capabilities: [100 v1] Advanced Error Reporting                     UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-                     UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-                     UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-                     CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-                     CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-                     AERCap: First Error Pointer: 14, GenCap- CGenEn- ChkCap- ChkEn-             Capabilities: [12c v1] Virtual Channel                     Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1                     Arb:    Fixed- WRR32- WRR64- WRR128-                     Ctrl:   ArbSelect=Fixed                     Status: InProgress-                     VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-                             Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-                             Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=01                             Status: NegoPending- InProgress-             Capabilities: [148 v1] Device Serial Number 01-00-00-00-36-4c-e0-00             Capabilities: [154 v1] Power Budgeting <?>             Kernel driver in use: r8169          linux-dopx:~ #


Live-migration of a SLES9 DomU?

With SLES9 SP4 we managed to set up a XEN PV DomU. We are using SLES10 SP4 as Dom0 and DRBD 8 as disc-backed: a drbd-device corresponds to xvda in the DomU. The DomU uses the xenblk and xennet drivers, so everything seems ok. We applied the last patches (EoL of SLES9 SP4 was on 31th of August). After live-migration to another Dom0 the DomU seems to crash. No reaction to SYSRQ, nothing on the console. DRBD switches from one side (primary) to the other, so the disk-backend does not seem to be a problem here. With CentOS 4/5, SLES 10/11 DomUs we never had an issue with live-migration. Even W2K3 works. After destroy/create of the DomU it comes up without problems, last-log shows a "crash" entry. Any hints are welcome...


Linux "rpl" command doesn't replace text

I'm using `rpl` program in linux to replace `date(` with `pdate(` in some files.   But it says `A Total of 0 matches replaced in 1 file searched.`   while grep output for `date(` is:               ariyan@ariyan-laptop:/var/www/moodle21$ grep -wR 'date(' admin/uploaduser.php     $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);      I'm using `rpl` as this:               rpl -wR 'date(' 'pdate(' admin/uploaduser.php      What is the problem?


VLC surround to stereo problem

I noticed a problem with certain video files where speech volume component is just too low. I googled a bit and it seems that the problem is that it tries to play surround sound on stereo speakers and it fails to blend everything in as it should. If I play the same video in mplayer, everything is normal. Does anyone else have the same problem? Anyone know how to fix this? I tried changing the output module in vlc audio settings, but the problem would remain no matter what I chose. Thanks. Version of VLC that I am using is 1.1.12 on Arch-Linux (KDE 4.7.2).   If you any additional info is needed, I will provide it.


Display Non-Zero Return Status in PS1

I want to include the return status in my prompt. (Easy add `'$? '`, right?) However, I only want the status returned (and trailing space) if non-zero. Example:               sd ~ $ false     1 sd ~ $ true     sd ~ $


echo vs <<<, or Useless Use of echo in Bash Award?

By now the Useless Use of `cat` Award is very well known, and there's also a mention of a Useless Use of `echo` (not relevant for this question). I'm wondering if there should be a "Useless Use of `echo` in Bash Award": Piping seems to be much slower than heredocs and herestrings according to some highly unscientific measurements:   * Heredocs:              for reps in 1 2 3     do         time for i in {1..1000}         do             cat <<'END'     test string     END         done > /dev/null     done          real    0m1.786s     user    0m0.212s     sys     0m0.332s          real    0m1.817s     user    0m0.232s     sys     0m0.332s          real    0m1.846s     user    0m0.256s     sys     0m0.320s        * Herestrings              for reps in 1 2 3     do         time for i in {1..1000}         do             cat <<< 'test string'         done > /dev/null     done          real    0m1.932s     user    0m0.280s     sys     0m0.288s          real    0m1.956s     user    0m0.248s     sys     0m0.348s          real    0m1.968s     user    0m0.268s     sys     0m0.324s        * Redirection              for reps in 1 2 3     do         time for i in {1..1000}         do             echo 'test string' | cat         done > /dev/null     done          real    0m3.562s     user    0m0.416s     sys     0m0.548s          real    0m3.924s     user    0m0.384s     sys     0m0.604s          real    0m3.343s     user    0m0.400s     sys     0m0.552s      In general, heredocs and herestrings are about the same speed (this is just one data set from several tests) while redirection is consistently more than 50% slower. Am I misunderstanding something, or could this be used as a general rule for commands reading standard input in Bash?


Getting or cloning the users current terminal?

I have to work with a script that forks and launches an instance of xterm in order to display log output in one window and have an interactive interface in the other. Personally I prefer rxvt-unicode and I would like to modify this script so that it is no longer hardcoded to use xterm. Is it possible to either figure out the users preferred terminal in a desktop- agnostic way or to get the parent terminal. The parent terminal might not be the next parent in the process tree since it's possible that the script in question can in term be called by another script or application. Since the script is written in Perl a solution written in Perl is good enough as long as it doesn't have weird dependencies (I can't control the global environment).


Virtualbox seamless mode in Bodhi Linux

I just created a Bodhi virtual machine (Win 7 Host) and installed virtualbox- guest-additions but I'm still not able to activate seamless mode in virtualbox. Is this mode even supported for Bodhi Linux and what do I need to add to my guest system? My goal is to integrate Bodhi terminal sessions into my Windows Desktop without the Bodhi Desktop. The seamless mode isn't available means I'm not able to click on that tab. `/etc/init.d/vboxadd` isn't on my machine, only `/etc/init.d/virtualbox`


Why ssh-copy-id prompts for the local user password three times?

Noticed from my previous question that when trying to copy an SSH public key to a remote host via `ssh-copy-id`, I am prompted for the local user password three times:               ssh-copy-id myuser@myserver     Password:     Password:     Password:     myuser@myserver's password:      Why am I being prompted three times for the local user's password? Is that an expected behavior? Also, what is going on under the hood?? **EDIT** : when using `ssh`, it doesn't prompt for the local user password.. And my local password is an ordinary Linux password of my laptop, and the remote machine is an Ubuntu box (11.10) joined to an Active Directory Domain via likewise-open. So `myuser` is actually `mydomain\myuser` or `myuser@mydomain.com`, escaping the `\` character as in my previous question.. The remote machine `/etc/ssh/sshd_config` file is as follows:               # Package generated configuration file     # See the sshd_config(5) manpage for details          # What ports, IPs and protocols we listen for     Port 22     # Use these options to restrict which interfaces/protocols sshd will bind to     #ListenAddress ::     #ListenAddress 0.0.0.0     Protocol 2     # HostKeys for protocol version 2     HostKey /etc/ssh/ssh_host_rsa_key     HostKey /etc/ssh/ssh_host_dsa_key     HostKey /etc/ssh/ssh_host_ecdsa_key     #Privilege Separation is turned on for security     UsePrivilegeSeparation yes          # Lifetime and size of ephemeral version 1 server key     KeyRegenerationInterval 3600     ServerKeyBits 768          # Logging     SyslogFacility AUTH     LogLevel INFO          # Authentication:     LoginGraceTime 120     PermitRootLogin yes     StrictModes yes          RSAAuthentication yes     PubkeyAuthentication yes     #AuthorizedKeysFile %h/.ssh/authorized_keys          # Don't read the user's ~/.rhosts and ~/.shosts files     IgnoreRhosts yes     # For this to work you will also need host keys in /etc/ssh_known_hosts     RhostsRSAAuthentication no     # similar for protocol version 2     HostbasedAuthentication no     # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication     #IgnoreUserKnownHosts yes          # To enable empty passwords, change to yes (NOT RECOMMENDED)     PermitEmptyPasswords no          # Change to yes to enable challenge-response passwords (beware issues with     # some PAM modules and threads)     #Overwritten by lwidentity: ChallengeResponseAuthentication no     ChallengeResponseAuthentication yes          # Change to no to disable tunnelled clear text passwords     #PasswordAuthentication yes          # Kerberos options     #KerberosAuthentication no     #KerberosGetAFSToken no     #KerberosOrLocalPasswd yes     #KerberosTicketCleanup yes          # GSSAPI options     #GSSAPIAuthentication no     GSSAPIAuthentication yes     #GSSAPICleanupCredentials yes     GSSAPICleanupCredentials yes          X11Forwarding yes     X11DisplayOffset 10     PrintMotd no     PrintLastLog yes     TCPKeepAlive yes     #UseLogin no          #MaxStartups 10:30:60     #Banner /etc/issue.net          # Allow client to pass locale environment variables     AcceptEnv LANG LC_*          Subsystem sftp /usr/lib/openssh/sftp-server          # Set this to 'yes' to enable PAM authentication, account processing,     # and session processing. If this is enabled, PAM authentication will     # be allowed through the ChallengeResponseAuthentication and     # PasswordAuthentication.  Depending on your PAM configuration,     # PAM authentication via ChallengeResponseAuthentication may bypass     # the setting of "PermitRootLogin without-password".     # If you just want the PAM account and session checks to run without     # PAM authentication, then enable this but set PasswordAuthentication     # and ChallengeResponseAuthentication to 'no'.     UsePAM yes     KbdInteractiveAuthentication yes


required output not achieved by bash script

I am new to bash script and want to create bash script that moves some days old files between source and destination as per days defined in script.               #!/bin/bash          echo "Enter Your Source Directory"     read soure          echo "Enter Your Destination Directory"     read destination           echo "Enter Days"     read days          find $soure -mtime -$days -exec mv {} $destination \;     echo "Files which were $days Days old moved from $soure to $destination"      my script runs without error, but I am not getting required output. When I run to move 30 day old files of /home/ketan/maxi folder to /home/ketan/google, it moves whole maxi folder to google rather than files. I need to be able to move files that meet the age criteria as per the script. What is wrong with this script?


Do mplayer's audio filters contain the opposite of "Karaoke" Mode?

A friend showed me mplayer's Karaoke mode (`-af karaoke`), and I was blown away by how good it is on the majority of the tracks I threw at it. Instead of tweaking the 10-band EQ, is there an audio filter for the opposite of Karaoke Mode? Specifically, is there an audio filter that would allow me to "extract the vocals" and filter out the music?


ZFS adding new device to RAIDZ

I wondering about problem with adding new device to ZFS RAIDZ. I'm thinking about it only theoretically: After destroying ZFS pool with only RAIDZ in it. The data should be still there on the disks. Is there a way to create new RAIDZ with old disks? If so, it should be almost the same way to add a new extra hard drive (or more) to the new RAIDZ. Only extra thing in this case is recalculate all parity. Am I wrong? So for now the **_main_** question is: **Is there some way to create new RAIDZ with old disks (from old RAIDZ) without adding new extra disk?**


How can you trim files using the command line?

What is the console equivalent of the following Python code:               target = file("disk", "w")    # create a file     target.seek(2*1024*1024*1024) # skip to 2 GB     target.write("\0")     target.close()      Maybe some dd incantation? The idea is making a file with the apparent size of 2 GB for use e.g. in virtualization.               kvm disk -cd whatever.iso #Only allocate space as necessary


Blocking visitors that access by server IP address

My Apache Server IP address is 192.168.1.100 and the Domain Name is `test.local`.   * If a user types in the URL, say "http://test.local", then they should be allowed.   * If a user tries to access "http:// 192.168.1.100" then they should be denied.  How can I accomplish this?


What is the difference between start-stop-daemon and running with &?

I am setting up a service in /etc/init.d. I am looking at various scripts in there, some are implemented with `start-stop-daemon ...` and some with `/path/to/script &`. All of them save the pid in a file and do some checks. What is the best practice, what are the differences, what is important to know here ... ? (in general) In my particular case I have a simple lightweight localhost http server in java that an application will call once every hour or so and it just gives a stupid random number (no more details here, I just mean it doesn't use the file system or threads or anything complicated in case this matter in my question) Thanks


How to cd automatically after git clone?

I want to automatically `cd` to the directory created by the `clone` command after I `git clone`d something. Shell: ZSH if that matters.


optimizing Debian wheezy for an embedded board

I have Debian 7.1 on an embedded board that I just use WiFi interface, openVPN, and run a C code. The code uses UDP socket to transfer data, and do some calculations and output some signal on GPIO. I noticed that there are too many unnecessary tasks are running on the background like `apache2` that consumes memory and CPU. I already disable it. Could anybody tell me what else would be safe to disable/remove from the Wheezy that would not be needed on an embedded board? (unnecessary documentations etc.?)


Can't reliably create a directory on startup after ec2 instance mounts its ephemeral drives

This particular instance type mounts two ephemeral drives, in `/dev/` and `/mnt/`. I have to create working directories for one of my services in these paths at startup or the services won't launch. Sometimes the script below works, sometimes it does not. I suspect it's a race between the folder being mounted, and my rc.local script kicking off. Is there a more reliable place I can create these directories? The last time I booted up, the `/mnt/mongodb` dir did get created, but the `/dev/` one did not. I'm running the 12.04 HVM ubuntu instance from amazon. Here is my rc.local file:               cd /mnt/     sudo mkdir mongodb     sudo chown -R mongodb mongodb     sudo chgrp -R mongodb mongodb     cd /dev/     sudo mkdir mongodb     sudo chown -R mongodb mongodb     sudo chgrp -R mongodb mongodb     sudo service mongodb start     exit 0


Inherit environment variables in systemd Docker container

I have a Docker container running systemd. I want to pass environment variables to applications under it. When I start systemd from within Docker (`/sbin/init` as command line), Docker exposes variables to systemd, but _does not expose to child services_. If I add `systemd.setenv=...` to the cmdline, the variables are passed. I am looking for a cleaner solution. How do I expose environment variables passed to `/sbin/init` to applications started by it?               % docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged -ti \                  -e VAR1=1 motiejus/systemd_fedora20 \                  init systemd.setenv=VAR2=2     ...     Welcome to Fedora 20 (Heisenbug)!     ...     [  OK  ] Reached target Multi-User System.     [root@740690365eb0 ~]# env | grep VAR     VAR2=2      I expect to see `VAR1=1` while running my command. In other words, can systemd pass variables passed to it to children it starts? For Dockerfile, see github repository.


Why do these 2 find commands give differnt results?

I wanted to see all files modified within the last 10 days and who owned them, so i entered the following to give me an idea how many results would be returned;               find . -maxdepth 1 -mtime -10      I then issued the command;               find . -maxdepth 1 -mtime -10 -exec ls -lh {} \;      Both commands give very different result, but i dont understand why, can someone explain what is going on and why they produce different results?


How to change user with authentication inside shell script

It is possible to change the user within a shell script by `su - newuser`; but what if the newuser needs authentication. How can I provide the password within the shell script? None of the users is root.


Assistance wanted in removing the "No mail." notification in MOTD for Ubuntu 10.10

How do I remove the `No mail.` notification on Ubuntu 10.10 Server?   This occurs when I log in, and is located underneath the message of the day I have a separate script which uses a different messaging system than the default one


Subversion on Ubuntu server - setup issues

I have followed a guide for setting up a Subversion server and I cannot seem to access any repositories that I have created and imported from a Windows based SVN repository. In the past, I installed a Windows app called Visual SVN that allows me to run a SVN server on a Windows machine. I had lots of repositories I made for it with many projects in it and now I want to migrate all these into my Ubuntu server. I followed this guide, and successfully installed SVN, added a user and configured the Apache 2 config file as such:               <Location /svn>       DAV svn       SVNPath /windows/mediahdd1/Repositories/Spring       AuthType Basic       AuthName Spring projects       AuthUserFile /etc/subversion/passwd       <LimitExcept GET PROPFIND OPTIONS REPORT>       Require valid-user       </LimitExcept>       </Location>      I also simply moved my repository (from my Windows machine) folder into that SVN path of `/windows/mediahdd1`. I first created a dummy repository using the same guide I linked above and it creates exactly the same folders and files that I saw inside my own Windows repository, so I assumed that I could easily import my previous repository folder and it should work. Anyways, the main issue I am having is that I can't access my SVN server from another machine using the HTTP or HTTPS protocol. I am able to boot up a putty session and access it using `SVN co file:///windows/mediahdd1/Repositories/Spring` and it returns me what appears to be a list of files related to my project. How can I access this remotely? Do i need to run SVN or is it running? The guide doesn't explain how to run the SVN server, all it states is how to install, create a repository, create users and different protocols you can use to access it but how do you access it remotely from say TortoiseSVN? The HTTP link doesn't work and that's what I normally use to access a SVN repo from TortoiseSVN or another SVN client. Any advice? Do I need to change port? What is the default port for SVN?


How to change the hostname of a linux machine using terminal?

I logged in for the first time, opened terminal, and typed in ‘hostname’. It returned ‘localhost.localdomain.com’. Then I logged as the root user in terminal using the command, ‘su –‘, provided the password for the root user and used the command ‘hostname etest’ where etest is the hostname I’d like my machine to have. To test if I got my hostname changed correctly, I typed ‘hostname’ again at terminal and it returned etest. However, when I restart my machine, the hostname reverts back to ‘localhost.localdomain.com’. Here are the entire series of commands I used in terminal.                   [thomasm@localhost ~]$ hostname           localhost.localdomain           [thomasm@localhost ~]$ su -           Password:            [root@localhost ~]# hostname etest           [root@localhost ~]# hostname           etest      I had run into the same problem when I set up RHEL and Ubuntu OS’s with VMPlayer.


possible to load kernel module that "disagrees about version of symbol"

I downloaded the sources for my kernel, applied a patch and rebuilt it and now I have a kernel module that, when I try to `insmod`, complains "Unknown symbol in module" with `dmesg` giving the error "disagrees about the version of symbol ...". Without having to hunt down the source for this module and rebuild it against my kernel is it possible to somehow force the kernel to accept this module? I realise this would be dangerous but I'll to take the risk if its possible.


All my superblocks are corrupt!

I am having a problem with my ubuntu ext3 filesystem. I can't boot from it or mount the volume when running live CD. When I try e2fsck I get: "Bad magic number in super-block while trying to open /dev/sda5". I have tried all the alternative superblocks with the same result. I have heard you can delete the journaling system and mount as ext2, but the suggestions on how to do this (eg this one) all require a valid superblock. Is it credible that all the backup superblocks are corrupted or is there something else going on? The filesystem seemed fine before I rebooted, so pretty sure it's recoverable. What else can I try? * * * ### Output from `fdisk`               Disk /dev/sda: 320.1 GB, 320072933376 bytes     255 heads, 63 sectors/track, 38913 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xa4e507fa          /dev/sda1              26        8903    71303168    7  HPFS/NTFS     /dev/sda2            8903       38914   241061889    5  Extended     /dev/sda5            8904       13159    34186320   83  Linux     /dev/sda6           38167       38914     5999616   82  Linux swap / Solaris     /dev/sda7           13160       38166   200868696    7  HPFS/NTFS      ### Output from `sudo file - `</dev/sda5``               bash: /dev/sda5: Permission denied      (What was this supposed to show?) ### Output from `sudo file -s `/dev/sda5``               /dev/sda5: data


Setting up Samba to use AD server for authentication?

I am looking for howtos or instructions on setting up Samba to use an AD server for authentication instead of using a Samba password file. Pointers to documentation helpful, especially the right document to look at on http://samba.org/samba/docs/ .


Unable to handle kernel paging request?

[Disclaimer: I was initially a little nervous about posting this here, so I asked on Meta if discussing homebrew / modding was acceptable. Based on the response I've gotten from several veteran members, I've gone ahead and posted this thread. Here is the link on Meta.] I'm currently trying to mod my original Xbox using xboxhdm and ndure 3.0. xboxhdm is built around a small bootable Linux distro, and it's giving me fits, so I figured that I'd ask here and see if anybody could give me a hand. (Note: Before anybody suggests a different board, xboxhdm boots from CD on a PC - the Xbox hardware is completely uninvolved in the process, so that's why I'm asking here.) The PC I'm using is relatively old - it's an old Compaq desktop with about 512mb RAM and a 2.5ghz processor (likely a P IV). I'm using it because it has 2 IDE ports on the motherboard. The age of the computer shouldn't be an issue, performance-wise - the xboxhdm + ndure hack has been around for years - it was designed to run on such hardware. Anyway - at one point in the process, I have to copy some files from the CD to the Xbox hard drive (which is a standard Seagate IDE drive, powered by a Molex). About halfway through the copy, everything just dies... I get an `unable to handle kernel paging request` error, and eventually a kernel panic. I couldn't find anything about this error and how it specifically relates to Xbox modding, but what information I could find suggested that I might have a bad stick of RAM. I've not been able to test this yet, but I'm going to run MEMTEST as soon as I get home. I don't have the setup with me - I'm at work, and it's at home - but if anybody's interested in lending a hand, I'll take pictures tonight and post them up. The only reason that I'm asking here is because I'm still a fairly new *nix convert, and I'm not quite sure how it all works. I'm assuming that `unable to handle kernel paging request` is a fairly standard error message, too... correct me if I'm wrong.


tcpdump command works only on local ip

I am trying to capture some IP packets in my personal LAN with tcpdump, through the command               tcpdump -A -i eth0 'tcp and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) and host 192.168.1.x'      where 192.168.1.x is the target host in the network. But it works only if the target host is my ip, that is the IP of the machine where tcpdump runs. With any other IP in the network it doesn't record anything. I have an unmanaged switch. The simpler command               tcpdump -A 'host 192.168.1.x'      detects only some igmp packets periodically sent to a broadcasting address, 224.0.0.251, from the host 192.168.1.x. But how could the IP capture be performed? Thank you anyway!


Remove by date in Shell Script

I have a shell script that creates a backup of a database. I would like to keep the last 7 days for files. What is the syntax I need to remove files in a directory by date or can I keep the newest 7 files in a directory? Script runs via cron EDIT: something like this?               find -type f -mtime +7 -maxdepth 1 -exec rm -f {} \;


How to install Kali Linux without CD and flash drive?

I have download Kali Linux. But the size is too large for my flash drive, my flash drive is 1.8gb and the Kali Linux iso is 2.3gb. I use an Asus eeepc 1215p which has no CD/DVD drive. My machine was installed with Ubuntu 12.04, and I've an empty partition. I want to install Kali Linux onto that partition, but I don't understand how? Can anyone here tell me how to install Kali Linux without a CD/DVD drive and flash drive ? I heard about poor man, I was searching for it, but I only found a lot for PCLinux OS.


How to tell yum that a package is installed when it thinks it isn't?

I accidentally deleted all my RPM data (I removed `/var/lib/rpm/*` instead of `/var/lib/rpm/__*`), and then ran `rpm --rebuilddb`. Now when I try to run `yum update` I get:               Could not parse metalink https://mirrors.fedoraproject.org     /metalink?repo=fedora-$releasever&arch=i386 error was     No repomd file     Error: File /var/cache/yum/i386/$releasever/fedora/metalink.xml does      not exist      I found that I don't even have the `/var/cache/yum/i386` folder anymore after the previous operation. I downloaded the fedora-release RPM of Fedora 18 and locally installed and rebuilt my yum cache (is that what i did?):               rpm -Uvh --replacefiles --replacepkgs /$MYPATH_TO_Fedorareles/fedorarelease-18-0.8.noarch.rpm      This made a new rpmdb where only one package is installed: `fedora-release`. Since yum thinks that's the only package installed, if I try to install anything it resolves the dependencies and queues lots of packages for install that I actually already have installed. How do I make yum aware of all the packages that are already installed? I don't want to reinstall anything, and I don't want to download 500MB of RPMs.


Yum user temp files (/var/tmp/yum*) fills up with repo data

On my rhel6 system, non-sudo users can do yum check-update. Files are then placed in `/var/tmp/yum[user]*/` . The repodata there gets quite large. Can I:   1. Configure the location?   2. Configure yum so it removes old files? My /var/tmp/yum-nrpe*/x86_64/6Server looks contains the following: > >     28M > el-6-epel/5f32b55aa431745fe8b48deb2e0083a6507d19abbc29562a2e2b01b70ef93ada- > primary.sqlite >     29M > el-6-epel/89f1177c1b9f003409e2f5a91f7f3074a4b8e162376ffab286a35b8221e0a308-primary.sqlite >     29M > el-6-epel/b98f6809469e5de3a13a5b251c5d35c622baecb9f3c593804245c443ace9a224-primary.sqlite >     29M > el-6-epel/c79dd64a4e4aa8fb160353e9cd9d8e10120f5402a18aca730ae860d07f52bda3-primary.sqlite >     29M > el-6-epel/e4b306d444fcfb361f7f2aace64a3ef67c8bd7fd1cbd251e64f150096f2f1ba9-primary.sqlite >     1.2M    el-6-comp- > extra/6c04e2f2f68bc085d529d857dd6c0539ff23d5139d2be21565dac3d8e586bae0-primary.sqlite >     15M     rhel-6-server-optional- > rpms/2469dd815fb83f3667f043cf3098a487a13ac6955ea36b2349bdc3a2ee1e20d2-primary.sqlite >     15M     rhel-6-server-optional- > rpms/bf8ce73943e4c78fc4205924fbfaf20ec4bcb72757f03366ec1245ffe2e0803e-primary.sqlite >     15M     rhel-6-server-optional- > rpms/e4f6cad281229297c712f8dd828c2062f8fbc02c6be215ea0df35059e98b4a5d-primary.sqlite >     124M    rhel-6-server- > rpms/5a411e3bf6a743656636e6baaec1680eec3480cf69acb79aad11c535862f2787-primary.sqlite >     124M    rhel-6-server- > rpms/60daa8229ca2386d6c7f319ce1fd819a46109e0b7a42c90e48acde23c3b200f6-primary.sqlite >     124M    rhel-6-server- > rpms/8592d0cd0b2e358c7850dee130497cb8969a72b9ac28cddc13a054caccee6d65-primary.sqlite >     124M    rhel-6-server- > rpms/f5798fe075da31815c5e43356a10c208af55a972b61fea37d63ea6edb3a78cae- > primary.sqlite >


How is the loopback device traffic allowed?

How can I allow the traffic to be sent on the loopback device (lo)? What is the iptables command for it?


How do I connect and send data to a bluetooth serial port on Linux?

I'm trying to setup a virtual serial port though a USB-Bluetooth adapter on Linux and send a message to it through an Android device. I'm on kernel 3.6. I'm able to pair to the device successfully using gnome-bluetooth and also able to send files to it. To set up the serial port I first add a channel with an SP profile to my adapter:               sdptool add --channel=22 SP      Then I call 'listen' with rfcomm:               rfcomm listen /dev/rfcomm0 22      which blocks on               Waiting for connection on channel 22      Apparently rfcomm will create /dev/rfcomm0 upon a successful connection. Once that happens, I'd like to use something like cutecom to send messages back and forth to the connected device. On my Android device I open up a Bluetooth SPP terminal (there are several out there, I tried a few different ones) and try to connect. They all fail. Given that I can pair successfully and send files without any issues, I know that bluetooth pairing and communication works. I'm not too sure what else I can try. I used 'sdptool browse' on my local device and the Android device to ensure that there aren't any RFCOMM channel conflicts.


While Linux is rebooting which directory is used to search for the executable system binaries?

While Linux is rebooting which `sbin` directory is used to execute the system binaries. As per my knowledge it used to load the binaries in the directory `sbin` directory . But in my system I find so many `sbin` diretories , like `/sbin` , `/usr/sbin` , `/var/usr/sbin`. Which file takes precedence?


Search for specified keywords in files and copy to a new filename based on the keyword

I'm trying to create an .sh script where if any keyword is found in a file then copy that file to the directory `/pathtofolder/keywords/$thefirstkeywordfound` (overwrite the file if it already exists). Any help would be appreciated with the copy code ( `cp -rf filename /pathtofolder/keywords/$thefirstkeywordfound` ) which is incorrect. It probably also needs a line of code to exclude the path it copies to (/pathtofolder/keywords/) Note that I want to copy the file into a directory called `/pathtofolder/keywords/$keyword`, creating it if necessary.


Why does't stopping the nginx server kill the processes associated with it?

When I stop nginx like this on ubuntu 12.04, I get the following errors:               $ sudo service nginx stop     Stopping nginx: nginx.     $sudo service nginx start     Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)      I have to use this to fix it. Why does't stopping the service kill the nginx process? That is confusing!


Wireless constantly reconnecting on Ideapad running Arch

I just bought a new laptop, a Lenovo IdeaPad U330 touch, and after some struggle (with the Secure Boot stupidity) I have managed to install Arch Linux. I have configured my system, installed all the drivers (I think), but I have a problem with my wireless disconnecting from the network. I have noticed that my `dmesg` is being spammed with the               ideapad_laptop: Unknown event: 1      Also, somewhere in the flood of all those messages, there appears               mce: [Hardware Error]: Machine check events logged      but searching for the latter, there was a known bug and it's supposed to be fixed in the 3.14 version of the kernel. I don't know if those messages are related to my wireless issues but I thought they might be relevant. I'm pasting the last few lines of dmesg with wireless reconnecting, hope it helps someone explain to me what's happening:               [ 2513.577794] ideapad_laptop: Unknown event: 1     [ 2534.762183] ideapad_laptop: Unknown event: 1     [ 2555.958244] ideapad_laptop: Unknown event: 1     [ 2577.159613] ideapad_laptop: Unknown event: 1     [ 2580.083918] cfg80211: Calling CRDA to update world regulatory domain     [ 2580.918208] wlp2s0: authenticate with 10:fe:ed:65:58:c0     [ 2580.920015] wlp2s0: send auth to 10:fe:ed:65:58:c0 (try 1/3)     [ 2580.924404] wlp2s0: authenticated     [ 2580.931245] wlp2s0: associate with 10:fe:ed:65:58:c0 (try 1/3)     [ 2580.957371] wlp2s0: RX AssocResp from 10:fe:ed:65:58:c0 (capab=0x431 status=0 aid=10)     [ 2580.968632] wlp2s0: associated     [ 2598.361115] ideapad_laptop: Unknown event: 1     [ 2619.550989] ideapad_laptop: Unknown event: 1     [ 2621.534185] cfg80211: Calling CRDA to update world regulatory domain     [ 2622.369409] wlp2s0: authenticate with 10:fe:ed:65:58:c0     [ 2622.371192] wlp2s0: send auth to 10:fe:ed:65:58:c0 (try 1/3)     [ 2622.375724] wlp2s0: authenticated     [ 2622.378073] wlp2s0: associate with 10:fe:ed:65:58:c0 (try 1/3)     [ 2622.426904] wlp2s0: RX AssocResp from 10:fe:ed:65:58:c0 (capab=0x431 status=0 aid=10)     [ 2622.428139] wlp2s0: associated     [ 2624.830025] cfg80211: Calling CRDA to update world regulatory domain     [ 2625.652178] wlp2s0: authenticate with 10:fe:ed:65:58:c0     [ 2625.653835] wlp2s0: send auth to 10:fe:ed:65:58:c0 (try 1/3)     [ 2625.679633] wlp2s0: authenticated     [ 2625.680707] wlp2s0: associate with 10:fe:ed:65:58:c0 (try 1/3)     [ 2625.800834] wlp2s0: associate with 10:fe:ed:65:58:c0 (try 2/3)     [ 2625.858120] wlp2s0: RX AssocResp from 10:fe:ed:65:58:c0 (capab=0x431 status=0 aid=10)     [ 2625.874661] wlp2s0: associated     [ 2640.757569] ideapad_laptop: Unknown event: 1     [ 2661.948093] ideapad_laptop: Unknown event: 1     [ 2683.154343] ideapad_laptop: Unknown event: 1     [ 2704.340696] ideapad_laptop: Unknown event: 1      Here is also the output of `iwconfig`:               wlp2s0    IEEE 802.11bgn  ESSID:"Krizred2"             Mode:Managed  Frequency:2.427 GHz  Access Point: 10:FE:ED:65:58:C0              Bit Rate=90 Mb/s   Tx-Power=16 dBm              Retry  long limit:7   RTS thr:off   Fragment thr:off           Power Management:on           Link Quality=54/70  Signal level=-56 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:380  Invalid misc:627   Missed beacon:0          lo        no wireless extensions.      and `lspci | grep Net`:               02:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)      Kernel: Linux 3.13.6-1-ARCH **EDIT** If anyone still cares about this... I didn't had much time to deal with my problem, and some things I tried didn't work either. But just now I noticed this, while trying to update my system, just in case, since I don't have much to lose. I tried to update my system with providing network connection with USB tethering over my mobile phone. There I noticed that my phone gets disconnecting in a similar way than my wifi! Even with USB tethering turned off. I also tried with an USB flash key, but that seems to be working...I think I now have a prety good reason to completely freak out :P


How does Menumaker select categories?

I am using Gentoo with Openbox and would like to switch which categories the mmaker (Menumaker) program puts programs into for my menu. But I am unsure of how/where Menumaker pulls this data from, and my Google skills seem to be failing me on this one.


How can I disable IPv6 in custom built embedded setup

I have an embedded system built using buildroot. I have had a number of network issues, one of which is that my machine cannot see its gateway despite it being on the same subnet. I have tried using wireshark to analyse what is going on without success so as a last resort, I am considering trying to turn off support for IPv6 as I do not need it (my device doesn't need DNS or anything similar, simply needs to be able to communicate with other local machines on its subnet). I have read that I can turn off IPv6 by editing `/etc/modprobe.conf` but this file does not exist on my setup. Is there anything else I can do to disable IPv6 or is the only option to build the kernel from scratch without IPv6 support?


Network Manager doesn't show Wireless connection

I've just installed on my Debian Sid with XFCE4 network manager, but I have a problem, no wireless connection are shown. What Should I do? I used to use wicd but I had problems to connect to free wifi :S I don' t know why. However now I'm connected from terminal, but I don't know why connections aren't shown in network manager.. Sameone can help me? Thank you. **EDIT:** Now is showing but network manager gives me this error: ![enter image description here](http://i.stack.imgur.com/HnYJl.jpg) **EDIT2:** My `/etc/network/interfaces`               auto lo     iface lo inet loopback


Color coding html color sequeces in vim

It it possible to setup syntax highlighting in vim so that a html color sequence is colored in that color, e.g. #FF0000 would show up as red. I'd also be ok with it underlining the text that color like Visual Studio does. So basically I'd be looking for the pattern `\\#([0-9a-fA-F]{3}){1,2}` and then want to get the color for that and make that text that color.