title: how do I prevent Xorg using my Linux laptop's display panel?

text: I have a laptop (~5 year old HP compaq nc6400 running Fedora Linux) that I use most of the time as a desktop machine. It is plugged into a docking station with its lid closed and connected through that by DVI cable to a large external LCD display. For various reasons (login greeter appears on closed display, limited graphics card cannot do 3D to both displays at once) I would like to prevent the laptop's integrated display panel being used by X at all. While docked and on my desk (which is how I use it about 97% of the time) I would like it to simply not use the integrated laptop panel. Booting is not a particular problem, as by default everything is mirrored between the two displays. Also, I don't mind a 'manual' solution, such that I have to undo settings on those rare occasions when I am using the laptop away from my desk. Once logged in I can configure Gnome so that it only uses the external monitor and the laptop panel is marked "off", however this has no effect on the initial auto-configured state of X and the pre-login greeter display. Surprisingly the laptop does not appear to have a lid sensor, so opening or closing the lid does not appear to trigger any events. I can use `xrandr -display :0 --output LVDS1 --off --output DVI1 --auto` on a separate VC before login, but this is still after the fact of X having started and discovered and deciding to use both displays. I tried configuring Xorg by creating a file `/etc/X11/xorg.conf.d/01-turn-off- laptop-display.conf` which contains:               Section "Monitor"         Identifier  "laptop panel"         Option  "Monitor-LVDS1" "laptop panel"         Option  "Enable" "no"     EndSection     Section "Monitor"         Identifier  "big display"         Option  "Monitor-DVI1" "big display"     EndSection          Section "Screen"         Identifier  "main"         Device  "Default"         Monitor "big display"     EndSection      However that did not have a useful effect. The video card is Intel 945GM:               [dan@khorium ~]$ sudo lspci -v -s 0:2     00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller])         Subsystem: Hewlett-Packard Company Device 30ad         Flags: bus master, fast devsel, latency 0, IRQ 16         Memory at f4600000 (32-bit, non-prefetchable) [size=512K]         I/O ports at 4000 [size=8]         Memory at e0000000 (32-bit, prefetchable) [size=256M]         Memory at f4680000 (32-bit, non-prefetchable) [size=256K]         Expansion ROM at <unassigned> [disabled]         Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-         Capabilities: [d0] Power Management version 2         Kernel driver in use: i915         Kernel modules: i915          00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)         Subsystem: Hewlett-Packard Company Device 30ad         Flags: bus master, fast devsel, latency 0         Memory at f4700000 (32-bit, non-prefetchable) [size=512K]         Capabilities: [d0] Power Management version 2      The machine has been running various versions of Fedora Linux (x86_64) since about version 10/11). I'm currently trying Fedora 15 beta (which includes Gnome 3), but the problem has existed in previous OS releases.


title: Can I pipe /dev/video over ssh

text: I have two computers, a _desktop_ in my office ( with a **webcam** attached ) and a _laptop_ somewhere else on the network. Usually I take a look at my office through my webcam by running               ssh Office -Y "mplayer tv://device=/dev/video0"      from my laptop. I don't like Xforwarding mplayer, so why can't I tunnel `/dev/video` to my pc by running this on my laptop?               sudo mkfifo /dev/video1     ssh Office 'dd if=/dev/video' | sudo dd of=/dev/video1'      and then to watch the webcam ( on my _laptop_ )               mplayer tv://device=/dev/video1


title: Looking for a complete TUI script for configuring date and networking of CentOS 5

text: I'm looking for a script that allows complete configuration of a CentOS 5 system via TUI (no GUI, X, etc.). I found system-config-network-tui but other than the fact it looks unprofessional (typos, bugs, etc.) I actually would like to find a script which supports the configuration of many other aspects (such as date/time, timezone, routing, etc.) Is there anything available?


title: Scribes Editor and Slackware64 13.37 -- PyGTKSpell Cannot Be Found

text: I am trying to build Scribes in Slackware64 13.37 with XFCE and I am having a lot of troubles with the Python Binding for GTK Spell. I have gtkspell-2.0.16-x86_64-1 and pygtkspell-2.25.3-i486-3sl installed but, the autogen script does not seem to find it:               ...     checking for python script directory... ${prefix}/lib64/python2.6/site-packages     checking for python extension module directory... ${exec_prefix}/lib64/python2.6/site-packages     Checking for D-Bus (Python Bindings)... yes     Checking for PyGTK... yes     Checking for pygtksourceview2... yes     Error: Python bindings for gtkspell was not found.     configure: error: Error: Dependency check failed      I tried to put a link in the path mentioned there ( **${prefix}/lib64/python2.6/site-packages** , even though I do not know where that ${prefix} points =S, so I assumed the lib64 is the one in /) because the modules for python2.6/site-packages are really located in               /usr/lib/python2.6/site-packages/gtk-2.0/gtkspell.la     /usr/lib/python2.6/site-packages/gtk-2.0/gtkspell.so      also, I tried pointing all the link all the way to **/usr/lib/python2.6/site- packages/gtk-2.0/**               site-packages -> /usr/lib/python2.6/site-packages/gtk-2.0/      but no luck =(. Is there a way to specify the path to pygtkspell? should I put those modules somewhere else? I am out of ideas, so thank you very much for yours =) Regards,


title: Where is the GPU?

text: Installed Debian 7.5.0 on Asus X550LD-XX028 (http://www.flipkart.com/asus-x550ld-xx082d-notebook-4th-gen-ci7-8gb-1tb-free- dos/p/itmdvyg4krwqgaes), with Nvidia GeForce 820M. The nvidia-detect (https://packages.debian.org/wheezy/nvidia-detect) command didn't detect any NVIDIA GPU. Can someone please explain what is happening ?


title: Why is screen seemingly doing nothing with commands passed with -X?

text: I've been trying to set up an automated backup system for a minecraft server, and I'm having trouble with screen, specifically when using 'screen -r sessionname -X "/var/minecraft/somebatchfile"', nothing happens. My process flow is somewhat like this at the moment: `screen -m -d -S minecraft /var/minecraft/bin/server_nogui.sh` This starts the minecraft server without any trouble. However, the issue is that even simple followups like this fail: `screen -r minecraft -X "stop"` I get no error message or success message, and the server does not actually disconnect clients and shut down, like it should. I assume I'm doing something wrong, but I don't know what. Is there some obvious mistake I'm making? I've read the man page a bit but I'm having no luck figuring it out myself.


title: Why do I need ntfs-3g when I have already enabled NTFS support in the kernel?

text: When configuring the kernel I see an option to add read-write support for NTFS. Then when mounting my NTFS partition I still have to install ntfs-3g and pass ntfs-3g as the type. I thought if I add NTFS support in the kernel then I wouldn't have to install a library for it. Why is it so?


title: How did they manage to drive a Unix computer before mice and copy & paste?

text: Since Unix is 40 years old, Unix is older than the invention of the computer mouse. (actually only 3 years if Unix is from 1969 and the mouse from 1972) How in the world did a new user do anything on Unix without copy & paste? I know they always had a text editor with copy/paste, but everything I do on Linux is copy from web browser, and paste (from the CLIPBOARD) into vim or gedit or gnome terminal. You're the same, right? I just can't imagine loading up a man file into vim, copying & pasting code from it- into a temporary buffer, and then having bash execute that buffer. This question has an answer, i'm hoping someone who knows can tell me. Maybe they never left emacs, is that the answer?


title: Redirecting Google search to HTTPS with Privoxy

text: I tried this in the `user.action` file:               { +redirect{s@http://www.google.*/search@https://encrypted.google.com/search@} }     .google.      But it doesn't work. My goal is to redirect from this:               http://www.google.*/searchBLA-BLA      to this:               https://encrypted.google.com/searchBLA-BLA      It could be `de`, `pl`, etc.; that's why I need the `*`.


title: How is sudo intended to be used?

text: I've tried configuring `sudo` before, but I haven't had too much luck with it. How is it different from `su -l -c "x"`? It seems that via the configuration file, one can make it so a user can only have access to certain commands and more. I always thought of `sudo` as a way of one-lining a command as another user or group. Since distros like Ubuntu and Mint make it easy by essentially giving the main user easy access to root via a password, I'm not really sure what its intended use is. How do I add a user to the sudo file, giving them rights to only run certain commands at root? I also don't want to open up any security holes.


title: How do you specify a format for the input to date?

