title: Display shuts down while watching a movie after 10 minutes no matter the settings in Elementary OS

text: I've noticed this when trying to watch movies on that laptop running eOS. After 10 minutes or so the display is turned down. I've looked for settings against this and found the following:   * Power setting: put the computer to sleep: I set that to 'Never'. But it couldn't be this setting, my problem being that the display is shut, not that the computer is put to sleep.   * Brightness and lock: Brightness: Turn screen off when inactive for: set that to 'Never'. That should be it but it does not work.    ![enter image description here](http://i.stack.imgur.com/1qTfp.png) Because I'd experienced a similar issue with GUI settings for display not being followed in another Ubuntu based distro - Xfce - reported here \- I imagined also that a screensaver setting was the matter. I've found a situation similar to that and tried that solution. Only that, unlike in Xfce, now a `gnome-screensaver` was installed but without accessible GUI settings for it. So, it looked like a certain blank-screen screensaver was active in the background. To get a GUI for screensaver I installed `xscreensaver`. When starting that I was prompted that gnome-screensaver was already running and asked to shut it down. Said yes and then disabled screensaver in Xscreensaver.   ![enter image description here](http://i.stack.imgur.com/jE8s5.png) Afterwards I also uninstalled `gnome-screensaver`, but the same problem would still reappear.


title: Can't mount DVD

text: my OS is ArchLinux running on an old ASUS laptop. Recently, I picked a DVD box-set from the store and later realized that they just won't play in my computer. Thinking that the DVD's were faulty I went back to the store and to my surprise they worked quite well when played on the stores dvd-player. I don't remember playing a DVD in the last few years but I did have a bunch of issues with region specific DVD's, this was quite a while back. Usually, DVDs' are automatically mounted by Nautilus. I tried mounting the device with `mount`:               localhost% sudo mount -t iso9660 /dev/sr0 ~/cdrom      mount: /dev/sr0 is write-protected, mounting read-only     mount: no medium found on /dev/sr0      I think the problem might very well be hardware related but any pointers would be more than welcome. Output of the `cd-drive` command at paste-bin. ### Update #1: Here are the `dvd*` packages present in my OS:               extra/libdvdcss 1.2.13-3 [installed]       Portable abstraction library for DVD decryption     extra/libdvdnav 4.2.0-2 [installed]       The library for xine-dvdnav plugin.     extra/libdvdread 4.2.0-1 [installed]        Provides a simple foundation for reading DVD video disks      Output of the `cd-info` command:               Disc mode is listed as: Error in getting information     ++ WARN: error in ioctl CDROMREADTOCHDR: No medium found     cd-info: Can't get first track number. I give up      I should have checked the system logs. Here is what I found from `journalctl` when I tried playing the disc using `vlc`:                -- Logs begin at Sun 2013-10-20 01:18:10 IST, end at Tue 2013-11-05 15:30:23 IST. --     Nov 05 15:30:22 localhost gnome-session[1443]: libdvdnav: Using dvdnav version 4.2.0     Nov 05 15:30:22 localhost gnome-session[1443]: libdvdread: Using libdvdcss version 1.2.13 for DVD access     Nov 05 15:30:22 localhost gnome-session[1443]: libdvdread: Could not open /dev/sr0 with libdvdcss.     Nov 05 15:30:22 localhost gnome-session[1443]: libdvdread: Can't open /dev/sr0 for reading     Nov 05 15:30:22 localhost gnome-session[1443]: libdvdnav: vm: failed to open/read the DVD     Nov 05 15:30:22 localhost gnome-session[1443]: libdvdread: Using libdvdcss version 1.2.13 for DVD access     Nov 05 15:30:23 localhost gnome-session[1443]: libdvdread: Could not open /dev/sr0 with libdvdcss.     Nov 05 15:30:23 localhost gnome-session[1443]: libdvdread: Can't open /dev/sr0 for reading     Nov 05 15:30:23 localhost gnome-session[1443]: [0x7f9848009158] dvdread demux     error: DVDRead cannot open source: /dev/sr0     Nov 05 15:30:23 localhost gnome-session[1443]: [0x7f9858005b88] main input error: open of `dvd:///dev/sr0' failed


title: How to Disable AutoMount of External Drives

text: Is it possible to Disable auto mount of External Harddrives or USB's in RHEL. For security reasons I have to disable this feature. And when I need it I will enable it back.


title: What is "lightweight"?

text: Is there a technical definition, or at least some benchmark notion, of the word "lightweight"? Is it just some arbitrary "doesn't consume a lot of computer resources"? Or perhaps "the application doesn't fork new processes" (a singe process or threads-only)? If there is no technical definition, I'll accept the answer that gives the best rules-of-thumb as whenever something is lightweight or not.


title: Carriage return issue

text: I have this in a bash script               DAY2="20130605"<Cr>     echo  "This is yesterday date:"$DAY2"end"      Why is the output the following? It seems as though there is a carriage return in `DAY2` but where is it coming from?               ends is yesterday date:20130605


title: Simple keyboard-less interface for playing video?

text: Can anyone suggest a simple GUI that works with a remote control from which I can play video files and DVDs, and mount removable media? Preferably not MythTV, because I already spent two weeks trying to set that up, and it's still not working. Something that I can put in my `~/.xsessionrc` that just works, or works after editing a simple configuration file and the like.


title: Linux prompt missing brackets

text: I'm using centos in my VPS server and guest system. There're two logins for a guest system. One is root and one is regular. After I mounted the guest system and chroot to the mounting directory, I switched to the regular account in the mounted guest system. Then the brackets missed as shown below:               [root@server image]# chroot /mnt/guest34     [root@server /]# su - regular     -bash-4.1$ sd     -bash: sd: command not found


title: zfs one pool error

text: I have zpool with name zroot and zroot has 4 pool when electricity down system reboots and than i saw some error with 1 pool:               Solaris: Warning: can`t open object for zroot/var/crash     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement     Solaris: Warning: can`t open object for zroot/var/crash     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement     log_sysevent: type19 is not emplement      System FreeBSD 8.2, zfs v28 How i can destroy zroot/var/crash with out default tool zfs/zroot because it`s not work, just freeze.


title: How to restore GnuPG key after reinstall?

text: I know that GnuPG is all about security, thus it's not giving many chance of retrieve private keys (otherwise anyone could do it) but I've got a private key, and my own rev.asc file. I had to reinstall my Ubuntu box (former Ubuntu Studio) and I have backup of /home and /etc. Is it possible to recover my GnuPG key instead of revoke it and create another one?


title: How do you recall the last (n-th?) passed argument of the previous command you used with bash?

text: Often times I issue different commands on the same file. For example:               $ youtube-dl aB54c4p0eo #I made this video id up on the spot     $ mv aB54c4p0eo.flv kittens.flv     $ vlc kittens.flv     $ rm kittens.flv      Is there a way to reuse arguments from the previous command in the current so that I don't have to rewrite it?


title: Is this enough for a working mail server?

text: I have an internet connection with a public, static IPv4 address (the IP address has a PTR record for foo.org domain, and I own foo.org domain, and have nameservers for it elsewhere, mx record is set to use the static ip). I have an OpenBSD i386 installed on a machine that is the only thing that uses this internet connection. If I nmap all the port of it from the internet side, I can't see any open ports. Great. Since no service is running on the OpenBSD machine that is faced to the internet. I need to install a mail server on it, so people could use it for sending/receiving e-mails securely. So I googled and I will choose to install: OpenSMPTd for SMTPS (using port 465)   popa3d for POP3S (using port 995)   **Question:** is this enough for a mail server? **Will I be able to send/receive e-mails?** (only port 465 will be open for the world/internet, pop3s will be only allowed from localhost, because we will use an ssh tunnel /with port knock/ to this openbsd machine to receive mail), so nmaping all the ports of the openbsd machine only outputs that port 465 is open. UPDATE: so it turn out I don't really need a pop3 server, because I just need to log in to the openbsd machine, and there I can see the mails locally(afaik thunderbird can be set to see local mails.).


title: How to rotate an image in gs

text: How can I rotate an image with ghostscript? I am visualizing eps to screen. I am using the command:               gs image.eps


title: Wildcard in /etc/hosts file

text: It seems that wildcards are not supported in the /etc/hosts file. What is the best solution for me to resolve all *.local domains to localhost?


title: Can not use WEBEX in CentOS 6.5 , Fedora 18 and 20

text: Tried to use WebEx with the following setup: **Machine :** intel i5 , x86 architecture **OS :** CentOs : 6.5 , Fedora 18 and Fedora 20 **Java :** jdk 1.7_45 64 bit **Browser :** firefox 26 with java plugin enabled With the above setup, Able to schedule a meeting with WebEx. While meeting on the run, having issue with audio devices. Getting error message like **"Audio Device Unaccessible Now"** when i have clicked call using computer option. While i am googling the issue, I got a info like **"Webex supports for 32 bit machines"**. But I dont believe in it. **Please guide me with the following :** 1 ) If i have installed 32-bit Java the issue will be solved ? 2 ) Need to install any other stuff to enable WebEx in my machine ? ( Because, I have not installed anything related to webex) 3 ) May i run 32-bit and 64-bit Java for two different applications at same time ?


title: Is it bad when dvdisaster says that some sectors of a dvd disc are unreadable?

