/dev/md127 refuses to stop. No open files

So I'm trying to stop /dev/md127 on my Ubuntu 12.10 box. It was set up as RAID1, but I'm trying to move everything (well, rename) to md0. I read that renaming isn't possible, so I'm trying to remove the drives and put them into a new array as md0. I've been able to remove one drive (sdb) by using --fail and --remove, but sdc isn't responding, nor will md127 respond to --stop --force. I've run fuser and lsof, and neither show anything using md127. I was running LVM on top of md127, but I've umounted the LVs and I've done "{lv,vg}change -an vg_Name". I'm at a loss for what to try next. And for those who want to know why I want to rename/move, I'm a little OCD over things like that. If it's relevant, here are the exact commands I've used, though the stop/fail/remove commands have been tried multiple times:               mdadm --stop --force /dev/md127 # this failed with the error message "mdadm: Cannot get exclusive access to /dev/md127:Perhaps a running process, mounted filesystem or active volume group?"     fuser /dev/md127 # no output     lsof /dev/md127 # no output     mdadm --fail /dev/md127 /dev/sdb # succeeded     mdadm --remove /dev/md127 /dev/sdb # succeeded     mdadm --fail /dev/md127 /dev/sdc # this failed - "device or resource busy"     mdadm --remove /dev/md127 /dev/sdc # this failed - "device or resource busy"     lvchange -an vg_Name     vgchange -an vg_Name


What's the difference between sudo su - and sudo su --

When I am working on our RHEL machines, I use `sudo su -` to switch to being root. One day, a typo meant I typed `sudo su --` instead - it seems to me that everything was the same as with a single hyphen, except that I was in the same folder as before I issued the command (with a single hyphen I find myself in `/root`). Are there other differences? Is it safe to use this in scenarios where I know I want to work in the same directory?


Redirect mail adressed to specific address to individual mail servers - postfix

My current set up: mailserver1 mailserver2 (both serving the same domain) and user1 user2 I want do redirect all mails which are addressed to user1 to mailserver1 and the same for user2 to mailserver2. So, I was able to find a lot of tutorials, which describes how to redirect all messages regarding a domain to a different mail server but not for each individual user. Could someone help me which the configuration?


Why do Chromebooks no longer allow VPN connections in Guest Mode?

This is reproducible in stable, beta, and developer channels. It is also ticketed on their website:   * https://code.google.com/p/chromium/issues/detail?id=308811 Any ideas as to why VPN connections no longer appear to work in Guest Mode?


Look for a process with a given name

I am trying to convert the VMS command `show/system/process=processname` into an equivalent Linux command. I tried the following but it returned none of the processes:               ps -C /exeimages/processname.pl


Compiling Wine 1.7.1 in Gentoo

Trying to compile Wine 1.7.1 with the great new D3D and Opengl patches. I proceed like this:   1. Download the GIT source code from here: https://github.com/tpruzina/wine-1.7.1-d3dstream_patches-gentoo_compat_patches   2. Run the script the author made to build both 32 bit and 64 bit libs, which is basically creating 2 directories one for each arch and configure / make   3. The configure goes kind of well for what I see but then the make crashes badly here:              make[1]: Leaving directory `/home/cf/Downloads/wine-1.7.1-d3dstream_patches-gentoo_compat_patches-master/wine64/dlls/dxguid'     make: *** No rule to make target `dlls/ntoskrnl.exe/ntoskrnl.exe.spec', needed by `dlls/ntoskrnl.exe/libntoskrnl.exe.def'.  Stop.      Full configure and make logs here : http://pastebin.com/vRZpUVH1


Determine xinput device manufacturer and model?

I'm trying to find the device manufacturer and model of my keyboard and touch pad so I can write an XOrg configuration file targeting it via:               Section "InputClass"         Identifier "touchpad"         MatchIsTouchpad "on"         Driver "synaptics"         MatchProduct "Product Name"         MatchVendor "Vendor Name"     EndSection      How can I discover a device's product and vendor name using a CLI tool? I'd like to nail down my Bluetooth touchpad and keyboard so as to be able to tailor Xorg configuration.


bash commands don't seem to run in .xinitrc

I am trying to run some bash commands in my `.xinitrc` script, but the window manager starts without these commands running properly. I run Arch Linux with the window manager is called "awesome", and I start it with `startx`. This is the entirety of my `~/.xinitrc` file:               #!/bin/sh     #     # ~/.xinitrc     #     # Executed by startx (run your window manager from here)          if [ -d /etc/X11/xinit/xinitrc.d ]; then       for f in /etc/X11/xinit/xinitrc.d/*; do         [ -x "$f" ] && . "$f"       done       unset f     fi          xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation" 8 1     xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation Button" 8 2     xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation Timeout" 8 200     xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation Axes" 8 6 7 4 5          rfkill block bluetooth          # exec gnome-session     # exec startkde     # exec startxfce4     # ...or the Window Manager of your choice     exec awesome      As you may have noticed, I'm trying to shut down my Bluetooth and activate trackpoint scrolling on my laptop. Each of those `xinput` and `rfkill` commands work when entered manually, but nothing happens when I run `startx`. What on earth is the problem here? :(


Multi-line grep beween two tags, only show the last match


'Cannot open display' on restored GNU screen session

Using debian unstable with Gnome 3 but I think this has always happened. If I log out and then log back in again it seems the X session is restarted or in some way changed. In any case, when I start a terminal in the second session and re attach the screen, it's no longer possible to start X apps. (message is 'Cannot open display'). Is there an environment variable I can set or command I can run so that the screen session knows the new X details, or do I always have to start a new screen session?


How to run a specified codeblock with getopts when no options or arguments are supplied?

So I am writing a script that mixes options with arguments with options that don't. From research I have found that getopts is the best way to do this, and so far it has been simple to figure out and setup. The problem I am having is figuring out how to set this up so that if no options or arguments are supplied, for it to run a separate set of commands. This is what I have:               while getopts ":n:h" opt; do       case $opt in         n)           CODEBLOCK >&2           ;;         h)           echo "script [-h - help] [-n <node> - runs commands on specified node]" >&2           exit 1           ;;         \?)           echo "Invalid option: -$OPTARG" >&2           exit 1           ;;         :)           echo "Option -$OPTARG requires an argument." >&2           exit 1           ;;       esac     done      I have tried adding something like this to the top of the code to catch no arguments, but it then runs the same code even when options and arguments are supplied (something is probably wrong in my syntax here):               [[ -n "$1" ]] || {     CODEBLOCK1     }          while getopts ":n:h" opt; do       case $opt in         n)           CODEBLOCK2 >&2           ;;         h)           echo "script [-h - help] [-n <node> - runs commands on specified node]" >&2           exit 1           ;;         \?)           echo "Invalid option: -$OPTARG" >&2           exit 1           ;;         :)           echo "Option -$OPTARG requires an argument." >&2           exit 1           ;;       esac     done      The man page for getopts was sparse and I have found relatively few examples on searches that provide any insight into getopts, let alone all the various features of it.


What happens with /etc/fstab when using an initramfs?

I have a simple embedded setup as follows: x86 target, kernel and root file system built using buildroot. Syslinux is the bootloader configured to boot with an initramfs which points to a .cpio file generated from the buildroot generated root file system. My system boots and works as I am expecting, but I am confused as to what happens with the entries contained in /etc/fstab. I would like my system to be able to mount the /var directory as a partition on an attached compact flash device for various reasons (mainly because I want to be able to store and run an application on the compact flash and additionally store log data here). Is it possible to use an initramfs and yet mount /var on device outside of RAM? If that is the case, is /etc/fstab the correct place to configure this?


What does the Enlightenment desktop (E17) environment variable "PANTS=ON" do?

Installing the Enlightenment Window Manager (E17), results in an environment variable being set:               PANTS=ON      What does this environment variable do? What will happen if I set               PANTS=OFF


sed: replacing newline at a given line (or last line)

I have a file like the following:               a,b,c,d,e,f     1,2,3,4,5,6     7,8,9,0,1,2      I need to join the last two lines with a comma, like so:               a,b,c,d,e,f     1,2,3,4,5,6,7,8,9,0,1,2      The problem is that this is all inside a loop that will add two new lines to that file, say               a,b,c,d,e,f     1,2,3,4,5,6,7,8,9,0,1,2     0,9,8,7,6,5     4,3,2,1,0,9      And now I need to do the same to _that_ last line for the file to end like               a,b,c,d,e,f     1,2,3,4,5,6,7,8,9,0,1,2     0,9,8,7,6,5,4,3,2,1,0,9      So, in only a few words, I need to replace the _last_ new line of a text file with a comma, but only the last line, as lines are being added. I've tried several things but they don't work. The last one was `sed '$!N;s/\n/,/' dna.data`, but it applies to all lines with a newline. Any ideas?


Savings emails as individual files using Procmail

I installed Getmail to retrieve emails from another email server and Procmail to filter the incoming emails. (I am running Debian/Squeeze.) The recipe I created has this code:               :0:     * ^TO_myemailaddress@domain.com     Xyz      I thought this will make sure that all incoming emails will be saved in `~/Maildir/Xyz/` as individual files. Instead, it seems to be creating a file called `Xyz` (not a directory) inside `~/Maildir/` and appending new emails to the same file. How do I save incoming mails as individual files to a folder, instead of a single file?


No shutdown or reboot option in KDE4's menu

I obviously have the privilege to shutdown through dbus, cuz it works in XFCE4, but in KDE4, I only have an option to logout. Any thoughts? I start kde4 with `dbus-launch --exit-with-session startkde` **EDIT** Yes, I got `Active=yes` from systemctl, but removing the dbus-launch stopped docky from launching, and .. shutdown option still not available


Find command returns wrong files