text: Given a date and time in a format that is not recognized by `date`, how can I get `date` to recognize the date and time? For example:               $ date -d "09SEP2012:23:58:46"     date: invalid date `09SEP2012:23:58:46'     $ date -d "09SEP2012:23:58:46" --magic-option "ddMMMYYY:hh:mm:ss"     Sun Sep  9 23:58:46 MDT 2012      Does `--magic-option` exist? If not, is there a more elegant way to solve this rather than using `sed` to transform the input into a well-formed date string?


title: Sphinx Search shutting down after `FATAL: accept() failed: Too many open files`

text: I'm running Sphinx Search Server V2.06 ( the latest stable release ) on an Amazon EC2 with Linux CentOS. In general it is running fine, but the searchd.log is showing this error over and over with varying number of repeat times:               send() failed: 32: Broken pipe     WARNING: last message repeated 6 times      I assume this is some sort of lost connection ( based on some Sphinx forum responses ). I'd like to fix this, but it's not our primary concern ... but possibly related. After Sphinx has been running for a while, or under heavy load ( as near as I can tell ), the number of times the 'message repeats' goes up and peaks at 100. Generally around the same time the following fatal error will occur and it will shut Sphinx down:               FATAL: accept() failed: Too many open files      I've looked into upping the file limits on my system but am not sure what exactly to do. Here is what my system currently reports. I am still seeing this error.               sysctl fs.file-max ... returns ... fs.file-max = 7017952     ulimit -a ... returns ... open files 1024     ulimit -Hn ... returns ... 4096     ulimit -Sn ... returns ... 1024      I don't really know what these different numbers mean, but I think they could be used to solve my problem according to this article. How can I fix the sphinx Fatal error and make sure that the system maintains this 'fixed' configuration after a reboot?


title: How do I parse namespaces from an XML file using XMLLINT and BASH

text: Below I have an example of an Adobe XML swidtag used to track inventory. I need to parse out relevant information using xmllint in bash and output that to a new text file. For example I would like to parse the following               swid:entitlement_required_indicator     swid:product_title     swid:product_version     swid:name     swid:numeric     swid:major     swid:minor     swid:build     swid:review      I have tried using this, but it will not let me read the namespace               xmllint --xpath '//swid:product_version/swid:name/text()' file.xml      I've also tried               xmllint --xpath "//*[local-name1()='product_version']/*[local-name2()='name']/text()" file.xml      But got these errors               xmlXPathCompOpEval: function local-nameame1 not found     XPath error : Unregistered function     XPath error : Stack usage errror     XPath evaluation failure      Sample tag file for Creative Suite 5 The following sample is for Adobe Photoshop CS5 serialized as Creative Suite 5 Master Collection (Suite)               <?xml version="1.0" encoding="utf-8"?>     <swid:software_identification_tag xsi:schemaLocation="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"           xmlns:swid="http://standards.iso.org/iso/19770/-2/2008/schema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">          <!--Mandatory Identity elements -->     <swid:entitlement_required_indicator>true</swid:entitlement_required_indicator>     <swid:product_title>Acrobat XI Pro</swid:product_title>     <swid:product_version>         <swid:name>1.0</swid:name>         <swid:numeric>             <swid:major>1</swid:major>             <swid:minor>0</swid:minor>             <swid:build>0</swid:build>             <swid:review>0</swid:review>         </swid:numeric>     </swid:product_version>     <swid:software_creator>         <swid:name>Adobe Systems Incorporated</swid:name>         <swid:regid>regid.1986-12.com.adobe</swid:regid>     </swid:software_creator>     <swid:software_licensor>         <swid:name>Adobe Systems Incorporated</swid:name>         <swid:regid>regid.1986-12.com.adobe</swid:regid>     </swid:software_licensor>     <swid:software_id>         <swid:unique_id>CreativeCloud-CS6-Mac-GM-MUL</swid:unique_id>         <swid:tag_creator_regid>regid.1986-12.com.adobe</swid:tag_creator_regid>     </swid:software_id>          <swid:tag_creator>         <swid:name>Adobe Systems Incorporated</swid:name>         <swid:regid>regid.1986-12.com.adobe</swid:regid>     </swid:tag_creator>     <!--Optional Identity elements -->     <swid:license_linkage>         <swid:activation_status>activated</swid:activation_status>         <swid:channel_type>SUBSCRIPTION</swid:channel_type>         <swid:customer_type>RETAIL</swid:customer_type>     </swid:license_linkage>     <swid:serial_number>909702426602037824854600</swid:serial_number>     </swid:software_identification_tag>


title: Fedora 17 Xorg fails to start on boot

text: My Fedora 17 installation is no longer booting into X : it finished loading the boot screen, then the cursor turns into an "X", flashes a quickly a few times then the just stalls. To get X to load, I have to log into a terminal, kill the Xorg process and run it manually using `startx`, at which point it all works fine. I thought it might have been an issue with the Plymouth service, as described in another post here: Fedora 17 freezes on boot, but disabling the plymouth service like this:               systemctl mask plymouth-start.service      had not effect. Oddly, in my `/var/log` directory, there are 6 Xorg log files created at every boot (named `Xorg.0.log` \--> `Xorg.5.log`). Is this normal? Are 6 Xorg servers trying to start? The #1 to #5 log files all have the same error message in them:               [ 21.665] (EE) Screen(s) found, but none have a usable configuration.      I have tried reinstalling my graphics driver (gallium driver for AMD 3450 HD card) as well as uninstalling and reinstalling plymouth. Xorg obviously works as I can start it from the command line, but why does it fail to start from booting? Any help would be very much appreciated!


title: Sort Column with matching string

text: I have tab-demlimted file, I want to sort them only for red_ball as follows input.txt               id      tagid    name     HH556   EN76     red_ball     JH678   EN45     green_ball     MH678   CV67     red_ball     TY896   RT56     red_ball      output.txt               Red_ball          id  tagid     HH556   EN76     MH678   CV67     TY896   RT56


title: grub does not boot when disk order changes

text: My BIOS has some problems and sometimes boot order of disks changes. I thought that if I insall grub on to the MBR of second data disk, it may boot. First disk(sda) is for boot and operating system, second disk(sdb) is for /var. All partitions are labeled and fsck has labels as partition references. I have install grub on to MBR of second disk by "grub-install /dev/sdb". It installed succesfully. However when I change the order to second disk to simulate, I got: "Error 15: File not found" on grub stage.                  | root (hd0,0)                                                            |        | kernel /boot/vmlinuz-3.5.3 ro root=LABEL=/ console=ttyS0,19200n8        |        | initrd /boot/initrd-3.5.3.img       If I change grub line "root (hd0,0)" to "root (hd1,0)" it boots correctly. However, this should work without admin intervention. How can I build such a self working grub boot on case of a disk order change?


title: What exactly is happening when I run `netctl-auto enable-all`?

text: My wifi connection has been dying very regularly. I notice when I run `netctl- auto enable-all` I reconnect within 5 seconds every time. (My connection has dropped twice while posting this.) Why does this work, and what does this suggest about the actual problem? How can I solve this for good? If you need more info, please ask and I'll gladly supply it. `IWCONFIG` output:               wlp3s0    IEEE 802.11abgn  ESSID:"NETGEAR30"                 Mode:Managed  Frequency:2.442 GHz  Access Point: 44:94:xx:xx:xx:xx                  Bit Rate=1 Mb/s   Tx-Power=16 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Power Management:on               Link Quality=33/70  Signal level=-77 dBm                 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:906  Invalid misc:12   Missed beacon:0          lo        no wireless extensions.          enp2s0    no wireless extensions.      * * * `lspci -nnk | grep -i -A5 network` output:               03:00.0 Network controller [0280]: Intel Corporation Wireless 7260 [8086:08b1] (rev 6b)         Subsystem: Intel Corporation Wireless-N 7260 [8086:c162]         Kernel driver in use: iwlwifi         Kernel modules: iwlwifi      * * * The last 20 lines of `dmesg`:               [    4.054881] systemd-journald[118]: Received request to flush runtime journal from PID 1     [    4.262104] iwlwifi 0000:03:00.0: L1 Disabled; Enabling L0S     [    4.262246] iwlwifi 0000:03:00.0: L1 Disabled; Enabling L0S     [    4.274116] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready     [    8.058666] wlp3s0: authenticate with 00:0f:xx:xx:xx:xx     [    8.060065] wlp3s0: send auth to 00:xx:xx:xx:xx:xx (try 1/3)     [    8.061828] wlp3s0: authenticated     [    8.061941] iwlwifi 0000:03:00.0 wlp3s0: disabling HT/VHT due to WEP/TKIP use     [    8.063395] wlp3s0: associate with 00:0f:xx:xx:xx:xx (try 1/3)     [    8.067304] wlp3s0: RX AssocResp from 00:0f:xx:xx:xx:xx (capab=0x431 status=0 aid=1)     [    8.068513] wlp3s0: associated     [    8.068542] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready     [   15.848000] fuse init (API version 7.22)     [  217.763444] cfg80211: Calling CRDA to update world regulatory domain     [  221.502417] wlp3s0: authenticate with 44:94:xx:xx:xx:xx     [  221.503254] wlp3s0: send auth to 44:94:xx:xx:xx:xx (try 1/3)     [  221.505078] wlp3s0: authenticated     [  221.506711] wlp3s0: associate with 44:94:xx:xx:xx:xx (try 1/3)     [  221.510277] wlp3s0: RX AssocResp from 44:94:xx:xx:xx:xx (capab=0x411 status=0 aid=10)     [  221.512033] wlp3s0: associated      * * * `lshw -c network` output:                 *-network DISABLED            description: Ethernet interface            product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller            vendor: Realtek Semiconductor Co., Ltd.            physical id: 0            bus info: pci@0000:02:00.0            logical name: enp2s0            version: 0c            serial: 20:1a:06:78:84:ae            size: 10Mbit/s            capacity: 1Gbit/s            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation            configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s            resources: irq:60 ioport:e000(size=256) memory:f7d00000-f7d00fff memory:f0000000-f0003fff       *-network            description: Wireless interface            product: Wireless 7260            vendor: Intel Corporation            physical id: 0            bus info: pci@0000:03:00.0            logical name: wlp3s0            version: 6b            serial: 5c:51:4f:51:b0:d5            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=iwlwifi driverversion=3.12.9-2-ARCH firmware=22.1.7.0 ip=192.168.1.2 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn            resources: irq:61 memory:f7c00000-f7c01fff


title: journalctl process groups

text: I recently tried setting up the `ChrootDirectory` property in `sshd_config` and ran into the ownership problems for chroot targets. After i have fixed the problem i noticed that `syslog-ng` had created log entries in `auth.log`:               Feb 21 18:56:18 raspberry sshd[28194]: fatal: bad ownership or modes for chroot directory "/home/smacktard"      Since i am running arch linux, the main logging facility is the journal system of `systemd`. However, `journalctl -fu sshd` did not show these log entries. So i missed these log entries. If i had seen them, i would have fixed the problem faster. I don't want that to happen again, so i did some research: I figured out that this happened because the `-u` option of `journalctl` filters for systemd units. However, the error is produced and logged by a child process of `sshd`. That means it has a different PID and therefore is not recognised as the systemd unit `sshd.service`. **How can i systematically find journal entries of child processes?**


title: How to choose directory name during untarring

text: Say I have file named `ugly_name.tar`, which when extracted, becomes `ugly_name` directory. What command can I use such that the resulting directory name is `pretty_name` instead?


title: Cannot use dual monitors in Elementary OS Luna - radeon driver

text: Once I attach the external monitor, **the image on both monitors is activated but is messed up, just chaotic lines and colors** , so that i cannot access the 'Displays' settings. This never happened with the same laptop in Ubuntu 12.04 (nor in 12.10 or 13.04). Also **this happens only if I plug the cable while the computer is open. If I restart with the external monitor attached, both will work in parallel.** To recover my normal desktop without restarting, I go to console (ctrl-alt-f1) and then back (ctrl-alt-f7) - after having unplugged the vga. Also, in most cases I can recover my image even without unplugging the external monitor if I run from shortcut `xrandr --output LVDS --mode 1680x1050 --rate 60.1 --output VGA-0 --off` to use only the internal display. Afterwards, I can use the external display if I activate it from 'Displays' **while disabling the internal one** (if I try to activate both, both will display just lines and colors). * * * After updating to the raring 3.8.0-31 kernel some behaviour changed that was initially reported here but after a while it all come back to what was said. I finally updated the kernel to 3.12 and no improvement. Also updated the video driver from here. My VGA: RV380 Radeon X600, M24, fully supported as explained here. I have used this laptop with ubuntu 11.10, 12.04, 12.10, 13.04 without seeing a such severe problem. Never used proprietary drivers * * * Setting to extended monitor does not work. * * * I have managed to printscreen the internal display while both enabled and caught this: ![enter image description here](http://i.stack.imgur.com/7s2jS.png) Ouput of `xrandr` external monitor disconnected:               ~$ xrandr     Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 4096 x 4096     VGA-0 disconnected (normal left inverted right x axis y axis)     DVI-0 disconnected (normal left inverted right x axis y axis)     LVDS connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm        1680x1050      60.1*+        1400x1050      60.0          1280x1024      59.9          1440x900       59.9          1280x960       59.9          1280x854       59.9          1280x800       59.8          1280x720       59.9          1152x768       59.8          1024x768       59.9          800x600        59.9          848x480        59.7          720x480        59.7          640x480        59.4       S-video disconnected (normal left inverted right x axis y axis)      External monitor connected, internal off:               ~$ xrandr     Screen 0: minimum 320 x 200, current 1360 x 768, maximum 4096 x 4096     VGA-0 connected 1360x768+0+0 (normal left inverted right x axis y axis) 580mm x 320mm        1360x768       60.0*+        1280x720       60.0          1024x768       60.0          800x600        60.3          640x480        60.0       DVI-0 disconnected (normal left inverted right x axis y axis)     LVDS connected (normal left inverted right x axis y axis)        1680x1050      60.1 +        1400x1050      60.0          1280x1024      59.9          1440x900       59.9          1280x960       59.9          1280x854       59.9          1280x800       59.8          1280x720       59.9          1152x768       59.8          1024x768       59.9          800x600        59.9          848x480        59.7          720x480        59.7          640x480        59.4       S-video disconnected (normal left inverted right x axis y axis)


title: Difference between running mke2fs and setting FS type in cfdisk?

text: When I run `cfdisk` (or `fdisk`) to partition a storage device, there's a point where I can specify the file system type. Does this do anything with respect to the _actual_ file system? Suppose I want to to format a usb thumb drive with an ext2 file system. I'll still need to run `mke2fs` after `cfdisk`, correct? Would there be any problems with choosing something like FAT32 (or SWAP or whatever) in `cfdisk` and then creating an ext2 file system with `mke2fs`? What's the worst that could happen?


title: Is NTFS under linux able to save a linux file, with its chown and chmod settings?

text: I'm having some doubts about how to install and allow linux to correctly read/write to a _NTFS_ formated harddrive used as backup of various machines (windows included, that's how I need _NTFS_ ). For now I've read some pages and I have the feeling I need someone else's guidance, from who already did this step-by-step, to not ruin things here. What I need is to be able to save a linux file, with its `chown` and `chmod` settings, to a _NTFS_ filesystem, and be able to retrieve this information back. What I have today is a _NTFS_ that saves all files with the `owner:group` of who mounted the volume, and permissions `rwxrwxrwx` for all. I read this article but it is too much information and I could not understand some things when trying to actually implement:   * Is it stable in the current version?   * Do UBUNTU 10.04 have all things needed already? Or do I need to install anything?   * What is the relation of POSIX ACL to this? Do I need install anything regarding this or just `ntfs-3g` will do?   * Where are UBUNTU packages to run with `apt-get`?   * If I map the users (with `usermap`) can bring the HardDrive to another computer with different users, will I be able to read them? (Under linux/windows)? For one thing I noticed, `usermap` was not ready to use. So I download and compiled (but not installed because I was afraid to mess things here), the last version of ntfs-3g. In the README file it says: > TESTING WITHOUT INSTALLING > > Newer versions of ntfs-3g can be tested without installing anything and > without disturbing an existing installation. Just configure and make as > shown previously. This will create the scripts ntfs-3g and lowntfs-3g in the > src directory, which you may activate for testing : >   >     >         ./configure >         make >   > > then, as root : src/ntfs-3g [-o mount-options] /dev/sda1 /mnt/windows > > And, to end the test, unmount the usual way : umount /dev/sda1 But it tells nothing about the mount-options that I need to use to have full backups (full == backuping/restoring files, owners, groups and permissions). This faq says: > Why have chmod and chown no effect? > > By default files on NTFS are owned by root with full access to everyone. To > get standard per-file protection you should mount with the "permissions" > option. Moreover, if you want the permissions to be interoperable with a > specific Windows configuration, you have to map the users. Also, I did used the `ntfs-3g.usermap /dev/sdb2` tools to create the map file and got this result:               # Generated by usermap for Linux, v 1.1.4     :carl:S-1-5-21-889330461-3416208041-4118870141-511     :default:S-1-5-21-2592120051-4195220491-4132615201-511     carl:carl:S-1-5-21-889330462-3416208046-4118870148-1000      Now this default was mapped because I wrote " **default** " to one file that was under the default user during the inquiring. I'm not sure if I did that right. I don't care for any users but **carl** (and **root** for that matter), and for any other groups but **users**. I saw the FAQ telling me to answer the group with the username. Isn't it the case to tell the group as " **users** "? And how can I check, booting windows, if this mapping is correct? **Summary** :   1. I need `rsync` to save linux files and windows files from various computers, to a NTFS external USB HD, without losing file permissions.    2. I don't know how to install and run the driver ntfs-3g to allow chown, chmod and anything else that is needed to make that possible. What options, and where?   3. All computers have carl username, but that doesn't guarantee that their SID, UID or GID are the same.   4. The environment is composed of 18 "documents" folders, 6 of them linux, 6 of them win7, 6 of them virtualbox win XP. All of them will be a single "documents" folder into the NTFS external hard drive. Reference:   * I also read this forum, and maybe it is useful to someone trying to help me here.    * Also thought of these other three solutions, making the filesystem ext. But the external HD may be used in windows boxes I could not install or have write to install drivers. So it needs to be readable easily by any windows and NTFS is the standard.  All my google searches was too much technical to follow.


title: Identifying open and closed server IP Address/ports

text: I use a fairly simple WGET command to verify if the IP Address and port are open or closed for a particular server: `wget -a /tmp/ports.log -t1 -T1 10.178.30.45:443` The issue I have is that there are a number of servers that I need to check, and each server links to other IP addresses/ports. Currently I have several of these one liner type scripts deployed on each of the specific servers which require being run manually as and when required. Ideally, I am looking to customize this with one script that can recursively read in a flat file of IP addresses/ports using a WGET command. The resulting report produced will identify those that are not connected (ie: "failed: Connection timed out."). The script should ideally run from within windows rather than deployed and run on each of the server. A list of user id’s/passwords can be obtained for each server if this needs to be passed via the script.


title: ldap_bind: Invalid credentials (49)

text: I'm trying to set up an openLdap server and after following the instructions I'm stuck at the point where I can't add any data. The error I'm getting is               ldap_bind: Invalid credentials (49)      Please help me in this issue. And be patient while reading the debug data and the `slapd.conf` file because they are quite long. My system is: Red Hat Enterprise Linux 6.0   Installed openLdap using `yum openldap*`. Here is my `slapd.conf` file:               #     # See slapd.conf(5) for details on configuration options.     # This file should NOT be world readable.     #          include     /etc/openldap/schema/corba.schema     include     /etc/openldap/schema/core.schema     include     /etc/openldap/schema/cosine.schema     include     /etc/openldap/schema/duaconf.schema     include     /etc/openldap/schema/dyngroup.schema     include     /etc/openldap/schema/inetorgperson.schema     include     /etc/openldap/schema/java.schema     include     /etc/openldap/schema/misc.schema     include     /etc/openldap/schema/nis.schema     include     /etc/openldap/schema/openldap.schema     include     /etc/openldap/schema/ppolicy.schema     include     /etc/openldap/schema/collective.schema          # Allow LDAPv2 client connections.  This is NOT the default.     allow bind_v2          # Do not enable referrals until AFTER you have a working directory     # service AND an understanding of referrals.     #referral   ldap://root.openldap.org          pidfile     /var/run/openldap/slapd.pid     argsfile    /var/run/openldap/slapd.args          # Load dynamic backend modules:     # Module syncprov.la is now statically linked with slapd and there     # is no need to load it here     # modulepath    /usr/lib/openldap # or /usr/lib64/openldap     # moduleload accesslog.la     # moduleload auditlog.la     ## To load this module, you have to install openldap-server-sql first     # moduleload back_sql.la     ## Following two modules can't be loaded simultaneously     # moduleload dyngroup.la     # moduleload dynlist.la     # moduleload lastmod.la     # moduleload pcache.la     # moduleload ppolicy.la     # moduleload refint.la     # moduleload retcode.la     # moduleload rwm.la     # moduleload translucent.la     # moduleload unique.la     # moduleload valsort.la          # The next three lines allow use of TLS for encrypting connections using a     # dummy test certificate which you can generate by changing to     # /etc/pki/tls/certs, running "make slapd.pem", and fixing permissions on     # slapd.pem so that the ldap user or group can read it.  Your client software     # may balk at self-signed certificates, however.     # TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt     # TLSCertificateFile /etc/pki/tls/certs/slapd.pem     # TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem          # Sample security restrictions     #   Require integrity protection (prevent hijacking)     #   Require 112-bit (3DES or better) encryption for updates     #   Require 63-bit encryption for simple bind     # security ssf=1 update_ssf=112 simple_bind=64          # Sample access control policy:     #   Root DSE: allow anyone to read it     #   Subschema (sub)entry DSE: allow anyone to read it     #   Other DSEs:     #       Allow self write access     #       Allow authenticated users read access     #       Allow anonymous users to authenticate     #   Directives needed to implement policy:     # access to dn.base="" by * read     # access to dn.base="cn=Subschema" by * read     # access to *     #   by self write     #   by users read     #   by anonymous auth     #     # if no access controls are present, the default policy     # allows anyone and everyone to read anything but restricts     # updates to rootdn.  (e.g., "access to * by * read")     #     # rootdn can always read and write EVERYTHING!          #######################################################################     # ldbm and/or bdb database definitions     #######################################################################          database    bdb     suffix dc=ttsbroot,dc=teleotele     #checkpoint 1024 15     rootdn cn=shamal,dc=ttsbroot,dc=teleotele     # Cleartext passwords, especially for the rootdn, should     # be avoided.  See slappasswd(8) and slapd.conf(5) for details.     # Use of strong authentication encouraged.     rootpw {crypt}49/WKVk.6oz3o     # rootpw        secret     # rootpw        {crypt}ijFYNcSNctBYg          # The database directory MUST exist prior to running slapd AND      # should only be accessible by the slapd and slap tools.     # Mode 700 recommended.     directory   /var/lib/ldap          # Indices to maintain for this database     index objectClass                       eq,pres     index ou,cn,mail,surname,givenname      eq,pres,sub     index uidNumber,gidNumber,loginShell    eq,pres     index uid,memberUid                     eq,pres,sub     index nisMapName,nisMapEntry            eq,pres,sub          # Replicas of this database     #replogfile /var/lib/ldap/openldap-master-replog     #replica host=ldap-1.example.com:389 starttls=critical     #     bindmethod=sasl saslmech=GSSAPI     #     authcId=host/ldap-master.example.com@EXAMPLE.COM               # enable monitoring     database monitor          # allow onlu rootdn to read the monitor     access to * by * write by * read by * search by * auth      I'm adding the debug data returned when I added `-d 255` argument.               [root@TTSBROOT Documents]# ldapadd -D "cn=shamal,dc=TTSBROOT,dc=teleotele" -W -x -a -f teleotele.ldif -d 255     ldap_create     Enter LDAP Password:      ldap_sasl_bind     ldap_send_initial_request     ldap_new_connection 1 1 0     ldap_int_open_connection     ldap_connect_to_host: TCP localhost:389     ldap_new_socket: 4     ldap_prepare_socket: 4     ldap_connect_to_host: Trying 127.0.0.1:389     ldap_pvt_connect: fd: 4 tm: -1 async: 0     ldap_open_defconn: successful     ldap_send_server_request     ber_scanf fmt ({it) ber:     ber_dump: buf=0x18345d0 ptr=0x18345d0 end=0x1834612 len=66       0000:  30 84 00 00 00 3c 02 01  01 60 84 00 00 00 33 02   0....<...`....3.         0010:  01 03 04 22 63 6e 3d 73  68 61 6d 61 6c 2c 64 63   ..."cn=shamal,dc         0020:  3d 54 54 53 42 52 4f 4f  54 2c 64 63 3d 74 65 6c   =TTSBROOT,dc=tel         0030:  65 6f 74 65 6c 65 80 0a  73 68 61 6d 61 6c 31 32   eotele..shamal12         0040:  33 34                                              34                     ber_scanf fmt ({i) ber:     ber_dump: buf=0x18345d0 ptr=0x18345d9 end=0x1834612 len=57       0000:  60 84 00 00 00 33 02 01  03 04 22 63 6e 3d 73 68   `....3...."cn=sh         0010:  61 6d 61 6c 2c 64 63 3d  54 54 53 42 52 4f 4f 54   amal,dc=TTSBROOT         0020:  2c 64 63 3d 74 65 6c 65  6f 74 65 6c 65 80 0a 73   ,dc=teleotele..s         0030:  68 61 6d 61 6c 31 32 33  34                        hamal1234              ber_flush2: 66 bytes to sd 4       0000:  30 84 00 00 00 3c 02 01  01 60 84 00 00 00 33 02   0....<...`....3.         0010:  01 03 04 22 63 6e 3d 73  68 61 6d 61 6c 2c 64 63   ..."cn=shamal,dc         0020:  3d 54 54 53 42 52 4f 4f  54 2c 64 63 3d 74 65 6c   =TTSBROOT,dc=tel         0030:  65 6f 74 65 6c 65 80 0a  73 68 61 6d 61 6c 31 32   eotele..shamal12         0040:  33 34                                              34                     ldap_write: want=66, written=66       0000:  30 84 00 00 00 3c 02 01  01 60 84 00 00 00 33 02   0....<...`....3.         0010:  01 03 04 22 63 6e 3d 73  68 61 6d 61 6c 2c 64 63   ..."cn=shamal,dc         0020:  3d 54 54 53 42 52 4f 4f  54 2c 64 63 3d 74 65 6c   =TTSBROOT,dc=tel         0030:  65 6f 74 65 6c 65 80 0a  73 68 61 6d 61 6c 31 32   eotele..shamal12         0040:  33 34                                              34                     ldap_result ld 0x182c3e0 msgid 1     wait4msg ld 0x182c3e0 msgid 1 (infinite timeout)     wait4msg continue ld 0x182c3e0 msgid 1 all 1     ** ld 0x182c3e0 Connections:     * host: localhost  port: 389  (default)       refcnt: 2  status: Connected       last used: Fri Apr 22 14:24:17 2011               ** ld 0x182c3e0 Outstanding Requests:      * msgid 1,  origid 1, status InProgress        outstanding referrals 0, parent count 0       ld 0x182c3e0 request count 1 (abandoned 0)     ** ld 0x182c3e0 Response Queue:        Empty       ld 0x182c3e0 response count 0     ldap_chkResponseList ld 0x182c3e0 msgid 1 all 1     ldap_chkResponseList returns ld 0x182c3e0 NULL     ldap_int_select     read1msg: ld 0x182c3e0 msgid 1 all 1     ber_get_next     ldap_read: want=8, got=8       0000:  30 84 00 00 00 10 02 01                            0.......               ldap_read: want=14, got=14       0000:  01 61 84 00 00 00 07 0a  01 31 04 00 04 00         .a.......1....         ber_get_next: tag 0x30 len 16 contents:     ber_dump: buf=0x1835a50 ptr=0x1835a50 end=0x1835a60 len=16       0000:  02 01 01 61 84 00 00 00  07 0a 01 31 04 00 04 00   ...a.......1....       read1msg: ld 0x182c3e0 msgid 1 message type bind     ber_scanf fmt ({eAA) ber:     ber_dump: buf=0x1835a50 ptr=0x1835a53 end=0x1835a60 len=13       0000:  61 84 00 00 00 07 0a 01  31 04 00 04 00            a.......1....          read1msg: ld 0x182c3e0 0 new referrals     read1msg:  mark request completed, ld 0x182c3e0 msgid 1     request done: ld 0x182c3e0 msgid 1     res_errno: 49, res_error: <>, res_matched: <>     ldap_free_request (origid 1, msgid 1)     ldap_parse_result     ber_scanf fmt ({iAA) ber:     ber_dump: buf=0x1835a50 ptr=0x1835a53 end=0x1835a60 len=13       0000:  61 84 00 00 00 07 0a 01  31 04 00 04 00            a.......1....          ber_scanf fmt (}) ber:     ber_dump: buf=0x1835a50 ptr=0x1835a60 end=0x1835a60 len=0          ldap_msgfree     ldap_err2string     ldap_bind: Invalid credentials (49)