text: I wanted to check if an image was successfully written to a DVD, so I checked the checksums:               $ sha256sum debian-7.3.0-amd64-DVD-1.iso     da0249fd52abc0afd4256c754849543f1621255715e57d2265bad97836dc9131  debian-7.3.0-amd64-DVD-1.iso          $ ls -al debian-7.3.0-amd64-DVD-1.iso     -rw-r--r-- 1 morfik morfik 3942645760 Dec 25 22:40 debian-7.3.0-amd64-DVD-1.iso          $ dd if=/dev/sr0 bs=2048 count=1925120 | sha256sum     da0249fd52abc0afd4256c754849543f1621255715e57d2265bad97836dc9131  -     1925120+0 records in     1925120+0 records out     3942645760 bytes (3.9 GB) copied, 355.885 s, 11.1 MB/s      It looks OK, but the application dvdisaster has some problems with it and says that some sectors are unreadable:    ![dvdisaster](http://i.stack.imgur.com/3K4cu.png) Is it because of my DVD drive or is something wrong with the DVD disc? Should I be worried about this?


title: Disabling TCP/IP during boot process in linux

text: I'm trying to install Linux on an FPGA board. The linux flavour is petalinux for Xilinx FPGA chips. The current Xilinx SoC has a Cortex A9 processor and a programmable hardware logic i.e FPGA. I captured the boot message on the terminal:               .....................U-boot time.......................partition.......................................................          [Fri Dec 27 15:18:53.108 2013] Copying Linux from SD to RAM...     [Fri Dec 27 15:18:53.129 2013] Device: SDHCI     [Fri Dec 27 15:18:53.129 2013] Manufacturer ID: 2     [Fri Dec 27 15:18:53.129 2013] OEM: 544d     [Fri Dec 27 15:18:53.129 2013] Name: SA04G      [Fri Dec 27 15:18:53.129 2013] Tran Speed: 25000000     [Fri Dec 27 15:18:53.129 2013] Rd Block Len: 512     [Fri Dec 27 15:18:53.129 2013] SD version 1.10     [Fri Dec 27 15:18:53.129 2013] High Capacity: Yes     [Fri Dec 27 15:18:53.129 2013] Capacity: 3951034368     [Fri Dec 27 15:18:53.129 2013] Bus Width: 1-bit     [Fri Dec 27 15:18:53.129 2013] reading zImage     [Fri Dec 27 15:18:59.367 2013]      [Fri Dec 27 15:18:59.367 2013] 2304852 bytes read     [Fri Dec 27 15:18:59.381 2013] reading devicetree.dtb     [Fri Dec 27 15:18:59.475 2013]      [Fri Dec 27 15:18:59.475 2013] 2709 bytes read     [Fri Dec 27 15:18:59.491 2013] reading ramdisk8M.image.gz     [Fri Dec 27 15:19:06.121 2013]      [Fri Dec 27 15:19:06.121 2013] 2501584 bytes read     [Fri Dec 27 15:19:06.144 2013] Trying to set up GEM link...     [Fri Dec 27 15:19:06.144 2013] Resetting PHY...     [Fri Dec 27 15:19:06.144 2013]      [Fri Dec 27 15:19:06.144 2013] PHY reset complete.     [Fri Dec 27 15:19:06.144 2013] Waiting for PHY to complete auto-negotiation...     [Fri Dec 27 15:19:18.176 2013] ***Error: Auto-negotiation stalled...     [Fri Dec 27 15:19:18.176 2013] ping failed; host 10.10.70.101 is not alive      I'm specifically interested in these lines:               [Fri Dec 27 15:19:06.144 2013] PHY reset complete.         [Fri Dec 27 15:19:06.144 2013] Waiting for PHY to complete auto-negotiation...         [Fri Dec 27 15:19:18.176 2013] ***Error: Auto-negotiation stalled...         [Fri Dec 27 15:19:18.176 2013] ping failed; host 10.10.70.101 is not alive      **Question #1:** I guess these lines are for TCP/IP? As can be seen about 12 seconds are wasted in here. The thing is I need a fast boot system, and would not be needing TCP/IP at all in the end application. The Linux that I installed so far was using a pre-built image provided by Xilinx. Now to get rid of the TCP/IP part (since I don't need it, and if I don't have it in OS, this 12 seconds could be saved - this is my understanding), I'm planning to build my own Linux kernel. So I downloaded the source code of for PetaLinux, assuming I'll have to cross compile it from my host system. **Question #2:** But I want to know how can I exclude the TCP/IP part from the OS source, so that when the OS boots it will never execute those time consuming TCP/IP routines? **Question #3:** I'm also not sure if in pre-built image can we have any option to disable TCP/IP part? My aim is to get rid of these lines during the boot process:               [Fri Dec 27 15:19:06.144 2013] PHY reset complete.             [Fri Dec 27 15:19:06.144 2013] Waiting for PHY to complete auto-negotiation...             [Fri Dec 27 15:19:18.176 2013] ***Error: Auto-negotiation stalled...             [Fri Dec 27 15:19:18.176 2013] ping failed; host 10.10.70.101 is not alive


title: Is it possible to find the physical address range of a DIMM?

text: I note that SMBios Type 20 would help here, but it's optional as of version 2.5 (2006-09-05) pp. 25, L796, and pp. 131, whereas types 16, 17 and 19 are mandatory, but don't quite help. ### Physical Memory Array (Type 16) There is one of these structures for the entire system, explaining what is possible on this board.               Handle 0x1000, DMI type 16, 23 bytes     Physical Memory Array         Location: System Board Or Motherboard         Use: System Memory         Error Correction Type: Multi-bit ECC         Maximum Capacity: 768 GB         Error Information Handle: Not Provided         Number Of Devices: 24      ### Memory Device (Type 17) There is one record per each Dimm, which tells you the physical Dimms installed on the board.               Handle 0x1100, DMI type 17, 34 bytes     Memory Device         Array Handle: 0x1000         Error Information Handle: Not Provided         Total Width: 72 bits         Data Width: 64 bits         Size: 2048 MB         Form Factor: DIMM         Set: 1         Locator: DIMM_A1          Bank Locator: Not Specified         Type: DDR3         Type Detail: Synchronous Registered (Buffered)         Speed: 1600 MHz         Manufacturer: XXXX         Serial Number: XXXX         Asset Tag: XXXX         Part Number: XXXX          Rank: 1         Configured Clock Speed: 1333 MHz      ### Memory Array Mapped Address (Type 19) There can be multiple of these records, and each record lists a range of physical addresses. Here is the output with two 2GB sticks:               Handle 0x1300, DMI type 19, 31 bytes     Memory Array Mapped Address         Starting Address: 0x00000000000         Ending Address: 0x000CFFFFFFF         Range Size: 3328 MB         Physical Array Handle: 0x1000         Partition Width: 2          Handle 0x1301, DMI type 19, 31 bytes     Memory Array Mapped Address         Starting Address: 0x00100000000         Ending Address: 0x0012FFFFFFF         Range Size: 768 MB         Physical Array Handle: 0x1000         Partition Width: 2      And here is the output with 4 sticks; 2*2GB and 2*4GB:               Handle 0x1300, DMI type 19, 31 bytes     Memory Array Mapped Address         Starting Address: 0x00000000000         Ending Address: 0x000CFFFFFFF         Range Size: 3328 MB         Physical Array Handle: 0x1000         Partition Width: 2          Handle 0x1301, DMI type 19, 31 bytes     Memory Array Mapped Address         Starting Address: 0x00100000000         Ending Address: 0x0032FFFFFFF         Range Size: 8960 MB         Physical Array Handle: 0x1000         Partition Width: 2      Note that in the first sample output above, there were two 2GB DIMMs, but two ranges of 3.3GB and 0.7GB. With 4 Dimms, the system will also coalesce the memory array mapped address region into two chunks, as it is just representing the same as the e820 map, i.e. the valid memory physical address ranges. 1 to many Type 20 records are tied to exactly one type 17 memory device, meaning that the entire physical range can be known: ### Example               $ sudo dmidecode -t 20     # dmidecode 2.12     SMBIOS 2.6 present.          Handle 0x002F, DMI type 20, 19 bytes     Memory Device Mapped Address         Starting Address: 0x00000000000         Ending Address: 0x000FFFFFFFF         Range Size: 4 GB         Physical Device Handle: 0x002B         Memory Array Mapped Address Handle: 0x002E         Partition Row Position: 1          Handle 0x0030, DMI type 20, 19 bytes     Memory Device Mapped Address         Starting Address: 0x00100000000         Ending Address: 0x001FFFFFFFF         Range Size: 4 GB         Physical Device Handle: 0x002C         Memory Array Mapped Address Handle: 0x002E         Partition Row Position: 1      It seems possible to go from address to DIMM for EDAC - Error Detection & Correction purposes, but not from DIMM to entire range. Looking at the source code of mcelog, it is also using type 20 for its decoding.


title: Move iptables rule (w/o removing and adding)

text: Is there a way to move a rule in the `iptables` and change it position ? I'm aware i can use `-I` to insert a rule in a specific position, but i also like to keep the counters.


title: Fixed udev rules for USB modems

text: On gentoo i have 10 USB modems and every of them has 3 interfaces /dev/ttyUSB0, 1, 2 and so on for each modem. Sometimes their postitions can change, so it is very difficult to work with them. I'm working with each modem first interface. So for first modem it would be ttyUSB0, other ttyUSB1 and ttyUSB2 i dont need for sending commands to modem. How can I write static udev rules for each of them so they would have fixed position, and how could i rename ttyUSB0 in something like modem-xxxxxxx interface for easier working with them ? lsusb output:               client dev # lsusb     Bus 002 Device 039: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem      dmesg output for one of the huawei modems:               [166041.393547] usb 2-6: default language 0x0409     [166041.402548] usb 2-6: udev 40, busnum 2, minor = 167     [166041.402552] usb 2-6: New USB device found, idVendor=12d1, idProduct=1001     [166041.402555] usb 2-6: New USB device strings: Mfr=1, Product=2, SerialNumber=1     [166041.402558] usb 2-6: Product: HUAWEI Mobile     [166041.402660] usb 2-6: usb_probe_device     [166041.402664] usb 2-6: configuration #1 chosen from 1 choice     [166041.405566] usb 2-6: adding 2-6:1.0 (config #1, interface 0)     [166041.408589] option 2-6:1.0: usb_probe_interface     [166041.408593] option 2-6:1.0: usb_probe_interface - got id     [166041.408600] option 2-6:1.0: GSM modem (1-port) converter detected     [166041.408803] usb 2-6: GSM modem (1-port) converter now attached to ttyUSB0     [166041.408835] usb 2-6: adding 2-6:1.1 (config #1, interface 1)     [166041.411572] option 2-6:1.1: usb_probe_interface     [166041.411576] option 2-6:1.1: usb_probe_interface - got id     [166041.411581] option 2-6:1.1: GSM modem (1-port) converter detected     [166041.411683] usb 2-6: GSM modem (1-port) converter now attached to ttyUSB1     [166041.411703] usb 2-6: adding 2-6:1.2 (config #1, interface 2)     [166041.414572] option 2-6:1.2: usb_probe_interface     [166041.414576] option 2-6:1.2: usb_probe_interface - got id     [166041.414580] option 2-6:1.2: GSM modem (1-port) converter detected     [166041.414682] usb 2-6: GSM modem (1-port) converter now attached to ttyUSB2     [166041.414714] hub 2-0:1.0: state 7 ports 10 chg 0000 evt 0040      **EDIT:** Tried to find port adresses like this:               client rules.d # udevadm info -q path -n /dev/ttyUSB0     /devices/pci0000:00/0000:00:02.0/usb2/2-6/2-6:1.0/ttyUSB0/tty/ttyUSB0      then created file /etc/udev/rules.d/10-local.rules and wrote there lines like this:               KERNEL=="ttyUSB*", KERNELS=="2-6:1.0", NAME="ttyUSB0_654"     KERNEL=="ttyUSB*", KERNELS=="2-6:1.1", NAME="ttyUSB1_654"     KERNEL=="ttyUSB*", KERNELS=="2-6:1.2", NAME="ttyUSB2_654"      but looks like it's not working.


title: Pipeline and redirection understanding

text: Please explain this script (from ABSG. Ch. 20):               exec 3>&1                              # Save current "value" of stdout.     ls -l 2>&1 >&3 3>&- | grep bad 3>&-    # Close fd 3 for 'grep' (but not 'ls').     #              ^^^^   ^^^^     exec 3>&-                              # Now close it for the remainder of the script      Currently I imagine how it works:   1. script connects fd/3 output to stdout   2. pipeline connects stdout of `ls` to stdin of `grep` (fd/3 is inherited by both processes)   3. redirerection of stderr of `ls` to stdout   4. stdout of `ls` is changed to fd/3 (so `grep` process has no more `ls` output, only errors)   5. fd/3 is closed for `ls` Is this the exactly sequence of redirections? Can't understand why I see output of `ls` if there are no errors and we close fd/3 where stdout is redirected. What is the purpose of closing fd/3 for `grep` process (`grep bad **3>&-**`)?


title: Why yum resolve dl.google.com to an IPv6 address?

text: I installed Google chrome browser on Fedora 18. Now when I try update softwares using `yum upgrade`, it report the following error and I can't get chrome updated.               http://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 2404:6800:4005:c00::88: Network is unreachable"      It looks like dl.google.com is resolved to an IPv6 address, but I don't use IPv6, and `ping dl.google.com` returns an IPv4 address as expected.               # ping dl.google.com     PING dl.l.google.com (74.125.128.93) 56(84) bytes of data.      What's the possible reason, and how can I fix this?


title: How to see the total progress while copying the files

text: We know that if we give --progress parameter to rsync it will show the progress of files copied. But issue is that is shows the progress for each single file not total or overall progress. So how to see the Total progress of files copied.


title: dpkg sees them, but apt-get can't remove them?

text: (similar to the question Uninstalling default VBoxGuestAdditions on Debian but a Ubuntu install, and the solution there isn't working for me?) and really the issue seems to be with dpkg/apt-get not virtualbox or its linux guest additions:               host:/media/VBOXADDITIONS_4.2.10_84104$ dpkg -l | grep virtualbox     rc  virtualbox-guest-utils                 4.1.12-dfsg-2ubuntu0.2                  x86 virtualization solution - non-X11 guest utilities     rc  virtualbox-guest-x11                   4.1.12-dfsg-2ubuntu0.2                  x86 virtualization solution - X11 guest utilities     host:/media/VBOXADDITIONS_4.2.10_84104$ sudo apt-get remove virtualbox-guest-utils virtualbox-guest-x11     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package virtualbox-guest-utils is not installed, so not removed               Package virtualbox-guest-x11 is not installed, so not removed     0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.     host:/media/VBOXADDITIONS_4.2.10_84104$ sudo sh ./VBoxLinuxAdditions.run      Verifying archive integrity... All good.     Uncompressing VirtualBox 4.2.10 Guest Additions for Linux..........     VirtualBox Guest Additions installer     You appear to have a version of the VBoxGuestAdditions software     on your system which was installed from a different source or using a     different type of installer.  If you installed it from a package from your     Linux distribution or if it is a default part of the system then we strongly     recommend that you cancel this installation and remove it properly before     installing this version.  If this is simply an older or a damaged     installation you may safely proceed.          Do you wish to continue anyway? [yes or no]     no          Cancelling installation.      so dpkg sees the virtualbox-guest-utils and virtualbox-guest-x11 but apt-get can't remove them?!


title: How can I prevent Windows from overwriting GRUB when using a dual-boot machine

text: I've been reading a lot about dual-booting, and it seems as easy as loading Windows and then loading Linux with GRUB, but everybody says that Windows loves to trash GRUB when it gets the opportunity. What are some steps I can take to prevent this from happening (other than using Windows' bootloader, I want to keep this as simple as possible)?


title: Bash: For loop with binary range keeping control value binary

text: Let's say I have two bash variables that contain binary values:               a=0011 # decimal 3     b=1000 # decimal 8      Is there a way I can loop through all the possible values between `$a` and `$b` keeping it binary? Something like:               for blah in $(seq $a $b) ; do         print "Blah is: $blah"     done      So it will output:               Blah is: 0011     Blah is: 0100     Blah is: 0101     Blah is: 0110     Blah is: 0111     Blah is: 1000      I have tried:               for blah in $(seq "$((2#$a))" "$((2#$b))") ; do      But then `$blah` becomes decimal, and I'd like to keep it a binary (I can always transform the decimal back to binary, but that seems a waste, since I alredy have the _extremes_ in binary) This code must run in a limited linux (OpenWRT) that doesn't have `obase` available. If the answer is that _it's not possible to keep the binary value_ , that's a useful answer as well (I can create a function that converts decimal to binary without using `obase`) Besides, it can be a useful answer to people using regular `bash`.


title: delete first two line in awk script

text: How can I delete the first two line in awk script? From > blabla > > blala > > 1 > > 2 > > 3 > > 4 To > 1 > > 2 > > 3 > > 4


title: How does rsync patch files when there is a difference in the middle?

text: I know how `rsync` works. My doubt is how does `rsync` patches the parts which are different between source and destination file. After calculating the block which is different, it sends that part to destination. Now how does the destination insert this in mid of file? Does it move all the subsequent bytes also because we can't insert (appending) byte in the mid of the file. Suppose source : `ABCDEFGH` destination : `ABCEFGH` suppose rsync detects that D is missing it send that to destination. Than how destination insert D in to the file. Whether it insert after C and move EFGH or it does something else efficient. Because in any programing language we can not insert bytes in the mid of a file without replacing.


title: Using regular experision in "rpl" command

text: I need to replace text in lots of files. I'm using `rpl` for this purpose, but I can't find any way to make it use regular expressions. Can `rpl` use "regex"? how? **Edit:**   I'm using `rpl 1.5.2` from `Ubuntu 13.04` repositories.


title: How to make `find` output full absolute file names?

text: When I run `find`, it outputs relative (`./`-based) file names, but I need full absolute (`/`-based) names.


title: why host command return no SRV record?

text: I am a bit confuse here, I'm trying to establish a connection to Active Directory server from linux, someone told me to use this command: `host -t srv zeus.company.com` Assuming the Active Directory server is having this host name > [zeus.company.com] and the output shows: `zeus.company.com has no SRV record` According to the documentation, if the output doesn't return an SRV record, then it could be a problem with my DNS. Does this means `zeus.company.com` is not register in my linux's `/etc/resolv.conf` or it has to be register in Active Directory server?


title: firefox process dies after ssh log out on remote machine

text: I need to run firefox on a remote host via ssh and keep process running even after ssh logout. I already have tried these ways:               nohup firefox &     screen     disown -h      But it seems these work only for the process without an X11 display, because these work fine with my scripts and I can keep my scripts running even after ssh log out. But I can't do the same for firefox. How can I make this work for firefox too?


title: Why is the default process creation mechanism fork?

text: The UNIX system call for process creation, fork(), creates a child process by copying the parent process. My understanding is that this is almost always followed by a call to exec() to replace the child process' memory space (including text segment). Copying the parent's memory space in fork() always seemed wasteful to me (although I realize the waste can be minimized by making the memory segments copy-on-write so only pointers are copied). Anyway, does anyone know why this duplication approach is required for process creation?


title: Find/ls caching

text: It seems as though the first time I run `find` or `ls` on a directory, it takes a while to work. But, each time thereafter, it is fast, as though a list of the directory's contents has been cached or indexed somewhere. Is there a way to preserve this cache across reboots of the computer?


title: Kernel Panic - not syncing: VFS: Unable to mount root fs after new kernel compile

text: So I've been at this for a while and have been poking around for an answer for a few days, and figure it's about time to ask for help. I am running Ubuntu 10.10 in VMWare Fusion, and have downloaded a copy of the 3.2 kernel and built it with all default settings. When I try to boot into the new kernel after a call to make install, I get the following message:               [    1.581916] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)     [    1.582260] Pid: 1, comm: swapper/0 Not tainted 3.2.4 #1     [    1.582444] Call Trace:     [    1.582552]  [<ffffffff815e7447>] panic+0x91/0x1a7     [    1.582666]  [<ffffffff815e75c5>] ? printk+0x68/0x6b     [    1.582799]  [<ffffffff81ad2152>] mount_block_root+0x1ea/0x29e     [    1.582929]  [<ffffffff81ad225c>] mount_root+0x56/0x5a     [    1.583047]  [<ffffffff81ad23d0>] prepare_namespace+0x170/0x1a9     [    1.583178]  [<ffffffff81ad16f7>] kernel_init+0x144/0x153     [    1.583304]  [<ffffffff815f45f4>] kernel_thread_helper+0x4/0x10     [    1.583436]  [<ffffffff81ad15b3>] ? parse_early_options+0x20/0x20     [    1.583570]  [<ffffffff815f45f0>] ? gs_change+0x13/0x13      Which used to appear on every reboot. I found that if I changed the VM's harddrive type, I could get GRUB to boot at least, but the message above comes up if I try to load the newly compiled kernel. The old kernel works as before. I have checked and I have compiled in support for ext4, which is the fs my root is running. I have also tried generating an initrd file with a call to "sudo update-initramfs -c -k 3.2.4", but to no avail. The compilation, I think, was pretty standard:               make menuconfig     make     make modules_install     make install     update-grub     reboot      Were the general steps. In terms of options, I basically took the default on everything. In case it's pertinent, my fstab looks like this:               proc            /proc           proc    nodev,noexec,nosuid 0       0     #UUID=c75eddd9-f4fa-49be-927b-8c2da7074135 /               ext4    errors=remount-ro 0       1                                                                                /dev/sda1                                  /               ext4    defaults          0       1     #UUID=5bc6915e-fdfa-479a-885f-ea03cb14f9cd none            swap    sw              0       0                                                                                /dev/sda5                                  none            swap    sw              0       0     /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0      Where I've tried it with both UUID's and /dev/sd* notation. Any help or advice would be much appreciated, as it's gotten quite frustrating. Thank you.


