title: Create a tar archive split into blocks of a maximum size

text: I need to backup a fairly large directory, but I am limited by the size of individual files. I'd like to essentially create a `tar.(gz|bz2)` archive which is split into 200MB maximum archives. Clonezilla does something similar to this by splitting image backups named like so:               sda1.backup.tar.gz.aa     sda1.backup.tar.gz.ab     sda1.backup.tar.gz.ac      Is there a way I can do this in one command? I understand how to use the `split` command, but I'd like to not have to create one giant archive, then split it into smaller archives, as this would double the disk space I'd need in order to initially create the archive.


title: How is GRUB able to read it's config file on ext3 fileystem?

text: I have read that GRUB can read ext2 filesystems and has modules for doing this. What is the location of the mod on a Redhat system and how about if the /boot partition is ext3/ext4 or other filesystem type?


title: Linux Kernel: Good beginners' tutorial

text: I'm interested in modifying the kernel internals, applying patches, handling device drivers and modules, for my own personal fun. Is there a comprehensive resource for kernel hacking, intended for experienced programmers?


title: resource for understanding the kernel and drivers

text: > **Possible Duplicate:**   >  Linux Kernel: Good beginners' tutorial What **resources** are available if I wanted to _develop_ , _change_ and _understand_ **device drivers**.


title: How to delete number of lines from file repetitively

text: I've read How do I delete the first n lines of an ascii file using shell commands?, it is helpful. However I've a file something as below (please consider 2 columns as 2 different files):               1 4     1 4     1 4     1 4     1 4     3 5     3 5     3 5     3 5     3 5     7 5     7 5     7 5     7 5     7 5      I need to delete line 2-5 then 7-10 and so on (Valid outputs are 1, 3, 7 and 4, 5, 5). I know number of lines for which pattern (number) repeats. However I don't know if everytime it would follow same pattern for e.g. here its 1, 3, 7 next file can have 4, 6, 1 or 4, 5, 5 so I need to make it number of lines based than grepping the values. Can anyone give me a pointer how would I delete lines repetitively?


title: BCM2046 Bluetooth on new 8,3 MacBook Pro

text: I recently was able to install and configure Ubuntu 11.10-amd64 on my new late 2011 8,3 MacBook Pro:               $ sudo dmidecode -s system-product-name     MacBookPro8,3     $ uname -a     Linux work-macbook 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 20:28:43 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux      Just about everything is working, with the major exception of Bluetooth. Bluetooth actually does show up in the app-indicator tray and I can try to connect to devices with it. It also shows up fine in `hcitool` output:               $ hcitool dev     Devices:         hci0    60:C5:XX:XX:XX:XX      However, no matter how I try, I simply cannot get it to find pairable devices in the area, whether with the graphical tool or with `hcitool scan`. The only way that it can successfully connect to things is when I use my Nexus One to initiate a pairing request with the machine (client-to-server), but it doesn't work the other way around, meaning that my Nexus One _can see and connect to the MacBook Pro_ , but my MacBook Pro _cannot see nor connect to my Nexus One._ I've tested multiple other devices as well to try and resolve the issue. Neither my Jawbone Aliph headset, nor my Motorola S305 headset, nor my Nexus One show up to the computer when it scans for them. By comparison, another computer in the area sees them almost immediately with `hcitool scan`. (The other computer is running LM11-amd64 with an ASUS USB Bluetooth dongle.) I've tried just about everything I can think of here, but I'm sure there's something I'm not doing just right.               $ lsusb -v     Bus 001 Device 008: ID 05ac:821a Apple, Inc.      Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.00       bDeviceClass          255 Vendor Specific Class       bDeviceSubClass         1        bDeviceProtocol         1        bMaxPacketSize0        64       idVendor           0x05ac Apple, Inc.       idProduct          0x821a        bcdDevice            0.37       iManufacturer           1 Apple Inc.       iProduct                2 Bluetooth USB Host Controller       iSerial                 0        bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength          216         bNumInterfaces          4         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xe0           Self Powered           Remote Wakeup         MaxPower                0mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           3           bInterfaceClass       255 Vendor Specific Class           bInterfaceSubClass      1            bInterfaceProtocol      1            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0010  1x 16 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x02  EP 2 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0000  1x 0 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0000  1x 0 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       1           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0009  1x 9 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0009  1x 9 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       2           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0011  1x 17 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0011  1x 17 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       3           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0020  1x 32 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0020  1x 32 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       4           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       5           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        2           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass       255 Vendor Specific Class           bInterfaceSubClass    255 Vendor Specific Subclass           bInterfaceProtocol    255 Vendor Specific Protocol           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x84  EP 4 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0020  1x 32 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x04  EP 4 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0020  1x 32 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        3           bAlternateSetting       0           bNumEndpoints           0           bInterfaceClass       254 Application Specific Interface           bInterfaceSubClass      1 Device Firmware Update           bInterfaceProtocol      1            iInterface              0            Device Firmware Upgrade Interface Descriptor:             bLength                             7             bDescriptorType                    33             bmAttributes                        7               Will Not Detach               Manifestation Tolerant               Upload Supported               Download Supported             wDetachTimeout                   5000 milliseconds             wTransferSize                      64 bytes     Device Status:     0x0001       Self Powered      I've provided a lot of relevant logs and configuration files below to try and help resolve this: `dmesg` output.   `lsusb -v` output.   `hciconfig` output.   `/etc/default/bluetooth` conf file. `/etc/bluetooth/input.conf` conf file.   `/etc/bluetooth/audio.conf` conf file.   `/etc/bluetooth/serial.conf` conf file.   `/etc/bluetooth/network.conf` conf file.   `/etc/bluetooth/rfcomm.conf` conf file.   `/etc/bluetooth/main.conf` conf file. Can anyone think of why this wouldn't be working? The BCM2046 driver seems to have been supported by Linux for a long time! * * * Update: if I add the device in OSX, then boot back into Linux, I can now find the device with `bluetooth-applet`, but it fails to connect to it. Hmm...


title: Find all symlinks to a directory and change target to another directory

text: I have a bunch of symlinks in `/home` to files and sub-directories in `/foo`. I want to target the new directory, `/bar`. My approach was to look at all invalid symlinks and verify that they were pointing to `/foo`. I then did the following:               sudo find . -type l -! -exec test -e {} \; -exec sh -c '\        old_link_target=$(readlink "$0"); \        new_link_target=${old_link_target//foo/bar}; \        ln -snf $new_link_target $0' {} \;      However, I want a more precise approach that would not include the initial step of putting eyes on the invalid symlinks. So, for the sake of this question, assume `/foo` still exists so another approach is required.


title: How to install caffeine on fedora16?

text: https://launchpad.net/caffeine I'm trying to install caffeine on Fedora but I am stuck on some problem, that is I can't run:               ./bin/caffeine


title: Unmounting shares on logout with pam_mount

text: I am using `pam_mount` to mount `cifs` and `sshfs` shares for users when they log in to an Arch Linux workstation. I have the a volume line in `/etc/security/pam_mount.conf.xml`:               <volume user="strongbad" fstype="fuse" path="sshfs#%(USER)@myserver.com:" mountpoint="/mnt/%(USER)" options="idmap=user,password_stdin" />      Everything works great on log in and I get an entry in `/proc/mounts`:               strongbad@myserver.com: /mnt/strongbad fuse.sshfs rw,nosuid,nodev,relatime,user_id=1002,group_id=1002 0 0      The problem is the shares do not get unmounted when the user logs out. I hae tried logging in with both KDE/KDM and directly to a TTY. I get the same error in the system logs no matter how I log in: > systemd[474]: (pam_mount.c:706): received order to close things > > systemd[474]: (pam_mount.c:538): _*_ PAM_MOUNT WAS INVOKED WITH INSUFFICIENT > PRIVILEGES (euid=1002) > > systemd[474]: (pam_mount.c:539): _*_ THIS IS A BUG OF THE CALLER. CONSULT > YOUR DISTRO. > > systemd[474]: (pam_mount.c:540): _*_ Also see bugs.txt in the pam_mount > source tarball/website documen Taking a look at bugs.txt uninformatively, at least to me, says: > == su, probably others — privilege drop == > > I sometimes get reports about unmount failing because of insufficient > privileges. Some programs and/or distributions and/or pam configurations > seem to drop the root privileges after successful authentification. This > goes counter to pam_mount which needs these privileges for umount. (May not > apply for FUSE mounts.) > > Known constellations include > >   * su from coreutils, on some distros > >   * GDM on Ubuntu > > This seems to describe my problem. Am I doing something wrong? Is Arch broken? Are there any distributions where `pam_mount` is actually able to unmount shares on logout?