Is there a version of Wine that actually runs mainstream chat clients? I'm willing to consider commercial forks. I'd need it to support at least:   * Yahoo   * QQ   * Skype (yes there's a native client but it's too outdated) all with full voice and video support. Supporting more would be nice too. Unfortunately all versions of Wine I've tried have either completely failed to run QQ, or botched the character encoding badly, showing Chinese correctly in some places and interpreting it as Latin-1 in other places, and I haven't gotten webcam/video chat support to work anywhere. Is this just hopeless?


title: How do I specify which version of a program to run?

text: Here's my situation: I have two versions of postgres installed, and with the two versions, come two different psql interactive terminals. One is located at `/usr/bin/psql`, and starts when I run `# psql -U username` Another newer one is located at `/usr/pgsql-9.1/bin/psql` I want the newer one to start by default when I run psql from the command line. How can this be done? Thanks! Edit: I am using centos


title: How do I enable sound in Fedora 17?

text: I did a minimal install of Fedora 17 some months ago and only until today did I try playing some audio with it only to find out that sound is not working. How do I get the sound to work on Fedora 17? My current setup is only using Xmonad as window manager, no desktop environment. So I would prefer the CLI way of installing/troubleshooting this.


title: problem dual booting windows 7 with debian

text: I install windows and resize its partition. I then try to install debian in the remaining space. As it's installing the base system, it consistently gives me the following error message: "No Installable kernel was found in the defined APT source". This has never happened when I just use the entire disk. I tried ignoring the message and continuing. When it finally started grub 1.99 (this was debian testing), it gave me a prompt asking me to enter a command instead of the normal "select the operating system" screen. I messed around and got another message which said something along the lines of "no kernel is installed." Why is this happening? What difference does it make that I'm now trying to install onto a smaller partition? The same thing happens with debian stable.