I'm trying to find files in a folder using find command which are a day older than the day on which the command is run.. I use the following command:               FILES_dcn=($(find  $dir_dcn -maxdepth 1 -type f -name "*.pcap" -mtime +1 -print0 | xargs -0 ls -lt | tail -15 | awk '{print $9}'))      But the output seems to be like :               -rw-rw-rw- 1 nethawk nethawk  2097664 Mar 16 01:58 /mnt/md0/capture/dcn/dcn_2014_03_16_01_58_00_438.pcap     -rw-r--r-- 1 root    root    27935978 Mar 17 10:00 /mnt/md0/capture/dcn/dcn_2014_03_16_18_29_18_983.pcap     -rw-rw-rw- 1 nethawk nethawk  2097296 Mar 17 10:02 /mnt/md0/capture/dcn/dcn_2014_03_17_10_02_00_335.pcap     -rw-rw-rw- 1 nethawk nethawk  2097192 Mar 17 10:02 /mnt/md0/capture/dcn/dcn_2014_03_17_10_02_49_476.pcap     -rw-rw-rw- 1 nethawk nethawk  2097936 Mar 17 10:07 /mnt/md0/capture/dcn/dcn_2014_03_17_10_06_59_326.pcap     -rw-rw-rw- 1 nethawk nethawk  2097464 Mar 17 10:10 /mnt/md0/capture/dcn/dcn_2014_03_17_10_10_00_407.pcap     -rw-rw-rw- 1 nethawk nethawk  2097232 Mar 17 10:13 /mnt/md0/capture/dcn/dcn_2014_03_17_10_13_48_603.pcap     -rw-rw-rw- 1 nethawk nethawk   426800 Mar 17 10:14 /mnt/md0/capture/dcn/dcn_2014_03_17_10_13_58_428.pcap     -rw-rw-rw- 1 nethawk nethawk  2097544 Mar 17 10:14 /mnt/md0/capture/dcn/dcn_2014_03_17_10_14_10_259.pcap     -rw-rw-rw- 1 nethawk nethawk  2097600 Mar 17 10:14 /mnt/md0/capture/dcn/dcn_2014_03_17_10_14_49_609.pcap     -rw-rw-rw- 1 nethawk nethawk  2097472 Mar 17 10:17 /mnt/md0/capture/dcn/dcn_2014_03_17_10_16_59_503.pcap     -rw-rw-rw- 1 nethawk nethawk  2097696 Mar 17 10:17 /mnt/md0/capture/dcn/dcn_2014_03_17_10_17_48_698.pcap     -rw-rw-rw- 1 nethawk nethawk  2098048 Mar 17 10:18 /mnt/md0/capture/dcn/dcn_2014_03_17_10_18_29_981.pcap     -rw-rw-rw- 1 nethawk nethawk  2097352 Mar 17 10:20 /mnt/md0/capture/dcn/dcn_2014_03_17_10_20_10_320.pcap     -rw-rw-rw- 1 nethawk nethawk  2097416 Mar 17 10:20 /mnt/md0/capture/dcn/dcn_2014_03_17_10_20_49_703.pcap      Its should have been               -rw-rw-rw- 1 nethawk nethawk  2097296 2014-03-17 10:02 dcn_2014_03_17_10_02_00_335.pcap     -rw-rw-rw- 1 nethawk nethawk   443736 2014-03-17 10:02 dcn_2014_03_17_10_01_58_254.pcap     -rw-rw-rw- 1 nethawk nethawk  2098136 2014-03-17 10:01 dcn_2014_03_17_10_01_48_427.pcap     -rw-rw-rw- 1 nethawk nethawk  2097456 2014-03-17 10:01 dcn_2014_03_17_10_01_38_622.pcap     -rw-rw-rw- 1 nethawk nethawk  2097480 2014-03-17 10:01 dcn_2014_03_17_10_01_28_773.pcap     -rw-rw-rw- 1 nethawk nethawk  2097184 2014-03-17 10:01 dcn_2014_03_17_10_01_18_966.pcap     -rw-rw-rw- 1 nethawk nethawk  2097184 2014-03-17 10:01 dcn_2014_03_17_10_01_09_127.pcap     -rw-rw-rw- 1 nethawk nethawk  2097272 2014-03-17 10:01 dcn_2014_03_17_10_00_59_280.pcap     -rw-rw-rw- 1 nethawk nethawk  2097896 2014-03-17 10:00 dcn_2014_03_17_10_00_49_462.pcap     -rw-rw-rw- 1 nethawk nethawk  2097376 2014-03-17 10:00 dcn_2014_03_17_10_00_39_653.pcap     -rw-rw-rw- 1 nethawk nethawk  2097344 2014-03-17 10:00 dcn_2014_03_17_10_00_29_816.pcap     -rw-rw-rw- 1 nethawk nethawk  2097656 2014-03-17 10:00 dcn_2014_03_17_10_00_19_977.pcap     -rw-rw-rw- 1 nethawk nethawk  2097232 2014-03-17 10:00 dcn_2014_03_17_10_00_10_172.pcap     -rw-rw-rw- 1 nethawk nethawk  2097656 2014-03-17 10:00 dcn_2014_03_17_10_00_00_323.pcap     -rw-rw-rw- 1 nethawk nethawk   435544 2014-03-17 10:00 dcn_2014_03_17_09_59_58_280.pcap      And the current time Fri Mar 21 16:10:42 UTC 2014. Why is this happening ? The files are stored in a samba share drive.


Citrix XenServer, all packages appear to be 32bit

I'm hoping to use Citrix XenServer for a group of 4/5 machines. One of these machines has 18TB of storage (after RAID5 is taken into account). I've installed XenServer and mkfs.ext3 is the only option. After looking through packages using yum, everything is i386. I downloaded the ISO from here; http://www.xenserver.org/overview-xenserver-open-source- virtualization/download.html Has anyone else noticed this?


Bash in php exec in webpage don't colors for png and mp3 files on Linux

I have code like this in php:               header("Content-Type: text/plain");     exec("/bin/bash -c 'ls --color=always'", $result);     echo implode("\n", $result);      and I've got result (escape is not visible)               Makefile     README     Yann Tiersen - Comptine d'un autre ete L'apres midi.mp3     bush-src.js     bush.js     bush.min.js     [0m[01;34mcgi-bin[0m     config.json     [01;34mcss[0m     favicon.ico     foo.png     index.php     [01;34mlib[0m     ls.txt     test.php     test.php~     [01;32mtest.txt[0m      It show ANSI escape codes for directories and executable files, but when I call from command line               php -r "exec('bash -c \"ls --color=always\"', \$result);echo implode(\"\\n\", \$result);" | less      I've got this:               bush.js     bush.min.js     bush-src.js     ESC[0mESC[01;34mcgi-binESC[0m     config.json     ESC[01;34mcssESC[0m     favicon.ico     ESC[01;35mfoo.pngESC[0m     index.php     ESC[01;34mlibESC[0m     ls.txt     Makefile     README     test.php     test.php~     ESC[01;32mtest.txtESC[0m     ESC[00;36mYann Tiersen - Comptine d'un autre ete L'apres midi.mp3ESC[0m      png and mp3 have ANSI escapes codes, why php exec from webpage don't give that as return?


How do I tail a log file and keep tailing it when the latest one changes date?

I'm using RHEL 4. The normal `tail -F file_name*.log` doesn't update when the time flips over to 0000. Here's what I've tried so far from searching the web, both of which try to use nested `tail`: `tail -F $(ls -tr file_name*.log | tail -n 1)` `tail -F $(fine . -maxdepth 1 -type f -printf "%T@ %p\n" | sort -n | tail n 1 | cut -d' ' -f 2-)` None of these flip over to new files. Plain old `tail -F file_name*.log` works in my small test cases (while the 2 above don't), but it doesn't work when I'm tailing a real log file.


Is there a faster alternative to pkg-config?

Our build system uses pkg-config to build the software, but the linking can take very long (sometimes up to 20 minutes). We identified pkg-config as the guilty tool. So, is there a faster alternative to pkg-config? Or, are there some settings to use to speed up the linking? PS I am not sure if this question is relevant for this question.


Disable trackpad click in Yellowdog linux

I just installed yellowdog linux 6.2 on an old PowerPC laptop. By default, it's interpreting trackpad taps as clicks, which I want to disable. I followed the directions here, and put `TRACKPAD_OPT=notap` in my `/etc/sysconfig/mouse-emulation` and rebooted, but taps are still interpreted as clicks. Putting the setting in `/etc/sysconfig/mouse` instead (which I had to create) and rebooting didn't fix the problem either. I also tried               % sudo trackpad notap     Password:     writing /dev/adb: No such device or address      So that didn't seem to work. What should I do?


Max Open Files, clarification needed

On my machine, `ulimit -n` returns 2560 Given that `-n` returns > The maximum number of open file descriptors. Does it mean that system won't allow more then 2560 open files to be out there at any given time? If not, how can i find out what is a hard limit system imposes on open files?


Is there any sort of online kernel repository or sharing sites (possibly for laptops)

It just seems there should reasonably be something like this considering so many folks run *nix on laptops and laptops have such consistent hardware sets. At a guess I'd imagine there's likely in the ~1000-2000 range of hardware combinations making up ~85% of laptops in current use (this is completely random guess off the top of my head). That said, does anyone know of any sites where people share their precompiled kernels or .configs? I used to meddle them up myself; but that was ~10 years ago and I don't frankly want the headache of getting my hardware working myself. Would be awesome if I could just go to a website, start selecting hardware my machine has and it filters down to other peoples shared .config files, or I could just put in my laptop's model number and it finds someone elses posted .config who had the same. On a side note, yes the common default kernels distros come with seem to work fine on my laptop, but I'm struggling to get the ATI drivers working correctly (I understand I need to remove DRI/KMS and stand on my head while doing some other things; so far I've managed to boot to a black screen in my latest kernel recompile attempt) but it seems somebody else has probably wrestled this into submission on their machine, and their should be a site they can share it in a more concrete form than tutorial.


Bash tab completion fails inside of command substitution

I've been using kill $(pidof ) to terminate programs for a while, and since last night, every time I try to use tab completion inside the `$()` it throws an error,               bash: unexpected EOF while looking for matching `)'     bash: syntax error: unexpected end of file      Tab-completion works fine outside of command substitution. I guess my question is where are the configuration files for tab-completion located on an Ubuntu system? If anyone has had this specific problem, or can see plainly what I cannot, how to fix this, and/or why this would occur? (I always want to know why.) and if not that, even where and how I should begin my investigation into this problem, would be greatly appreciated. **UPDATE** tab completion following `$(pidof` is no longer throwing an error, but is now not working at all. I've never really messed with any bash internals before, but am not afraid to get my hands dirty. Any guidance greatly appreciated.


EBtales not working

I wanted to go a little bit further and install EBtables (the 2-layer filtering and routing table). The purpose of it was to only allow the minimal necessary(IPv4 and ARP). To test it I ran:               ebtables -P INPUT DROP     ebtables -P FORWARD DROP     ebtables -P OUTPUT DROP      Then, I tested it, `ping 8.8.8.8`, and surely enough, I got a reply. I tried a couple of other combinations, checked there are no other tables, but ping still worked. If EBtables can't block/filter, it is pointless. I am **_NOT_** trying to block ICMP, I am trying to block everything except IPv4. To test EBtables, I **tried** using ICMP, but it was not blocked (meaning EBtables don't work). What am I doing wrong? (Debian Squeeze, iptables and whatnot, EBtables v2.0.9-2)


Is there a way to intercept interprocess communication in Unix/Linux?

For intercepting/analyzing network traffic, we have a utility called Wireshark. **Do we have a similar utility for intercepting all the interprocess communication between any two processes in Unix/Linux?** I have created some processes in memory and I need to profile how they communicate with each other.


PXE boot via off-site TFTP server

I would like to PXE boot from a TFTP server that is not on my local network. The server is running in a cloud VM. Is it possible to specify the remote server's IP without utilizing DHCP? If not, what would the simplest pass-through method be to proxy requests via another working PC on the local subnet?


How can I ensure my cronjob will run at specified time?