title: Man displaying groff control characters

text: Man is displaying groff control characters after I compiled a later version of `groff`. For example, when I try to view `groff`'s man page:               GROFF(1)                    General Commands Manual                   GROFF(1)                    ESC[1mNAMEESC[0m            groff - front-end for the groff document formatting system          ESC[1mSYNOPSISESC[0m            ESC[1mgroff ESC[22m[ESC[1m-abcegijklpstzCEGNRSUVXZESC[22m] [ESC[1m-d ESC[4mESC[22mcsESC[24m] [ESC[1m-D      ESC[4mESC[22margESC[24m] [ESC[1m-f ESC[4mESC[22mfamESC[24m] [ESC[1m-F ESC[4mESC[22mdirESC[24m]                  [ESC[1m-I ESC[4mESC[22mdirESC[24m] [ESC[1m-K ESC[4mESC[22margESC[24m] [ESC[1m-L ESC[4mESC[22marg     ESC[24m] [ESC[1m-m ESC[4mESC[22mnameESC[24m] [ESC[1m-M ESC[4mESC[22mdirESC[24m] [ESC[1m-n ESC[4mESC[22mnumESC[24m] [ESC[1m-o ESC[4mESC[22mlistESC[24m]                  [ESC[1m-P ESC[4mESC[22margESC[24m] [ESC[1m-r ESC[4mESC[22mcnESC[24m] [ESC[1m-T ESC[4mESC[22mdevESC[24m] [ESC[1m-w ESC[4mESC[22mnameESC[24m] [ESC[1m-W ESC[4mESC[22mnameESC[24m] [ESC[4mfileESC[24m ...]            ESC[1mgroff -h ESC[22m| ESC[1m--helpESC[0m            ESC[1mgroff -v ESC[22m| ESC[1m--version ESC[22m[ESC[4moptionESC[24m ...]          ESC[1mDESCRIPTIONESC[0m            This  document  describes the ESC[1mgroff ESC[22mprogram, the main front-end for the            ESC[4mgroffESC[24m document formatting system.  The ESC[4mgroffESC[24m program and macro suite is            the implementation of a ESC[1mroffESC[22m(7) system within the free software collec-            tion GNU <http://www.gnu.org>.  The ESC[4mgroffESC[24m system has  all  features  of     :