title: command not running in cron (systemctl suspend)

text: I have this cronjob set :               * * * * * /usr/bin/systemctl suspend      And it is not working. But I can run it in a shell and it works. I don't understand what could be not working. **EDIT** Redirecting error output to `/tmp/error` gives this :               Failed to issue method call: Access denied     Failed to issue method call: Access denied      My question is then : Are cronjobs run as a special user (`cron` for example), which would explain that my user can run the command, but not `cron` itself? Additional explanation :   * This is a minimal example to show a problem I have in a script (that makes more sense than the single command provided here)   * `systemctl` is part of `systemd`. I think reboot, shutdown, suspend are working with a non-root user with `systemd`. Anyway, it is working on my system.   * Finally, I use Arch Linux and `/bin`, `/usr/sbin`, `/sbin` are all symlinks to `/usr/bin`.


title: ext4 directory lists as a file

text: I'm working with a large (8TB) EXT4 filesystem in linux. After a power outage, the filesystem wouldn't mount. fsck is taking weeks to complete, but i ran testdisk and i'm able to see my partition and the files and directories of the root. the problem is the directory that contains most of the data on the disk is in a certain folder that when listed in testdisk lists as a directory. The "D" at the beginning of the file permissions is not set. Is there any way to fix this or browse to the directory? Can i search for the directories that sit below this unusable directory? thanks for your help!


title: KDE causes "READ FPDMA QUEUED" Error

text: Here is the situation. My UPS battery has recently died, and I've not replaced it yet. Today someone came over to do electrical work on the home, which involved shutting down the circuit breaker on which the computer sits. I'm smart enough to start shutting down my computer before I trip the breaker, but I was talking to the electrician and forgot to check that my computer was 100% down before tripping the breaker. The result: When I log into one account, using KDE, during the login process I start getting errors like this: since I only get these errors when I log in as this person and only into KDE ( other DEs and other accounts with KDE OK ) I think it is safe to say that something in my kde configuration is screwed up.               ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0     ata3.00: irq_stat 0x40000008     ata3.00: failed command: READ FPDMA QUEUED     ata3.00: cmd 60/08:00:98:b2:78/00:00:13:00:00/40 tag 0 ncq 4096 in              res 41/40:08:9a:b2:78/00:00:13:00:00/00 Emask 0x409 (media error) <F>     ata3.00: status: { DRDY ERR }     ata3.00: error: { UNC }     ata3.00: SB600 AHCI: limiting to 255 sectors per cmd     ata3.00: SB600 AHCI: limiting to 255 sectors per cmd     ata3.00: configured for UDMA/133     sd 2:0:0:0: [sda] Unhandled sense code     sd 2:0:0:0: [sda]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     sd 2:0:0:0: [sda]  Sense Key : Medium Error [current] [descriptor]     Descriptor sense data with sense descriptors (in hex):             72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00              13 78 b2 9a      sd 2:0:0:0: [sda]  Add. Sense: Unrecovered read error - auto reallocate failed     sd 2:0:0:0: [sda] CDB: Read(10): 28 00 13 78 b2 98 00 00 08 00     end_request: I/O error, dev sda, sector 326677146     ata3: EH complete      My question comes in two parts. 1) I'm kind of freaked that I see this kind of error based on just a minor ( relatively speaking ) corruption error in a file system . 2) My kde configuration is kind of long and involved. I don't want to delete the whole thing and start over. Is there a way of logging the progress of a startup sequence to see when it encounters an error, so I can just delete that part of the configuration?


title: Difference between free -m and ps -euf