I'd like to know how I can check to see if my cronjob will run at the specified time I set it at. Is there anyway I can test this without having to wait for that time? Here are my crontab -l results:               root@work:~$ crontab -l     3 */23 * * * /opt/lampp/bin/php /opt/lampp/htdocs/site/cron/my_script.php > /dev/null      If I did the values right, will my cronjob run at exactly 11pm every night and log any output to /dev/null for cleanliness? Thanks.


Can grep return true/false or are there alternative methods

I'm trying to write this script for an assignment - it's only the second one I've written so bear with me. As a part of this script, I need to be able to check if the first argument given matches the first word of file. If it does, exit with an error message, if it doesn't, append the arguments to the file. I understand how to write the if statement, but not how to use grep within a script. I understand that grep will look something like this grep ^$1 schemas.txt I feel like this should be much easier than I am making it. Any help appreciated. Update: I'm getting an error too many arguments on the if statement. I got rid of the space between grep-q and then got an error binary operator expected. I've been poking around at it, but I don't see what it sees.               if [ grep -q ^$1 schemas.txt ]     then             echo "Schema already exists. Please try again"             exit 1     else             echo "$@" >> schemas.txt     fi


How to adjust charging thresholds of laptop battery?

My laptop is Lenovo T400, and OS is Ubuntu 12.04. I have not been able to adjust the thresholds for battery starting charging and stopping charging. I observed that its current starting charging threshold is about 40%, and stopping charging threshold is about 60%. I forgot if it was me and which program I used to control the battery to stop charging at 60% and start charging at 40%. I followed my previous post http://askubuntu.com/questions/58789/how-to-check- charged-percentage-of-battery-and-to-adjust-its-thresholds, but I don't find `/sys/devices/platform/smapi`. Also I have `/proc/acpi/battery/BAT0/`, but I have only three files `alarm`, `info` and `state`. I want to adjust the thresholds. So I wonder how to do that? Thanks!


Local servers (behind NAT) on vpn with email servers and sync with a central email server open to internet

**What I have** I have a number of Linux (Ubuntu) servers (20 as of now but may grow over time to hundreds) connected to each other via private VPN (OpenVPN) which serve intranet web application (Apache and PHP) in their respective local network. Users in these local networks do not have internet and they use these servers for few services. A lot of such servers can be behind NAT, or dial up internet. Users of the servers are not connected to VPN or Internet. Their only access within the local network is that server. There is one central server in the VPN which also have a public static IP and a domain name pointed to it. The same application is also served by the central server for those users (road warriors) who wish to connect from public internet. In case of my web application I sync the changes between a local server and the central server, whenever possible. I am using MongoDB for data storage. I have a unique name for every server which can be used for making FQDN, but I don't have a DNS system in place as of now. * * * **What I need** I also wish to add an email service [collaborative suite if possible] to these servers, in such a way that a local server can facilitate email communication within the local network and also sync with the central server [current VPN host] so that a user of a local server connecting via internet (road warrior) is still able to exchange emails. some amount of delay will be acceptable for sync to complete across servers. The service should be transparent. I do not wish my users to use different email addresses or have different IMAP inbox. * * * **Constraints** I have user's credentials in MongoDB databases in local servers and synced to central server. These credentials can be accessed via a PHP REST API. If required I can put hooks on the API create/update events to update the credentials in any required format (LDAP, MySQL, Memcache or something else), But I don't know about replicating in reverse direction. * * * **Answers I seek**   1. Such a system possible with email replication along with IMAP inbox? [Yes/No]   2. will I need a DNS setup? [Yes/No -- Details if possible]   3. is there a suite/software (which integrates, mail transfer agent, mail delivery agent and webmail) for such multi tier scenario, which I can use for such a setup? such as Zimbra? [Which suite/software]   4. or i have to use a stack of Mail Transfer Agent (Postfix/sendmail/Exim), Mail Delivery Agent (sendmail/Dovecot/Cyrus/Courier) and Webmail (Squirrel/OpenWebMail)? [Yes/No and which combination will work for such a system - details if possible] * **Note** \- I am not asking how to setup. I am just asking what's possible and which tools to use.  * * * **A different but Related question** Right now i have users in every server in MongoDB. At central server I keep a database for every server (I have unique names for every server which can be used to make FQDN). I identify users at central server like this > unique_userid_at_local@local_server_name can i have a multi tier LDAP setup where i can keep the users in both local and central server and keep both in sync? is yes which software/stack will work best?


cp -L vs. cp -H

**Problem** When copying files with `cp -H` or `cp -L`, I get the same results:               $ ls -l fileA       fileA -> fileB     $ cp fileA somewhere/ -H     $ ls -l somewhere/       fileA     # fileA is a copy of fileB, only renamed, with same properties!      This answer here describes both options as similar UNLESS used in combination with `-R`. Not for me. Soft- as hardlinked files become renamed copies of the files they point to at the source.   ## **Question** : What is the proper use of `cp -H` and `cp -L`? Is this the expected behavior?      **My attempt to solve** : `man cp` tells me quite the same for both options,     but `info cp`'s _wording_ makes it even more confusing for me. Maybe one     can help me break this down a bit: > `-H` If a command line argument specifies a symbolic link, then **copy the > file it points to rather than the symbolic link** itself. However, **copy > (preserving its nature) any symbolic link** that is encountered via > recursive traversal. This sounds like a contradiction to me: I guess that » _a symbolic link's nature_ « is that it points somewhere… > `-L, --dereference` Follow symbolic links when copying from them. With this > option, `cp` cannot create a symbolic link. For example, a symlink (to > regular file) in the source tree will be copied to a regular file in the > destination tree. I do know that a symlink isn't a regular file, but… I admit I'm overchallenged with this explanation here.


Why date output X-3 instead X-2 days when I am doing arithmetic operations