title: OpenLDAP Centos 6

text: I am trying to set up some ACLs (starting off with a simple userpassword ACL) on a new OpenLdap deployment. I am trying to get to grips with the new `conf.d` configuration format - but am struggling. Can anyone direct me to a good resource for this? (The obvious resources are yet to be updated to this new way of working it seems)


title: Frustrating issue where neither cron nor su -c runs my job (permissions?)

text: **Updated (andsnipped) with more details below.** I've set up a cron script and I'm trying to debug why it's not running. _[Snipped context testing, which is all ok;see revision 2 for details]_ The command itself, in case it helps, (arrows indicate line-wrapping for legibility) is:               /usr/bin/php -C /etc /path/to/process.php     ↪  >>/path/to/stdout.log 2>>/path/to/stderr.log      _[Snipped permissions testing, which is all ok; see below andrevision 2 for details]_ Checking `crontab` (again, wrapped for legibility), I get:               [blackero@XXXXXXXXXXX to]$ sudo crontab -u cronuser -l     MAIL="blackero@localhost"          30 9 * * * cronuser /usr/bin/php -C /etc /path/to/process.php     ↪   >>/path/to/stdout.log 2>>/path/to/stderr.log     20 18 7 * * cronuser /usr/bin/php -C /etc /path/to/process.php     ↪   >>/path/to/stdout.log 2>>/path/to/stderr.log     22 18 7 * * cronuser echo "Test" > /path/to/test.txt     ↪   2> /path/to/error.txt      **Update #1** at 2012-02-08 12:32 Z _[Snip: Having triedderobert's suggestion (revision 3)]_, I know that the `cronuser` can run the script properly and can write to the two `.log` files. (One of the first things the `process.php` script does is download a file by FTP; it is successfully doing that too.) But, even after fixing the `MAIL=""` line (both by removing it and by changing it to `MAILTO="blackero@localhost"`), the cron task still doesn't run, nor does it send me any email. A friend suggested that I retry the                9 12 8 * * cronuser /bin/echo "Test" > /var/www/eDialog/test.txt      ↪  2> /var/www/eDialog/error.txt      task, after passing the full path to `/bin/echo`. Having just tried that, it also didn't work and also generated no email, so I'm at a loss. **Update #2** at 2012-02-08 19:15 Z A very useful chat conversation with oHessling, it would seem that the problem is with `pam`. For each time that `cron` has tried to run my job, I have `/var/log/cron` entries:               crond[29522]: Authentication service cannot retrieve authentication info     crond[29522]: CRON (cronuser) ERROR: failed to open PAM security session: Success     crond[29522]: CRON (cronuser) ERROR: cannot set security context      I fixed that by adding the following line to `/etc/shadow`:               cronuser:*:15217:0:99999:7:::      As I found on a forum, if the user does not appear in `/etc/shadow`, then `pam` won't continue processing the security request. Adding `*` as the second column means this user cannot log in with a password (as no hash is specified). Fixing that led to a different error in `/var/log/cron`, so, double-checking my `crontab` I noticed I had specified the username each time. Correcting that means my `crontab` now reads:               [blackero@XXXXXXXXXXX ~]$ sudo crontab -u cronuser -l     MAILTO="blackero@localhost"          30 9 * * * /usr/bin/php -C /etc /path/to/process.php     ↪   >>/path/to/stdout.log 2>>/path/to/stderr.log     52 18 8 * * /usr/bin/php -C /etc /path/to/process.php     ↪   >>/path/to/stdout.log 2>>/path/to/stderr.log     9 12 8 * * /bin/echo "Test" > /path/to/test.txt     ↪   2> /path/to/error.txt      but now `/var/log/cron` shows me:               Feb  8 18:52:01 XXXXXXXXXXX crond[16279]: (cronuser) CMD (/usr/bin/php -C /etc     ↪   /path/to/process.php >>/path/to/stdout.log 2>>/path/to/stderr.log)      and nothing comes into the `stdout.log` or the `stderr.log`. No mail was sent to me and none of the other files in `/var/log/` has any entry in the right timeframe, and I'm running out of ideas as to where to look to see what's going wrong


title: SSH connection does not work while browsers do

text: I have the following network layout: Internet comes true fiber optics to modem. From modem LAN cable goes to router. Since that router wifi signal is weak, a LAN cable goes to another router from which I connect over true wifi. TL;DR - Modem > router > router with wifi > me. Browser connects just fine. (I had to set up to use OpenDNS or Google (optional) DNS server since somewhy browser could not detect providers DNS; It was done in second router). And now I tried to ssh to another IP and noticed that terminal does not have any internet connection. How comes that browser can connect while simple ping does not? I haven't changed any settings in my PC regarding connection. I'm using Fedora 16;   Gnome 3.2.1;   Terminal - Terminator 0.96;   Google chrome 16;   FireFox 10


title: find usage with -L

text: I have               link -> file      I do               find -L . -name 'link'      And get               ./link      Why is that? man find says: -L : Follow symbolic links. When find examines or prints information about files, the information used shall be taken from the properties of the file to which the link points, not from the link itself (unless it is a bro‐ ken symbolic link or find is unable to examine the file to which the link points).


title: How can I send reads and writes on a single file descriptor to different places?

text: I have a Linux executable `foo` that reads input from fd 0 and writes output to fd 0 ( _not_ fd 1). This works just fine for interactive use in the terminal. From the shell command line, how can I execute this program such that reads from fd 0 come from one file, but writes to fd 0 go into a different file? The best I can come up with is `$ goo input.txt output.txt | foo` where `goo` is some helper program, but I don't know of any existing helper program, and I don't even know if the pipe set up by `|` is bidirectional.


title: it takes too long to connect to ssh server

text: I've got two VMs with `arch linux` and `debian` (running under `virtual box`). Not long ago, it started to take a lot of time connecting to `arch` VM over `ssh`. The first time after a while, successive attempts happen quickly. Here's what I see in the `arch` VM:               debug1: userauth-request for user yuri service ssh-connection method none     debug1: attempt 0 failures 0     debug3: Trying to reverse map address 10.0.2.2.     # ^^^ spends a lot of time after this line     debug2: parse_server_config: config reprocess config len 314     debug2: input_userauth_request: setting up authctxt for yuri     debug1: PAM: initializing for "yuri"     debug1: PAM: setting PAM_RHOST to "10.0.2.2"     debug1: PAM: setting PAM_TTY to "ssh"     debug2: input_userauth_request: try method none     Failed none for yuri from 10.0.2.2 port 35786 ssh2      `10.0.2.2` is the default gateway for the VMs. What does this all mean? P.S. Here's a good answer, thanks to which I was able to make some progress in researching the issue.


title: USB to Virtual Machine XenServer 6.2

text: I've been fighting with this for a while and still nothing. So here is the deal, I have a XenServer 6.2 machine with many VM. I'm trying to attach the USB Port to the Virtual Machine, to use it with a Print Server using CUPS (CentOS6.4). This is the architecture; > XenServer 6.2 (Physic Machine) (Printer Connected via USB)   >  |------- VM (CentOS6.4 need to access the USB Printer)   >  |------- VM   >  |------- VM Anything would be appreciated!


title: What is $() in a command?

text: What is `$()` in Linux Shell Commands? For example:               chmod 777 $(pwd)


title: “Other” permissions on files

text: To my understanding, the last three character of file permission printed by `ls` command is about other user's file permission. If **the other user"s"** have separate file permissions to this file, what will the `ls` command show? ![](http://docstore.mik.ua/orelly/linux/run/figs/rl3_0401.gif)


title: /dev/root does not exist in CentOS 7