text: I'm not an expert on linux so I do apologize in advance for the silly question. I have a vps machine with ubuntu 10.04 and 512Mb of RAM. I'm trying to guess how much memory is available after running the mongodb daemon. If I run `free -m` I get                            total       used       free     shared    buffers     cached     Mem:           496        489          6          0          4        452     -/+ buffers/cache:         33        462     Swap:          511          4        507      If I run `ps euf` I get               USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     root       948  0.0  0.0   5928   472 tty6     Ss+  Aug25   0:00 /sbin/getty 384     root       947  0.0  0.0   5928   472 tty5     Ss+  Aug25   0:00 /sbin/getty 384     root       946  0.0  0.0   5928   472 tty4     Ss+  Aug25   0:00 /sbin/getty 384     root       945  0.0  0.0   5928   472 tty3     Ss+  Aug25   0:00 /sbin/getty 384     root       944  0.0  0.0   5928   472 tty2     Ss+  Aug25   0:00 /sbin/getty 384     root       943  0.0  0.1  51856   536 hvc0     Ss   Aug25   0:00 /bin/login --      root       978  0.0  0.4  20580  2424 hvc0     S    Aug25   0:01  \_ -bash TERM=     root      7593  0.0  0.1  10332   524 hvc0     T    Aug25   0:00      \_ nano he     root     12576  0.7  3.1 122520 16220 hvc0     Sl   07:42   0:12      \_ ./mongo     root     12599  0.0  0.2  16300  1060 hvc0     R+   08:09   0:00      \_ ps euf      So it seems that less than 5% of memory is used by processes but I have only 6Mb of free memory... why?


title: Installing FreeBSD from USB-Stick boots but later can't find the USB-Stick

text: When trying to install FreeBSD 8.2 from USB memory stick the kernel boots from the USB-Stick and the installer menus work and let me partition and everything. However when it comes to actually installing from the USB-Stick it is not found. Checking with the emergency shell showed that there are no `/dev/da*` entries visible. This happened with hardware ASUS P8 H67-M Pro, Intel i7-2600 with EFI BIOS.


title: Make top shows only server process

text: Can I make _top_ show info about the **web** and **db servers**? Can it be done by piping the _pids_ to the _top_? They can be many process from every one?!? Or is there any better method for this?


title: Can a WM raise or lower windows?

text: Judging from window management on Linux (at least on Ubuntu using Gnome with Compiz), windows are organised in a stack. Switching to a window other than the one in focus will bring the former on top of the stack, right above the latter. So is it theoretically possible to tell the WM to raise or lower windows in that stack and to raise them to topmost or lower them to bottommost? If so, would Python XLib be able to do that? Is there any WM that already has this feature?


title: how to make read only filesystem writable on busybox?

text: I want to change some files on my router. Firstly i can change everything in /var, but i want to change /etc/fstab. when i try to change it, i get an error message that says filesystem is read only. Busybox inside router, has limited commands, so i had got busybox binary for mips http://www.busybox.net/downloads/binaries/1.19.0/busybox-mips, and upload it by tftp (`tftp -g -r busybox-mips my.i.p.addr`), so now i can use full commands (`/var/tmp/busybox-mips` command). There is no rom inside router (sdram), or there is no another partition. it must be related with busybox.               # /var/tmp/busybox-mips df     Filesystem           1K-blocks      Used Available Use% Mounted on     /dev/root                 1344      1344         0 100% /          # mount     rootfs on / type rootfs (rw)     /dev/root on / type squashfs (ro)     proc on /proc type proc (rw,nodiratime)     ramfs on /var type ramfs (rw)     #                     Model:              Airties 5021     Processor:             BCM6332KFBG             HS1037 P12             994981 N1     Memory:              M12L64164A-7T (SDRAM)             ANM1P02HL 1028


title: Error 'IO Error: Broken Pipe' when upgrading server from Debian Squeeze to Wheezy