In one of my script, I need to find a 2 days back date from a given date. I have been using the below without any issue since long time, but it's just the first time I got a error which drilled down to wrong value by date command.               $ date -d 20140331" - 2 days" +%Y%m%d      Expected output               20140329      Actual output               20140328      Using "- 2 days" gives expected output, but still struggling to find why subtracting seconds didn't work? ![unix date output](http://i.stack.imgur.com/SwM7U.png) **Note:** My process runs in middle of the day, and hence I don't see any extreme boundary condition like 1 sec got dwindled here and there. **Some more info**               $ date --version     date (GNU coreutils) 5.97     Copyright (C) 2006 Free Software Foundation, Inc.


exit shell script from a subshell

Consider this snippet:               stop () {         echo "${1}" 1>&2         exit 1     }          func () {         if false; then             echo "foo"         else             stop "something went wrong"         fi     }      Normally when `func` is called it will cause the script to terminate, which is the intended behaviour. However, if it's executed in a sub-shell, such as in               result=`func`      it will not exit the script. This means the calling code has to check the exit status of the function every time. Is there a way to avoid this? Is this what `set -e` is for?


Can't sudo after lock password, can I recover from that?

After setup ubuntu with default settings, It allows user to login with password, so I use passwd -l [username] to forbid password login both in ssh and console. But when I use sudo to execute commands, it needs password so I can't use sudo any more. Is there any solution that I can use sudo again, another question is how to forbid password login both in ssh and console but keep sudo password auth available?


How to inline expand wildcard in bash?

I remembered bash can do the following: Suppose there are 3 files: a,b,c in the current directory, when I input:               $> somecommand *      and then press a key or key combinations or a key sequence, the wildcard * online expanded as:               $> somecommand a b c      but I cannot remember and cannot google out the key sequence! help!


EPUB reader for *BSD/Linux

What are the best native EPUB readers for *BSD/Linux. Browser add-ons are not an option. I prefer non-Qt applications but you can share Qt applications if you want. If possible, I want a program that remembers the page I was last viewing.


Managing unofficial repositories on a Debian system

A few years ago I added this repository to my sources.list: http://www.deb-multimedia.org/ because it contained packages like acroread or flash player, which were either missing or out of date in the official repos. However, now I have just realized that some of the packages from that repository are broken, e.g. mencoder. Hence a few questions:   1. How can I find out which packages are installed from this particular repository?   2. How can I make this repository lower priority, so that only the packages I want are automatically installed/upgraded from there? EDIT: I edited `/etc/apt/preferences' file as someone suggested:               grzes:/home/ga# cat /etc/apt/preferences     Package: *     Pin: release a=testing     Pin-Priority: 700          Package: *     Pin: release a=stable     Pin-Priority: 600          Package: *     Pin: release a=unstable     Pin-Priority: 50          Package: *     Pin: origin deb-multimedia.org/     Pin-Priority: 50      but it didn't seem to work (note that I downgraded this package manually):               grzes:/home/ga# apt-cache policy mencoder     mencoder:       Installed: 2:1.0~rc4.dfsg1+svn34540-1+b2       Candidate: 3:1.1-dmo5       Version table:          3:1.1-dmo5 0              50 http://www.deb-multimedia.org/ unstable/main i386 Packages             700 http://www.deb-multimedia.org/ testing/main i386 Packages      *** 2:1.0~rc4.dfsg1+svn34540-1+b2 0              50 http://ftp.uk.debian.org/debian/ unstable/main i386 Packages             700 http://ftp.uk.debian.org/debian/ testing/main i386 Packages             100 /var/lib/dpkg/status          2:1.0~rc3++final.dfsg1-1 0             600 http://ftp.uk.debian.org/debian/ stable/main i386 Packages


Make thunar mount drives into /media rather than /run/media/username?

It's pretty annoying that thunar mounts a drive to `/run/media/user_name/XX` instead of `/media/XX`, can I change that behavior ? I'm running latest arch linux


Tmux, change window pane by mouse click

Is it possible to use the mouse to navigate between different window panes which are split vertically or horizontally?


Replace every odd or even occurance of a pattern in a file

I want to replace either every odd or even occurrence of a pattern. Look at the following example:               $ echo aaaaa | sed -e 's/a/b/' -e 's/a/c/' -e 's/a/b/' -e 's/a/c/' -e 's/a/b/'     bcbcb      Is there some command that can do this more concisely? What I'm actually doing is converting `*`s into BBCode `[i]` and `[/i]` tags, so if there's a markdown-to-BBCode converter out there, I'd like to hear about it too.


Console download accelerator that downloads *multiple* files simultaneously

The download accelerators I've found thus far only let me specify a single file to download. This is useful for single large files, but I'm looking for a tool that lets me hand over a _list_ of multiple files to download simultaneously. In some cases I would want to download the entire list in the traditional accelerated fashion, but sometimes I wouldn't want acceleration - for example, when I was fetching script-generated content. **EDIT** : `lftp` is quite a good program (!), but has no way to show live information about **_all_** running downloads, only one (via `wait all`). I _can_ write a script which watches `lftp`'s file descriptors and displays statistics off of that, but that's decidedly inelegant... and thinking about it, I don't know how big the downloaded file is (since I have no access to the `lftp` process) so I can't calculate percentages anyway. :(


Why does the substitution of newlines using g/re/p only apply to every other line in Vim?

Consider:               foo     bar     ....     bar     baz      Then:               :g/bar/s/\n/\r\r/g      unexpectedly returns:               foo     bar          bar     bar          bar     bar          ...     baz      when I want newlines after every `bar`. Yet:               :g/bar/p      returns:               bar     bar     ...     bar      as expected and if there are newlines between all the `bar`s I get what I expect--an extra newline after every line containing `bar`. I solved the problem by via:               :%s/\(bar.*\)\n/\1\r\r/g      but I'd really like to have a better understanding on what's going on.


Please enter PIN (Ubuntu, Desktop, 3G Modem) turn off

Upon having booted to my Ubuntu on my notebook which has an internal dial-up device for 3G network, which I don't use anymore, Ubuntu asks for my PIN for the sim card. How can I disable this pin request?


Why ls -lrth and ls -ltch gives different results

I was trying to find the time of database backup. Normally i use > >     ls -ltch >   But this time i used > >     ls -lrth >   It gave me different result for One file and all date-stamps were same for both commands               -rw-r----- 1 oracle dba  41M Dec  7 23:59 ctrl_071223     -rw-r----- 1 oracle dba  42M Dec  7 20:52 c-4249173797-20121207-00     -rw-r----- 1 oracle dba 202M Dec  7 20:52 ALG_OSLPRD_jens9rfr.alg     -rw-r----- 1 oracle dba 189M Dec  7 20:52 ALG_OSLPRD_jfns9rfr.alg     -rw-r----- 1 oracle dba 140M Dec  7 20:52 ALG_OSLPRD_jgns9rfr.alg     -rw-r----- 1 oracle dba 3.0G Dec  7 20:51 BKPOSLPRD_jbns9p1f.F_bkp     -rw-r----- 1 oracle dba 4.2G Dec  7 20:46 BKPOSLPRD_jdns9p1f.F_bkp     -rw-r----- 1 oracle dba 3.8G Dec  7 20:43 BKPOSLPRD_jcns9p1f.F_bkp     [root@pdbosl02 daily]# ls -lrth     total 12G     -rw-r----- 1 oracle dba 3.8G Dec  7 20:43 BKPOSLPRD_jcns9p1f.F_bkp     -rw-r----- 1 oracle dba 4.2G Dec  7 20:46 BKPOSLPRD_jdns9p1f.F_bkp     -rw-r----- 1 oracle dba 3.0G Dec  7 20:51 BKPOSLPRD_jbns9p1f.F_bkp     -rw-r----- 1 oracle dba 140M Dec  7 20:52 ALG_OSLPRD_jgns9rfr.alg     -rw-r----- 1 oracle dba 189M Dec  7 20:52 ALG_OSLPRD_jfns9rfr.alg     -rw-r----- 1 oracle dba 202M Dec  7 20:52 ALG_OSLPRD_jens9rfr.alg     -rw-r----- 1 oracle dba  42M Dec  7 20:52 c-4249173797-20121207-00     -rw-r----- 1 oracle dba  41M Dec  7 20:52 ctrl_071223      What I'm missing


Symbolic link and hard link questions

Let's say /A/B/c.sh is symbolic linked to /X/Y/c.sh.   * If c.sh has the command "./SOMETHING", '.' means /A/B/ or /X/Y/?   * How about the hard link?


OS X: how to keep the computer from sleeping during a ssh session

When I _ssh_ into a **OS X** computer on my network the session lasts until the **OS X** goes into **sleep** mode. Is there a way to prevent this from happening during my _SSH_ session, apart from physically bumping the mouse or typing keys, or manually disabling the sleep function? EDIT: The ssh session would normally be a simple sshfs mount.


Is it impossible to run as `root` if the machine isn't rooted?

By default, the user of the device does not have access to certain `root` objects (e.g. the `/data` directory). Even though these objects are off- limits, however, it would seem to me that these objects are there for a reason; some process that runs as `root` eventually to access these objects, or else why would they exist. But I have little experience with UNIX and Android and wanted to ask to make sure: Can the `root` user run on an Android device which hasn't been "rooted"? In which cases can a process initiate a `root`-level action? (e.g. OS updates?). Must the `root` password be provided in all cases? Although I would try to answer this question myself, all things "UNIX" and "Android" looks like a lot to read, and I am not sure where I would find the answer to my specific question.


Picking a random file from each subfolder

Inspired by the accepted answer to this thread: List X random files from a directory, I tried to put together two lines that would pick one file from each subfolder of my current directory, with no success:               rand() REPLY=$RANDOM     for x in *; do y=$($x/*(o+rand[1])); print ${y:r}; done      It looks like the expansion of `y` is not working properly. Why? What's wrong with the code above?


Can I use pmap to find out Memory utilization?

I want to measure memory utilization of my Apache Server. Can I use the `pmap` command and pass all the process IDs of `httpd` and take that as total utilization?               pmap PID1 PID2 ....      It seems that `pmap` gives more info than just RAM utilization. Is there any command in Unix/Perl with which I can get the correct info for memory use?


Block Internet Connection through Terminal on OSX

Even though I don't have administrative privileges, can I block Internet connection on my Mac OS 10.8 machine, through the terminal? I want to do this because I am too lazy to disconnect ethernet cable from my machine to check one of my apps in offline mode. I have found that for Windows we have: `ipconfig release` and `ipconfig renew` commands for the same task. Do we have any alternatives for those in Mac or any better solution to achieve it?


How to prevent user applications from knowing about network failure?

I have a very unreliable connection which disconnects quite frequently and becomes a massive problem when downloading, as the option to resume is not always available. The solution that comes to my mind is to _prevent_ processes to know about the disconnection while I am reconnecting so that downloads do not fail. How can I do this? (I am running Linux)


Can we use symbolic link and hard link for directories?

I know we can do that for files. What about directories? It seems that cpanel uses that a lot.


Prompt user for sentence and store it without being disturbed by spaces

I have a bash function that prompts user to input certain data. I tried it with first name, last name, birthday etc. Data that is mostly represented in one sentence. When I ask for street + no. the function breaks, because it can't handle spaces.               askForData 'Please enter your street and number' STREET      I get following error.               Please enter your street and number: ExampleStreet 123     func_askForData: line 21: 123: command not found      How can I extend my function to accept sentences? file: func_askForData               #!/bin/bash          # Usage askForData "Prompt for value" VARIABLE     # Prints out prompt and stores input in VARIABLE     #      # Prompt is printed till non-empty input is made.          function askForData()     {     local PROMPT=${1}     eval local VAR_NAME=${2}          local CONTINUE=true     while ${CONTINUE}         do             read -p "${PROMPT}: " VAR_VALUE             if [ -z "$VAR_VALUE" ]; then                 CONTINUE=true             else                 CONTINUE=false                 eval ${VAR_NAME}="${VAR_VALUE}"             fi         done     }      **Additional info**               bash --version     GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)     Copyright (C) 2007 Free Software Foundation, Inc.


Why index files?

I installed Linux on something like 3 or 4 different machines last year, and in two cases, I had a serious urge to vomit after noting that file indexers such as `virtuoso` (Debian testing with the latest KDE) and `libtracker-miner` were installed by default. I simply don't see the point of these programs. They hog CPU and slow everything down. My life was fine without them. And I'm not the only one complaining. So please, can someone tell me what the point of them is? I really don't even know what they do! Can someone explain to me, why index files? People are so surprised by these indexers, they sometimes think their computer is infected with a virus. If it's about finding files: whenever I needed to find a file, I just do `ls -R > filelist.tmp` on my entire filesystem and opened the resulting file in `nano`. Not only do I find the file I need, but I remember where things are. I'm sure there are other solutions. But a program that needs to run all the time just to facilitate... whatever it facilitates... doesn't that contradict the Unix philosophy on a number of counts?


What means warning: rpmts_HdrFromFdno when installing from rpmfusion?

Installing a media player from rpmfusion (via `yum`) yields following output:               Transaction Summary     ================================================================================     Install  3 Packages (+32 Dependent packages)          Total download size: 21 M     Installed size: 68 M     Is this ok [y/N]: y     Downloading Packages:     warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature,                                 key ID 8296fa0f: NOKEY     Public key for a52dec-0.7.4-16.fc17.x86_64.rpm is not installed     (1/35): a52dec-0.7.4-16.fc17.x86_64.rpm                  |  50 kB     (2/35): faad2-libs-2.7-2.fc17.x86_64.rpm                 | 145 kB      What is that supposed to mean? I've enabled rpmfusion via:                yum localinstall rpmfusion-free-release-stable.noarch.rpm      (downloaded the rpm from the rpmfusion site) I have `/etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-17-primary` (and symlinks) which has the right key id:               # gpg --with-fingerprint RPM-GPG-KEY-rpmfusion-free-fedora-17-primary     pub  4096R/8296FA0F  [...]      But `rpm -qa gpg-pubkey*` does not display an entry for 8296FA0F. I am not really sure how `/etc/pki/rpm-gpg` and `rpmkeys --import` and friends work together. And btw, why is `yum` just issuing a warning and not an error that the key is not available?


Upgrade swig 2.0 or newer

I'm using `Fedora 13` and I have `swig 1.3` installed:               $ swig -version     SWIG Version 1.3.40      I need to upgrade it to `swig 2.0`. How is this done?.


How to detect and delete lines containing ˆ@

I have a simple problem: In my file, the are lines containing the string `ˆ@ˆ@ˆ@ˆ@ˆ@ˆ@`. I just want to delete all lines with this string, using for example the `sed` or `grep` commands. And I would like to know why there is such string occurred in my file. What is it meaning for in Linux/Unix world?


is there a way to get newer packages when using a debian distribution?

I'm using a debian distribution (crunchbang). I like the distribution a lot, and as far as I know, it's not available in ubuntu form. However, I run into some issues with the package-manager lagging several years behind the latest versions, as I do a lot of work in research where I need the latest versions (examples - R, gcc). I know the debian philosophy about stability being more important than the latest version, but for some things, the I can get through apt-get just lag too much. Short of manually installing software off the web and compiling / working out the dependencies by hand, is there a way to use apt-get (or another package manager) to get more recent packages for debian distributions?


Adobe Air version > 2.6 port

I just want to know if anybody is aware of a port of Adobe Air Runtime > 2.6. Adobe officially discontinued support of air technology for Linux desktop after releasing 2.6 and I got some .air app updates that require version 2.7 or 3.0.


Can anyone please explain me below AWK script

format of flat file :               ;metier_code              ;     ;-------------------------;          (0 rows affected)     ;CRDS_Ptf_No;          ;                                ;                         ;          ;                                ; ;                         ;                         ;               ;               ;               ;                         ;                         ;     ;Status;     ;-----------;----------;--------------------------------;-------------------------;----------;--------------------------------;-;-------------------------;-------------------------;---------------;---------------;---------------;-------------------------;-------------------------;-----;------;     ;       NULL;ABCD      ;ABHJARS                         ;                         ;ABCD      ;ABCD                            ;Y;                         ;                         ;               ;               ;               ;                         ;                         ;     ;A     ;     ;       1234;XEU-ANKD  ;XEU-AJKD                        ;                         ;ABCD      ;ABCD                            ;Y;                         ;                         ;               ;               ;               ;                         ;                         ;     ;A     ;     .     .     ;      11745;ANJLDMAOKD;AMKDJ AN DJ JAHF AS CPFVH ACCR  ;NONE                     ;AN DJ JAHA;AN DJ JAHA                      ;Y;NO ANKIO GAP             ;YES AMK SCF              ;               ;               ;               ;                         ;                         ;     ;I     ;     ;      11744;AMKDIONSKH;AMKDJ AN DJ JAHF AS CPFVH MTM   ;NONE                     ;AN DJ JAHA;AN DJ JAHA                      ;Y;NO ANKIO GAP             ;YES AMK SCF              ;               ;               ;               ;                         ;                         ;     ;I     ;          (5436 rows affected)     (return status = 0)          Return parameters:          ;           ;     ;-----------;     ;       5436;               (1 row affected)     ;       ;           ;     ;-------;-----------;     ;grepkey;       5436;          (1 row affected)      Below script is used to format the flat file.               awk -F ';' '/^;-----------;/ {start=1;next;}; start==0 {next;}; /^[^;]|^$/ { exit;}; { line_nr++; gsub(" +",""); print line_nr "" $0;}' temp_file > test      Below is the correct output that i am getting by using the above script .               1;NULL;ABCD;ABHJARS;;ABCD;ABCD;Y;;;;;;;;;A;     2;NULL;XEU-ANKD;XEU-AJKD;;ABCD;ABCD;Y;;;;;;;;;A;     3;NULL;SWAPOLEIL;SWAPOLEIL;;QWERDF;QWERDF;Y;;;;;;;;;A;     .     .     5436;11744;AMKDIONSKH;AMKDJ AN DJ JAHF AS CPFVH MTM;;QWERDF;QWERDF;Y;;;;;;;;;A;      CAN ANYONE PLEASE EXPLAIN ME THE BELOW AWK SCRIPT, which is used to format the file               awk -F ';' '/^;-----------;/ {start=1;next;}; start==0 {next;}; /^[^;]|^$/ { exit;}; { line_nr++; gsub(" +",""); print line_nr "" $0;}' temp_file > test      i am new to scripting world. i was able to understand few things from the above script : 1) /^[^;]|^$/ { exit;}; stops the processing if a line occurs which does not start with ; 2) it is ignoring the leading lines please help me understand the script and let me know if the script needs to be modified inorder to be more generic, if so. Thanks in Advance!


Ubuntu 14.04 LTS desktop manager

How do I activate the desktop manager? I'm getting the error message "desktop manager inactive" after installing, then removing Cairo. When looking for alternative desktop pictures, I installed something called "Cairo" or maybe "Cairo Desktop". I didn't like the way it took over the desktop so I tried to uninstall it, but this didn't work. Eventually I ran `purge` in terminal, I don't have the details. I got rid of the nuisance program, with all the buttons at the bottom of the screen, but an icon "Cairo-Dock" remains. Now when I try to install alternative "desktop" programs, I get the error message "desktop manager inactive" and the install fails. Sorry if I'm using Windows terms, relatively new to Linux.


What is the default or most commonly used multiprocessing model in Linux? Symmetric or Asymmetric?

What the multiprocessing model for Linux? Is there a default or most commonly used model? Is it similar or very different from say BSD or even the MS Windows kernel? If SMP is used normally, can assymetric be used instead if desired?


How to change "Number Format" in Gnome 2

I require to change my Number format in my CentOS 6.0 box. I am using "gnome desktop environment" version 2.28.2. I want to know from where can I change the default Number Format of the system. I want to change this because in my system the number values are automatically changing as per default number format and I don't know what is that format. In windows it is possible from control panel:   ![enter image description here](http://i.stack.imgur.com/lY2w1.png) I tried searching into   1\. System-> Administration-> Language   2\. System-> Preferences-> Keyboard   3\. System-> Preferences-> Input Method   But the required settings are not there. If it is not possible by GUI then how to do it with command-line? **Update:** Being specific, I want `Digit grouping: 123456789` i.e. NOT including any comma, which is shown in above windows numbering format.


What happens to RPM transaction when it is interrupted in the middle?

Let's imagine that I'm installing with RPM packages A, B and C. They are installed in the same order. And suddenly in the middle of installing B there is a power cut. 1) regarding state after turning on: What happens to this transaction? Will it be resumed? Or maybe RPM will remove all packages and files from that transaction? 2) regarding user actions: does RPM require user action to do above things or it checks it automatically at computer start? RPM transctions are described mainly in terms of dependency error or error when computer is still running...


watch perldoc output preserving formatting

When I use `watch` to follow a `perlpod` documentation i am writing, the formatting gets mangeled (see `NAME` and `Synopsis` sections):               Every 2,0s: perldoc lib/Uki/Handlers/SOS.pm                                                   Tue Apr  8 10:42:43 2014          Uki::Handlers::SOS(3) User Contributed Perl DocumentationUki::Handlers::SOS(3)                    N NA AM ME E            Uki::Handlers::SOS - Studenten-Handler          S Sy yn no op ps si is s            SOS-spezifische Spezialisierung des Uki::Handlers::Person-Handlers.      I think this is due to `nroff` thinking the output terminal is not a TTY, but I don't know how to tell it that, infact, it _is_ a TTY.


Including a date in a filename

Inside a directory, there are 150 files named like `ABLIMITS.TXT`. How do I rename them to `ABLIMITS_date.txt` prompting the user for date?


How to understand the command awk '{for(x=1;$x;++x)print $x}'?

I know this command               awk '{for(x=1;$x;++x)print $x}'       will print out all columns in a line. wouldn't this `++x` change `x` to 2, and thus print `$2` first? As I understood based on this: http://stackoverflow.com/questions/1812990/incrementing-in-c-when-to-use-x- or-x And what does the `$x` do in `for(x=1;$x;++x)` ?


How to make Arabic appear properly in linux terminal?

In Linux Mint 13, when using the Arabic language, text is shown backwards. I found a possible answer that says I should do:               sudo apt-get install libfribidi0 libfribidi-dev      then install bicon, and then put               Terminal=true     Exec=/usr/bin/bicon.bin      in `/usr/share/applications/gnome-terminal.desktop`. After doing this, I restart my computer and enter terminal, but my language is still shown backwards, so then I type in `bicon` and it fix it. How can I make terminal work properly without having to type `bicon` every time?


Can't run executable file on Ubuntu, terminal expects sudo, or gives errors like “Invalid or incomplete multibyte or wide character”

I'm trying to run executable files on Ubuntu, but it's not working, although the exact same executable file works fine on others' machines, which are also running Ubuntu 12.04 like me. Based on this, I asked a question here: Executing compiled file on Ubuntu But now I realize the issue isn't in my compiled file. Because I wrote a very simple .cpp file and tested it, but Ubuntu still didn't run it. This is my simple test.cpp:               #include <stdio.h>     #include <stdlib.h>          int main( int argc, char **argv )      {      printf ("Hello, this test worked!");     return 0;     }      Then I compiled it:               g++ `pkg-config --cflags opencv` -o test test.cpp      And then tried to run it:               ./test      But I get an error:               bash: ./test: Permission denied      So I try with sudo: sudo ./test which asks me for my user password, which I give, but then it says:               sudo: ./test: command not found      So how can I run executable files at all? ## Edit I've got this Ubuntu installed on top of Windows, using the Wubi installer. When I run:               pkg-config --cflags opencv      I get this:               -I/usr/local/include/opencv -I/usr/local/include        When I run               df .      It says:               Filesystem     1K-blocks    Used Available Use% Mounted on     /dev/loop0      17596475 6112377  11484098  35% /      And when I run:               cat /proc/mounts      Then this is the output:               rootfs / rootfs rw 0 0     sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0     proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0     udev /dev devtmpfs rw,relatime,size=1944900k,nr_inodes=486225,mode=755 0 0     devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0     tmpfs /run tmpfs rw,nosuid,relatime,size=781788k,mode=755 0 0     /dev/sda4 /host fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0     /dev/loop0 / ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0     none /sys/fs/fuse/connections fusectl rw,relatime 0 0     none /sys/kernel/debug debugfs rw,relatime 0 0     none /sys/kernel/security securityfs rw,relatime 0 0     none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0     none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0     gvfs-fuse-daemon /home/asaaki/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0


look up the device from its tty file?

Here is from my Ubuntu               $ ls /dev/*tty*     /dev/tty    /dev/tty17  /dev/tty26  /dev/tty35  /dev/tty44  /dev/tty53  /dev/tty62      /dev/ttyS12  /dev/ttyS21  /dev/ttyS30     /dev/tty0   /dev/tty18  /dev/tty27  /dev/tty36  /dev/tty45  /dev/tty54  /dev/tty63      /dev/ttyS13  /dev/ttyS22  /dev/ttyS31     /dev/tty1   /dev/tty19  /dev/tty28  /dev/tty37  /dev/tty46  /dev/tty55  /dev/tty7       /dev/ttyS14  /dev/ttyS23  /dev/ttyS4     /dev/tty10  /dev/tty2   /dev/tty29  /dev/tty38  /dev/tty47  /dev/tty56  /dev/tty8       /dev/ttyS15  /dev/ttyS24  /dev/ttyS5     /dev/tty11  /dev/tty20  /dev/tty3   /dev/tty39  /dev/tty48  /dev/tty57  /dev/tty9       /dev/ttyS16  /dev/ttyS25  /dev/ttyS6     /dev/tty12  /dev/tty21  /dev/tty30  /dev/tty4   /dev/tty49  /dev/tty58  /dev/ttyprintk  /dev/ttyS17  /dev/ttyS26  /dev/ttyS7     /dev/tty13  /dev/tty22  /dev/tty31  /dev/tty40  /dev/tty5   /dev/tty59  /dev/ttyS0      /dev/ttyS18  /dev/ttyS27  /dev/ttyS8     /dev/tty14  /dev/tty23  /dev/tty32  /dev/tty41  /dev/tty50  /dev/tty6   /dev/ttyS1      /dev/ttyS19  /dev/ttyS28  /dev/ttyS9     /dev/tty15  /dev/tty24  /dev/tty33  /dev/tty42  /dev/tty51  /dev/tty60  /dev/ttyS10     /dev/ttyS2   /dev/ttyS29     /dev/tty16  /dev/tty25  /dev/tty34  /dev/tty43  /dev/tty52  /dev/tty61  /dev/ttyS11     /dev/ttyS20  /dev/ttyS3      I have 7 virtual consoles. I have also opened some tabs inside gnome terminal, and several emacs (some running shell, but I have probably closed them all), and screen sessions (but now closed).   1. what is the difference between `/dev/tty`, `/dev/tty[[:digit:]]+`, `/dev/ttyprintk`, and `/dev/ttyS[[:digit:]]+`?   2. How can I find out which device each tty file corresponds to?   3. Some said the device files for pseudo tty is /dev/ _pty_ , but why is there no pty file or dir here:              $ ls /dev/*pty*     ls: cannot access /dev/*pty*: No such file or directory        4. Not sure what `/dev/*pts*` means:              $ ls /dev/*pts*      0  1  10  11  12  13  14  15  16  17  18  2  20  21  22  23  24  26  3  4  5  6  7  8  9  ptmx      Thanks and regards!


Attachment missing in Unix mail when multiple files were attached

I am trying to attach multiple files in Unix, which are the result of a `find` command. When I try to send the mail, the attachments are missing.               dir=$path     echo "Entered into $spr/sum_master"     for fil in `find $dir -ctime -2 -type f -name "Sum*pdf*"`     do       uFiles=`echo "$uFiles ; uuencode $fil  $fil"`     done     \($uFiles\) | mailx -s "subject" abc@gmail.com      What is wrong with this code?


Bash restricted Shell using rbash

I am using `/bin/rbash` for some users. It's working as expected but there is some hack like when users run `bash` or `dash`, then they got unrestricted shells, so to avoid these commands, I have added below functions in their `.bashrc` files.               bash() {     echo "WARNING: NOT ALLOW!!"     }          sh() {     echo "WARNING: NOT ALLOW!!"     }      So my question is: 1# can we use functions with multiple names as below               func1,func2 () {      # do stuff     }      2# I also tried:               case $BASH_COMMAND in # check each command`             bash|dash|sh)              echo "WARNING: NOT ALLOW!!"              ;;     esac      3# `/bin/rbash -> bash` it's just a soft link of bash, then how does it work as restricted? Also there is some command to avoid users to execute that like `unset HISTFILE` and `kill -9 $$` Is there any alternate way to achieve the same?


How can I get my Mountain Lion Mac to have Apache serve up content on port 80?

There might be more than one problem here, but I got my Mac back from the shop after the hard drive was failing, and the new hard drive reproduced my home directory but not httpd.conf. Since I have gotten it back, Apache appears to start without reported error, but I can't connect, even from the same machine, to port 80. I am guessing that the httpd processes are dying rather than this behavior happening due to an overactive firewall, as ps is not turning up any Apache daemon processes as far as I can tell. My present httpd.conf has been modified to serve up `/Users/jonathan/mirror` instead of `/Library/WebServer/Documents`; both the `ServerRoot` and `DocumentRoot` are intended to serve up the modified location. My `httpd.conf`, without other files, reads:               #     # This is the main Apache HTTP server configuration file.  It contains the     # configuration directives that give the server its instructions.     # See <URL:http://httpd.apache.org/docs/2.2> for detailed information.     # In particular, see      # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>     # for a discussion of each configuration directive.     #     # Do NOT simply read the instructions in here without understanding     # what they do.  They're here only as hints or reminders.  If you are unsure     # consult the online docs. You have been warned.       #     # Configuration and logfile names: If the filenames you specify for many     # of the server's control files begin with "/" (or "drive:/" for Win32), the     # server will use that explicit path.  If the filenames do *not* begin     # with "/", the value of ServerRoot is prepended -- so "log/foo_log"     # with ServerRoot set to "/usr" will be interpreted by the     # server as "/usr/log/foo_log".          #     # ServerRoot: The top of the directory tree under which the server's     # configuration, error, and log files are kept.     #     # Do not add a slash at the end of the directory path.  If you point     # ServerRoot at a non-local disk, be sure to point the LockFile directive     # at a local disk.  If you wish to share the same ServerRoot for multiple     # httpd daemons, you will need to change at least LockFile and PidFile.     #     ServerRoot "/Users"          #     # Listen: Allows you to bind Apache to specific IP addresses and/or     # ports, instead of the default. See also the <VirtualHost>     # directive.     #     # Change this to Listen on specific IP addresses as shown below to      # prevent Apache from glomming onto all bound IP addresses.     #     #Listen 12.34.56.78:80     Listen 80          #     # Dynamic Shared Object (DSO) Support     #     # To be able to use the functionality of a module which was built as a DSO you     # have to place corresponding `LoadModule' lines at this location so the     # directives contained in it are actually available _before_ they are used.     # Statically compiled modules (those listed by `httpd -l') do not need     # to be loaded here.     #     # Example:     # LoadModule foo_module modules/mod_foo.so     #     LoadModule authn_file_module libexec/apache2/mod_authn_file.so     LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so     LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so     LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so     LoadModule authn_default_module libexec/apache2/mod_authn_default.so     LoadModule authz_host_module libexec/apache2/mod_authz_host.so     LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so     LoadModule authz_user_module libexec/apache2/mod_authz_user.so     LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so     LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so     LoadModule authz_default_module libexec/apache2/mod_authz_default.so     LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so     LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so     LoadModule cache_module libexec/apache2/mod_cache.so     LoadModule disk_cache_module libexec/apache2/mod_disk_cache.so     LoadModule mem_cache_module libexec/apache2/mod_mem_cache.so     LoadModule dbd_module libexec/apache2/mod_dbd.so     LoadModule dumpio_module libexec/apache2/mod_dumpio.so     LoadModule reqtimeout_module libexec/apache2/mod_reqtimeout.so     LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so     LoadModule include_module libexec/apache2/mod_include.so     LoadModule filter_module libexec/apache2/mod_filter.so     LoadModule substitute_module libexec/apache2/mod_substitute.so     LoadModule deflate_module libexec/apache2/mod_deflate.so     LoadModule log_config_module libexec/apache2/mod_log_config.so     LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so     LoadModule logio_module libexec/apache2/mod_logio.so     LoadModule env_module libexec/apache2/mod_env.so     LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so     LoadModule cern_meta_module libexec/apache2/mod_cern_meta.so     LoadModule expires_module libexec/apache2/mod_expires.so     LoadModule headers_module libexec/apache2/mod_headers.so     LoadModule ident_module libexec/apache2/mod_ident.so     LoadModule usertrack_module libexec/apache2/mod_usertrack.so     #LoadModule unique_id_module libexec/apache2/mod_unique_id.so     LoadModule setenvif_module libexec/apache2/mod_setenvif.so     LoadModule version_module libexec/apache2/mod_version.so     LoadModule proxy_module libexec/apache2/mod_proxy.so     LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so     LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so     LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so     LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so     LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so     LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so     LoadModule ssl_module libexec/apache2/mod_ssl.so     LoadModule mime_module libexec/apache2/mod_mime.so     LoadModule dav_module libexec/apache2/mod_dav.so     LoadModule status_module libexec/apache2/mod_status.so     LoadModule autoindex_module libexec/apache2/mod_autoindex.so     LoadModule asis_module libexec/apache2/mod_asis.so     LoadModule info_module libexec/apache2/mod_info.so     LoadModule cgi_module libexec/apache2/mod_cgi.so     LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so     LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so     LoadModule negotiation_module libexec/apache2/mod_negotiation.so     LoadModule dir_module libexec/apache2/mod_dir.so     LoadModule imagemap_module libexec/apache2/mod_imagemap.so     LoadModule actions_module libexec/apache2/mod_actions.so     LoadModule speling_module libexec/apache2/mod_speling.so     LoadModule userdir_module libexec/apache2/mod_userdir.so     LoadModule alias_module libexec/apache2/mod_alias.so     LoadModule rewrite_module libexec/apache2/mod_rewrite.so     #LoadModule perl_module libexec/apache2/mod_perl.so     #LoadModule php5_module libexec/apache2/libphp5.so     #LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so          <IfModule !mpm_netware_module>     <IfModule !mpm_winnt_module>     #     # If you wish httpd to run as a different user or group, you must run     # httpd as root initially and it will switch.       #     # User/Group: The name (or #number) of the user/group to run httpd as.     # It is usually good practice to create a dedicated user and group for     # running httpd, as with most system services.     #     User _www     Group _www          </IfModule>     </IfModule>          # 'Main' server configuration     #     # The directives in this section set up the values used by the 'main'     # server, which responds to any requests that aren't handled by a     # <VirtualHost> definition.  These values also provide defaults for     # any <VirtualHost> containers you may define later in the file.     #     # All of these directives may appear inside <VirtualHost> containers,     # in which case these default settings will be overridden for the     # virtual host being defined.     #          #     # ServerAdmin: Your address, where problems with the server should be     # e-mailed.  This address appears on some server-generated pages, such     # as error documents.  e.g. admin@your-domain.com     #     ServerAdmin you@example.com          #     # ServerName gives the name and port that the server uses to identify itself.     # This can often be determined automatically, but we recommend you specify     # it explicitly to prevent problems during startup.     #     # If your host doesn't have a registered DNS name, enter its IP address here.     #     #ServerName www.example.com:80          #     # DocumentRoot: The directory out of which you will serve your     # documents. By default, all requests are taken from this directory, but     # symbolic links and aliases may be used to point to other locations.     #     DocumentRoot "/Users/jonathan/mirror"          #     # Each directory to which Apache has access can be configured with respect     # to which services and features are allowed and/or disabled in that     # directory (and its subdirectories).      #     # First, we configure the "default" to be a very restrictive set of      # features.       #     <Directory />         Options FollowSymLinks         AllowOverride None         Order deny,allow         Deny from all     </Directory>          #     # Note that from this point forward you must specifically allow     # particular features to be enabled - so if something's not working as     # you might expect, make sure that you have specifically enabled it     # below.     #          #     # This should be changed to whatever you set DocumentRoot to.     #     <Directory "/Users/jonathan">         #         # Possible values for the Options directive are "None", "All",         # or any combination of:         #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews         #         # Note that "MultiViews" must be named *explicitly* --- "Options All"         # doesn't give it to you.         #         # The Options directive is both complicated and important.  Please see         # http://httpd.apache.org/docs/2.2/mod/core.html#options         # for more information.         #         Options Indexes FollowSymLinks MultiViews              #         # AllowOverride controls what directives may be placed in .htaccess files.         # It can be "All", "None", or any combination of the keywords:         #   Options FileInfo AuthConfig Limit         #         AllowOverride None              #         # Controls who can get stuff from this server.         #         Order allow,deny         Allow from all          </Directory>          #     # DirectoryIndex: sets the file that Apache will serve if a directory     # is requested.     #     <IfModule dir_module>         DirectoryIndex index.html     </IfModule>          #     # The following lines prevent .htaccess and .htpasswd files from being      # viewed by Web clients.      #     <FilesMatch "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">         Order allow,deny         Deny from all         Satisfy All     </FilesMatch>          #     # Apple specific filesystem protection.     #     <Files "rsrc">         Order allow,deny         Deny from all         Satisfy All     </Files>     <DirectoryMatch ".*\.\.namedfork">         Order allow,deny         Deny from all         Satisfy All     </DirectoryMatch>          #     # ErrorLog: The location of the error log file.     # If you do not specify an ErrorLog directive within a <VirtualHost>     # container, error messages relating to that virtual host will be     # logged here.  If you *do* define an error logfile for a <VirtualHost>     # container, that host's errors will be logged there and not here.     #     ErrorLog "/private/var/log/apache2/error_log"          #     # LogLevel: Control the number of messages logged to the error_log.     # Possible values include: debug, info, notice, warn, error, crit,     # alert, emerg.     #     LogLevel warn          <IfModule log_config_module>         #         # The following directives define some format nicknames for use with         # a CustomLog directive (see below).         #         LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined         LogFormat "%h %l %u %t \"%r\" %>s %b" common              <IfModule logio_module>           # You need to enable mod_logio.c to use %I and %O           LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio         </IfModule>              #         # The location and format of the access logfile (Common Logfile Format).         # If you do not define any access logfiles within a <VirtualHost>         # container, they will be logged here.  Contrariwise, if you *do*         # define per-<VirtualHost> access logfiles, transactions will be         # logged therein and *not* in this file.         #         CustomLog "/private/var/log/apache2/access_log" common              #         # If you prefer a logfile with access, agent, and referer information         # (Combined Logfile Format) you can use the following directive.         #         #CustomLog "/private/var/log/apache2/access_log" combined     </IfModule>          <IfModule alias_module>         #         # Redirect: Allows you to tell clients about documents that used to          # exist in your server's namespace, but do not anymore. The client          # will make a new request for the document at its new location.         # Example:         # Redirect permanent /foo http://www.example.com/bar              #         # Alias: Maps web paths into filesystem paths and is used to         # access content that does not live under the DocumentRoot.         # Example:         # Alias /webpath /full/filesystem/path         #         # If you include a trailing / on /webpath then the server will         # require it to be present in the URL.  You will also likely         # need to provide a <Directory> section to allow access to         # the filesystem path.              #         # ScriptAlias: This controls which directories contain server scripts.          # ScriptAliases are essentially the same as Aliases, except that         # documents in the target directory are treated as applications and         # run by the server when requested rather than as documents sent to the         # client.  The same rules about trailing "/" apply to ScriptAlias         # directives as to Alias.         #         ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"          </IfModule>          <IfModule cgid_module>         #         # ScriptSock: On threaded servers, designate the path to the UNIX         # socket used to communicate with the CGI daemon of mod_cgid.         #         #Scriptsock /private/var/run/cgisock     </IfModule>          #     # "/Library/WebServer/CGI-Executables" should be changed to whatever your ScriptAliased     # CGI directory exists, if you have that configured.     #     <Directory "/Library/WebServer/CGI-Executables">         AllowOverride None         Options None         Order allow,deny         Allow from all     </Directory>          #     # DefaultType: the default MIME type the server will use for a document     # if it cannot otherwise determine one, such as from filename extensions.     # If your server contains mostly text or HTML documents, "text/plain" is     # a good value.  If most of your content is binary, such as applications     # or images, you may want to use "application/octet-stream" instead to     # keep browsers from trying to display binary files as though they are     # text.     #     DefaultType text/plain          <IfModule mime_module>         #         # TypesConfig points to the file containing the list of mappings from         # filename extension to MIME-type.         #         TypesConfig /private/etc/apache2/mime.types              #         # AddType allows you to add to or override the MIME configuration         # file specified in TypesConfig for specific file types.         #         #AddType application/x-gzip .tgz         #         # AddEncoding allows you to have certain browsers uncompress         # information on the fly. Note: Not all browsers support this.         #         #AddEncoding x-compress .Z         #AddEncoding x-gzip .gz .tgz         #         # If the AddEncoding directives above are commented-out, then you         # probably should define those extensions to indicate media types:         #         AddType application/x-compress .Z         AddType application/x-gzip .gz .tgz              #         # AddHandler allows you to map certain file extensions to "handlers":         # actions unrelated to filetype. These can be either built into the server         # or added with the Action directive (see below)         #         # To use CGI scripts outside of ScriptAliased directories:         # (You will also need to add "ExecCGI" to the "Options" directive.)         #         #AddHandler cgi-script .cgi              # For type maps (negotiated resources):         #AddHandler type-map var              #         # Filters allow you to process content before it is sent to the client.         #         # To parse .shtml files for server-side includes (SSI):         # (You will also need to add "Includes" to the "Options" directive.)         #         #AddType text/html .shtml         #AddOutputFilter INCLUDES .shtml     </IfModule>          #     # The mod_mime_magic module allows the server to use various hints from the     # contents of the file itself to determine its type.  The MIMEMagicFile     # directive tells the module where the hint definitions are located.     #     #MIMEMagicFile /private/etc/apache2/magic          #     # Customizable error responses come in three flavors:     # 1) plain text 2) local redirects 3) external redirects     #     # Some examples:     #ErrorDocument 500 "The server made a boo boo."     #ErrorDocument 404 /missing.html     #ErrorDocument 404 "/cgi-bin/missing_handler.pl"     #ErrorDocument 402 http://www.example.com/subscription_info.html     #          #     # MaxRanges: Maximum number of Ranges in a request before     # returning the entire resource, or one of the special     # values 'default', 'none' or 'unlimited'.     # Default setting is to accept 200 Ranges.     #MaxRanges unlimited          #     # EnableMMAP and EnableSendfile: On systems that support it,      # memory-mapping or the sendfile syscall is used to deliver     # files.  This usually improves server performance, but must     # be turned off when serving from networked-mounted      # filesystems or if support for these functions is otherwise     # broken on your system.     #     #EnableMMAP off     #EnableSendfile off          # 6894961     TraceEnable off          # Supplemental configuration     #     # The configuration files in the /private/etc/apache2/extra/ directory can be      # included to add extra features or to modify the default configuration of      # the server, or you may simply copy their contents here and change as      # necessary.          # Server-pool management (MPM specific)     Include /private/etc/apache2/extra/httpd-mpm.conf          # Multi-language error messages     #Include /private/etc/apache2/extra/httpd-multilang-errordoc.conf          # Fancy directory listings     Include /private/etc/apache2/extra/httpd-autoindex.conf          # Language settings     Include /private/etc/apache2/extra/httpd-languages.conf          # User home directories     Include /private/etc/apache2/extra/httpd-userdir.conf          # Real-time info on requests and configuration     #Include /private/etc/apache2/extra/httpd-info.conf          # Virtual hosts     #Include /private/etc/apache2/extra/httpd-vhosts.conf          # Local access to the Apache HTTP Server Manual     Include /private/etc/apache2/extra/httpd-manual.conf          # Distributed authoring and versioning (WebDAV)     #Include /private/etc/apache2/extra/httpd-dav.conf          # Various default settings     #Include /private/etc/apache2/extra/httpd-default.conf          # Secure (SSL/TLS) connections     #Include /private/etc/apache2/extra/httpd-ssl.conf     #     # Note: The following must must be present to support     #       starting without SSL on platforms with no /dev/random equivalent     #       but a statically compiled-in mod_ssl.     #     <IfModule ssl_module>     SSLRandomSeed startup builtin     SSLRandomSeed connect builtin     </IfModule>          Include /private/etc/apache2/other/*.conf      What can I do to get Apache working and serving up content?


Change Zombie window X properties from Iconic state to Normal state

Mathematica sets its _Documentation Center_ as an iconic window according to `xprop`. I think this state might be the culprit for making this window a zombie window, not focusable by the mouse on my window manager. Can I change the window state to normal using some X tools? Here is the output from `xprop`:               _NET_WM_DESKTOP(CARDINAL) = 3     _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 25191353     _NET_WM_USER_TIME(CARDINAL) = 46824074     _NET_WM_NAME(UTF8_STRING) = "Mathematica - Wolfram Mathematica"     _NET_WM_ICON(CARDINAL) =    Icon (31 x 32):                              ░                                       ▒                                      ░▒                              ░       ▒▒░      ░                      ░▒░    ░▒▓▒     ▒░                       ▒▒▒░ ░▒▓▓▓░  ░▒▒                        ▒▒▒▒▒▒▒▓▓▓▓▒▓▓▒░                        ▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒░                        ▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒                    ▒░░░▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒░                    ▒▒▒▒▒░░▒▒▒▒▒▒▒▒▒▒▒▒▒░                    ▒▒▒▒▒░░░░▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒░               ░▓▓▓▒░░░░░░▒▒▒▒▓▓▓▓▒▒▒░                  ▒▓▓▒░░░░░░▒▒▒▒▓▓▓▒▒▒░                   ▒▓▒░░░░░░░▒▒▒▒▓▓▓▒▒░                   ░▓▓░░░░░░░░░░▒▒▓▓▓▒▒                   ░▓▒░░░░░░░░░░░░▒▒▓▓▓▒                  ▒▓▒░░░░░░░░░░░░░░▒▒▒▒▒░               ░▒▒▒░░░░░░░░░░░░░░░▒▒▒▒▒▒░                   ░▒▒░░░░░░░░░░▒▒▒▒▒▒▒▒░                    ▒▓▒░░░░░░▒▒▒▒▒▒▒░░▒▒░                   ▒▒▓▒░░░░▒▓▓▓▓▓▒                         ▒▒▒▓░░░▒▓▓▓▓▒▒▒                        ░▒▒▒░▒░░▒▒▒▒▒▒▒▒                        ░░    ░▒▒▒░  ░▒▒                              ▒▒▒░     ▒░                             ▒▒▒       ░                              ▒░                                      ▒                                       ░                                    XdndAware(ATOM) = BITMAP     _MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0 WM_CLIENT_LEADER(WINDOW): window id # 0x1800003     _NET_WM_PID(CARDINAL) = 2882     _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL     _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0 WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS,     _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_NAME(STRING) = "Mathematica - Wolfram Mathematica" WM_LOCALE_NAME(STRING) = "en_US.UTF-8" WM_CLASS(STRING) = "XMathematica" WM_HINTS(WM_HINTS):       Client accepts input or input focus: True       Initial state is Iconic State.      bitmap id # to use for icon: 0x180637b      window id # of group leader: 0x1800003 WM_NORMAL_HINTS(WM_SIZE_HINTS):      user specified location: 277, 12        program specified location: 277, 12         user specified size: 725 by 775         program specified size: 725 by 775      program specified minimum size: 56 by 177       window gravity: NorthWest WM_CLIENT_MACHINE(STRING) = "wdkrnls" WM_COMMAND(STRING) = { "/usr/local/Wolfram/Mathematica/9.0/SystemFiles/FrontEnd/Binaries/Linux-x86-64/Mathematica", "-topDirectory", "/usr/local/Wolfram/Mathematica/9.0" }      And here is a screenshot showing the border of this window: ![enter image description here](http://i.stack.imgur.com/OlKaP.png)


iw: what's the default channel bandwidth?

I'm using the `iw` tool to configure a WiFi interface to sniff the air (monitor mode) on specific channel:               ifconfig wlan0 down     iw dev wlan0 set channel 1     iwconfig wlan0 mode monitor     ifconfig wlan0 up      The manpage for `iw` says that the channel bandwidth is optional:               dev <devname> set channel <channel> [HT20|HT40+|HT40-]      But it's not clear what value of the three is the default and according to what it's chosen? Using Ubuntu Ubuntu 12.04.4, kernel 3.5.0-45-generic.


Sending a file as the body of an email

I want a utility that does something like this:               email --subject="xxx" --body=body.txt --to=to_address@hostname.com      (using pre-configured sender information for e.g. gmail). Note that `body.txt` is plain text and should be the body of the message, not an attachment. If the body is omitted it should pop up an editor and let me type in my message that way. I could hack together a quick script that does this, but I was wondering if there's an easy way to do this with common unix tools?


What is the long ID that Linux assigns to a disk in /media/?

For example, when I plug in an external hard drive disk enclosure via USB, sometimes the disk is automatically mounted in `/media/`. For example, the disk might be mounted to `/media/13f35f59-f023-4d98-b06f-9dfaebefd6c1` or `/media/4668484A68483B47` What are those long IDs?


kernel build: why does 'make install' complain about missing modules?

I'm building a 3.2.x kernel on a RedHat Enterpise system. During 'make install' it takes a very long time and is complaining : > ERROR: modinfo: could not find module xxx I assume its probing existing modules but why? I created a small test module that I loaded by hand with insmod and sure enough it shows up as > ERROR: modinfo: could not find module testmodule. Could someone explain to me whats going on here? Why does 'make install' care about existing modules that may (or may not) be loaded? Thanks


Inexplicable high memory usage (apparently not caused by programs, buffers, cache, or slab cache)

I've got a server that claims 1.7 of its 2 GB of RAM are used, but the combined memory usage of the running processes doesn't come anywhere near that figure:               $ free -m                  total       used       free     shared    buffers     cached     Mem:          1993       1898         94          0          0        199     -/+ buffers/cache:       1699        294     Swap:         2046         40       2006          $ grep VmRSS /proc/*/status | awk '{s+=$2} END {print s}'       29080      So far, the explanations I've found blame high RAM usage on caches and buffers or the kernel's slab cache, but neither of those seems to be the reason in this case (see also `/proc/meminfo` below). What else could be causing this excessive RAM usage (which often causes the system to start swapping, even with vm.swappiness=1)?   What can I do to find and perhaps mitigate the reason? * * * Potentially relevant information:   The system is a rented dedicated server with an Intel Atom N2800 CPU and 2 GB of RAM, as seen above. It is running Debian Wheezy (7.6) with the 3.13 kernel from wheezy-backports.   Its current `/proc/meminfo`:               MemTotal:        2041464 kB     MemFree:           95224 kB     Buffers:              20 kB     Cached:           204240 kB     SwapCached:        13000 kB     Active:           100280 kB     Inactive:         132036 kB     Active(anon):      15496 kB     Inactive(anon):    12580 kB     Active(file):      84784 kB     Inactive(file):   119456 kB     Unevictable:           0 kB     Mlocked:               0 kB     SwapTotal:       2096124 kB     SwapFree:        2054960 kB     Dirty:                64 kB     Writeback:             0 kB     AnonPages:         17208 kB     Mapped:             6888 kB     Shmem:                20 kB     Slab:              31180 kB     SReclaimable:      14628 kB     SUnreclaim:        16552 kB     KernelStack:        1848 kB     PageTables:         4556 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:     3116856 kB     Committed_AS:     122748 kB     VmallocTotal:   34359738367 kB     VmallocUsed:       81792 kB     VmallocChunk:   34359611556 kB     HardwareCorrupted:     0 kB     AnonHugePages:         0 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:      136108 kB     DirectMap2M:     1943552 kB      `ps -eo pid,user,args,pmem --sort pmem`, as Braiam requested:                 PID USER     COMMAND                     %MEM         2 root     [kthreadd]                   0.0         3 root     [ksoftirqd/0]                0.0         5 root     [kworker/0:0H]               0.0         7 root     [rcu_sched]                  0.0         8 root     [rcu_bh]                     0.0         9 root     [migration/0]                0.0        10 root     [watchdog/0]                 0.0        11 root     [watchdog/1]                 0.0        12 root     [migration/1]                0.0        13 root     [ksoftirqd/1]                0.0        15 root     [kworker/1:0H]               0.0        16 root     [watchdog/2]                 0.0        17 root     [migration/2]                0.0        18 root     [ksoftirqd/2]                0.0        20 root     [kworker/2:0H]               0.0        21 root     [watchdog/3]                 0.0        22 root     [migration/3]                0.0        23 root     [ksoftirqd/3]                0.0        25 root     [kworker/3:0H]               0.0        26 root     [khelper]                    0.0        27 root     [kdevtmpfs]                  0.0        28 root     [netns]                      0.0        29 root     [writeback]                  0.0        30 root     [kintegrityd]                0.0        31 root     [bioset]                     0.0        32 root     [kblockd]                    0.0        35 root     [khungtaskd]                 0.0        36 root     [kswapd0]                    0.0        37 root     [ksmd]                       0.0        38 root     [khugepaged]                 0.0        39 root     [fsnotify_mark]              0.0        40 root     [crypto]                     0.0        45 root     [kthrotld]                   0.0        46 root     [deferwq]                    0.0       151 root     [khubd]                      0.0       156 root     [ata_sff]                    0.0       168 root     [scsi_eh_0]                  0.0       170 root     [scsi_eh_1]                  0.0       171 root     [scsi_eh_2]                  0.0       172 root     [scsi_eh_3]                  0.0       191 root     [kworker/3:1H]               0.0       192 root     [kworker/1:1H]               0.0       193 root     [kworker/0:1H]               0.0       197 root     [kworker/2:1H]               0.0       212 root     [bioset]                     0.0       218 root     [btrfs-genwork-1]            0.0       219 root     [btrfs-submit-1]             0.0       220 root     [btrfs-delalloc-]            0.0       221 root     [btrfs-fixup-1]              0.0       224 root     [btrfs-rmw-1]                0.0       225 root     [btrfs-endio-rai]            0.0       226 root     [btrfs-endio-met]            0.0       228 root     [btrfs-freespace]            0.0       230 root     [btrfs-cache-1]              0.0       231 root     [btrfs-readahead]            0.0       233 root     [btrfs-qgroup-re]            0.0       234 root     [btrfs-cleaner]              0.0       235 root     [btrfs-transacti]            0.0       415 root     [kworker/2:2]                0.0       533 root     [kpsmoused]                  0.0       619 root     [kworker/3:0]                0.0      1383 root     [btrfs-genwork-1]            0.0      1384 root     [btrfs-submit-1]             0.0      1385 root     [btrfs-delalloc-]            0.0      1386 root     [btrfs-fixup-1]              0.0      1389 root     [btrfs-rmw-1]                0.0      1390 root     [btrfs-endio-rai]            0.0      1391 root     [btrfs-endio-met]            0.0      1393 root     [btrfs-freespace]            0.0      1395 root     [btrfs-cache-1]              0.0      1396 root     [btrfs-readahead]            0.0      1398 root     [btrfs-qgroup-re]            0.0      1399 root     [btrfs-cleaner]              0.0      1400 root     [btrfs-transacti]            0.0      1687 root     /usr/sbin/sshd               0.0      2087 root     [kworker/1:0]                0.0      2218 root     [kworker/u8:0]               0.0      2470 root     tmux                         0.0      2473 root     -bash                        0.0      4643 root     tmux a                       0.0      6072 root     [kworker/u8:1]               0.0      7126 root     [btrfs-worker-2]             0.0     14524 root     [btrfs-delayed-m]            0.0     16555 root     [kworker/0:2]                0.0     20514 root     [btrfs-flush_del]            0.0     22924 root     [btrfs-endio-2]              0.0     23031 root     [btrfs-worker-3]             0.0     26010 root     [btrfs-endio-3]              0.0     26227 root     [btrfs-endio-met]            0.0     26383 root     [btrfs-delayed-m]            0.0     26823 root     [btrfs-endio-wri]            0.0     27063 root     [btrfs-endio-met]            0.0     28637 root     [kworker/0:0]                0.0     30011 root     [kworker/2:0]                0.0     30832 root     [btrfs-flush_del]            0.0     31387 root     [kworker/1:2]                0.0     31475 root     [kworker/3:2]                0.0     31803 root     [btrfs-endio-wri]            0.0     32361 root     [kworker/1:1]                0.0       499 root     lxc-start -d -n io           0.0      1682 sshd     /usr/bin/dbus-daemon --syst  0.0      2181 mail     /usr/sbin/nullmailer-send -  0.0     13533 root     -bash                        0.0     19059 root     lxc-start -n callisto -d     0.0     20446 root     /usr/sbin/sshd               0.0     20693 root     /usr/sbin/acpid              0.0      1708 root     /sbin/getty 38400 console    0.0      1709 root     /sbin/getty 38400 tty1 linu  0.0      1710 root     /sbin/getty 38400 tty2 linu  0.0      1711 root     /sbin/getty 38400 tty3 linu  0.0      1712 root     /sbin/getty 38400 tty4 linu  0.0      1832 root     -bash                        0.0      2276 root     /sbin/getty 38400 tty1       0.0      2277 root     /sbin/getty 38400 tty2       0.0      2278 root     /sbin/getty 38400 tty3       0.0      2279 root     /sbin/getty 38400 tty4       0.0      2280 root     /sbin/getty 38400 tty5       0.0      2281 root     /sbin/getty 38400 tty6       0.0     13990 root     -bash                        0.0     20478 root     /sbin/getty 38400 console    0.0     20479 root     /sbin/getty 38400 tty1 linu  0.0     20480 root     /sbin/getty 38400 tty2 linu  0.0     20481 root     /sbin/getty 38400 tty3 linu  0.0     20482 root     /sbin/getty 38400 tty4 linu  0.0     24167 root     -bash                        0.0     31031 root     -bash                        0.0     19067 root     init [3]                     0.0      2132 root     -bash                        0.0      4549 root     -bash                        0.0         1 root     init [2]                     0.0      2508 root     tmux a                       0.0       503 root     init [3]                     0.0      4652 root     -bash                        0.0      7923 root     -bash                        0.0      2130 root     sshd: root@pts/5             0.0      1824 root     ssh io                       0.0      2140 root     /usr/sbin/cron               0.0       504 root     udevd --daemon               0.0       505 root     udevd --daemon               0.0      1826 root     sshd: root@pts/0             0.0      4544 root     sshd: root@pts/0             0.0       381 root     udevd --daemon               0.0     16820 root     /usr/sbin/vnstatd -d         0.0     14381 root     /usr/sbin/sshd               0.0      2224 101      /usr/bin/dbus-daemon --syst  0.0      8182 ntp      /usr/sbin/ntpd -p /var/run/  0.0      2497 nst      bash                         0.0      6459 root     -bash                        0.0      2382 root     /usr/sbin/console-kit-daemo  0.0      2472 root     tmux                         0.0      3074 root     ps -eo pid,user,args,pmem -  0.0     17115 root     /usr/sbin/rsyslogd -c5       0.0      6149 root     htop                         0.0      3075 root     view -                       0.1       911 root     munin-node                   0.1      2231 snmp     /usr/sbin/snmpd -Lsd -Lf /d  0.1     13988 root     tmux                         0.1     26168 root     -bash                        0.1     27332 root     -bash                        0.1       628 root     -bash                        0.1