title: getting the message "out of partition" after installing GRUB 2. What is happening?

text: I recently moved a partition with a complete Linux install except `/home` to a new disk (with DD). Everything went fine, I can mount the partition, browse it... perfect. Next step: install GRUB to make it bootable. Restarted from a Live CD mounted the partition (`mount /dev/sda1 /mnt/root/`) and installed GRUB:               grub-install --boot-directory=/mnt/root /dev/sda      I get a success message when I do this. Now, when I boot, I go to the GRUB rescue CLI with the error "out of partition". I tried to see what's inside the disk `ls (hd0,1)/` and I got the list of directories. If I try to list the content of one of the directories I get an "out of partition" again. The hardware is actually a virtual machine (QEMU).


title: Language Support on Linux Mint Debian Edition

text: After a new install of Linux Mint Debian Edition I have some words unlocalized to my native language: ![language missing](http://i.stack.imgur.com/kyTL2.png) most in Czech, some words in English. Whenever I've installed Ubuntu/Linux Mint this always happened, but then I just clicked on "language center" and it automaticilly asked me if I want to install the remaining language packages. ![language support](http://i.stack.imgur.com/QD2O4.jpg) (this is a an ubuntu screen, but it was almost the same thing on Linux Mint) However, on the new Linux Mint Debian Edition (with MATE) I cannot find that language support window. It's not in the Control Panel. How can I install the remaining packages?


title: How do I route different users over different OpenVPN tunnels in Linux?

text: The setup: I have multiple, static-key OpenVPN client/server configurations, labeled "client1", "client2", and "client3" with server/client IPs 10.10.1.1/10.10.1.2, 10.10.2.1/10.10.2.2, and 10.10.3.1/10.10.3.2, respectively, hosted on one Linux server and one Linux client (with three openvpn processes each, each with a different tunX interface). I have three users on my Linux client machine, user "client1", "client2" and "client3". I have my server setup to do NAT so that incoming traffic from client1 on 10.10.1.2 goes out to the Internet (via -j SNAT in iptables) from one IP, client2 on 10.10.2.2 out another IP, etc. The problem: What I don't have is a way for the client Linux machine to properly route traffic from each user to the proper OpenVPN server IP over it's OpenVPN tunnel. Essentially, I am wanting all Internet-destined traffic from client1 to go out one internet-facing IP on the OpenVPN server, traffic from client2 to go out another, and so on and so forth for as many users as I'd like to add. But this must all be done from ONE machine hosting all the different client users. I am aware of an iptables functionality involving marking packets by user ID and then setting up IP routing based on these marks, but I don't know how to actually achieve it. Are there any iptables/netfilter/etc gurus out there that can help me in this matter?


title: Stream system audio through mpd

text: I use mpd to stream music to my phone (connected to Hi-Fi) via `http`. Yet, this only works for songs in my mpd database. I oftentimes want to play stuff in my browser and would like that to be streamed over `mpd`, too. Is there a way to route the `pulse audio` output to `mpd` instead of the speakers?


title: Multiple remote gateways for one ipsec phase 1 entry with pfsense

text: On a Sonicwall I've to replace it is possible to configure multiple remote gateways for one phase 1 ipsec entry. Can I do this on a pfsense 2.0 installation too? I haven't found a way so far and looking into the generated racoon configuration I could not even imagine how it could work, but as it works on the Sonicwall it supposingly is not impossible for ipsec at all. Is there a way to achieve this on the pfsense?


title: Why is LVM metadata backed up to /etc/lvm and not /boot?

text: Recent question I saw got me thinking on this particular point:   * If bootloader restrictions usually cause `/boot` to be outside LVM, why isn't this the target of LVM metadata backups?  Putting it underneath `/etc` seems like it would make a chicken and egg dilemma possible if we're restoring a PV for the root filesystem's VG versus just having it already available for access in rescue mode. Also, if most installers make the root filesystem LVM, it would seem they're almost intentionally creating the situation (versus the distro doing a symlink from `/etc/lvm/archive` to a directory underneath `/boot` or patching the tools to look for LVM information in `/boot`). Not that it's really a problem (I can usually just get it out of backup) but it would seem like having it under `/boot` is more ideal. I was wondering what the logic might have been for locating it under `/etc`.


title: mei 0000:00:16.0: init hw failure

text: When I boot up I get the following errors:                mei 0000:00:16.0: init hw failure.      mei 0000:00:16.0: initialization failed.      (they don't prevent the bootup, I'm just curious as to what they are and if I should be worried). I googled of course, but I only found reference to Supermicro motherboards on servers. I have simply a home laptop (Lenovo Thinkpad S540) and my motherboard vendor simply shows as Lenovo. More googling lead me to believe it's something to do with `Intel vPro technology`, "an interface that uses the Intel ME hardware features to enable an interaction between high- and low-level hardware systems in a system. With this Intel feature, the administrators can now handle the tasks without intervention of the human beings." According to /sys/devices/pci0000:00/0000:00:16.0, vendor is `0x8086` and device is `0x9c3a`, which Google translate as 0x9C3A Intel Management Engine Interface driver and 0x8086 Intel Corporation. Could anyone shed more light on `mei` , and if possible what this error is regarding?


title: How to decrease the size of a logical volume/fs aix?

text: oslevel -s      6100-03-03-0943      IF I have a Logical Volume that I need to shrink, then how can I do it? [there could be several FileSystems on it...]. What is the process?


title: Starting jackd after using other audio

text: I know this is probably a common question. When I start jackd after first booting, everything works fine. If I use another audio (such as Banshee or Youtube, etc) jack won't start. From what I gather, the audio server is committed to whatever was running before. I guess what my question is; how do I free up the server to allow jackd to run? (without having to reboot before I record)


title: I need a very light weight GUI to run under Ubuntu 9.04 (jaunty) with a twist

text: I am in kind of a pickle. I have a VPS, for which I am paying next to nothing and grandfathered in. Therefore I am unwilling to part with it. And I want it to perform a smidgen more by making it accessible via VNC. Mind you this VPS runs with 256MB RAM, burstable to 512 MB only. And it is stuck at Ubuntu version 9.04, for which the usual Ubuntu archive is not providing any more new installations as it is out of support I believe. Upgrading to a supportable Ubuntu version is harder than pulling teeth at this time. So, my question has two parts:   1. What is the best and lightest weight window manager that will run under jaunty with 256MB RAM?   2. (the twist) Where can I download all necessary parts so that I don't need to use any repositories to install it? Step-by-step instructions are highly appreciated. I have a keen understanding of legacy Unix platforms but my experience with Linux is quite limited.


title: How to make RHEL 6 to boot in Text-mode?

text: I am using RHEL 6.4 on a HP-Z620 Workstation.Whenever this machine starts up, it comes up with Graphics Mode e.g. Splash Screen,Red Hat Logo etc. But I want my machine to start in Text Mode. e.g. I want my machine showing all Kernel Messages(saying which services are being started). Previous versions of RHEL provided an option               Press I for interactive startup      But this version does not provide that. How to get back that feature?


title: Please help me in installing a Linux distribution on Apple TV 2?

text: I want to hook up an Apple TV 2 (the second, small black version) to my 58" Samsung television, and want to use an RDP client that comes built into Google Chrome to control the Apple TV from my Macbook Air. This would effectively enable me to 'remote' my tv using my computer. The only questions that I have are as follows:   1. Do you have any tips or recommendations as to how effectively I can root Apple TV, remove the iOS build, and install another operating system on it?   2. Which OS should I replace with the iOS build? I just checked to find that even Ubuntu demands 1GB of RAM, whereas the Apple TV only has 128MB of RAM, with a 1Ghz A4 Processor.


title: How to set up backspace to go up instead of back in Thunar?

text: I'd like pressing `backspace` to step one level up (outside) in a directory hierarchy instead of going to the previous opened location. How to configure this in Thunar?


title: touch: cannot touch file: No such file or directory

text: I am getting the error:               touch: cannot touch `/opt/tsrm/compliance/cme/log/20121207.log`: No such file or directory      on the touch command: `touch $LOGFILE` I also checked the link: touch: cannot touch `foo': No such file or directory, But I didn't understand the answer. Note: I was also getting `mkdir: cannot create directory`; I fixed this by adding the `-p` option. Could this be something with the version of Linux I am working in?


title: Is it a script or is it a binary?

text: At the end, it looks like it's just a regular sh script:               [USER@MACHINE ~/Desktop/D] head -2 truecrypt-7.1-setup-x86      #!/bin/sh     CHECKSUM=163123652      but @the scripts end:               [USER@MACHINE ~/Desktop/D] tail -2 truecrypt-7.1-setup-x86      5��\V<Rx+÷o��6ܺF!&8�ʷ�����^��T4     Sk�!�0"�W���L�`���Su�VP�!m�]5����C'}�/���%�������8�4�?�N;:��zgf�q�14S%oL�hҌz����+����Ƥ<'��jN7)m�H�^�ɧa��:�S���so[�$_�/Ø��&#X�+x����                                                                                Sd  hz=��H����)n�_�������48�,4�M�x�w��z�Mp��)�Ѩa=2a��0ۙI     ���YI��`��om��0�3���,�}�ȇ��I.��G���x���g��ЌÞ%�H��4�ڛ{35��0�C!�$Fԝ�?�.�T�UǺEa���38sl)��[x"��,                                                                                /�/���o���hV���R�`���nʂ�a��ۛ=~{#��FV����35�5Y;k��D��[mK����9 *lY��hD�:��{n����۝�$^�'���w�!$��Ĝ������*�����!'�?����?����?�+�L#(+�V      well.. binary data.. how??               [USER@MACHINE ~/Desktop/D] file truecrypt-7.1-setup-x86      truecrypt-7.1-setup-x86: POSIX shell script text executable     [USER@MACHINE ~/Desktop/D]       How could the file contain ASCII + binary data too? The script is launched as a script, but ends with binary data? How can they do that?? How can I keep a "hello word" binary at the end of a script? [and launch the binary part from the script?]


title: iptables rule for limiting bandwidth in given time

text: Under Linux/iptables how can I limit the bandwidth in given time? ex.: don't limit the connection speed from 22h to 06h, but limit it from 06h to 22h, ex.: the max speed would be only 1Mbit/second! How can I do this with iptables?


title: How to disable requesting AAAA records when I have no IPv6 address?

text: Why can I see `AAAA` DNS requests when I run `tcpdump` on my Scientific Linux PC when I haven't got any IPv6 addresses? I already rebooted after setting `NETWORKING_IPV6=no` in `/etc/sysconfig/network` and `options ipv6 disable=1` in `/etc/modprobe.d/ipv6.conf`, but I can still see `AAAA` requests if I visit a few websites. How can I disable the requesting of `AAAA` records?


title: Cannot remove or reinsert kernel module after error while inserting it without rebooting

text: I am learning how to create kernel modules and it was all working fine: I compiled, inserted the `.ko` with `sudo insmod cheat.ko`, and the `printk` messages inside the init function (set by `module_init`) appeared correctly in `/etc/log/syslog`. Then I made changes to the module, removed it with `sudo rmmod cheat.ko`, reinserted, and `printk` messages were good again. Then, when I tried a new feature the screen became like a tty, error messages all over, I did ctrl-alt-f2 ctrl-alt-f7 (I'm on ubuntu), and I got back to the X server. I undid the most recent modifications to the source file, recompiled, but the problem now is that I am unable to reinsert the module to test things out again, unless I reboot, which is too annoying for testing. How can I reinsert the modified module without rebooting? What I tried and info I got:   * `cat /etc/log/syslog`: The only relevant information to me was:              BUG: unable to handle kernel NULL pointer dereference at 00000003      so it seems that was the cause of the problem, and then I got an oops:              Oops: 0002 [#1] SMP      Horrid debug information follows that, but nothing that seems to help me on how to reinsert the module.   * `sudo insmod cheat.ko`: command just hangs, outputs nothing, and the only way I can get on using that terminal emulator is killing it with `c-c`   * `sudo rmmod cheat`:              Error: Module cheat is not currently loaded        * `sudo modprobe -r cheat.ko`              FATAL: Module cheat.ko not found.        * `lsmod | grep cheat`:              cheat                  19009  -2      which has a very suspicious `-2` usage count...   * `cat /proc/modules | grep cheat`              cheat 19009 1 - Loading 0x00000000 (OF+)      interesting, so the module is still loading...


title: How to use scriptreplay?

text: I know I can replay terminal actions with:               scriptreplay /path/to/$STARTTIME-timing.txt /path/to/$STARTTIME-log.txt      But how can I replay the actions from, for example, the 2nd to the 3rd minute? Does `scriptreplay` only offer a "speed up/slow down" option?


title: How can I use two HDD as one on Debian?

text: I have installed Debian on my server with a 250GB HDD. Now I have bought another HDD that is 2TB large, but I don't know how I could use that 2TB with my webhosting solution. I heard about LVM, but can I use it after I installed Debian, or is it better to copy everything and reinstall my Linux?


title: GRUB2 under Mint: Booting PC-BSD without chainloading?

text: Wanting to try several operating-systems, I installed the following on a MBR- partitioned harddrive: Partition 1: FreeBSD on UFS split in root-slice and swap. No problem booting... Partition 2: PC-BSD on UFS split in root-slice, swap, var and usr Got a menu allowing me to choose between the two, no problem booting either... Partition 5: (logical 1): LinuxMint root-partition (using other logical partitions for swap etc.) Installed GRUB2, no problem booting LinuxMint, but no way to select other OS'. In /etc/grub.d I then added the following entries: 15_freebsd:               #!/bin/sh -e     echo "Adding FreeBSD..."     cat << EOF     menuentry "FreeBSD" {        set root=(hd0,1)        chainloader (hd0,1)+1        }     EOF      16_pcbsd:               #!/bin/sh -e     echo "Adding PC-BSD..."     cat << EOF     menuentry "PC-BSD" {        set root=(hd0,2)        chainloader (hd0,2)+1        }     EOF      I set them both to executable, ran `grub2-update` and `grub-install /dev/sda`. I now had entries for both FreeBSD and PC-BSD. Using the one for FreeBSD worked as expected, I booted into FreeBSD... But using the one for PC-BSD, _also_ booted into FreeBSD - _not_ PC-BSD as I'd expected. I can't frankly see what I did wrong, so `chainloading` obviously doesn't work for my set-up. I was therefor wondering what the correct parameters to boot PC-BSD directly (ie. without chainloading) from GRUB installed under LinuxMint? The weirdest part is of course that the PC-BSD entry "worked" - it just booted the wrong OS... (Of course, any ideas on why chainloading worked with FreeBSD but not PC-BSD would also be a help.)


How can I run a cron command with existing environmental variables? If I am at a shell prompt I can type `echo $ORACLE_HOME` and get a path. This is one of my environmental variables that gets set in my `~/.profile`. However, it seems that `~/.profile` does not get loaded fron cron scripts and so my scripts fail because the `$ORACLE_HOME` variable is not set. In this question the author mentions creating a `~/.cronfile` profile which sets up variables for cron, and then he does a workaround to load all his cron commands into scripts he keeps in his `~/Cron` directory. A file like `~/.cronfile` sounds like a good idea, but the rest of the answer seems a little cumbersome and I was hoping someone could tell me an easier way to get the same result. I suppose at the start of my scripts I could add something like `source ~/.profile` but that seems like it could be redundant. So how can I get make my cron scripts load the variables from my interactive- shell profile?


title: How to delete inet6 Link address automatically?

text: There is an inet6 addr on the eth0 interface:               eth0      Link encap:Ethernet  HWaddr 00:0c:29:d9:46:f5                 inet6 addr: fe80::20c:29ff:fed9:46f5/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:38 errors:0 dropped:0 overruns:0 frame:0               TX packets:193 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:4133 (4.1 KB)  TX bytes:32902 (32.9 KB)               Interrupt:19 Base address:0x2024       I don't need this address and I use the following command to delete it:               sudo ifconfig eth0 inet6 del fe80::20c:29ff:fed9:46f5/64      However, each time I restart the system, this address comes back. How to disable the autoconfigured inet6 address?


title: how to rename files while copying?

text: How would I copy (archive style where date isn't changed) all the files in a backup directory to the user's directory while renaming each file to remove the random string portion from the name (i.e., -2b0fd460_1426b77b1ee_-7b8e)? cp from:               /backup/path/data/Erp.2014.02.16_16.57.03-2b0fd460_1426b77b1ee_-7b8e.etf      to:               /home/user/data/Erp.2014.02.16_16.57.03.etf      Each file will always start with "Erp." followed by the date-time stamp string followed by the random string and then the extension ".etf". I want to keep all name elements including the date-time stamp. I just want to remove the random string. The random string allows multiple backups of the same file. However, in this case, I just ran fdupes and there are no duplicates. So I can simply restore all the files, removing the random string. I'm looking for a one-line bash command to do it. If that won't work, I could do it in two or more steps. I normally use KRename, but in this case I need to do it in bash. (I'm working remotely.)


title: Combining two bash scripts by adding flags

text: I have two scripts which transform the code from `software v.1` to `software v.2` and viceversa. These are essentially a lot of `sed` substitutions. In the way I wrote them they accept two arguments: first, the input file , and second the output file.               $ ./transform2new oldfile newfile      or               $ ./transform2old newfile oldfile      I'd like to merge both codes and manage the transformation with a flag, e.g,               $ ./transform -n oldfile newfile     $ ./transform -o newfile oldfile      **Question** How could I write a single script to achieve the purpose? Cheers.


title: Git Server Bash and SSH

text: I want to use Git over SSH with my Linode VPS running Ubuntu 10.04 LTS. Instructions seem pretty easy, infact given I had already setup my SSH key etc.. All I had to do was instruct my local repository to send to the server ssh://matt@myvps.com:22/~/mygits/proj1.git Problem is when I do _git push origin master_ it just stall, no network activity, no errors, after a few minutes I kill it with ctrl+c. I sent along time yesterday try to diagnosis the problem. So on the server I setup a new user matt2 and copied authorized_keys across to matt2 and tried pushing to matt2@myvps.com:22 and viola it worked. What are differences between matt and matt2? Well matt has this in his .bash_profile to ensure an ssh-agent is running (i need this func alot):                   #Start/Reuse SSH Agent - restart or re-use an existing agent     SSH_AGENT_CACHE=/tmp/ssh_agent_eval_`whoami`     if [ -s "${SSH_AGENT_CACHE}" ]     then     echo "Reusing existing ssh-agent"     eval `cat "${SSH_AGENT_CACHE}"`     # Check that agent still exists     kill -0 "${SSH_AGENT_PID}" 2>-     if [ $? -eq 1 ]     then     echo "ssh-agent pid ${SSH_AGENT_PID} no longer running"     # Looks like the SSH-Agent has died, it'll be restarted below     rm -f "${SSH_AGENT_CACHE}"     fi     fi          if [ ! -f "${SSH_AGENT_CACHE}" ]     then     echo "Starting new ssh-agent"     touch "${SSH_AGENT_CACHE}"     chmod 600 "${SSH_AGENT_CACHE}"     ssh-agent >> "${SSH_AGENT_CACHE}"     chmod 400 "${SSH_AGENT_CACHE}"     eval `cat "${SSH_AGENT_CACHE}"`     ssh-add      So it appears my .bash_profile conflicts with the operating of git over SSH. Any suggestions of workarounds, I dont want to use 2 user accounts, and I want to keep my .bash_profile. It would be good if I could edit the .bash_profile and wrap the functionality around if [ $connectingWith != "git-client"] but I doubt such thing exists? Thoughts?


title: How do I capture audio from interactive webpages using VLC?

text: ## I'm trying to capture an audio video feed (screen-cast) from my web browser and all screen-casting options I tried have the same issue: # No sound is captured * * * ### Platform I'm using a near default install of Linx Mint KDE x64 Petra. The FLAC package is installed Outputs of `cat /proc/asound/pcm`               00-00: ALC270 Analog : ALC270 Analog : playback 1 : capture 1      00-03: HDMI 0 : HDMI 0 : playback 1      * * * ### My current process is   * open vlc and press `Ctrl`-`C`   * change `Capture mode` to `Desktop`   * Change `Desired fame rate` to something reasonable (24 f/s)   * Check `Show more optoions`   * Change `Caching` to 0   * check `Play another media synchronously` ## I think the problem is in this next step:   * In the `Extra media` field I've tried entering `alsa://plughw` or `alsa://hw:0,0` as specified here.   * I've also tried browsing for my audio device:     * I clicked `Capture Device` tab     * Next to `Capture mode` I selected `Video for Linux 2`     * Next to `Audio device name` I chose hw;0,0     * I then pressed select **However, when I'm retured to the`Open Media` window, the text next to `Extra media` is filled in with `v4l2://` with no references to the audio device.** Following this, I click the drop down next to `play` and choose convert and set the profile to `Video - Theora + Flac (OGG)` and set my destination file to `<someFile>.ogg` and hit `start` and launch the webpage I want to record. The video comes out fine, but there is no audio. **Note:** As VLC's user-base is likely much larger than any other option I've tried, I've decided to restrict my focus to solving this issue for VLC but am not opposed to other solutions aside from the obvious bridging of the headphone and mic jacks via an 3.5mm audio cable.


title: Do I need graphics card driver for Linux?

text: I am using Linux with the following hardware configuration:   * Intel Core i7 3.4GHhz 4770k   * MSI Z87 MPower motherboard   * MSI GeForce GTX760 2GB DDR5 graphics card   * 1TB hard drive   * 16GB RAM  Do I need a graphics card driver for Linux?


title: How to export data in the terminal to a file (e.g. csv file)

text: I am a complete beginner in using Linux and I would like to know how to export a bunch of data in the command line to a csv or spreadsheet file (or even text would work). Right now I am simply using `echo` on a topic that prints out a ton of data. So I can see the data as it streams over time. What I want to do is to section off only the parts with numbers and export them to a data file. So for example if the command is repeatedly streaming something like:               header:        seq: 93342        stamp:          secs: 1406820172          nsecs: 191358647        frame_id: ''      name: ['arm_joint_1', 'arm_joint_2', 'arm_joint_3', 'arm_joint_4', 'arm_joint_5', 'gripper_finger_joint_l', 'gripper_finger_joint_r']      position: [2.116426527797216, 1.8058519002096407, -1.6111500844302575, 3.479512978878036, 2.8513271915116376, 0.0, 0.0]      velocity: [-0.0, -0.0, 0.0, -0.0, -0.0, 0.0, 0.0]      effort: []      ---      header:        seq: 93343        stamp:          secs: 1406820172          nsecs: 211357280        frame_id: ''      name: ['arm_joint_1', 'arm_joint_2', 'arm_joint_3', 'arm_joint_4', 'arm_joint_5', 'gripper_finger_joint_l', 'gripper_finger_joint_r']      position: [2.116426527797216, 1.8058519002096407, -1.6111500844302575, 3.479512978878036, 2.8513271915116376, 0.0, 0.0]      velocity: [-0.0, -0.0, 0.0, -0.0, -0.0, 0.0, 0.0]      effort: []      etc, as time goes on, I want just the following:   1. The numbers representing Position and    2. The numbers representing Secs and Nsecs,  all in a csv file. The numbers are whatever they are and I have no way of knowing what this topic will be spitting out in advance. A secondary question is, is there a way for it to simply export all of these numbers for as long as it is streaming, or do I have to stream for a few seconds, and then run a command to grab all the numbers that it spits out after the fact?


title: Difference between slow system calls and fast system calls

text: What's the difference between slow system calls and fast system calls? I have learned that slow system call can block if the process catches some signals, because the caught signals may wake up the blocked system call, but I can't exactly understand this mechanism. Any examples would be appreciated.


title: Environment variable set but not respected

text: I find the following behavior a little confusing, can someone please explain why it happens? In `/etc/bash.bashrc` I have:               EDITOR=vim      And it is indeed set:               lev@home ~ $ echo $EDITOR     vim      I would like `visudo` to respect that. Now, I have read in `man visudo` that it doesn't always respect this variable, but then I don't understand why the following gives different results:               $ sudo visudo # opens vi     $ sudo EDITOR=vim visudo # opens vim      Note that the `EDITOR` variable must be set for root, too (AFAIU):               $ sudo echo $EDITOR     vim      Also, when I install packages from `AUR` using `yaourt` (I'm on Arch Linux) and opt to edit the PKGBUILD file, I see:               Please add $EDITOR to your environment variables     for example:     export EDITOR="vim" (in ~/.bashrc)     (replace vim with your favorite editor)          ==> Edit PKGBUILD with:      So the issue is not limited to `visudo`. Why can I see the variable set, but programs can't (unless I specify it again right in the command)? Technical info:               lev@home ~ $ uname -a     Linux home 3.6.9-1-ARCH #1 SMP PREEMPT Tue Dec 4 08:04:10 CET 2012 x86_64 GNU/Linux     lev@home ~ $ bash --version | head -1     GNU bash, version 4.2.39(2)-release (x86_64-unknown-linux-gnu)


title: User data in evince and cups

text: Some days ago my evince stopped printing. After reinstalling it and trying different versions without success I figured out that it works from other user accounts on the same box. So which files stores evince and cups per user basis such that I can remove or modify some files for the user where evince makes problems? **Edit #1** Printing from all other applications works. Evince from the particular user account just feeds out empty pages. **Edit #2** The user accounts where it worked didn't have any `./config/evince/` and `./cups`. I just deleted those directories in the account where it doesn't work, but it doesn't help. Any ideas what may be different between the users regarding evince printing?


title: Open a port in my CentOS

text: I'm trying top open a port on my CentOS machine: I edit the `/etc/sysconfig/iptables` file and add my rule:               -A INPUT -p TCP -m state --state NEW -m tcp --dport 143 -j ACCEPT      Then I restart the iptable service               # service iptables restart      But when I'm checking the open ports the one I declared doesn't appear               netstat -tulpn | less


title: set up local mail delivery to user from cron script

text: A line in my cron.daily script not work as expected. I haven't any **special** smtp mail server in system, this line rsync -avun --inplace /oneuser/file.xls /otheruser/file.xls| mail -s "$0 $?" provide `Cannot open mail:25` message What Do i need to setup a local mail subsystem? I preffer simple mailboxes to email server setup. I like that otheruser logged in could read cron (root) messages by `mail` command. I found a similar question but not the answer here How to set up local mail retrieval and delivery? when i try to send a mail to user with `mail` command i get after dot               EOT     [root@localhost etc]# send-mail: Cannot open mail:25


I want to install Kali Linux side by side on my machine which is currently running on Ubuntu 12.10.Is it possble and if it is could you instruct me how?


title: Current Workgroup

text: I would like to get the current workgroup of my Linux machine. When I google it, I get only methods to set or rename the workgroup. I found a command `hostname` but that returns only my PC name as username-desktop.


title: enabling numa for Intel Core i7

text: In Linux kernel, the documentation for `CONFIG_NUMA` says:               Enable NUMA (Non Uniform Memory Access) support.           he kernel will try to allocate memory used by a CPU on the       local memory controller of the CPU and add some more     NUMA awareness to the kernel.          For 64-bit this is recommended if the system is Intel Core i7     (or later), AMD Opteron, or EM64T NUMA.      I have an Intel Core i7 processor, but AFAICT it only has one NUMA node:               $ numactl --hardware     available: 1 nodes (0)     node 0 cpus: 0 1 2 3 4 5 6 7     node 0 size: 16063 MB     node 0 free: 15031 MB     node distances:     node   0        0:  10       so what is the purpose of having `CONFIG_NUMA=y`, when i7 has only one numa node ?


title: how to set the sftp -s subsystem option in a configuration file

text: The sftp command supports a subsystem option (-s) which allows the remote user to select the remote sftp-server executable, and optionally upgrade to sudo in the process like so;               sftp -s "/usr/bin/sudo /usr/libexec/openssh/sftp-server" xxx.yyy.zzz.aaa      This command defers to the ssh client options in ~/.ssh/config allowing the transparent use of pubkey and custom port and user settings. However `subsystem` appears to be sftp specific, and hence it not set in the config file and it appears it has to be set as a command line option for sftp. However some tools wrap the sftp invocation so its impossible to set the subsystem option, and hence stuck with user access. Is there some configuration option file I can use to set this for openssh sftp generally? is there some configuration file to effect the way gnome nautilus invokes the sftp for its file manager integration? * * * **Update** possible hacky-but-functioning solution is... So it turns out that there is no obvious config file that sftp will use for options so I ended up modifying a generic wrapper script to add the option explicitly for my selected hosts by putting this in my path;               #!/bin/bash     #  Generic shell wrapper that performs an operation          OPERATION=/usr/bin/sftp     args=("$@")     #the final arg should contain a hostname of the form [user@]host[:path]     case "${args[@]: -1}" in         myserver.com)         exec $OPERATION -s "/usr/bin/sudo /usr/libexec/openssh/sftp-server" "$args"         ;;     *)        exec $OPERATION "$args"          ;;     esac      * * * **However** depending on your sudoers file, usually to run sudo requires a tty, so you have to pass the "-t" option to ssh, and guess what? there is no configuration option for the ssh client command that is documented that works in the ssh_config or ~/.ssh/config files. haha. So I write another wrapper script to provide that....               #!/bin/bash     #  Generic shell wrapper that performs an operation          OPERATION=/usr/bin/ssh     args=("$@")     #locating the hostname is not so simple with ssh     exec $OPERATION -tt "$args"      * * * although, I am now having trouble getting the sftp to use my ~/bin/ssh wrapper file, as it appears to be hard coded into sftp and controlled by an option "-S"


title: Bash: Filter invalid commands from history, specifically passwords

text: > Related Question, less specific: Automatic cleanup of Bash history This question focuses on a single problem. Over time, a user will eventually enter a password on the command line by accident, and may even press enter, which will place the password in history. The user probably was expecting a password prompt, but something was typed wrong, causing that prompt to not show. This user may not know how to clean up the history with `history` and `history -d`, or may be too busy to think about it. I suggest removing all history items that are not found in `which`, or other white-list. An added benefit is you will not make the same mistake twice on a mis-typed command, not found in `which` Do you know of   * a way to tell `bash` to run my cleanup script before, or right after writing history,   * an option that includes this particular `which` based cleanup already, or   * an alternative way to prevent passwords from being stored in `history`?


title: Shell programming temp=$1 vs temp=1

text: What's the difference between `temp=$1` and `temp=1`? Why do I need the dollar sign? For example:               #!/bin/bash          temp=$1     cell=$((($temp-32)*5/9))          echo $cell


title: How to do incremental backup of .img files containing windows partition?

text: On an OVS I have a few windows machines. I want to create a full backup their .img disk files, thats done, .img.gz. Than I want to incrementally backup their C:/ partition, but thats not working. The backup media is a tape drive installed on a remote windows machine accessible by FTP. With help from my previous post I came up with the following commands for the first run:               cd /backup/win-vm-1/     losetup /dev/loop9 win-vm-1.img     kpartx -av /dev/loop9     mount /dev/mapper/loop9p2 drive-C/ -o ro     # Creates a 20Gb file     tar -cSmf drive-C.0.tar --no-check-device -g drive-C.0.snapshot drive-C/     umount -d drive-C/     kpartx -dv /dev/loop9      For the incremental backups I tried the same script but with this changes:               cp drive-C.0.snapshot drive-C.1.snapshot     tar -cSmf drive-C.1.tar --no-check-device -g drive-C.1.snapshot drive-C/      But doing this results in a 8.5GB file. The changes made on the .img between the full and incremental backup were:   1. Boot machine   2. Create two .png files in one folder   3. Delete one .png file in another folder   4. Shutdown What am I doing wrong? Is there a better solution?


title: Screwed up the lightdm.conf file, now what?

text: I screwed up the lightdm.conf file as superuser. What I was trying to do: I tried to insert a command (`xbacklight -set 50`) that sets my monitor brightness at the lightdm config file. Now when I start my laptop, it gets stuck at the xubuntu loading screen, so I can't login. Is there a way to go into the shell/command-line and fix the lightdm.conf file??


title: Command to find file/path lengths that are too long for burning to DVD?

text: I'm trying to burn a DVD from Windows but it fails because the full path name length exceeds the limit of something like 255 characters. Our files are stored in Debian Linux (accessed by Windows using samba), so to avoid running some dodgy Windows app to find long path names I'd prefer to find them using a Linux command. What command could I run to output a list of the relative path and file names for a given folder, sorted by the length of each (in descending order)? The output should look something like this:               92 ./site/testapidocs/wjhk/jupload2/policies/class-use/DefaultUploadPolicy_WithoutAlertBox.ht     83 ./site/testapidocs/wjhk/jupload2/upload/class-use/PacketConstructionThreadTest.html     76 ./site/apidocs/wjhk/jupload2/upload/helper/class-use/ProgressBarManager.html     52 ./site/xref/wjhk/jupload2/gui/JUploadFileFilter.html     31 ./site/samples.java/applet.jnlp     17 ./site/index.html


title: strange problem: join: file 2 is not in sorted order

text: sort flash_int_list.txt|join finish_comm - > t1     join: file 2 is not in sorted order      I have sorted flahs_int_list.txt but it still says file 2 is not in sorted order what is wrong ? the flash_int_list.txt is like(just the first 2 lines are shown,it has mearly 1000 lines):               1     8cvGIKL7C-M   1  1         1         0    0    0    0  -28     9     27ugSKW4-QQ   1  3         3         0    0    0    0  -28


title: Cygwin: readline lib loaded in different locations

text: Within cygwin, almost each unix command I type prints a warning message, takes time and eventually gives a correct result:               -bash-4.1$ ls     0 [main] bash 7468 child_info_fork::abort: cygreadline7.dll: Loaded to different address:     parent(0x320000) != child(0x3B0000)     -bash: fork: retry: Resource temporarily unavailable      What is the meaning of this warning?


title: Why does Linux only see 3832MB of my 4096MB of RAM?

text: I am setting up a lot of 64-bit RedHat VMs (VMware vSphere) for our development department in my company. Most of them start with 4096MB of RAM, but Linux only seems to recognize 3832MB. Can anyone tell me why that is?


title: Uncompress txt.gz files

text: Trying to uncompress txt.gz files on Linux. gzip, gunzip, unzip are not recognizing the file format. The archive is guaranteed to be not corrupted.


title: How to apply du (f.x.) to all sub directories except for some of them?

text: ./a      |-/bx1      |-/by2      |-/bz3      |-/bx4      |-/by5      Now I want to apply `du` to all sub-folders except for /by2 and /bx4. I can make it happen for one folder:               du --max-depth=1 --exclude=./by2      but not for two. * * * I found to related questions:   1. Getting size of directories and exclude some folders   2. Using --exclude with the du command In (1) regular expressions are applied which won't work in my case - at least not comfortably. In (2) the exclusion refers to a full sub-directory. Essentially my question is: Can I feed `\--exclude` a list of files/directories and if yes, how?


title: Error in .zshrc file

text: I've just installed last kubuntu and zsh shell, not for first time by the way. But in this time it shows some configuration option (perhaps it occurs problem), I chose something and quit. Then as usually i've change zshrc file and zhystory with my old, but .zshrc won't work. An error occures in first possible line (in this case it is a comment, but i've change it and error in first character too):               ➜  ~  zsh     /home/akder/.zshrc:1: command not found: #      So it load nothing. I install it with `sudo apt-get install zsh`, there is no error. I've tried to reinstall it, but has the same result.               zsh --version     zsh 5.0.0 (x86_64-unknown-linux-gnu)


title: Help with understanding the usage of the command "equery has"

text: equery has portage     !!! Fatal error: Used ENV_VAR without match_expression or --package      There is no description in http://en.gentoo-wiki.com/wiki/Gentoolkit On the other hand man page says it is not working fully yet. However how could I get sensible output? And to understand ENV_VAR (no description in man) , EAPI.. To operate the command with this module fluently I need several examples.               equery has bash     !!! Fatal error: Used ENV_VAR without match_expression or --package      The same result with others (even man page) equery has repository ....


title: confusion about mount options

text: I feel confused about mount options such as: `\--bind`, `\--make-unbindable` and `\--make-shared` and could you please help me explain the below commands?               sudo "mount --bind #{vm_bind_mount} #{vm_bind_mount}"     sudo "mount --make-unbindable #{vm_bind_mount}"     sudo "mount --make-shared #{vm_bind_mount}"      EDIT: In fact, I wonder why there are duplicate `#{vm_bind_mount}` in `mount --bind`? In other words, does `mount --bind /tmp/foo /tmp/foo` make sense?


title: Debian cannot SSH to OS X by hostname (Windows OK)

text: I've seen some questions asking why xxx can't connect to `MyMacName.local`, which answer regarding Avahi as a requirement. I don't think I am in the same category as I can successfully connect to a Windows machine without needing to do anything on my Debian one. I am able to SSH into both Windows and Mac via IP address, but the Mac only via IP. Does something need to change on the Mac side or the Debian host? **UPDATE:**   * Debian can connect to Windows via hostname   * Windows can connect to Debian via hostname   * Debian **cannot** connect to OS X via hostname   * OS X **cannot** connect to Debian via hostname All can connect to each other via IP


title: Installation of Fedora 19 does not start / freezes in loop while booting from usb-medium

text: I made a usb bootmedium as explained on the Fedora homepage. I then startet up my laptop and booted form USB. Then the screen to select action popped. I choose start Fedora. After that that "citrus" like logo started filling up white (as it is indicating loading procedure) But when this is done the Problem starts. After the Fedora sign appears it (seemingly) freezes, and nothing changes anymore. By hitting some (random) keys, I ended in the shell overview of what is happening and could see this line:               (1 of 3) a start job is running for Network Manager      and there it holds for a while. About 60secs later it starts to print a bunch of loading information, all with a green ok, to again stop at that same message. How can I fix this behaviour to successfully install Fedora. (As this is a Laptop with no cd/dvd drive I have to use a usb-device) As the boot medium works just fine on another machine, I do have to assume it is related to my hardwar. I got a Lenovo Thinkpad x121e. I'll be happy to provide more information, but due to the nature of os- installation I doubt that I can.


title: Truncating strings after a word in unix

text: I have a sentence > Albert Einstein was born in Ulm, in the Kingdom of Württemberg in the German > Empire on 14 March 1879. I want to truncate the above sentence after kingdom and look like the following > Albert Einstein was born in Ulm, in the Kingdom Please provide a unix command to accomplish the above task.


title: MDADM - how to reassemble RAID-5 (reporting device or resource busy)

text: I rather new to the linux scene, and don't have nearly enough experience to actually consider myself somebody that can be trusted with using the system :P Anyhow long story short - I decided to use linux RAID 5 as I consider it more stable than getting it to run on Windows.   The RAID recently failed to mount, and I am rather sure it encountered a issue while trying to rebuild. Trying to assemble the array now, `mdadm` keeps reporting device or resource busy - and yet its not mounted or busy with anything to my knowledge. Google reported that dmraid is a possible culprit - but trying to remove it shows it is not installed... System is a 12 drive RAID-5, but it seems 2 of the drives is not having the correct superblock data installed. I have included output form most of the common commands below Any ideas welcome :) * * *               cat /proc/mdstat          erwin@erwin-ubuntu:~$ cat /proc/mdstat     Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md0 : inactive sdd1[10](S) sde1[2](S) sdf1[11](S) sdg1[6](S) sdm1[4](S) sdl1[9](S) sdk1[5](S) sdj1[7](S) sdi1[13](S) sdc1[8](S) sdb1[0](S) sda1[3](S)          11721120064 blocks          unused devices: <none>      * * * detail mdadm * * *               erwin@erwin-ubuntu:~$ sudo mdadm --detail /dev/md0     mdadm: md device /dev/md0 does not appear to be active.     erwin@erwin-ubuntu:~$      * * * mdadm examine Strange part noted - I am not sure why, but system drive usually was `sda` - now all of a sudden it is `sdh` - and nope, I didn't move any physical wiring? * * *               erwin@erwin-ubuntu:~$ sudo mdadm --examine /dev/sd*1     /dev/sda1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1bcd - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     3       8       97        3      active sync   /dev/sdg1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdb1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1bd7 - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     0       8      113        0      active sync   /dev/sdh1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdc1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1bf7 - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     8       8      129        8      active sync   /dev/sdi1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdd1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1c0b - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this    10       8      145       10      active sync   /dev/sdj1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sde1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 08:05:07 2011               State : clean      Active Devices : 11     Working Devices : 12      Failed Devices : 1       Spare Devices : 1            Checksum : 3597cbb - correct              Events : 74284                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     2       8      161        2      active sync   /dev/sdk1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       8      161        2      active sync   /dev/sdk1        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8       17       12      spare   /dev/sdb1     /dev/sdf1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1c2d - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this    11       8      177       11      active sync   /dev/sdl1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdg1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1c33 - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     6       8      193        6      active sync   /dev/sdm1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     mdadm: No md superblock detected on /dev/sdh1.     /dev/sdi1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1b8b - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this    13       8       17       13      spare   /dev/sdb1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdj1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1b95 - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     7       8       33        7      active sync   /dev/sdc1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdk1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1ba1 - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     5       8       49        5      active sync   /dev/sdd1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdl1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1bb9 - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     9       8       65        9      active sync   /dev/sde1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1     /dev/sdm1:               Magic : a92b4efc             Version : 0.90.00                UUID : 7964c122:1ec1e9ff:efb010e8:fc8e0ce0 (local to host erwin-ubuntu)       Creation Time : Sun Oct 10 11:54:54 2010          Raid Level : raid5       Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)          Array Size : 10744359296 (10246.62 GiB 11002.22 GB)        Raid Devices : 12       Total Devices : 12     Preferred Minor : 0              Update Time : Mon Dec  5 19:24:00 2011               State : clean      Active Devices : 10     Working Devices : 11      Failed Devices : 2       Spare Devices : 1            Checksum : 35a1bbf - correct              Events : 74295                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     4       8       81        4      active sync   /dev/sdf1             0     0       8      113        0      active sync   /dev/sdh1        1     1       0        0        1      faulty removed        2     2       0        0        2      faulty removed        3     3       8       97        3      active sync   /dev/sdg1        4     4       8       81        4      active sync   /dev/sdf1        5     5       8       49        5      active sync   /dev/sdd1        6     6       8      193        6      active sync   /dev/sdm1        7     7       8       33        7      active sync   /dev/sdc1        8     8       8      129        8      active sync   /dev/sdi1        9     9       8       65        9      active sync   /dev/sde1       10    10       8      145       10      active sync   /dev/sdj1       11    11       8      177       11      active sync   /dev/sdl1       12    12       8      161       12      faulty   /dev/sdk1      * * * mdadm --assemble --scan --verbose *edit - acapture truncated to save characters - as noted in edit - resource busy was solved by stopping the array first - yes as simple as that * * *               erwin@erwin-ubuntu:~$ sudo mdadm --assemble --scan --verbose     mdadm: looking for devices for /dev/md0     mdadm: cannot open device /dev/sdm1: Device or resource busy     mdadm: /dev/sdm1 has wrong uuid.      * * * My feeling is that I need to probably zero the superblock on the two faulty drives (since the one drive is shown as a spare, and the other well - disk number just doesn't match?) - then it needs to be reassembled, but I'm not sure what to do about the resource busy. I dont want to take unnecessary, possible data damaging steps - so any advise will be greatly appreciated. *Update 1 derobert suggested to stop the array and then to reassemble it :D Yay resource busy has been fixed, but it still seems that two drives is not co-operating. I am guessing a manual assemble/recreate is in order? Any ideas welcome for the next step? Latest output from mdadm assemble listed below:               erwin@erwin-ubuntu:~$ sudo mdadm --assemble --scan --verbose     mdadm: looking for devices for /dev/md0     mdadm: no RAID superblock on /dev/sdm     mdadm: /dev/sdm has wrong uuid.     mdadm: no RAID superblock on /dev/sdl     mdadm: /dev/sdl has wrong uuid.     mdadm: no RAID superblock on /dev/sdk     mdadm: /dev/sdk has wrong uuid.     mdadm: no RAID superblock on /dev/sdj     mdadm: /dev/sdj has wrong uuid.     mdadm: no RAID superblock on /dev/sdi     mdadm: /dev/sdi has wrong uuid.     mdadm: cannot open device /dev/sdh6: Device or resource busy     mdadm: /dev/sdh6 has wrong uuid.     mdadm: no RAID superblock on /dev/sdh5     mdadm: /dev/sdh5 has wrong uuid.     mdadm: no RAID superblock on /dev/sdh4     mdadm: /dev/sdh4 has wrong uuid.     mdadm: no RAID superblock on /dev/sdh3     mdadm: /dev/sdh3 has wrong uuid.     mdadm: no RAID superblock on /dev/sdh2     mdadm: /dev/sdh2 has wrong uuid.     mdadm: no RAID superblock on /dev/sdh1     mdadm: /dev/sdh1 has wrong uuid.     mdadm: cannot open device /dev/sdh: Device or resource busy     mdadm: /dev/sdh has wrong uuid.     mdadm: no RAID superblock on /dev/sdg     mdadm: /dev/sdg has wrong uuid.     mdadm: no RAID superblock on /dev/sdf     mdadm: /dev/sdf has wrong uuid.     mdadm: no RAID superblock on /dev/sde     mdadm: /dev/sde has wrong uuid.     mdadm: no RAID superblock on /dev/sdd     mdadm: /dev/sdd has wrong uuid.     mdadm: no RAID superblock on /dev/sdc     mdadm: /dev/sdc has wrong uuid.     mdadm: no RAID superblock on /dev/sdb     mdadm: /dev/sdb has wrong uuid.     mdadm: no RAID superblock on /dev/sda     mdadm: /dev/sda has wrong uuid.     mdadm: /dev/sdm1 is identified as a member of /dev/md0, slot 4.     mdadm: /dev/sdl1 is identified as a member of /dev/md0, slot 9.     mdadm: /dev/sdk1 is identified as a member of /dev/md0, slot 5.     mdadm: /dev/sdj1 is identified as a member of /dev/md0, slot 7.     mdadm: /dev/sdi1 is identified as a member of /dev/md0, slot 13.     mdadm: /dev/sdg1 is identified as a member of /dev/md0, slot 6.     mdadm: /dev/sdf1 is identified as a member of /dev/md0, slot 11.     mdadm: /dev/sde1 is identified as a member of /dev/md0, slot 2.     mdadm: /dev/sdd1 is identified as a member of /dev/md0, slot 10.     mdadm: /dev/sdc1 is identified as a member of /dev/md0, slot 8.     mdadm: /dev/sdb1 is identified as a member of /dev/md0, slot 0.     mdadm: /dev/sda1 is identified as a member of /dev/md0, slot 3.     mdadm: no uptodate device for slot 1 of /dev/md0     mdadm: added /dev/sde1 to /dev/md0 as 2     mdadm: added /dev/sda1 to /dev/md0 as 3     mdadm: added /dev/sdm1 to /dev/md0 as 4     mdadm: added /dev/sdk1 to /dev/md0 as 5     mdadm: added /dev/sdg1 to /dev/md0 as 6     mdadm: added /dev/sdj1 to /dev/md0 as 7     mdadm: added /dev/sdc1 to /dev/md0 as 8     mdadm: added /dev/sdl1 to /dev/md0 as 9     mdadm: added /dev/sdd1 to /dev/md0 as 10     mdadm: added /dev/sdf1 to /dev/md0 as 11     mdadm: added /dev/sdi1 to /dev/md0 as 13     mdadm: added /dev/sdb1 to /dev/md0 as 0     mdadm: /dev/md0 assembled from 10 drives and 1 spare - not enough to start the array.


title: Persistent directory stacks across sessions in zsh

text: I would like to share my directory stack (the one accessed with `dirs`) across sessions and tmux panes/windows. In the `zshbuiltins` man page I have found `autopushd` to add every directory I switch into to the stack. But there does not seem to be a native way to have the stack persist and share it. Do I have to save the stack to a temporary file or is there a better solution?


title: MySql: LOAD DATA INFILE

text: I am using **MySQL v5.1** on **Ubuntu** machine. **MySQL** data directory is `/var/lib/mysql/` I have a `test.dat` file located on `/var/lib/mysql/tmp/test.dat` I would like to load data from the `test.dat` file into my database table, so I execute the following SQL statement:               LOAD DATA INFILE '/var/lib/mysql/tmp/test.dat'                 INTO TABLE myapp.cars;      But I got the following error: `Mysql2::Error: Can't get stat of '/var/lib/mysql/tmp/test.dat' (Errcode: 2): LOAD DATA INFILE '/var/lib/mysql/tmp/test.dat`' What could be the reason?? **P.S.** one thing come to my mind is that `/var/lib/mysql/` can only be accessed by **root user** , but I am not sure if it is the reason.


title: How to get the version of my nvidia driver?

text: I tried using `cat /proc/driver/nvidia/version` but it says the file does not exist. Is there any alternative way to do that? I tried to look manually for that file, but I couldn't find it. I also searched for   it and still could not find it. Any suggestions?


title: How to auto type password for SCP or SFTP to automate it?

text: I have script where I put `scp` command to backup file to other server. But when it runs it asking to type password. Is there way to automate this? I am using CentOS 5.6. I have seen few guides they use `spawn` command when I use it, its saying `-bash: spawn: command not found`.               #!/usr/bin/expect -f          # connect via scp     spawn scp "user@example.com:/home/santhosh/file.dmp" /u01/dumps/file.dmp     #######################     expect {     -re ".*es.*o.*" {     exp_send "yes\r"     exp_continue     }     -re ".*sword.*" {     exp_send "PASSWORD\r"     }     }     interact


title: Recursive search doesn't work for grep on solaris

text: On our Solaris server I'm finding that `grep -r` doesn't work, which is the usual way that I use `grep`. It seems that `egrep` has the same behavior. Given that I have no control over the machine, is there a way to have `grep` perform a recursive search? Or do I need to pipe the output of `find` into `grep`?


title: Misleading explanation of Virtual Memory in TLDP

text: I'm completely confused about explanation of virtual memory in TLDP: http://www.tldp.org/LDP/tlk/kernel/processes.html#tthFtNtAAB They say: > Each individual process runs in its own virtual address space and is not > capable of interacting with another process except through secure, kernel > managed mechanisms. "Own virtual address space" for me reads as own 4Gb RAM in 32-bit mode: 0000:0000 - FFFF:FFFF. But they didn't mean that, right? If two processes point to virtual address 1111:1111, they mean the same physical address, so the same 4 Gb virtual address space is shared by all processes? Besides, I've read about Windows here, that they **really** have individual virtual address spaces for each process, separate 2Gb RAM for user mode and shared 2Gb for kernel mode, so 2 different processes can both point to 1111:1111, which maps to different physical memory. Do they? :) UPDATE: illustrations to my question. Which of the pictures is right for Linux: Case 1: ![enter image description here](http://i.stack.imgur.com/j17fO.png) Case 2 ![enter image description here](http://i.stack.imgur.com/3oFlZ.png)


title: how to close X Server, to avoid errors while updating nvidia driver?

text: I tried to update my nvidia driver but i got an error when i ran the driver installation. See the error:                      ERROR: You appear to be running an X server; please exit X before                          installing.  For further details, please see the section INSTALLING                 THE NVIDIA DRIVER in the README available on the Linux driver                       download page at www.nvidia.com.                Note: I tried following a guide by typing `init 3` but still nothing changed.. How to close the X server? So i can update the driver


title: Can ping any hosts but localhost. What's wrong?

text: I got a freshly installed red hat box on a server. I can ping another machine on the network usnig both ip and server name but I can't ping localhost or 127.0.0.1 or 192.168.4.42 (local ip)               [root@comp2 ~]# ping comp1     PING vcas1 (192.168.4.41) 56(84) bytes of data.     64 bytes from vcas1 (192.168.4.41): icmp_seq=1 ttl=64 time=0.104 ms     64 bytes from vcas1 (192.168.4.41): icmp_seq=2 ttl=64 time=0.100 ms          --- comp1 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 999ms     rtt min/avg/max/mdev = 0.100/0.102/0.104/0.002 ms     [root@comp2 ~]#           [root@comp2 ~]# ping 192.168.4.41     PING 192.168.4.41 (192.168.4.41) 56(84) bytes of data.     64 bytes from 192.168.4.41: icmp_seq=1 ttl=64 time=0.119 ms     64 bytes from 192.168.4.41: icmp_seq=2 ttl=64 time=0.105 ms          --- 192.168.4.41 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 999ms     rtt min/avg/max/mdev = 0.105/0.112/0.119/0.007 ms      But I can't ping localhost or local ip address.               [root@comp2 ~]# ping 192.168.4.42     PING 192.168.4.42 (192.168.4.42) 56(84) bytes of data.          --- 192.168.4.42 ping statistics ---     3 packets transmitted, 0 received, 100% packet loss, time 1999ms     PING comp2 (192.168.4.42) 56(84) bytes of data.          --- comp2 ping statistics ---     17 packets transmitted, 0 received, 100% packet loss, time 15999ms          [root@comp2 ~]# ping 192.168.4.42     PING 192.168.4.42 (192.168.4.42) 56(84) bytes of data.          --- 192.168.4.42 ping statistics ---     3 packets transmitted, 0 received, 100% packet loss, time 1999ms          [root@comp2 ~]# ping localhost     PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.          --- localhost.localdomain ping statistics ---     3 packets transmitted, 0 received, 100% packet loss, time 1999ms      This is my /etc/hosts               # Do not remove the following line, or various programs     # that require network functionality will fail.     127.0.0.1               localhost.localdomain localhost     ::1             localhost6.localdomain6 localhost6     192.168.4.41    comp1     192.168.4.42    comp2      and finally this is my ifconfig:               [root@comp2 ~]# /sbin/ifconfig     eth0      Link encap:Ethernet  HWaddr 00:26:55:D4:4E:81                 inet addr:10.0.0.14  Bcast:10.127.255.255  Mask:255.128.0.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:271591 errors:0 dropped:0 overruns:0 frame:0               TX packets:3079 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:16571921 (15.8 MiB)  TX bytes:228424 (223.0 KiB)               Memory:fbfa0000-fbfc0000           eth1      Link encap:Ethernet  HWaddr 00:26:55:D4:4E:80                 inet addr:192.168.4.42  Bcast:192.168.4.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:174349 errors:0 dropped:0 overruns:0 frame:0               TX packets:34537 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:12202232 (11.6 MiB)  TX bytes:3230241 (3.0 MiB)               Memory:fbfe0000-fc000000           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:16398 errors:0 dropped:0 overruns:0 frame:0               TX packets:16398 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:829344 (809.9 KiB)  TX bytes:829344 (809.9 KiB)      What's going on? EDIT:               [root@comp2 ~]# /sbin/iptables -F     [root@comp2 ~]# /etc/init.d/iptables stop     Flushing firewall rules:                                   [  OK  ]     Setting chains to policy ACCEPT: filter                    [  OK  ]     Unloading iptables modules:                                [  OK  ]     [root@comp2 ~]# ping localhost     PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.          --- localhost.localdomain ping statistics ---     6 packets transmitted, 0 received, 100% packet loss, time 4999ms      Still nothing.               [root@comp2 ~]#/sbin/ip route show     192.168.4.0/24 dev eth1  proto kernel  scope link  src 192.168.4.42      169.254.0.0/16 dev eth1  scope link      10.0.0.0/9 dev eth0  proto kernel  scope link  src 10.0.0.14      default via 10.0.0.1 dev eth0           [root@comp2 ~]# /sbin/route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.4.0     *               255.255.255.0   U     0      0        0 eth1     169.254.0.0     *               255.255.0.0     U     0      0        0 eth1     10.0.0.0        *               255.128.0.0     U     0      0        0 eth0     default         VideoGateway.Om 0.0.0.0         UG    0      0        0 eth0      New: This is something I should have done already but equally from server comp1 (192.168.4.41), I can't ping comp2(192.168.4.42)