text: As I am upgrading my virtual machine from Debian 6 (Squeeze) to 7 (Wheezy), I am seeing what appears to be a changelog (screenshot below). So, I pressed the 'q' key to quit and proceed with the upgrade process, and I notice some error-like message (screenshot below). **Changelog Screenshot:** ![Changelog Screenshot](http://i.stack.imgur.com/kR0aT.png) **Error Screenshot:** ![Error Screenshot](http://i.stack.imgur.com/hvmOr.png) **Relevant Error Text:**               ...          Get:368 http://ftp.us.debian.org/debian/ wheezy/main nmap amd64 6.00-0.3 [3,718 kB]     Fetched 166 MB in 23s (7,112 kB/s)     Reading changelogs... Done     apt-listchanges: Mailing root: apt-listchanges: news for li499-58     sh: /usr/sbin/sendmail: not found     Traceback (most recent call last):         File "/usr/bin/apt-listchanges", line 237, in <module>             main()         File "/usr/bin/apt-listchanges", line 221, in main             apt_listchanges.mail_changes(config.email_address, news, subject)         File "/usr/share/apt-listchanges/apt_listchanges.py", line 99, in mail_changes             fh.write(message.as_string())     IOError: [Errno 32] Broken pipe     Extracting templates from packages: 100%          ...      Any idea what it is? Should this be a concern?


title: How to find the underlying disks of a mirrored volume in LVM (linux)?

text: When I run command `lvs -a` the output shows the logical volumes from which the mirrored-volume has been made but how to find the actual disks from which the sub-logical volume were allocated. Any specific command, options? Or do we have to manually find out?               [root@cent06x32vm12 ~]# lvs -a     LV               VG               Attr       LSize   Pool Origin Data%  Move Log        Cpy%Sync Convert     mvol3            datavg2          mwi-a-m---  40.00m                         mvol3_mlog   100.00      [mvol3_mimage_0] datavg2          iwi-aom---  40.00m  <==== How to find which disks these come from      [mvol3_mimage_1] datavg2          iwi-aom---  40.00m  <====      [mvol3_mlog]     datavg2          lwi-aom---   4.00m  <====


title: Copying a few lines from stdout to stderr - but only if stderr is different from stdout

text: I have a bash script "backup.sh", which prints out everything to stdout, including all the files that are transferred during backup. I'd like to make it possible to keep that full output, but when it's called with               ./backup.sh 2>stderr.log      , then only a few important lines from stdout should be copied into stderr.log. My script currently uses the following function to print out these important lines:               errEcho() {         echo "$1"         echo "$1" 1>&2     }          echo "Some info message"     errEcho "Very important message"      But now, if somebody calls the script simply as               ./backup.sh      Then the errEcho lines appear duplicated on stdout. What's the best way to solve this? (Effectively, I'd like my script to recognize, if stdout == stderr, and then skip output to stderr, but I'm not sure, if I need a very different approach maybe). Please note: I don't want to have two scripts, where one of them calls "backup.sh 2>stderr.log".


title: PulseAudio plays Audio over Bluetooth too fast - sounds like a chipmunk on helium

text: I am using PulseAudio's program 'paplay' to play an 8 KHz 16 bit LE single channel wave file through bluetooth to my headset using the A2DP profile. This is on a Linux ARM board using the new BlueZ 5 stack. The audio plays fine and is good quality but sounds super fast like a chipmunk inhaling helium. You can see in the verbose output below that the sample specification is opened on the playback stream properly for s16le 1ch 8000Hz and mono.               # paplay -vvv --fix-rate cant_afford_that.wav     Opening a playback stream with sample specification 's16le 1ch 8000Hz' and channel map 'mono'.     Connection established.     Stream successfully created.     Buffer metrics: maxlength=4194304, tlength=64000, prebuf=63362, minreq=640     Using sample spec 's16le 1ch 16000Hz', channel map 'mono'.     Connected to device bluez_sink.48_C1_AC_55_86_F3 (1, not suspended).     Stream started.     Playback stream drained.: 81716 usec.               Draining connection to server.      The problem is the "Sample Spec" used - you can see in the output above that it is s16le 1ch 16000Hz. I need 8KHz! If you view the details on the BlueZ sink you'll see the **sample_spec** parameter is where this 16000 Hz value is coming from.               Sink #1         State: SUSPENDED         Name: bluez_sink.48_C1_AC_55_86_F3         Description: PLT Legend         Driver: module-bluez5-device.c         Sample Specification: s16le 1ch 16000Hz         Channel Map: mono         Owner Module: 20         Mute: no         Volume: mono: 65536 / 100% / 0.00 dB                 balance 0.00         Base Volume: 65536 / 100% / 0.00 dB         Monitor Source: bluez_sink.48_C1_AC_55_86_F3.monitor         Latency: 0 usec, configured 0 usec         Flags: HARDWARE DECIBEL_VOLUME LATENCY          Properties:             bluetooth.protocol = "a2dp_sink"             device.description = "PLT Legend"             device.string = "48:C1:AC:55:86:F3"             device.api = "bluez"             device.class = "sound"             device.bus = "bluetooth"             device.form_factor = "headset"             bluez.path = "/org/bluez/hci0/dev_48_C1_AC_55_86_F3"             bluez.class = "0x240404"             bluez.alias = "PLT_Legend"             device.icon_name = "audio-headset-bluetooth"             device.intended_roles = "phone"         Ports:             headset-output: Headset (priority: 0)         Active Port: headset-output         Formats:             pcm      I've been Googling around like crazy but can't figure out how to set this sample_spec on the sink? How do I do this? Thanks.


title: How to umount permanently /home

text: To install Linux Mint, I used two partitions: `/dev/sda4` for `/` and `/dev/sda5` the other contains `/home`. However, the contents of `/media/elvis/Home/elvis` and `/home/elvis` are not the same. So, I don't want to mount `/home` to the partition `/dev/sda5` anymore and use this partition with other purpose. I have tried using `umount` but it only detaches the partition at all without removing `/home` permanently. I thought to format it using `gparted`, but it is an unwanted solution. Which solutions do you suggest me to do that?


title: bash autocomplete not working, does not 'complete'

text: I my `bashrc.` I have a bash completion for the command `scp` implemented as follows               function _scp_complete     {       COMPREPLY=""       COMPREPLY+=( $(cat ~/.ssh_complete ) )       COMPREPLY+=( $( find . ! -name . -prune -type f ) )     }     complete -F _scp_complete scp      The idea is that when pressing `scp [tab]` I see all files in the current directory and the words listed in the text file `~/.ssh_complete`. Let's assume this file contain the following entries:               alex@192.0.0.1     alex@192.0.0.2      The desired behavior is as follows: I type `scp alex@ [tab]` and tab completion'completes' the command to `scp alex@192.0.0.` automatically, because there are only two possible arguments starting with `alex@` (assuming there is no file named similar to that in the currect working directory.). The behavior I get with the current implementation is as follows: I type `scp alex@ [tab]` and the tab completion does not complete anything, but lists every possible argument below the command. How can I get the desired behavior?


title: Did `sudo init 6` cause my file system to be corrupted?

text: I was developing some code and had open qtcreator (software development IDE), gnome-terminal, and possibly firefox. I needed to restart to test something. So i restarted using `sudo init 6`. When my VirtualBox Fedora 15 VM came back up I got this great error:               ... unexpected inconsistency run fsck manually fedora ...      `fsck` then proceeded to find lots of problems and prompted from my `y` or `n`. After running `fsck` the fedora system has booted up successfully. **Did`sudo init 6` cause my file system to be corrupted? or was something else the culprit?**


title: Include replies in the Inbox in Kmail

text: Is there a way to include my own replies to threads, as gmail does it?


title: How can I use environment variables in my shebang?

text: I have a Python script that need to be run with a particular python installation. Is there a way to craft a shebang so that it runs with `$FOO/bar/MyCustomPython`?


title: a file to be in git or not to be?

text: I didn't prevent same problem: I don't use `git rm projects.py` and when i use : `git cp projects``TAB``TAB` `projectsFindFrame.py projectsInsert.py` Also when i use:               git show a3ea2118bf1c5e2c6aa0974d0b6ff7415bd044ef      I prevent to content of projects.py file:               commit a3ea2118bf1c5e2c6aa0974d0b6ff7415bd044ef     Author: Mohsen Pahlevanzadeh <mohsen@debian>     Date:   Wed Oct 9 04:21:14 2013 +0330              formValidators has been added, all of *_Insert component has been added to Projects() class.          diff --git a/projects.py b/projects.py     new file mode 100644     index 0000000..d76685b     --- /dev/null     +++ b/projects.py     @@ -0,0 +1,303 @@     +#!/usr/bin/env python     +# -*- coding: utf-8 -*-     +#     +     +from tables import *     +from dbabslayer import *     +from languagecodes import *     +from PyQt4 import QtCore, QtGui     +     +     +try:     +    _fromUtf8 = QtCore.QString.fromUtf8     +except AttributeError:     +    def _fromUtf8(s):     +        return s     +     +try:     +    _encoding = QtGui.QApplication.UnicodeUTF8     +    def _translate(context, text, disambig):     +        return QtGui.QApplication.translate(context, text, disambig, _encoding)     +except AttributeError:     +    def _translate(context, text, disambig):     +        return QtGui.QApplication.translate(context, text, disambig)     +     +     +     +     +class Projects(QtGui.QMainWindow):      **My Question** is : Why i can't do `git cp projects.py` ? But it's to be.


title: rlwrap: mysql autocompletion not working

text: Normally, autocompletion works fine in mysql command-line client (`mysql- client-5.5`). I have a table called `booking`. When I type the letter `b` and pres `TAB` the name of my table gets autocompleted:               SELECT * FROM b<TAB>      However, when I use `rlwrap` (`alias mysql='/usr/bin/rlwrap -s 99999 -a -pRED /usr/bin/mysql'`), autocompletion stops working. It looks as if `rlwrap` is interfering with the autocompletion feature. Could somebody please advise how to fix this? I am using Debian Wheezy. **UPDATE 1** : When I start my command with `strace`, ie:               strace /usr/bin/rlwrap -s 99999 -a -pRED /usr/bin/mysql --auto-rehash      I see following error               access("/usr/share/rlwrap/completions/mysql", R_OK) = -1 ENOENT (No such file or directory)      could it be, that rlwrap needs some file with mysql completions? **UPDATE 2** OK, I have created the file `/usr/share/rlwrap/completions/mysql` and put 3 sample lines there:               select     from     where      Now when I start `mysql` and type `sele<TAB>`, the tab actually completes the word `select`. That is progress, but that does not solve the whole problem. I mainly need autocompletion to help me complete obscure table names which I don't (want to) remember. But I cannot edit the autocomplete file every time I change/add/rename a table. Is it not possible to tell `rlwrap` to use the same autocomplete file as `mysql` does? (I presume `mysql` must use some such file) **UPDATE 3** : following are the other errors from `strace`               access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     stat("/home/martin/.terminfo", 0x7fff27ee6a70) = -1 ENOENT (No such file or directory)     access("/etc/terminfo/x/xterm-256color", R_OK) = -1 ENOENT (No such file or directory)     access("/home/martin/.mysql_completions", R_OK) = -1 ENOENT (No such file or directory)     access("/usr/share/rlwrap/completions/mysql", R_OK) = -1 ENOENT (No such file or directory)     connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)     connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     stat("/home/martin/.inputrc", 0x7fff27ee7710) = -1 ENOENT (No such file or directory)


title: Problem while install ubuntu 12.04.3-server

text: I try to install Ubuntu 12.04.3-server-i386 in my system. My system configuration is 256MB RAM, 80GB hard disk, Pentium 4 (2.40Gz). I have a DVD drive, I downloaded 12.04.3-server-i386.iso and burnt it on a CD and started installation. The error I got: > Your installation CD-ROM couldn't be mounted. This probably means that the > CD-ROM was not put in the drive. If so you can insert it and try again > > Try again to mount the CD-ROM?   >  Yes No What shall I do now?


title: Does Printing a PDF to PDF degrade its quality?

text: Say I have a PDF of a website which is very long. After reading some of it, I decide there are extraneous pages in it; but rather than finding the website every time I decide to eliminate a page, I want to print it to PDF and just not select that page to print (using CUPS-PDF). Will this degrade the quality of the PDF, particularly if I were to do it multiple times? Is there a better way to achieve what I am looking for? I have tried PDFEdit, with mixed results, and would like something more reliable. Of course, I can always just go back to the site and save a new version, using the same technique of neglected those pages that I don't want.


title: Packets not received by TUN device

text: I created a TUN device(nat64) and created a route so that all the required packets are forwarded to the TUN device from an eth device. But, I see that many packets are not received by the TUN device. Explaining the long story, I am trying to implement a simple NAT64 application using TUN device to filter required traffic. 2001:abcd:1::1 is the Gateway IP. All IPv6 packets received by the gateway and destined to 2001:abcd:1:ffff::/64 need to be translated to IPv4. I wrote a program which reads from the TUN device and does all the required translations from IPv6 to IPv4. I created a route to 'nat64' TUN device for 2001:abcd:1:ffff::/64. It works fine if I try ping6 or traffic at low rates. When I tried to send packets at a higher rate, many packets have not reached the TUN device. Out of 4M UDP packets that I transmitted at 200K/sec, only 2.9M packets have been routed to TUN device. I verified this from the statistics in ifconfig and also using counters while read()ing from the TUN device. Also checked tcpdump to verify that all the packets have reached eth0. Used ostinato tool to send the UDP packets. Below is the configuration-               > $ip -6 route       > 2001:abcd:1:ffff::/64 dev nat64 metric 1024 mtu 1500 advmss 1440 hoplimit 0     >      > eth0 Link encap:Ethernet HWaddr 08:AC:A5:10:01:52 inet6 addr:     > 2001:abcd:1::1/128 Scope:Global inet6 addr: fe80::aac:a5ff:fe10:152/64     > Scope:Link UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1 RX     > packets:182256365 errors:0 dropped:0 overruns:0 frame:0 TX     > packets:91927 errors:0 dropped:0 overruns:0 carrier:0 collisions:0     > txqueuelen:0 RX bytes:8762429793 (8.1 GiB) TX bytes:10618282 (10.1     > MiB)     >      > nat64 Link encap:UNSPEC HWaddr     > 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 UP POINTOPOINT RUNNING     > NOARP MULTICAST MTU:1500 Metric:1 RX packets:49370386 errors:0     > dropped:0 overruns:0 frame:0 TX packets:49379475 errors:0 dropped:31     > overruns:12933189 carrier:0 collisions:0 txqueuelen:500 RX     > bytes:1394031492 (1.2 GiB) TX bytes:2378651480 (2.2 GiB)     >      > $tcpdump -ni nat64 > /dev/null      > tcpdump: WARNING: arptype 65534 not     > supported by libpcap - falling back to cooked socket tcpdump: WARNING:     > nat64: no IPv4 address assigned tcpdump: verbose output suppressed,     > use -v or -vv for full protocol decode listening on nat64, link-type     > LINUX_SLL (Linux cooked), capture size 65535 bytes ^C2961568 packets     > captured 2961568 packets received by filter 0 packets dropped by     > kernel     >      > $tcpdump -ni eth0 > /dev/null      > tcpdump: WARNING: eth0: no IPv4 address     > assigned tcpdump: verbose output suppressed, use -v or -vv for full     > protocol decode listening on eth0, link-type EN10MB (Ethernet),     > capture size 65535 bytes ^C4000482 packets captured 4000482 packets     > received by filter 0 packets dropped by kernel      What could be the reason for so many packets missing between eth0 and TUN device?


title: TLB cache flusing when a page is swapped out

text: I recently heard that Linux simply flushes the TLB cache when the corresponding data in that physical address is swapped out, resulting in underutilization of the TLB. I don't know whether all OSes do the same. If this is true then will increasing RAM and avoiding context switching keep cache in TLB?


title: Ubuntu: where add a script executing SQL on machine start?

text: Each time Ubuntu is starting I need to run a script, which is running some SQLs. So I need run it after MySQL already started. Where should I put such script?


title: What does xterm's Escape Sequence option do and how do I enable it?

text: xterm's `control`- _right-click_ menu contains an option named _Escape sequence_. It is always disabled ("grayed out") in Ubuntu-14.04. What is this option is used for? How do I enable it? I am looking for this just in case enabling it enables displaying combined characters.


title: How to uncompress a gzip file with a custom extension?

text: I have a file called `file1.atz`. I know that it is gzipped. The uncompressed file extension should be `.ats`. I have read the man pages and I just want to verify I'm uncompressing this correctly, because the program that's supposed to read this file isn't able to (which could be for other reasons, I'm just trying to isolate the problem). So if I do this:               gzip -S atz file1.atz      I'm then left with a file called `file1.` (note the `.`). Did I unzip that correctly? Then I just manually rename with a `mv file1. file1.ats` to get what I want? Sorry if this is a stupid question, I just couldn't find much out there about un-gzipping non-traditional file extensions.


title: Who are these BSD Unix contributors?

text: I'm trying to piece together the names of the people who contributed to BSD Unix, according to the contents of the SCCS logs. (This is the version control system used at the time.) A number of names appear in a list created by Jonathan Gray, but 72 are still missing. To keep this process organized, I will create a community wiki answer with the list of the unknown contributors. Please add the names beside each identifier.


title: How to send email from ssmtp with HTML

text: I want to send an HTML report that is piped from another command, eg: `mycommandthatprintshtml | mail someone@hostname.com` . When I do this currently, it prints all the html tags. Is there a way I can set the required headers to make it display in HTML formatted?


title: Lock console session

text: I've set up a no-x/console only system running a minimal install of debian jessie/testing. For this system I need a screen locker to lock the entire session when I'm away. vlock would be appropriate but for some reason it's not in the jessie repo. Does anyone know why vlock isn't in the jessie repo? What can I use instead? FYI I'm using tmux.