text: I take an error message when installing CentOS 7 from usb. ![The screenshot of error message.](http://seven.gen.tr/images/sc1.jpg) What is it solution?


title: How to evaluate a variable length in shell script?

text: I want to write a shell script, in which it will call different command according to the variable length. But I didn't figure it out yet. My unwork script is here:               for i in n5 n25      if ${#i} == 2;     then      do          python two.py n5     elif ${#i} == 3;     do          python three.py n25     fi      How to evaluate the variable length in shell script?


title: tcsh/vi-mode behavior difference between Solaris and Linux

text: We have both Solaris and Linux environments at work. We use tcsh as the standard shell for hundreds of users. My question is about vi-mode in tcsh: In Solaris, while I'm typing, I can backspace over previous chars, and then just start typing again. Insert mode is intuitive, and the commandline seems to be in insert mode automatically -- I can backspace, and type, backspace and type, all as if I pressed ESC-i to enter insert mode explicitly (doing that BTW presents the same behavior as not doing it...) In Linux however, using a slightly newer version of tcsh (6.17), as soon as I press backspace to backup over incorrect text, the editor exits insert mode, and thereafter, I have to press "i" to get back to inserting text. Further, before backspace will erase the char to the left of the cursor, you have to press it twice -- it's switching mode apparently. Then you have to press "i" to enter back to insert mode before you can start typing again, and so on and so on. I find this Linux behavior really annoying and tedious. What is possibly the reason for this difference in behavior? BTW, my terminal in both cases is xterm. thanks...


title: Static IPv4 & IPv6 configuration on CentOS 6.2

text: I try to configure static IPv4 & IPv6 configuration on CentOS 6.2. The configuration below works perfectly :               # ifconfig eth0 x.x.x.x/29     # route add defalt gw x.x.x.y          # ip addr add dev eth0 XXXX:C810:3001:D00::3/56     # ip -6 route add default XXXX:C810:3001:D00::1      However, I want to keep this configuration after a reboot. So I made the following configuration: Enabling IPv6               [root@test network-scripts]# cat /etc/sysconfig/network     NETWORKING=yes     HOSTNAME=test.net     NETWORKING_IPV6=yes      Interface Configuration               [root@test network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0      DEVICE="eth0"     BOOTPROTO="static"     ONBOOT="yes"     HWADDR="2C:C3:AC:A8:C3:3E"     IPADDR=x.x.x.x     GATEWAY=x.x.x.x     NETMASK=255.255.255.248     TYPE=Ethernet     IPV6INIT=yes     IPV6ADDR=XXXX:C810:3001:D00::3/56     IPV6_DEFAULTGW=XXXX:C810:3001:D00::1          DNS1=208.67.222.222     DNS2=208.67.220.220     # Only DNS{1,2} according to /usr/share/doc/initscripts-9.03.27/sysconfig.txt     # DNS3=2620:0:ccc::2     # DNS4=2620:0:ccD::2      Restarting the Network               [root@test network-scripts]# service network restart     Arrêt de l'interface eth0 :  État du périphérique : 3 (déconnecté)                                                                [  OK  ]     Arrêt de l'interface loopback :                            [  OK  ]     Activation de l'interface loopback :                       [  OK  ]     Activation de l'interface eth0 :  État de connexion active : activation     État de chemin actif : /org/freedesktop/NetworkManager/ActiveConnection/3     état : activé     Connexion activée                                                                [  OK  ]      [root@test network-scripts]# cat /var/log/message               Mar 13 14:32:13 test NetworkManager[8299]: <info> (eth0): device state change: 8 -> 3 (reason 39)     Mar 13 14:32:13 test NetworkManager[8299]: <info> (eth0): deactivating device (reason: 39).     Mar 13 14:32:13 test avahi-daemon[8311]: Withdrawing address record for x.x.x.x on eth0.     Mar 13 14:32:13 test avahi-daemon[8311]: Leaving mDNS multicast group on interface eth0.IPv4 with address x.x.x.x.     Mar 13 14:32:13 test avahi-daemon[8311]: Interface eth0.IPv4 no longer relevant for mDNS.     Mar 13 14:32:14 test kernel: lo: Disabled Privacy Extensions     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) starting connection 'System eth0'     Mar 13 14:32:14 test NetworkManager[8299]: <info> (eth0): device state change: 3 -> 4 (reason 0)     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started...     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete.     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting...     Mar 13 14:32:14 test NetworkManager[8299]: <info> (eth0): device state change: 4 -> 5 (reason 0)     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful.     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete.     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started...     Mar 13 14:32:14 test NetworkManager[8299]: <info> (eth0): device state change: 5 -> 7 (reason 0)     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) scheduled...     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Beginning IP6 addrconf.     Mar 13 14:32:14 test avahi-daemon[8311]: Withdrawing address record for fe80::1ec1:deff:feb8:a2fd on eth0.     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) started...     Mar 13 14:32:14 test NetworkManager[8299]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) complete.     Mar 13 14:32:15 test avahi-daemon[8311]: Registering new address record for fe80::1ec1:deff:feb8:a2fd on eth0.*.     Mar 13 14:32:35 test NetworkManager[8299]: <info> (eth0): IP6 addrconf timed out or failed.     Mar 13 14:32:35 test NetworkManager[8299]: <info> Activation (eth0) Stage 4 of 5 (IP6 Configure Timeout) scheduled...     Mar 13 14:32:35 test NetworkManager[8299]: <info> Activation (eth0) Stage 4 of 5 (IP6 Configure Timeout) started...     Mar 13 14:32:35 test NetworkManager[8299]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...     Mar 13 14:32:35 test NetworkManager[8299]: <info> Activation (eth0) Stage 4 of 5 (IP6 Configure Timeout) complete.     Mar 13 14:32:35 test NetworkManager[8299]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...     Mar 13 14:32:35 test avahi-daemon[8311]: Joining mDNS multicast group on interface eth0.IPv4 with address x.x.x.x.     Mar 13 14:32:35 test avahi-daemon[8311]: New relevant interface eth0.IPv4 for mDNS.     Mar 13 14:32:35 test avahi-daemon[8311]: Registering new address record for x.x.x.x on eth0.IPv4.     Mar 13 14:32:36 test NetworkManager[8299]: <info> (eth0): device state change: 7 -> 8 (reason 0)     Mar 13 14:32:36 test NetworkManager[8299]: <info> Policy set 'System eth0' (eth0) as default for IPv4 routing and DNS.     Mar 13 14:32:36 test NetworkManager[8299]: <info> Activation (eth0) successful, device activated.     Mar 13 14:32:36 test NetworkManager[8299]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.      IPv6 configuration is not working ...               [root@test network-scripts]# ip addr show     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo         inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 1c:c1:de:b8:a3:fd brd ff:ff:ff:ff:ff:ff         inet x.x.x.x/29 brd x.x.x.x scope global eth0         inet6 fe80::1ec1:deff:feb8:a3fd/64 scope link             valid_lft forever preferred_lft forever      IPv6 addresses of the resolvers are not even in the resolv.conf ! **Did I miss a configuration step ?** I thought that the IPv6 configuration would be a formality ..               [root@test network-scripts]# lsb_release -a     LSB Version:    :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch     Distributor ID:    CentOS     Description:    CentOS release 6.2 (Final)     Release:    6.2     Codename:    Final


title: How to update menu of info directory node?

text: I've installed some program that added menu items in info directory node (a main menu of `info` command). Then i manually deleted the programs info files from the system, so now when i click on 'program' item, it is not found. However the items of the program are still in the directory node. How does info compile the directory node? How it can be updated, so there are no more this program on the list? And generally how does the mechanism of finding and updating info files work, especially during install and uninstall? **Edit** : One dirty solution is to just manually delete infofiles from infopath. Also i learned that in every infopath there is a file `dir`, which has links to every info file in the current directory, so one may just edit it instead of deleting files.


title: Software raid checksumming slow

text: On my new 24 disk array I get 900 MB/s of raw read or write using `dd` to all the disks. When I set the disks up as a 24 disk RAID6 I get 400 MB/s write and 600 MB/s read. It seems to be due to checksuming, as I have a single process (md0_raid6) taking up 100% of one CPU.               # uname -a     Linux server 3.2.0-0.bpo.1-amd64 #1 SMP Sat Feb 11 08:41:32 UTC 2012 x86_64 GNU/Linux      I seem to remember back in kernel 2.6.x the kernel printed that it could do 8000 MB/s of RAID6 checksumming. It therefore surprises me that md0_raid6 is even close to 100%. I would have expected it to be around 10%. Edit: Found this in /var/log/messages:               Mar 13 16:02:42 server kernel: [   34.712039] raid6: int64x1   2125 MB/s     Mar 13 16:02:42 server kernel: [   34.780043] raid6: int64x2   2149 MB/s     Mar 13 16:02:42 server kernel: [   34.848049] raid6: int64x4   1832 MB/s     Mar 13 16:02:42 server kernel: [   34.916047] raid6: int64x8   1569 MB/s     Mar 13 16:02:42 server kernel: [   34.984041] raid6: sse2x1    3186 MB/s     Mar 13 16:02:42 server kernel: [   35.052031] raid6: sse2x2    5272 MB/s     Mar 13 16:02:42 server kernel: [   35.120032] raid6: sse2x4    6196 MB/s     Mar 13 16:02:42 server kernel: [   35.120035] raid6: using algorithm sse2x4 (6196 MB/s)     Mar 13 16:02:42 server kernel: [   35.144209] md: raid6 personality registered for level 6     Mar 13 16:02:42 server kernel: [   35.144212] md: raid5 personality registered for level 5     Mar 13 16:02:42 server kernel: [   35.144214] md: raid4 personality registered for level 4      I naïvely believed this meant that I could checksum 6196 MBytes/s. Why does it take 100% and not around 10%?


title: KVM and swap problem

text: So I have a problem, I'm managing a server and the swap partition is way too small at the moment. The machine runs KVM with about 24 VM's on it. The problem is that some of them are rather inactive so they get swapped. However the guy managing it before me only used 4 GB for swap, which is constantly filled. It's not a problem, because my memory usage is only at about 64%, but it would be nice if I could extend the swap. I know I can make an extra swap volume with lvm. What I was wondering about is if it is possible to mount it to the host and use it without rebooting the server?


title: fedora 17 with fedup 0.7

text: I get the bug described here when trying to upgrade to Fedora 20 from Fedora 17. > The symptom is that the first stage of upgrade (before rebooting) works > successfully, but when you reboot to complete the upgrade, the second stage > begins but almost immediately aborts and reboots back to your previous > Fedora system. Guess I'm running fedup 0.7 (see terminal output)               [root@localhost mylaptop]# yum install fedup     Loaded plugins: langpacks, presto, refresh-packagekit     Package fedup-0.7.3-5.fc17.noarch already installed and latest version     Nothing to do      There is a mention about getting fedup 0.8 from updates repository but that's in my repolist:               [root@localhost mylaptop]# yum repolist     Loaded plugins: langpacks, presto, refresh-packagekit     repo id                         repo name                                 status     adobe-linux-x86_64              Adobe Systems Incorporated                     2     fedora/17/x86_64                Fedora 17 - x86_64                        27,033     updates/17/x86_64               Fedora 17 - x86_64 - Updates              13,163     repolist: 40,198      The solution described is to update fedup to 0.8 but as you can see in the output it won't because 0.7 is installed and latest version. What am I to do next? **[UPDATE]** Got the fedup package from http://kojipkgs.fedoraproject.org//packages/fedup/0.8.0/3.fc18/noarch/fedup-0.8.0-3.fc18.noarch.rpm After installing (double clicking the file); as root copied the files I've already downloaded using fedup 0.7               cp -R /var/lib/fedora-upgrade /var/lib/system-upgrade     cp -R /var/tmp/fedora-upgrade /var/tmp/system-upgrade      Running fedup again as root:                fedup --network 20 --nogpgcheck      **[UPDATE]** After that it will boot through the update upgrade and boots into .... Fedora 17 :( Can reboot again and have the upgrade option again that will boot into 17 again minus a working wifi.


title: gnome-terminal unicode chars not showing - Locale is set to en_US.utf8

text: I've become stumped trying to get my terminal to show unicode characters. I've set the LOCALE/LANG environment variables to en_US.utf8:               locale         LANG=en_US.utf8         LC_CTYPE=en_US.utf8         LC_NUMERIC="en_US.utf8"         LC_TIME="en_US.utf8"         LC_COLLATE="en_US.utf8"         LC_MONETARY="en_US.utf8"         LC_MESSAGES="en_US.utf8"         LC_PAPER="en_US.utf8"         LC_NAME="en_US.utf8"         LC_ADDRESS="en_US.utf8"         LC_TELEPHONE="en_US.utf8"         LC_MEASUREMENT="en_US.utf8"         LC_IDENTIFICATION="en_US.utf8"         LC_ALL=               echo -e '\xe2\x82\xac'      ���      Everything I've found says to set the LANG and LOCALE vars, which I have done, but the problem persists. `locale -a` shows that the right locale is available:               Laptop:~:0:2030$ locale -a | grep utf     de_AT.utf8     de_BE.utf8     de_CH.utf8     de_DE.utf8     de_LI.utf8     de_LU.utf8     en_AG.utf8     en_AU.utf8     en_BW.utf8     en_CA.utf8     en_DK.utf8     en_GB.utf8     en_HK.utf8     en_IE.utf8     en_IN.utf8     en_NG.utf8     en_NZ.utf8     en_PH.utf8     en_SG.utf8     en_US.utf8     en_ZA.utf8     en_ZM.utf8     en_ZW.utf8     es_AR.utf8     es_BO.utf8     es_CL.utf8     es_CO.utf8     es_CR.utf8     es_DO.utf8     es_EC.utf8     es_ES.utf8     es_GT.utf8     es_HN.utf8     es_MX.utf8     es_NI.utf8     es_PA.utf8     es_PE.utf8     es_PR.utf8     es_PY.utf8     es_SV.utf8     es_US.utf8     es_UY.utf8     es_VE.utf8     fr_BE.utf8     fr_CA.utf8     fr_CH.utf8     fr_FR.utf8     fr_LU.utf8     ga_IE.utf8     nl_AW.utf8     nl_BE.utf8     nl_NL.utf8     pl_PL.utf8      I have also verified that this isn't limited to the CLI. Doing, for instance, `u+2713` in VIM (which is something I use often), also gives a `<?>` character output. In the gnome-terminal options, I have it set to use the default system font, but have tried all the fonts in the list with no assistance, and googling for "terminal unicode font" just continues the cycle of telling me to set my LOCALE/LANG. \-- Edit: As suggested below, I changed the locale/lang to en_US.UTF-8, which did not solve the problem:               Laptop:~:0:2013$ locale     LANG=en_US.UTF-8     LANGUAGE=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=          Laptop:~:0:2014$ echo -e '\xe2\x82\xac'     ���


title: Why are files in a smbfs mounted share created with executable bit set?

text: I mounted a samba share using the smbmount command:               $ sudo smbmount \\\\foo\\bar /mnt/bar -o user=tom      When I create new files, they get created with the executable bit set for owner, group and world. For e.g.               $ touch hello.txt      $ ls -la hello.txt     -rwxr-xr-x 1 root root 0 Dec  2 12:28 hello.txt      The same file when created on a NFS mounted share sets up correct permissions without any executable bit set. Why is this happening? How can it be fixed?


title: Use a parameter in a command argument

text: I run a `find` command to search files with a name containing `perl`:               find /tmp -name '*perl*'     /tmp/perl.pl     /tmp/run-perl-stage.pl      But when I set the perl name in a variable `PARAMETER` and run the `find` command again then I do not get any results! How to run the find command with `$PARAMETER`?               PARAMETER=perl     find /tmp -name '*$PARAMETER*'                       does not get any results.               find /tmp -name '*\$PARAMETER*'      does not get any results.


title: `openssl`: Subject Alternative Name

text: I wrote this bit of code to get the Common Name of the _subject_ field in the SSL certificate for a given domain: ` $ echo -e "GET / HTTP/1.1\nEOT" | openssl s_client -connect google.com:443 2>&1 | grep subject subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com ` However, this only gives me the “subject” value. Alternative CNs may be listed in the “Subject Alternative Name” field. For example: ![](http://i.stack.imgur.com/XD7tu.png) So, how can I get the value of the Subject Alternative Name field in Bash?


title: How do I create a hierarchy of UNIX groups as below?

text: I need to create a hierarchy of UNIX groups. Something like below:               A     |\     | \     B  c     |\     D e     |\     f g      ...where A, B and D are UNIX groups and c,e,f and g are UNIX accounts that are members of those specific groups. I have googled a lot but it seems that this is not possible. **Currently, we have the following:**   1. Group A has members c.    2. Group B has members e.    3. Group D has members f,g. * * * **UPDATE:** @John's post made me realize that I needed to re-frame my requirements to remove the ambiguity. **What I require is:**   1. Limit access to a directory only to members of group B (so B is group owner of that folder). As group D is a sub-group of B, members of D would be members of group B and have access to that directory as well.   2. But members of Group B needs to have the same rights as members of group A. (So if group A is a directory group owner then automatically group B is the directory group-owner). By the way, this is a real-world problem where I have full control over group B and its members; and limited or no control over other groups and their members. So I cannot create new groups and give membership to members from group A or D.


title: No targets specified and no makefile found. Stop. Makefile ubuntu

text: When I execute the command `sudo make` I get this error:               No targets specified and no makefile found.  Stop.


title: mdadm raid 5 missing partitions after reboot

text: I had a working raid 5 array that had a whole debian install on it (I set it up during a debian install). I'd been using it a couple of days, all was fine, but since I created it during debian install, the raid array itself had 2 partitions on it, one for GPT and the big ext4 with the OS and everything on it. After a lot of reading, it seems having your OS on the mdadm managed raid array is a bad idea. Since if there is a drive failure, you will have no OS to fix it. So I unplugged all my drives, grabbed an old one from the closet, and installed debian on that as the sole disk in the machine. Once installed, I plugged my raid drives back in. Ran `mdadm --assemble --scan` and setup my `/etc/mdadm/mdadm.conf` so it assembles on boot. All was pretty good, I could `mount -t ext4 /dev/md0p2 /mnt` and see all my data. Happy days. So I added it to `/etc/fstab` and rebooted. But after reboot, `/dev/md0p2` (and md0p1) don't exist anymore. Only `/dev/md0` is there. Not sure where the 2 partitions have gone! Completely weird that I can re-assemble the array with no worries, it doesn't complain one bit. But the 2 partitions that were there are gone. I'm not even sure what `/dev/md0p1` was for. It concerned me when I first set it up, fdisk told me it was of type `GPT`. Some command outputs to help:               $ cat /proc/mdstat     Personalities : [raid6] [raid5] [raid4]     md0 : active raid5 sdf1[0] sdb1[4] sdc1[5] sdd1[6] sde1[7] sdi1[3] sdh1[2] sdg1[1]           5860147200 blocks super 1.2 level 5, 512k chunk, algorithm 2 [8/8] [UUUUUUUU]           bitmap: 0/15 pages [0KB], 65536KB chunk          unused devices: <none>               $ sudo mdadm -D /dev/md0     /dev/md0:             Version : 1.2       Creation Time : Fri May 23 14:05:16 2014          Raid Level : raid5          Array Size : 5860147200 (5588.67 GiB 6000.79 GB)       Used Dev Size : 1953382400 (1862.89 GiB 2000.26 GB)        Raid Devices : 8       Total Devices : 8         Persistence : Superblock is persistent            Intent Bitmap : Internal              Update Time : Sun May 25 18:15:26 2014               State : active      Active Devices : 8     Working Devices : 8      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 512K                     Name : doc:0  (local to host doc)                UUID : 11d6a8a7:d05a8c58:41fab15a:0b177f69              Events : 25704              Number   Major   Minor   RaidDevice State            0       8       81        0      active sync   /dev/sdf1            1       8       97        1      active sync   /dev/sdg1            2       8      113        2      active sync   /dev/sdh1            3       8      129        3      active sync   /dev/sdi1            7       8       65        4      active sync   /dev/sde1            6       8       49        5      active sync   /dev/sdd1            5       8       33        6      active sync   /dev/sdc1            4       8       17        7      active sync   /dev/sdb1      * * * **UPDATE** : I just realise the order of those disks in the array aren't what they used to be. It should start at `/dev/sdb1`. I've done a `mdadm --create --level=5 --num-devices=8 /dev/md0 /dev/sd[b-i]1` to re-create the array. This has inadvertantly put /dev/sdi1 into recovery. Yuck. Now that I think back, I'm not entirely sure what the order should be. It's either alphabetical, or it's e,d,c,b,f,g,h,i which is odd. First 4 in reverse alphabetical, next for in normal alphabetical. I may have moved sata cables around when I plugged them back in, not sure.


title: What changes to the system does a putting dev in a profile do in portage?

text: I am working on building my own profile for portage. I have managed to add my profile and it shows up when:               eselect profile list      I added an entry in `/usr/portage/profiles`. The profiles are of the pattern               architecture        profile_name       stable or dev      What changes can I expect when I change this option and what is its purpose?


title: How to mount the `D:\` disk of Windows in linux mint?

text: I am unable to mount the `D:\` disk of windows in linux mint. What to do?


title: Should I use `mdadm --create` to recover my RAID?

text: There's this guy that keeps telling me that we shouldn't use `mdadm --create` to recover our RAID arrays, that it's worse than evil, is an error. Why is that? I mean I should get my RAID working again, no? What should I use instead if `--create` is a mistake?


title: Why does `make install` not produce an rpm?

text: A little Preface:   I'm unable to copy+paste between my Windows PC and a Linux machine that I'm viewing through VNC Viewer and yes the `Share Clipboard` option is enabled in VNC Settings.   Thus I came across autocutsel. I downloaded it from here.   Extracted the archive and as per the readme file, ran the following commands:               ./configure       make       make install      My expectation was that this would present me with an installable rpm file.   That however doesn't happen and instead I get this message:               [root@linuxpc autocutsel-0.9.1]# make install       make[1]: Entering directory `/root/Desktop/autocutsel-0.9.1'        /bin/mkdir -p '/usr/local/bin'       /bin/sh ./libtool   --mode=install /usr/bin/install -c autocutsel cutsel '/usr/local/bin'       libtool: install: /usr/bin/install -c autocutsel /usr/local/bin/autocutsel       libtool: install: /usr/bin/install -c cutsel /usr/local/bin/cutsel       make[1]: Nothing to be done for `install-data-am'.       make[1]: Leaving directory `/root/Desktop/autocutsel-0.9.1'         Can somebody please help me out. This is something I never came across before.   P.S I'm using Oracle Linux.


title: How are the processes in UNIX numbered?

text: I can't find any pattern when I look at the numbering of PIDs in process table (`ps -a`), as the PIDs are not subsequent numbers and sometimes there are large "gaps" between those numbers. Is it because there may be some processes that run for a short time and they reserve some PIDs? Is there some range, after which the numbering of processes resets? I'm using Mac OS X but I guess that the answer should apply to UNIX in general.


title: SSH causes while loop to stop

text: I have finally managed to boil down a problem I have been struggling with for a few weeks. I use SSH with "authorized keys" to run commands remotely. All is fine except when I do it in a while loop. The loop terminates after completing any iteration with an ssh command. For a long time I thought this was some kind of ksh weirdness, but I now discovered bash does in fact behave identically. A small sample program to reproduce the problem. This is distilled from a larger implementation which takes snapshots and replicates them amongst the nodes in a cluster.               #!/bin/bash          set -x          IDTAG=".*zone"     MARKER="mark-$(date +%Y.%m.%d.%H.%M.%S)"     REMOTE_HOST=sol10-target     ZFSPARENT=rpool          ssh $REMOTE_HOST zfs list -t filesystem -rHo name,mounted $ZFSPARENT | grep "/$IDTAG    " > /tmp/actionlist          #for RMT_FILESYSTEM in $(cat /tmp/actionlist)     cat /tmp/actionlist | while read RMT_FILESYSTEM ISMOUNTED     do        echo ${RMT_FILESYSTEM}@${MARKER}        [ "$ISMOUNTED" = "yes" ] && ssh $REMOTE_HOST zfs snapshot -r ${RMT_FILESYSTEM}@${MARKER}        echo Remote Command Return Code: $?     done      (Note there is a TAB character in the grep search expression as per the definition of the behaviour of the zfs list "-H" option.) My sample have some ZFS filesystems for the root where all the "zones" have their root file system on a dataset named similar to POOL/zones/app1zone   POOL/zones/group2/app2zone etc. **The above loop should create a snapshot for each of the selected datasets, but in stead it operates only on the first one and then exits.** That the program finds the right number of datasets can be easily confirm by checking the "/tmp/actionlist" file after the script exists. If the ssh command is replaced by, for example, an echo command, then the loop iterates through all the input lines. Or my favourite - prepend "echo" to the offending command. If I use a for loop in stead then it also works, but due to the potential size of the list of datasets this could cause problems with the maximum expanded command line length. I am now 99.999% sure that only those loops with ssh commands in them give me problems! Note that the iteration in which the ssh command runs, completes! It is as if the data pipped in to the while loop is suddenly lost... If the first few input lines don't perform an ssh command, then the loop goes on until it actually runs the SSH command. On my laptop where I am testing this I have two Solaris 10 VMs with only about two or three sample datasets, but the same is happening on the large SPARC systems where this is meant to go live, and there are many datasets.


title: RewriteRule to cause subdomain to load another DocumentRoot?

text: I could sure use a little help with what I am trying to do with a `RewriteRule` in `.htaccess`: ...to causes URLs using our `sharpedge.` subdomain to auto-load from the `Internet_IE` directory - one level deeper than the site root. I have this in `httpd.conf`:               [snip]     NameVirtualHost 11.22.33.44          <VirtualHost 11.22.33.44>         Options All +ExecCGI         ServerAdmin hostmaster@ourhost.com         DocumentRoot /var/www/html/ourdomain.com         ServerName ourdomain.com         ServerAlias www.ourdomain.com         DirectoryIndex index.htm index.html index.dna         #---------------------------------         <IfModule mod_rewrite.c>         RewriteEngine on         RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]         </IfModule>         #---------------------------------     </VirtualHost>          <VirtualHost 11.22.33.44>         Options All +ExecCGI         ServerAdmin hostmaster@ourhost.com         DocumentRoot /var/www/html/ourdomain.com         ServerName  sharpedge.ourdomain.com         DirectoryIndex index.htm index.html index.dna         #---------------------------------         <IfModule mod_rewrite.c>         RewriteEngine on         RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]         </IfModule>         #---------------------------------     </VirtualHost>     [snip]      ...and this in .htaccess (in the site root, here: /var/www/html/ourdomain.com/)               Options -Indexes          <IfModule mod_rewrite.c>         RewriteEngine On         RewriteBase /              RewriteCond   %{HTTP_HOST} ^sharpedge\.ourdomain\.com$         # years ago this next line was used here, but in httpd.conf: (I don't know what it was supposed to do)         # RewriteRule   ^(.+)        %{HTTP_HOST}$1          [C]         RewriteRule   ^sharpedge\.ourdomain\.com(.*) /var/www/html/ourdomain.com/Internet_IE/$1  [L]     </IfModule>      ..but nothing happens from the RewriteRule; it is as if the RewriteRule was not there. I'd much appreciate any suggestions. Edits:   * I would've just changed the DocumentRoot to the directory I actually want to serve, but I need to be able to call (include) files from within files in that directory with a prefixing `/` in the include path, where those files are located in the site root. Those files are also similarly called from other files that are in the site root.


title: how to play video with vlc via terminal to view on webpage?

text: Now have VLC installed ,how to play a video with vlc via terminal running centos 6 to be viewed on website? What is the command to test it? I want to use VLC on my website which resides on my VPS set up with Linux Centos so I can play videos. But after installing VLC, I don't know how to make it so I can see those videos on my website. I don't know what steps to take from play something on vlc via terminal to view it on my site. I don't even know how to get a video playing via terminal now it is installed because all the different commands just seem to do nothing. I need a head start....how do I open up the player? so I can view it on my server?


title: Quote escaping struggle with grep and sed

text: I'm writing a bash script to extract data from html tags and I found this command in another thread : `grep -o '<tr>.*</tr>' HTMLFILE | sed 's/\(<tr>\|<\/tr>\)//g' > NEWFILE`, it's working great. But know I want to extract a name from a link in an `<a>` tag, like `<a href="www.mywebsite.com?name="What_I_Want_To_Extract">`. I thought hard but didn't manage to adapt the command below, any help ?


title: Have ssh-add be quiet if key already there

text: I want to put `ssh-add /path/to/special_key` at the top of a script. This works fine, but it _always_ prompts for the passphrase. This is strange, and a little annoying, as it still asks for the passphrase even when `ssh-add -l` shows the key has already been added. Is there a way to tell it: "add this key and ask the passphrase if not already been added, otherwise do nothing" ?


title: recover email from imap account using mailx

text: I am having problems fetching emails with mailx. My imap account uses ssl/tls connection with normal password authentication on port 993. I don't have any problems sending through smtp though. Here is my ~/.mailrc:               set verbose     account bell {     set smtp-use-starttls     set smtp=smtp://smtp-mail.outlook.com:587     set smtp-auth=login     set smtp-auth-user=$USERNAME@bell.net     set smtp-auth-password=$PASSWORD     set from="$NAME <$USERNAME@bell.net>"     set nss-config-dir=/etc/openldap/certs     set ssl-verify=ignore          set folder=imaps://$USERNAME@imap-mail.outlook.com:993/INBOX     }      Mailx prompts for my password, then responds with "invalid username or password". Here is the output of "mail -A bell":               Resolving host imap-mail.outlook.com . . . done.     Connecting to 157.56.195.250 . . . connected.     Comparing DNS name: "*.hotmail.com"     Comparing DNS name: "*.live.com"     Comparing DNS name: "*.outlook.com"     SSL parameters: cipher=AES-256, keysize=256, secretkeysize=256,     issuer=CN=GlobalSign Organization Validation CA - G2,O=GlobalSign nv-sa,C=BE     subject=CN=*.hotmail.com,O=Microsoft Corporation,L=Redmond,ST=Washington,C=US     * OK Outlook.com IMAP4rev1 server version 17.4.0.0 ready (DUB451-IMAP167)     >>> T1 CAPABILITY     * CAPABILITY IMAP4rev1 CHILDREN ID NAMESPACE UIDPLUS UNSELECT AUTH=PLAIN AUTH=XOAUTH2 SASL-IR     T1 OK CAPABILITY completed     Password:     >>> T2 LOGIN "$USERNAME" "$PASSWORD"     T2 NO [AUTHENTICATIONFAILED] Invalid username or password.     IMAP error: [AUTHENTICATIONFAILED] Invalid username or password.     Password:      Is this related to the authentification method or am I missing some ssl/tls config options?


title: How to search for files with immutable attribute set?

text: For config auditing reasons, I want to be able to search my ext3 filesystem for files which have the immutable attribute set (via `chattr +i`). I can't find any options for `find` or similar that do this. At this point, I'm afraid I'll have to write my own script to parse `lsattr` output for each directory. Is there a standard utility that provides a better way?


title: How to use SSH to make a dd copy of disk A from host B and save on disk B?

text: I want to make remote backups from disk A at will using SSH from computer B. I want to save the backups to disk B. How can I do this? I've tried using               $ ssh hostname@my.ip.add.ress "sudo dd if=/dev/sdX " | \         dd of=/home/username/Documents/filename.image`      When I do this, I receive the following error: > no tty present and no askpass program specified How can I make remote backups from disk A from computer B to disk B? I have found information feeding `dd` backups from disk A to disk B, but I want to do everything remotely.


title: yum is asking the kernel version which is already there

text: I have a server with centos 5.3 x86_64 on it. I am trying to install some asterisk modules on this server using yum. So yum asked me to upgrade my kernel to "kernel-2.6.18-308.11.1.el5" Then i have upgraded the kernel using centos-plus repository as the required kernel was not available on base repo. Now after restarting i have tried again to install the same modules using yum but it is asking again for the "kernel-2.6.18-308.11.1.el5". Yum says:               Missing Dependency: kernel-x86_64 = 2.6.18-308.11.1.el5 is needed by package       I have checked the kernel using "uname -r" command and it is showing :               # uname -r     2.6.18-308.11.1.el5.centos.plus      Then i saw the difference that mine installed kernel has *.centos.plus appended in the its name. that might be the reason yum is not recognizing the kernel. Does any have the solution of this problem.? How can i make the yum see the installed kernel version?


title: Sort files into directories named by prefix of file

text: I have a bunch of files like this               5830_1.png     5830_2.png     5830_3.png     5831_1.png     5832_1.png     5832_2.png      I'd like to sort these files all into directories that take the prefix of the file name as the name of the directory. So I'd end up with               5830/         5830_1.png         5831_2.png         ...etc     5831/     5832/      Is there an easy way to do this?


title: Help me to read my school password-pdf-protected files faster without retyping

text: I tried this command but I think something is wrong with `'{}' '{}'`. By the latter, I want `InputXYZ.pdf OutputXYZ.pdf` (I do not want any dupe files, I want to replace the old files to make reading a bit more convenient).               $ find . -name "*.pdf" -ok qpdf --password=passMe --decrypt '{}' '{}' \;      If you have better and simpler ideas to handle this kind of repetitive pass- typing probs with other programs, do not hesitate to comment or answer. Actually, my teachers use many different passwords and it is quite mess to read the documents. Perhaps, some file with their passwords and then just the `find` -cmd testing every possibility?


title: Understanding a XINU system call - getstk.c

text: I am having trouble conceptually understanding what is going on towards the end of this system call, and why. I understand the getstk.c method returns the highest memory address of available space, but don't understand what some of the code is doing. Some clarity on this would be great. The areas of code I don't fully understand are emphasized in asterisks.               /* getstk.c - getstk */          #include <xinu.h>          /*------------------------------------------------------------------------      *  getstk  -  Allocate stack memory, returning highest word address      *------------------------------------------------------------------------      */     char    *getstk(               uint32        nbytes          /* size of memory requested     */             )     {             intmask mask;                   /* saved interrupt mask         */             struct  memblk  *prev, *curr;   /* walk through memory list     */             struct  memblk  *fits, *fitsprev; /* record block that fits     */                  mask = disable();             if (nbytes == 0) {                     restore(mask);                     return (char *)SYSERR;             }                  nbytes = (uint32) roundmb(nbytes);      /* use mblock multiples */                  prev = &memlist;             curr = memlist.mnext;             fits = NULL;             fitsprev = NULL;  /* to avoid a compiler warning */                  while (curr != NULL) {                  /* scan entire list     */                     if (curr->mlength >= nbytes) {  /* record block address */                             fits = curr;            /*   when request fits  */                             fitsprev = prev;                     }                     prev = curr;                     curr = curr->mnext;             }                  if (fits == NULL) {                     /* no block was found   */                     restore(mask);                     return (char *)SYSERR;             }             if (nbytes == fits->mlength) {          /* block is exact match */                     fitsprev->mnext = fits->mnext;             **} else {                                /* remove top section   */                     fits->mlength -= nbytes;                     fits = (struct memblk *)((uint32)fits + fits->mlength);             }**             memlist.mlength -= nbytes;             restore(mask);             **return (char *)((uint32) fits + nbytes - sizeof(uint32));**     }      The struct memblk can be found here:               struct  memblk  {           /* see roundmb & truncmb    */         struct  memblk  *mnext;     /* ptr to next free memory blk  */         uint32  mlength;        /* size of blk (includes memblk)*/         };     extern  struct  memblk  memlist;    /* head of free memory list */      Why are they returning the fits + nbytes - sizeof(uint32)? Why are they casting fits(a struct) to type uint32?


title: Counters in shell

text: I am looking for a shell script where counter needs to be set for input paramter and do action once the count reaches to 5. The problem is there could be n number of input parameter and action should also be dependent on time ... Lets suppose if within 60 mins if count reaches upto 5 then which ever action i want to do ....... I found somthing like below but there is no explanation in this programm.....Please help...               #!/bin/sh     COUNTER=0     VALUE="-1"     echo "Enter a series of lines of numbers separated by spaces."     read LIST     IFS=" "     for VALUE in $LIST ; do         eval ARRAY_$COUNTER=$VALUE         eval export ARRAY_$COUNTER         COUNTER=$(expr $COUNTER '+' 1) # More on this in Paint by Numbers     done          # print the exported variables.     COUNTERB=0;     echo "Printing values."     while [ $COUNTERB -lt $COUNTER ] ; do         echo "ARRAY[$COUNTERB] = $(eval echo '$'ARRAY_$COUNTERB)"         COUNTERB=$(expr $COUNTERB '+' 1) # More on this in Paint by Numbers     done      Thanks


title: Removing a directory hangs

text: I'm a non-root user on a shared compile server that mounts `/home` via NFS from some other host. I have a directory `~/a/b` with lots of subdirectories `c1,c2,...`. I wanted to delete `~/a/b` completely, and succeeded for most of the `cN` directories. But a few (say `c1`) are completely inaccessible: I can execute them (i.e. `cd` into them) but neither list (`ls`) let alone remove them. If I say `rm -rf ~/a/b/c1`, the process hangs in a `D` state. What can I do as a non-root user to get rid of `~/a/b`? * * * Update: I just ssh'd to the file-server (to rule out NFS) and I cannot perform the operation there either, so this doesn't seem to be an NFS problem after all. However, why does the kernel refuse to remove a directory?


title: Password expiry in Samba v3.0

text: I'm trying to setup a Samba server which asks new users to change their password on their first login and makes passwords expire after 90 days. I was able to setup the 90 days expiry date but the `--pwd-must-change-time` doesn't work. The verbose shows as the data was changed but when I run `-Lv` it still shows the “must change time” for 90 days ahead.


title: Script for opening emacs in two different ways

text: I've attempted to write a small script that will by default open emacs with               emacs -nw foo      by simply typing               emacs foo      and when I want a window typing               emacs foo &      The script I attempted to write looks like this               #!/bin/bash          if [ -z $2 ]; then         emacs -nw $1     else         emacs $1 &     fi      The problem I'm running into is that when I try to run the script nothing happens, as if I just hit enter. Would a more experienced person please advice how to make this script properly?


title: Building an appliance

text: I want to build an appliance for the kitchen. It is supposed to play music (files, streams, CDA), surf the web (recipe sites!), maybe play video (files and streams) display todays agenda during breakfast. Because I do not want it to run 24/7, it should boot up really fast. I am thinking about a small SSD for the OS. I also want to use a touch screen. I will probably use NetBSD or Linux (not sure yet). It really should get the feel of an appliance like a car GPS system or a smart phone. Now here is the question: Is there some kind of interface that can be operated by touch screen (on screen keyboard?) and that can be tweaked to what I want to do with it? Bonus question: Did you build such a system yourself? How?


title: how to create debian package to install files to /home/user

text: I created a debian package, I want to install the files to the directory /home/user/myapp instead of /usr/bin but after install the deb, the owner of /home/user/myapp is root I hope after install the deb, the owner should be user, so I add postinst to do the post-work:               #postinst     chown -R user /home/user/myapp      but I always got an error "chown: ... Operation not permitted" any helps? Thanks


title: How to easily install and uninstall unix packages

text: Hey everyone. I'm using the Ubuntu server for some time now. Everything is working fine, installing packages is a piece of cake. Usually I use aptitude or apt-get for package management. But...! There are cases when I need to install a package from a source. No problem usually I do ./configure, make install and so on. But...! There are also cases I want to upgrade a package I manually installed from a source. This is where things get blured :). My question: What is a proper way to install custom packages. I'm thinking of install/uninstall process like on Windows. I would like to remove all the package files after the package was manually installed using make/install command. I know there is a script through which you can run make commands and later it knows how to remove the package and all related files/paths but can not remember the name. Please help! Thx 10x!


title: CUPS: Spooling to printer is slow

text: Spooling to my PostScript printer is terrible slow. Today I printed a simple webpage where the .ps-file was 55kb. Sending it to the printer took 5 minutes. I have the feeling that CUPS is generating a 2400 DPI bitmap and sending that instead of just sending the .ps-file. The file in /var/spool/cups is 55kb, so if the above happens, then it is done one the fly. How do I debug this?


title: Configure a bridged Ethernet adapter in a VirtualBox guest running Scientific Linux

text: I installed Scientific Linux 6.2 x86 in VirtualBox on Windows 7 x64. The adapter is               Adapter 1: Paravirtualized Network (Bridged adapter, Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller)     promiscuous mode: Deny      But this adapter does not get ip address.               [root@server ~]# ifconfig -a     eth1      Link encap:Ethernet  HWaddr 00:40:5A:33:F2:92                 inet6 addr: fe80::240:5aff:fe33:f292/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:5 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 b)  TX bytes:398 (398.0 b)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:16 errors:0 dropped:0 overruns:0 frame:0               TX packets:16 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:960 (960.0 b)  TX bytes:960 (960.0 b)      The list of `/etc/sysconfig/network-scripts`               [root@server network-scripts]# ls     ifcfg-eth0   ifdown-eth   ifdown-ppp     ifup-aliases  ifup-isdn   ifup-routes       net.hotplug     ifcfg-eth1   ifdown-ippp  ifdown-routes  ifup-bnep     ifup-plip   ifup-sit          network-functions     ifcfg-lo     ifdown-ipv6  ifdown-sit     ifup-eth      ifup-plusb  ifup-tunnel       network-functions-ipv6     ifdown       ifdown-isdn  ifdown-tunnel  ifup-ippp     ifup-post   ifup-wireless     ifdown-bnep  ifdown-post  ifup           ifup-ipv6     ifup-ppp    init.ipv6-global      And `ifcfg-eth1` is               DEVICE=eth1     HWADDR=00:40:5a:33:f2:92     NM_CONTROLLED=yes     ONBOOT=no     BOOTPROTO=dhcp     TYPE=Ethernet     USERCTL=no     PEERDNS=yes     IPV6INIT=no      Please let me know how to get eth1's IP address 192.168.0.x.


title: How to run a script as soon as the week number changes?

text: I would like to keep my download folder sorted. My goal is to have the files of the current week in the download folder, and the older files in a folder named after week number and year (eg 2013.09, lexicographically sortable) of the creation date of these files. I only want this to apply to the files and folders found at the root of download folder; `tar` archives and others archives are sometimes automatically expanded by the browser when the download is complete. Files and folders currently at the root of the download folder are assumed to be the ones of the current week. However, mtime and ctime don't tell when the file actually finished downloading. If the machine was always on, I could set a cron task to run as soon as the week number changes, but this is a laptop, and I put it in stand by mode when I don't use it.


title: Get the number of inode in a tree

text: How can I get the number of inodes used by files in a given directory tree? Important: including hidden directories under it, like `.git`


title: Upgrading VirtualBox Guest Additions

text: I have been running a Debian (Wheezy) guest on a Window 7 host with Oracle VirtualBox. I was recently prompted to upgrade the VirtualBox and did so to version 4.3. Now I cannot get the guest additions upgraded. When I run through the install of guest additions I get the following error:               Installing the windows systems drivers... fail!!!     Could not find x.org or XFree86 Windows System


title: Break In Attempt

text: mysql service has vanished from my vps and service is down since yesterday where can see from /var/log/secure file it says break in attempt from an ip that is not known to me but cannot tell if the break in was accomplished by the file except by the fact my server is down. Under what circumstances does the mysql service disappear? Could that possibly happen when dedicated server my vps is on has maintenance upgrade as they did yesterday? Also with the secure file message :               Jan 12 04:16:51 foo sshd[26725]: Failed password for root from            61.174.51.207 port 1076 ssh2     Jan 12 04:16:54 foo sshd[26822]: Disconnecting: Too many authentication     failures for root     Jan 12 04:16:54 foo sshd[26825]: Failed password for root from     61.174.51.207 port 1076 ssh2     Jan 12 04:16:54 foo sshd[27324]: PAM 5 more authentication failures;    logname= uid=0 euid=0 tty=ssh ruser= rhost=61.174.51.207  user=root      Am I reading this correctly that last attempt was successful? Checking the IP it is in China.


title: Finding gEDA installation directory

text: I installed gEDA and I am trying to find it's installation directory/path. I've searched Google for many strings and entered a lot of the results it returned but didn't find anything about that. So how can I find gEDA's installation directory/path? * * * _Edit (24 May, 16:55 UTC):_ I've tried the following, suggested by @phunehehe:               $ dpkg-query -L gEDA     /.     /usr     /usr/share     /usr/share/doc     /usr/share/doc/geda      but it doesn't seem like the installation folder for gEDA, only the documentation.


title: Facebook games will not work on xubuntu 11.10 how do I fix?

text: I just had xubuntu 11.10 put on my computer and know nothing about the system. Adobe flash player is installed and up to date, I have only had this running for a few days. My YouTube works just fine but when I try to play a game on Facebook it tells me that my flash player needs to be upgraded. Being used to Windows, I went into my Firefox plugin menu, and there is not even an adobe flash plugin listed. (I thought maybe it wasn't active) I was wondering if/how this can be fixed? Can someone can explain it to me, even though I know absolutely nothing about the operating system?


title: stat on an encrypted volume in osx takes a long time

text: My workstation is a MacBook Pro with an SSD. For security reasons, my main volume is encrypted. I ran this command on a folder:               time find . -exec stat {} + >/dev/null          real    0m5.205s     user    0m0.367s     sys     0m4.556s      The folder contains 1961 items. Running the same command on a linux (debian) machine without ssd takes .09s real (similar folder, except it contains 1150 items). Also, running `find . -ls | wc -l` on my workstation only takes .05s real (it also lists modification dates). Is there anything that I can do to speed things up? For the record, I did this timing because my boost.build project takes 6s to check the dependencies on my workstation, while it takes less than a second on the linux machine. Edit: I copied the folder in question to another laptop with a 7200rpm non- encrypted hard disk, the find stat command takes 2.445s system time. Edit 2: I decrypted my hard disk, and now it takes ~3.6s on the same ssd on osx.


title: Which shell should I learn for FreeBSD and Debian?

text: I have read many articles that say the official shell in FreeBSD is `tcsh`, and in Debian, its `dash`. However, when I either `echo $shell` (FreeBSD) or `env` in Debian, it says that the shell is `csh` in the first case, or `bash` in Debian. This is in fresh installations. I tested under the root account and a normal user account. Also, when I create a new account in FreeBSD, I have the choice of 3 shells; `sh`, `csh` or `tcsh`. If I make no choice, `csh` is the default for the account. What is the official, standard shell under those systems? Is it `tcsh` or `csh` in FreeBSD? Is it `dash` or `bash` in Debian? Is it me that does something wrong? Or are the articles and sites misinformed? I want to learn two shells: one for Debian and one for FreeBSD, but I can't find which one I should learn, since its not clear which one is the official shell. Also, while searching for which shell I should learn, I found this: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ Is it someone that just doesn't like `csh`, or should we really avoid `csh`? I'm using the latest Debian and FreeBSD versions. I start to get lost with all these shell options, they all look the same to me (except for the syntax; I mean they all look to offer the same possibilities). It's why i want to learn the official one.