title: How does VARIABLE=() { function definition } work in bash

text: I have seen something like this in my bash ENV:               module=() {  eval `/usr/bin/modulecmd bash $*` }      How does this construct work? What is it called? I'm not asking about modulecmd, I am asking about the entire construct.


title: How does bash actually change stdin/stdout/stderr when using redirection/piping

text: Unfortunately I've had no luck figuring this out, as everything I find is just on the syntax of redirection, or shallow information about how redirection works. What I want to know is how bash actually changes `stdin`/`stdout`/`stderr` when you use pipes or redirection. If for example, you execute:               ls -la > diroutput.log      How does it change `stdout` of `ls` to `diroutput.log`? I assume it works like this:   * Bash runs `fork(2)` to create a copy of itself   * Forked bash process sets it's `stdout` to `diroutput.log` using something like `freopen(3)`   * Forked bash process runs `execve(2)` or a similar exec function to replace itself with `ls` which now uses the `stdout` setup by bash But that's just my educated guess.


title: Flipping Control/Command in GNOME breaks Alt key in JVM

text: I want to switch `Control` and `Command` modifier keys in GNOME / Debian Jessie, because I use a Macintosh laptop. I have managed to get these changed via the `TweakTool` -> `Typing panel`, like this:   * `Ctrl key position` -> `Left Ctrl as Meta`   * `Alt/Win key behaviour` -> `Ctrl is mapped to Win keys (and the usua..)` **But this introduces a new weird problem with the` Alt` key**, that I can at least witness in JVM applications, e.g. IntelliJ IDEA: It is not possible any longer to use any keyboard shortcut that uses the `Alt` modifier. For example the following prints the reported modifiers:               import javax.swing._     import java.awt.event.{InputEvent, KeyEvent}     val f = new JFrame     val p = new JPanel(new java.awt.GridLayout(3,1))     f.setContentPane(p)     val ls = Array.fill(3)(new JLabel("-"))     ls.foreach(p.add)     p.addKeyListener {       new java.awt.event.KeyAdapter {         def apply(i: Int, e: KeyEvent): Unit =            ls(i).setText(InputEvent.getModifiersExText(e.getModifiersEx))         override def keyPressed (e: KeyEvent): Unit = apply(0, e)         override def keyReleased(e: KeyEvent): Unit = apply(1, e)         override def keyTyped   (e: KeyEvent): Unit = apply(2, e)       }     }     f.setSize(200, 200)     f.setVisible(true)     p.requestFocus()      When I _press down_ the `Alt` key, it is reported as such. But as soon as I press the additional key, e.g. `Alt`+`A`, both the pressed, typed and released modifier mask is simply changed to `Meta`. If I release the additional key first, then `Alt`, the reported mask on `Alt` release is `Meta+Alt`. In any case, the expected behaviour is that `Alt` reporting is not changed at all. Since my development environment (IntelliJ IDEA) as well as many other applications make heavy use of `Alt` based shortcuts, I need to get this behaviour fixed. The bug is linked to the first setting (`Ctrl key position`), as soon as I disable it, `Alt` goes back to normal. * * * So is this a bug in Linux/GNOME? In OpenJDK (`Alt` still works normally in for example Iceweasel/Firefox)? **Is there an alternative way to flip` Ctrl` and `Command` without affecting the `Alt` keys?**


title: What is the significance of the the leading "4" before the listing of modified files?

text: After running the following command:               find /Users/UserName/Documents -type f -mtime -1 -print0 | xargs -0 du -sk | sort -nr      I receive the following output:               4   /Users/UserName/Documents/SubFolder/hello_2.txt     4   /Users/UserName/Documents/SubFolder/hello.txt     4   /Users/UserName/Documents/hello.txt      What is the significance of the leading "4 "?


title: How pipes work in Linux

text: I've been reading up about how pipes are implemented in the Linux kernel and wanted to validate my understanding. If I'm incorrect, the answer with the correct explanation will be selected.   * Linux has a VFS called pipefs that is mounted in the kernel (not in user space)   * pipefs has a single super block and is mounted at it's own root (`pipe:`), alongside `/`   * pipefs cannot be viewed directly unlike most file systems   * The entry to pipefs is via the `pipe(2)` syscall   * The `pipe(2)` syscall used by shells for piping with the `|` operator (or manually from any other process) creates a new file in pipefs which behaves pretty much like a normal file   * The file on the left hand side of the pipe operator has its `stdout` redirected to the temporary file created in pipefs   * The file on the right hand side of the pipe operator has its `stdin` set to the file on pipefs   * pipefs is stored in memory and through some kernel magic, shouldn't be paged  Is this explanation of how pipes (e.g. `ls -la | less`) function pretty much correct? One thing I don't understand is how something like bash would set a process' `stdin` or `stdout` to the file descriptor returned by `pipe(2)`. I haven't been able to find anything about that yet.


title: How are large directories stored (one inode or many?)

text: I've been studying up on the ext2 file system and inodes, and I'm not quite understanding a few things. How big is an inode? The output from tune2fs says its 256 for my system, so is that 256 byes? How are large directories stored? From what I understand, a directory is represented on the filesystem as an inode who's contents are a list of filenames and inode numbers that represent the contents of the directory. Are the contents stored in the inode itself, or in this case are they stored as "data" the same way file data is stored?


title: Why I get status: Unknown job on the service?

text: I followed this tutorial to add a program to init.d as a service (I guess), when I want to see its status with:               sudo status /etc/init.d/noip2      I get :               status: Unknown job: /etc/init.d/noip2      What it mean? should I change the program? Program is:               #! /bin/sh          # /etc/init.d/noip2     # Supplied by no-ip.com     # Modified for Debian GNU/Linux by Eivind L. Rygge <eivind@rygge.org>     # Updated by David Courtney to not use pidfile 130130 for Debian stable.          # . /etc/rc.d/init.d/functions  # uncomment/modify for your killproc          DAEMON=/usr/local/bin/noip2     NAME=noip2          test -x $DAEMON || exit 0          case "$1" in        start)            echo -n "Starting dynamic address update: "            start-stop-daemon –start –exec $DAEMON            echo "noip2."        ;;             stop)            echo -n "Shutting down dynamic address update:"            start-stop-daemon –stop –oknodo –retry 30 –exec $DAEMON            echo "noip2."        ;;             restart)            echo -n "Restarting dynamic address update: "            start-stop-daemon –stop –oknodo –retry 30 –exec $DAEMON            start-stop-daemon –start –exec $DAEMON            echo "noip2."        ;;             *)            echo "Usage: $0 {start|stop|restart}"            exit 1        ;;          esac     exit 0


title: Drop Process Privileges

text: I have a process that gets started by a damon running as root, now I want to "downgrade" this process's privileges to those of your average user. Is this possible? If yes how? PS: Running unix on a mac


title: How can I make Debian run m python script at startup?

text: I have this script in my home folder (pi): server.py. How could I make Debian run this script at startup so I dont need to log in and to i manually?


title: How to configure VirtualBox to route through tor?

text: How can I configure VirtualBox to route all network access of a guest OS through TOR? My host system is running Linux, and I've already set up TOR on it.


title: `[java] <defunct>` with defunct children -> Any way to collect them?

text: Relating to question : What if 'kill -9' doesn't work? I have following situation : _zombie process with threads, not collected by init_ :               [root@Arch64]# ps auxH | grep java     gwpl       569  0.0  0.0      0     0 ?        Zl   04:23   0:00 [java] <defunct>     gwpl       569  5.5 49.0 1466648 375572 ?      Rl   07:25  23:55 [java] <defunct>     gwpl       569 16.0 49.0 1466648 375572 ?      Rl   12:27  20:54 [java] <defunct>     gwpl       569 17.9 49.0 1466648 375572 ?      Rl   12:47  19:48 [java] <defunct>     root     10466  0.0  0.0   6740   628 pts/0    S+   14:38   0:00 grep java     [root@Arch64]# pstree -s 569     init---java---3*[{java}]      Can I do anything about that ? Or is it _init_ bug as suggested in comment to http://unix.stackexchange.com/a/11173/9689 ? If it's a bug, what should I dump to help fixing it? * * * Above listing uses following status codes: `Zl`, `Rl`, `S+`. Here is cheatsheet from `man ps` to decode them:               PROCESS STATE CODES            (...)            R    Running or runnable (on run queue)            S    Interruptible sleep (waiting for an event to complete)            (...)            Z    Defunct ("zombie") process, terminated but not reaped by its parent.                 For BSD formats and when the stat keyword is used, additional characters may be displayed:            (...)            L    has pages locked into memory (for real-time and custom IO)            (...)            +    is in the foreground process group


title: Importing hdhomerun channels into MythTV

text: I am setting up a MythTV backend, to stream Live TV from. I scanned for channels with the hdhomerun_config utility, and got this However, I really don't have a clue how to import it into MythTV.


title: How to stop warnings from being treated as errors in JHBuild

text: I tried building `mutter` module using JHBuild and it fails:               <snip>     make[4]: Entering directory `/home/wena/src/mutter/src'       CC     screen.lo     core/screen.c: In function 'reload_monitor_infos':     core/screen.c:445:16: error: variable 'display' set but not used [-Werror=unused-but-set-variable]     core/screen.c: At top level:     core/screen.c:394:1: error: 'find_monitor_with_rect' defined but not used [-Werror=unused-function]     core/screen.c:418:1: error: 'find_main_output_for_crtc' defined but not used [-Werror=unused-function]     cc1: all warnings being treated as errors          make[4]: *** [screen.lo] Error 1     make[4]: Leaving directory `/home/wena/src/mutter/src'     make[3]: *** [all-recursive] Error 1     make[3]: Leaving directory `/home/wena/src/mutter/src'     make[2]: *** [all] Error 2     make[2]: Leaving directory `/home/wena/src/mutter/src'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/home/wena/src/mutter'     make: *** [all] Error 2     *** Error during phase build of mutter: ########## Error running make   *** [1/1]


title: Load Balancer Solution with linux

text: I need a suggestion to realize a proper solution to this problem: As you can see in the image above, I have 2 application servers that need to talk with and external third party provider over the internet, at the moment the configuration is very simple, the firewall have a ptp VPN with the remote provider and the application server call directly the remote host with a firewall rule ad-hoc to enable the communication to the remote host via the ptp VPN. ![diagram 1](http://i.stack.imgur.com/bYU6v.png) This kind of configuration have no redundancy, because the actual remote host have 2 different public IPs, in different part of the world. The problem is that when the remote host IP 1 is down the whole thing doesn't work, but the firewall is not "smart" enough to switch in real time to the other IP and provide some sort of NAT. So my idea was to move all this logic to a software installed on a layer4/layer7 load balancer installed on another host, so the 2 app servers should call a Virtual IP on the local network and automatically the load balancer will switch in case of failure of node 1 to node 2 in a completely transparent way for the applications (see image below). ![diagram 2](http://i.stack.imgur.com/L9QGX.png) Anyway my question is: what kind of software I should use on the load balancer to satisfy my requirements? I was thinking about IPLVS + Keepalived or something similar, if someone have some better suggestion will be appreciated. The system is Red Hat 5 based and the application servers are Jboss 5 with a Cisco ASA as firewall. :) (P.S. The setup of this should be done in less than 1 week).


title: Asynchronous RPROMPT?

text: A friend of mine posted this on StackOverflow, and I thought we might be more likely to get an answer here. His post refers to speed, but we now know that the python script we are using to parse git status is slow, and at some point we intend to rewrite it to be faster. however, the question of settign `RPROMPT` asynchronously is still interesting to me, so I thought I’d quote his question here: Since I started using git I've had my RPROMPT setup to show the current branch. I've recently been using some of the "fancy" scripts to show un/staged file counts and other useful at a glance things. (https://github.com/olivierverdier/zsh-git-prompt/tree/master) After using this for a week or two, its performance started to bother me. Are there faster ways of getting this info or are there maybe ways to asynchronously write the RPROMPT? I don't want to wait to type a command while the RPROMPT is computed and would be perfectly happy with it popping in slightly later then my main PROMPT. No offense to the aforementioned script; it's great. I'm just impatient.


title: loop-device: is this a Linux entity or a lower-level one?

text: Here's an Ubuntu How-to about booting from ISO-image on flash. http://ubuntuforums.org/showthread.php?t=1288604 What I don't get is creation of loop-device in GRUB2 prior to booting a kernel:               menuentry "Ubuntu" {         set isofile="/boot/isos/ubuntu.iso"              loopback loop $isofile          linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash noprompt --         initrd (loop)/casper/initrd.lz     }      I don't understand, what is loop-device, irrelevant of OS. I thought, loop devices are Linux entities, non-existing apart from it. Or is it a GRUB2 entity? Where can I read more about them (I failed to google anything)? I'd understand, if they **first** loaded the kernel directly from flash and **then** created a linux loop-device out of ISO. But this way I don't get it.


title: FreeBSD: Remove symlinks in devfs

text: ### Background I have been rebuilding a small home NAS. This server represents my first 'real' foray into the world of server administration and it has taught me quite a bit already. Originally, the thing was setup using FreeNAS on a thumb drive with 3 magnetic disks configured in a raidz1. I have since resolved to migrate the entire system to FreeBSD 9.0 (STABLE) for greater control of the system as well as to simply learn how to "do it myself". Everything has been going well, with the operating system successfully installed and updated (thumb drive again, rw, with access times and a few other things disabled to prevent flash abuse). Now I am working on setting up my magnetic disk storage, again using a raidz1. To this end, I have copied all of the files that I want to persist to external storage. While exploring the various zfs commands, I discovered that the original zpool from the FreeNAS installation was still visible. I imported and upgraded the pool using               # zpool import ZFS1 tank   //Import the original zpool 'ZFS1', renaming it 'tank'     # zpool upgrade tank       //FreeNAS uses an older ZFS version, FreeBDS is v28     # zfs mount tank      and was able to view my files again. Gravy. After poking around a bit, I decided that I still wanted to blow away the old pool and start fresh. I issued               # zfs umount tank     # zpool destroy tank      which completed without error. Now I am looking to recreate a 'clean' raidz1 with these disks. ### Question Before I created the new raidz1, I did some poking around in `/dev`, just to see what I could learn. I wanted to examine the magnetic disks that were used in the array, but the output I got seems odd to me. Worse, googling doesn't really explain what is going on. The disks are listed as follows:               # ls -l ad*     lrwxr-xr-x  1 root  wheel            4 Aug 12 20:50 ad2 -> ada2     lrwxr-xr-x  1 root  wheel            4 Aug 12 20:50 ad4 -> ada0     lrwxr-xr-x  1 root  wheel            4 Aug 12 20:50 ad6 -> ada1     crw-r-----  1 root  operator    0,  96 Aug 12 20:50 ada0     crw-r-----  1 root  operator    0,  98 Aug 12 20:50 ada1     crw-r-----  1 root  operator    0, 100 Aug 12 20:50 ada2      I know that I created three virtual disks in FreeNAS while setting up the raid which is where I suspect the links came from. My questions about this are as follows:   1. From searching on how symlinks work, it is my understanding that a symlink is just a file that links one item to another. If that is the case, why aren't the ada* devices listed with the 'l' attribute and the actual hardware devices listed with another attribute (perhaps block device)?   2. These links are an artifact of the previous setup that I do not _think_ are necessary. Can they be deleted? If so, how (kinda afraid to go removing things willy-nilly; see the last link in the references section)? Will deleting the `ad*` entries implicitly remove the `ada*` nodes, as they now refer to a link that doesn't exist? Or do I have this backwards?   3. Which are the actual hardware devices? As I mentioned in my previous question, I would think the `ad*` nodes would be a character device or something similar and the `ada*` nodes would be the link files.   4. Finally, I know that there is definitely be some variance based on setup and individual preferences but what is the 'accepted' way to have my SATA devices configured for a simple raidz1? All of this symlink business seems like overkill for a simple home NAS. My apologies for the long post, but I have been trying for quite some time to understand this. Thank you in advance for your time and assistance. ### References   * http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2009-07/msg00359.html   * http://www.nixtutor.com/freebsd/understanding-symbolic-links/   * http://forums.freebsd.org/showthread.php?t=6455


title: How do I install packages with F17?

text: I just installed Fedora 17 on my box and I'm having trouble installing packages. I used to think that across all linux os'es all it took was `sudo apt-get install packagae.` I don't think this is the case here, as this is not working for me. Do I have to some how install apt-get before I can use it? I thought it came pre- configured with F17. I'm obviously very new to Linux, and any help or advice is greatly appreciated.


title: Udev : renaming my network interface

text: I just installed _RHEL 6.3_ on a Dell 1950 server. This server as two GBit ports, Gb0 and Gb1. For some obscure reason, `udev` chose to name _Gb0_ `eth1` and _Gb1_ `eth0`. This is definitly not a good find for me and just gives confusion. So I modified the configuration in `/etc/udev/rules.d/70-persistent- net.rules`:               # PCI device 0x14e4:0x164c (bnx2)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \       ATTR{address}=="00:20:19:52:d3:c0",           \       ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"          # PCI device 0x14e4:0x164c (bnx2)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \       ATTR{address}=="00:20:19:52:d3:be",           \       ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"      I just changed the "NAME" field on the file in order to reflect what I want. I rebooted the server and it didn't worked. In the `dmesg` log I can read the following :               udev: renamed network interface eth1 to rename5     udev: renamed network interface eth0 to eth1     udev: renamed network interface rename5 to eth0      Any idea on what is wrong here? Why is `udev` switching like this? I have another similar server, where I do not have this issue.


title: "cannot remove 'some_directory': Directory not empty"

text: I tried to delete some directory, but               $ rm DE.aspx_files -r     rm: cannot remove `DE.aspx_files': Directory not empty      But listing its content returns none               $ ls DE.aspx_files     $      **Added:** Actually               $ ls -la DE.aspx_files          total 4     drwx------ 1 ting ting 4096 Sep 14 20:48 .     drwx------ 1 ting ting    0 Sep 13 22:34 ..     -rw------- 1 ting ting    0 Sep 13 22:34 .fuse_hidden0001d4bf00000006      When I try to `rm .fuse_hidden0001d4bf00000006`, it is deleted, but another new `.fuse_hidden0001d4bf00000007` created. So I wonder what happened, and how to fix this problem? Note: it is a newly bought external portable HDD, and I just copy some files to it using a data recovery program. OS: Ubuntu 12.04 Thanks!


title: How do I install Chromium on F17?

text: I just installed the Beefy Miracle on my box, but essentially being the first time I've used Linux I'm not sure how to perform even some of the most basic tasks. I thought I would try to install Chromium as a starting exercise. I tried:               sudo yum install chromium      but the package doesn't exist. How does this work on Linux? I could easily `sudo yum install Git`, but I can't for Chromium.


title: piping strace to grep

text: I'm trying to run `strace` trough `ccze`, and the pipe doesn't work as expected. The command-line I'm running to test is `sudo strace -p $(pgrep apache2) | grep open`, and all lines are output, ignoring grep. Is there something special about `strace` that causes this behavior?


title: Sudo yum permission denied Fedora 17

text: On Fedora 13, in /etc/sudoers I used to have a line:               Cmnd_Alias      SOFTWARE=/usr/bin/yum      and then for a user that would have the privilege of installing his/her own RPM packages, an entry like:               david          somehost=SOFTWARE      would allow them to run yum with no problems and get the package installed. Now, I upgraded to F17 and this breaks, just like in the next sample trying to install the "clang" package (permission denied).               =========================================================================================================================================================================================       Package                                 Arch                           Version                                          Repository            Size     =========================================================================================================================================================================================      Installing:  clang                                   x86_64                3.0-13.fc17                                      local-updates                                   7.0 M      Installing for dependencies:  llvm                                    x86_64                                   3.0-13.fc17                   local-updates                                   1.1          Transaction Summary     =========================================================================================================================================================================================      Install  1 Package (+1 Dependent package)          Total download size: 8.1 M Installed size: 26 M      Is this ok [y/N]: y      Downloading Packages:      Traceback (most recent call last):       File "/usr/bin/yum", line 29, in <module>         yummain.user_main(sys.argv[1:], exit_code=True)          File "/usr/share/yum-cli/yummain.py", line 319, in user_main         errcode = main(args)          File "/usr/share/yum-cli/yummain.py", line 227, in main         return_code = base.doTransaction()          File "/usr/share/yum-cli/cli.py", line 559, in doTransaction         problems = self.downloadPkgs(downloadpkgs, callback_total=self.download_callback_total_cb)           File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 2313, in downloadPkgs         urlgrabber.grabber.parallel_wait()          File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 2259, in parallel_wait         start(opts, 1)          File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 2148, in start         dl.start(opts)          File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 2080, in start         dl = _ExternalDownloader()          File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 2003, in __init__         stdout = subprocess.PIPE,          File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__         errread, errwrite)          File "/usr/lib64/python2.7/subprocess.py", line 1249, in _execute_child         raise child_exception      OSError: [Errno 13] Permission denied      The reported Python script /usr/lib64/python2.7/subprocess.py is user-readable (has rw-r--r--). Any hints ?


title: How can you complete an interrupted Debian installation?

text: I started a Debian installation on a dual boot with Windows, but the package updating procedure got interrupted. Now I have only a text console available. How can I continue the Debian installation? I also do not have a network connection, I need to connect to a wireless device, but how? The wireless network does not need any key to connect to...


title: How to format a write protected pen drive in Linux?

text: How can I format the write protected pendrive?