title: lshw lists my drive but it has no /dev file

text: Ive just got a dedicated server which has 2x 1TB HDD. However when I type `df -h` I get the following:               [root@sd-56537 ~]# df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda2       916G  688G  182G  80% /     tmpfs           7.8G  368K  7.8G   1% /dev/shm     /dev/sda1       194M   61M  124M  34% /boot      How can I access the 2nd drive ? EDIT:               [root@sd-56537 ~]# fdisk -l          Disk /dev/sda: 999.7 GB, 999653638144 bytes     255 heads, 63 sectors/track, 121534 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000d74f9             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1          26      204800   83  Linux     Partition 1 does not end on cylinder boundary.     /dev/sda2              26      121404   974966784   83  Linux     /dev/sda3          121404      121534     1048576   82  Linux swap / Solaris     [root@sd-56537 ~]#      **Here are some things that have been tried:**               [root@sd-56537 ~]# udevadm trigger --verbose --dry-run | grep disk      /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/host0/target0:1:0/0:1:0:0/scsi_disk/0:1:0:0      * * *                [root@sd-56537 ~]# ls -l /dev/disk/by-id;      total 0      lrwxrwxrwx 1 root root 9 Jan 2 13:38 scsi-3600508e00000000019b5485ed592d30e -> ../../sda      lrwxrwxrwx 1 root root 10 Jan 2 13:38 scsi-3600508e00000000019b5485ed592d30e-part1 -> ../../sda1      lrwxrwxrwx 1 root root 10 Jan 2 13:38 scsi-3600508e00000000019b5485ed592d30e-part2 -> ../../sda2      lrwxrwxrwx 1 root root 10 Jan 2 13:38 scsi-3600508e00000000019b5485ed592d30e-part3 -> ../../sda3      lrwxrwxrwx 1 root root 9 Jan 2 13:38 wwn-0x600508e00000000019b5485ed592d30e -> ../../sda      lrwxrwxrwx 1 root root 10 Jan 2 13:38 wwn-0x600508e00000000019b5485ed592d30e-part1 -> ../../sda1      lrwxrwxrwx 1 root root 10 Jan 2 13:38 wwn-0x600508e00000000019b5485ed592d30e-part2 -> ../../sda2      lrwxrwxrwx 1 root root 10 Jan 2 13:38 wwn-0x600508e00000000019b5485ed592d30e-part3 -> ../../sda3      * * *               [root@sd-56537 ~]# lshw | grep -A 5 disk      *-disk:0 UNCLAIMED      description: ATA Disk      product: TOSHIBA MG03ACA1      vendor: Toshiba      physical id: 0.0.0      bus info: scsi@0:0.0.0      --      *-disk:1      description: SCSI Disk      product: Virtual Disk      vendor: Dell      physical id: 1.0.0      bus info: scsi@0:1.0.0      --      *-disk:2 UNCLAIMED      description: ATA Disk      product: TOSHIBA MG03ACA1      vendor: Toshiba      physical id: 0.1.0      bus info: scsi@0:0.1.0      [root@sd-56537 ~]#      * * *               [root@sd-56537 ~]# blkid      /dev/sda2: UUID="b93f6b9d-163e-4231-bac0-204ce290f0af" TYPE="ext4"      /dev/sda1: UUID="858364a4-263a-4e78-9ec5-ed6b23471377" TYPE="ext4"      /dev/sda3: UUID="6a4a69e0-6378-4c65-b7ba-e78e0b38013a" TYPE="swap"      [root@sd-56537 ~]#


title: Detecting monitor on boot time?

text: I am using my laptop in several monitor configurations that do require xorg.conf (say, I am driving a T221 from my laptop) and it's very inconvenient to manually switch them. Is there something in /sys which tells me if something is plugged into a DVI connector? Or a utility or ...?


title: awk regex matches wrong?

text: Playing around with awk I noticed this behavior:               [root@ror6ax3 ~]# grep open * | awk '$2 ~ /opens*/ {print $0}'     install.log:Installing openldap-2.4.23-32.el6_4.1.x86_64     install.log:Installing openssl-1.0.1e-15.el6.x86_64     install.log:Installing openssh-5.3p1-94.el6.x86_64     install.log:Installing openssh-clients-5.3p1-94.el6.x86_64     install.log:Installing openssh-server-5.3p1-94.el6.x86_64     install.log:Installing b43-openfwwf-5.2-4.el6.noarch     [root@ror6ax3 ~]# grep open * | awk '$2 ~ /opens */ {print $0}'     install.log:Installing openssl-1.0.1e-15.el6.x86_64     install.log:Installing openssh-5.3p1-94.el6.x86_64     install.log:Installing openssh-clients-5.3p1-94.el6.x86_64     install.log:Installing openssh-server-5.3p1-94.el6.x86_64      Why would `opens*` match `openldap` ?


title: Ctrl-C handling in SSH session

text: When I start an SSH session that executes a long-running command, what happens with `Ctrl`+`C` (SIGINT) handling? I can see that the SSH session is closed, but I am not sure who gets the SIGINT first: is it...   1. the remote long-running command? that is, (a) the signal handler in the remote command is called and stops the remote command, (b) the shell that spawned it detects that the command stopped, and stops as well (c) the remote sshd detects the shell stopped, so it closes the connection or   2. the local ssh receives the signal, and closes the connection. I think that (1) is happening, but want to make sure. I am also uncertain about what happens with shell handling of SIGINTs in this case. For example, if I ...               ssh remote 'while true ; do sleep 1 ; date ; done'      and `Ctrl`+`C`, then the remote connection is dropped. Is there a way to run the remote command under a shell that will stay alive after `Ctrl`+`C`? That is, in this case, stop the loop and allow me to keep working on the remote shell?


title: Error Installing "ia32-libs" to run ADB and Fastboot Linux Mint 16 "Petra"

text: I have been trying to get `adb`, `fastboot`, `avd` and others to work with the latest version of Linux Mint (16 "Petra") I originally got this error when trying to run ADB:               ➜  platform-tools  ./adb     ./adb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory      After looking around I found suggestions saying that you need to install 32-bit compatibility libraries. So, I tried to install the package `ia32-libs`, which, however, failed horribly.               ➜  ~  sudo apt-get install ia32-libs                                        Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      ia32-libs :               Depends: bluez-alsa:i386 but it is not going to be installed              Depends: gstreamer0.10-plugins-base:i386 but it is not going to be installed              Depends: gstreamer0.10-plugins-good:i386 but it is not going to be installed              Depends: gtk2-engines:i386 but it is not going to be installed              Depends: gtk2-engines-murrine:i386 but it is not going to be installed              Depends: gtk2-engines-oxygen:i386 but it is not going to be installed              Depends: gtk2-engines-pixbuf:i386 but it is not going to be installed              Depends: gvfs:i386 but it is not going to be installed              Depends: ibus-gtk:i386 but it is not going to be installed              Depends: libacl1:i386 but it is not going to be installed              Depends: libao4:i386 but it is not going to be installed              Depends: libasound2:i386              Depends: libasound2-plugins:i386 but it is not going to be installed              Depends: libasyncns0:i386 but it is not going to be installed              Depends: libattr1:i386 but it is not going to be installed              Depends: libaudio2:i386 but it is not going to be installed              Depends: libcanberra-gtk-module:i386 but it is not going to be installed              Depends: libcap2:i386 but it is not going to be installed              Depends: libcapi20-3:i386 but it is not going to be installed              Depends: libcups2:i386 but it is not going to be installed              Depends: libcupsimage2:i386 but it is not going to be installed              Depends: libcurl3:i386 but it is not going to be installed              Depends: libdbus-glib-1-2:i386 but it is not going to be installed              Depends: libesd0:i386 but it is not going to be installed              Depends: libfontconfig1:i386 but it is not going to be installed              Depends: libfreetype6:i386 but it is not going to be installed              Depends: libgail-common:i386 but it is not going to be installed              Depends: libgconf-2-4:i386 but it is not going to be installed              Depends: libgdbm3:i386 but it is not going to be installed              Depends: libgettextpo0:i386 but it is not going to be installed              Depends: libglapi-mesa:i386 but it is not going to be installed              Depends: libglu1-mesa:i386 but it is not going to be installed              Depends: libgphoto2-6:i386 but it is not going to be installed              Depends: libgphoto2-port10:i386 but it is not going to be installed              Depends: libgtk2.0-0:i386 but it is not going to be installed              Depends: libmpg123-0:i386 but it is not going to be installed              Depends: libncursesw5:i386 but it is not going to be installed              Depends: libnspr4:i386 but it is not going to be installed              Depends: libnss3:i386 but it is not going to be installed              Depends: libodbc1:i386 but it is not going to be installed              Depends: libopenal1:i386 but it is not going to be installed              Depends: libpulse-mainloop-glib0:i386 but it is not going to be installed              Depends: libpulsedsp:i386 but it is not going to be installed              Depends: libqt4-dbus:i386 but it is not going to be installed              Depends: libqt4-network:i386 but it is not going to be installed              Depends: libqt4-opengl:i386 but it is not going to be installed              Depends: libqt4-qt3support:i386 but it is not going to be installed              Depends: libqt4-script:i386 but it is not going to be installed              Depends: libqt4-scripttools:i386 but it is not going to be installed              Depends: libqt4-sql:i386 but it is not going to be installed              Depends: libqt4-svg:i386 but it is not going to be installed              Depends: libqt4-test:i386 but it is not going to be installed              Depends: libqt4-xml:i386 but it is not going to be installed              Depends: libqt4-xmlpatterns:i386 but it is not going to be installed              Depends: libqtcore4:i386 but it is not going to be installed              Depends: libqtgui4:i386 but it is not going to be installed              Depends: libqtwebkit4:i386 but it is not going to be installed              Depends: librsvg2-common:i386 but it is not going to be installed              Depends: libsane:i386 but it is not going to be installed              Depends: libsdl-image1.2:i386 but it is not going to be installed              Depends: libsdl-mixer1.2:i386 but it is not going to be installed              Depends: libsdl-net1.2:i386 but it is not going to be installed              Depends: libsdl-ttf2.0-0:i386 but it is not going to be installed              Depends: libsdl1.2debian:i386 but it is not going to be installed              Depends: libsqlite3-0:i386 but it is not going to be installed              Depends: libssl0.9.8:i386 but it is not going to be installed              Depends: libssl1.0.0:i386 but it is not going to be installed              Depends: libstdc++5:i386 but it is not going to be installed              Depends: libstdc++6:i386 but it is not going to be installed              Depends: libxaw7:i386 but it is not going to be installed              Depends: libxml2:i386 but it is not going to be installed              Depends: libxp6:i386 but it is not going to be installed              Depends: libxslt1.1:i386 but it is not going to be installed              Depends: libxss1:i386 but it is not going to be installed              Depends: libxtst6:i386 but it is not going to be installed              Depends: odbcinst1debian2:i386 but it is not going to be installed              Depends: xaw3dg:i386 but it is not going to be installed              Depends: libgl1-mesa-dri:i386 but it is not going to be installed              Depends: libgl1-mesa-glx:i386 but it is not going to be installed              Depends: libpam-winbind:i386 but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      Any help would be very much appreciated. EDIT: After following Rmano's suggestion to run this: `sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386` I got this error about unmet dependencies:               ➜  ~  sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386     [sudo] password for insanity:      Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:     libgcc1 : Breaks: libgcc1:i386 (!= 1:4.8.1-10ubuntu9) but 1:4.8.1-10ubuntu8 is to be installed     libgcc1:i386 : Depends: gcc-4.8-base:i386 (= 4.8.1-10ubuntu8) but it is not going to be installed                 Breaks: libgcc1 (!= 1:4.8.1-10ubuntu8) but 1:4.8.1-10ubuntu9 is to be installed     libstdc++6:i386 : Depends: gcc-4.8-base:i386 (= 4.8.1-10ubuntu8) but it is  not going to be installed     E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused  by held packages.      EDIT 2: It seems that I have to downgrade to an older version of a view core utils, however, I'm not sure that it is a safe idea.


title: Shell Script : Check for all the source files in different paths

text: This is the naming convention of the file.               <yearmonthdate>_<sourcesystem>_<totalnoofpartsof file>_<subject area>_<part number>.dat (or .dat.gz)      First part is Date, Second part is source system from where the file is coming from. Third part is the number of parts for the file. Which means there will be 3 files. Forth part is for which subject area Fifth part is part of the file. **In this example**               20131121_A01_003_SALES_001.dat.gz     20131121_A01_003_SALES_002.dat     20131121_A01_003_SALES_003.dat      `20131121` is date `A01` is source system `003` is number of parts in that file `SALES` is the community `001`, `002`, `003` are the part numbers of the file. Extension can be either `.dat` or `.dat.gz` **REQUIREMENT:** Now, there are a number of source systems and for each source system there is a path               /in/inroot/source/A01     /in/inroot/source/A02     /in/inroot/source/A03     /in/inroot/source/X04     /in/inroot/source/C06     /in/inroot/source/DN1      When we run the script, by passing subject area as argument, it should check in all the paths that files are present for that subject and should also check if it has all the parts for yesterday. **Example:**               sh filecheck.sh CUSTOMER      It should go into each of the paths mentioned above and check if `20131120_A01_002_CUSTOMER_001.dat` and `20131120_A01_002_CUSTOMER_002.dat` are present in `A01`. Similarly in all other folders. The number of parts is also dynamic. If the file is missing from any source system or any part of the file is missing it should write those to a separate file. I know I am asking too much, but it is a bit urgent and I don't have time to play around.


title: Should I confirm/verify an existing Debian bug?

text: I am currently experiencing similar issues as reported in this bug on my Debian laptop (similar symptoms, different software). I've read the documentation on bug reporting but I'm not sure what is considered best practice in this situation. Obviously I shouldn't create an new report if one already exists for this bug, but is it good practice to send a "me too" message to confirm that the bug actually exists, or will that just create unnecessary clutter? If so, should I send a simple email to `<number>@bugs.debian.org` describing my basic setup, or is more required?


title: How can I boot the PC-BSD live DVD-ISO IMAGE directly via GRUB2?

text: Via the loopback command, GRUB2 allows to directly boot an ISO file. Now, I've configured the according _menuentry_ to boot the PC-BSD **Live DVD ISO** , but when I try to boot it, the _FreeBSD bootstrap loader_ outputs:               can't load 'kernel'      **Here is the GRUB2 menuentry I currently use:**               menuentry "PC-BSD" {             search --no-floppy --fs-uuid --set root 0d11c28a-7186-43b9-ae33-b4bd351c60ad             loopback loop /PCBSD9.0-RC1-x64-DVD-live.iso             kfreebsd (loop)/boot/loader     }      **Does one know how I'd need to amend that in order to be able to boot the PC- BSD live system?**


title: Stripped down Kernel for a Laptop

text: I am a Linux noob, but I am willing to learn. My immediate objective is to compile a small kernel for my laptop without sacrificing usability. I am familiar with the kernel compilation steps (don't necessarily understand the process). What are the options I can get rid of in menuconfig for a faster, **slimmer** kernel? I have been using the trial and error method, i.e uncheck unused filesystems and drivers, but this is a painfully slow process. Can somebody point me towards things I **should not** touch or a better way of going about this process? This little "project" is for recreation only. System Specs and OS:   i7 580M, Radeon HD5850, 8Gb DDR3, MSI Motherboard x86_64 Ubuntu 11.10.


title: GTK-2 error when installing Glassfish plugin for Eclipse on Fedora 16 64-bit

text: I have Eclipse running fine on my Fedora 16. I was following these instructions to install the Glassfish Tools Bundle for Eclipse (which has to be done outside Eclipse through its own installer) and, after I went through the installer successfully, the next step was to launch the eclipse launcher in the plugin directory (so not the regular Eclipse launcher). I got the following error:               > ./eclipse          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",          (eclipse:2300): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",     Gtk-Message: Failed to load module "pk-gtk-module"     Gtk-Message: Failed to load module "canberra-gtk-module"      That was reported in the terminal. The GUI that popped up briefly said there is also an error log file under ~/workspace/.metadata/.log, which has the following:               !SESSION 2012-09-27 22:18:52.512 -----------------------------------------------     eclipse.buildId=M20090917-0800     java.version=1.6.0_16     java.vendor=Sun Microsystems Inc.     BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US     Framework arguments:  -pluginCustomization plugin_customization.ini -showsplash org.eclipse.platform     Command-line arguments:  -os linux -ws gtk -arch x86 -pluginCustomization plugin_customization.ini -showsplash org.eclipse.platform          !ENTRY org.eclipse.equinox.p2.directorywatcher 4 0 2012-09-27 22:19:01.715     !MESSAGE The installable unit org.eclipse.jdt.compiler.apt.translated_host_properties is missing the filename property.          !ENTRY org.eclipse.osgi 4 0 2012-09-27 22:19:07.181     !MESSAGE Application error     !STACK 1     java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3555 or swt-pi-gtk in swt.library.path, java.library.path or the jar file         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:254)         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:159)         at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)         at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)         at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)         at org.eclipse.swt.widgets.Display.<clinit>(Display.java:131)         at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:516)         at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)         at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:143)         at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:88)         at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)         at java.lang.reflect.Method.invoke(Method.java:597)         at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)         at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)         at org.eclipse.equinox.launcher.Main.run(Main.java:1311)     !SESSION 2012-09-27 22:22:17.706 -----------------------------------------------     eclipse.buildId=M20090917-0800     java.version=1.6.0_16     java.vendor=Sun Microsystems Inc.     BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US     Framework arguments:  -pluginCustomization plugin_customization.ini -showsplash org.eclipse.platform     Command-line arguments:  -os linux -ws gtk -arch x86 -pluginCustomization plugin_customization.ini -showsplash org.eclipse.platform      I found this site but I can't follow the instructions there to save my life. All I understand is that GTK-2 needs some 32-bit libs even though the system is 64-bit but it is trying to open 64-bit ones. Help please


title: Modification and Access time of a file?

text: Is it possible to change the file modification time without changing the file acess time?


title: ls gives me different sort orders during a cron job

text: I have a cron job that, among other things, does a recursive ls of a directory into a file. This gets compared to another file that I've created that, supposedly, contains an identical listing of the same directory. My problem is that, when I generate the version for comparison, I get the files listed in case-insensitive order. When the cron job runs, its list comes out in case- sensitive order. How can I get both of these to come out the same way (I don't care which)? My call to ls is `/bin/ls -lR --time-style=long-iso *`; as far as I can tell, LC_COLLATE is not set in either setting.


title: Preserve ownership with rsync and nonexistent user

text: I have two computers with the same user, me@Home and me@Work. I usually kept their folders synced by bringing Work home (it's a laptop) and rsyncing over LAN. However, now I'm not bringing Work home anymore, so I started using the uni's ssh server to keep my computers synced.               me@Work -> my_name@Uni     me@Home <- my_name@Uni      However, when rsyncing from Work to Uni, using `-avuz`, which should preserve ownership, file ownership is lost. I made some tests and the issue seems to be the unmatched "me" user at Uni. Not only that, directories owned by www-data also didn't have their ownership preserved (since there isn't such user at Uni either), which, one can imagine, caused me some trouble. I don't have root access at Uni nor can my username be changed. Is there anyway I can make this work without setting up a ssh server myself or start bringing Work home again?


title: Online grep exercises?

text: Are there any online grep tutorials that would feature some online tool for performing exercises? For example, having some predefined text sample and being told what patterns to find and so forth? It would be a very useful tool for practical learning of grep in a predictable environment.


title: /dev/sdb keeps changing to whatever disk contains Windows 7?

text: I am trying to install Windows 7 on `/dev/sda` and Ubuntu 12.04 on `/dev/sdb`. Initially I installed Windows 7 on (call it disk 1) and when I begun installing Ubuntu it said Windows 7 was on `/dev/sdb`. Therefore I deleted Win 7 and re-installed windows on disk 2 (I didnt change any boot priorities in the BIOS). However, when I then went to install Ubuntu for a second time Windows 7 was still on `/dev/sdb`.   In other words `/dev/sdb` had changed from disk 1 to disk 2 when all I did was delete the Windows partition and install it on the other disk. I don't get why the disk I install Windows 7 on becomes `/dev/sdb` when I go to install Ubuntu.


title: Awk with multiple delimiters

text: I am trying to execute `awk` on something like this :               <tag x="whatever" y="http://mysite.com/somewords/word1/word2/word3/word4">      I would like to extract `word2` which comes forever after `word1`, knowing that `somewords` does not always exist. I was able to do it using `awk`, but I used it 3 times, each time with one delimiter. Is there any way to merge multiple `awk` commands with multiple delimiters, or simply one `awk` command to pick out `word2`?


title: How to print a partial list of alias definitions in tcsh?

text: I'm working on Fedora 18 with tcsh on a network with a lot of pre-defined aliases. I'm adding my own personal aliases as well, but I want to be able to display these in a separate list. Right now I have a `.cshrc` file that loads alias definitions from a `.alias` file. This is the file with the pre-defined aliases. I thought to create a second file named `.myalias`, put my personal aliases there, and have `.cshrc` load that as well. That works fine. Sadly, using the `alias` command only lists ALL defined aliases. I want to list only my personal aliases from the `.myalias` file, but in the same format as the output from the `alias` command. Is there a way to do this?


title: Command substitution in for loop not working

text: I want to keep all files **not** ending with `.bat` I tried               for f in $(ls | egrep -v .bat); do echo $f; done      and               for f in $(eval ls | egrep -v .bat); do echo $f; done      But both approaches yield the same result, as they print everything. Whereas `ls | egrep -v .bat` and `eval ls | egrep -v .bat` work per se, if used apart from the `for` loop. **EDIT** It's interesting to see that if I leave out the `-v` flag, the loop does what it should and lists all files ending with `.bat`. * * * Feel free to edit the question title, as I was not sure what the problem is. I'm using `GNU bash, version 4.1.10(4)-release (i686-pc-cygwin). ` * * * **EXAMPLE**               $ ls -l | egrep -v ".bat"     total 60K     -rwx------+ 1 SYSTEM SYSTEM 5.3K Jun  6 20:31 fsc*     -rwx------+ 1 SYSTEM SYSTEM 5.3K Jun  6 20:31 scala*     -rwx------+ 1 SYSTEM SYSTEM 5.3K Jun  6 20:31 scalac*     -rwx------+ 1 SYSTEM SYSTEM 5.3K Jun  6 20:31 scaladoc*     -rwx------+ 1 SYSTEM SYSTEM 5.3K Jun  6 20:31 scalap*      Command is working, but not in the for loop.               $ for f in $(ls | egrep -v .bat); do echo $f; done     fsc     fsc.bat     scala     scala.bat     scalac     scalac.bat     scaladoc     scaladoc.bat     scalap     scalap.bat     scalac     scalac.bat     scaladoc     scaladoc.bat     scalap     scalap.bat      **DEBUG** `$ set -x`               mike@pc /cygdrive/c/Program Files (x86)/scala/bin     $ for f in $(ls | egrep -v .bat); do echo $f; done     ++ ls -hF --color=tty     ++ egrep --color=auto -v .bat     + for f in '$(ls | egrep -v .bat)'     + echo fsc     fsc     + for f in '$(ls | egrep -v .bat)'     + echo fsc.bat     fsc.bat     // and so on


title: How to autocd in tcsh?

text: I want to change directory without using cd, I want to access the directory by its name $home/user/tools               $cd tools //works fine     $tools    //permission denied      I tried `set autocd` but still the same?


title: Identifying and moving fields in a line

text: I want to identify a field in a line containing a string, and then move it to a different position. A line would look like this (sorry, I can't seem to type tabs in here)               string1 / string2 / blablaABCbla / string3      The idea is to locate the field containing ABC and move this field to the beginning or end of the line. How would I do this in bash, from stdout? [edit] I'm trying to work this into a piped sequence - I was hoping for a clever command I didn't know about, or else something really sed-ugly.


title: fdisk (expert mode) options

text: On GNU/Linux with `fdisk (util-linux 2.20.1)`, when using, say `fdisk /dev/sda3` there are quite some options and the and even an "expert mode" (`x`). Most of these are explained through the `m` option. But I can't find an documentation on these, neither in the `man` not the `info` page. As I don't want to fumble around with my file systems at the moment - any idea? Just to make this clear: I'm not talking about the "regular" option, e.g. `fdisk -v` but the ones where `fdisk`first had to be started. My guess was that I might get luck in another, related `man`page but I couldn't find anything so far. Did I miss something?


title: is there some simple/clean way to make an "empty boolean variable" be evaluated as `false` on bash scripts?

text: Well, the variable is not boolean until it has been set to `true` or `false`. So when the script begins, it checks for a boolean that was not set yet as in `bTest=''`. So if I do this: `if $bTest;then echo "is active";fi` it will output "is active" when I would like it to show nothing... I could use this: `[ "$bTest" == true ]`, when before was just `$bTest`, but to me that is the problem, it is not a "boolean", it is a string comparison... Also, if I misstype a boolean variable name, it will be empty, and the script execution will throw no error message... and for several times I discovered the real problem was just the misstyped variable... Could an IDE have get that? I use `gedit` so I must track my failures by myself. I wonder if is there a clean and simple way to work with booleans instead of typing `[ "$bTest" == true ]` every time..?


title: How to start a script with clean environment?

text: I tried the following but it doesn't seem to work:               $ cat script.sh     #!/bin/env -i /bin/sh          /bin/env     $ script.sh     /bin/env: invalid option -- ' '     Try `/bin/env --help' for more information.


title: How to ensure FTPeS uses a secure connection?

text: From: https://secure.wikimedia.org/wikipedia/en/wiki/FTPS > **Explicit:** If a client does not request security, the FTPS server can > either allow the client to continue insecure or refuse/limit the connection.   >   >  **Implicit:** A client is immediately expected to challenge the FTPS server > with a TLS/SSL ClientHello message. If such a message is not received by the > FTPS server, the server should drop the connection. So If I own only the client side, then what can I do to allow an FTPES connection to **only use** a secure connection? Under a non-windows OS. IPtables/pf rule? Proxy? or What can I do?


title: Trying to create a multiboot USB for Installs

text: I'm trying to boot various OS/Configurations of OS Install from a single USB. I've been using Multisystem, but it fails when I try to boot an install created with RemasterSys \+ Ubuntu 11.04. It gives something like "please provide a name for this disk". I tried copying in the `./disk` folder into the directory for the install but it still fails. Then I noticed that Ubuntu Desktop is boot directly via USB, so I copied the menu entry and modified the file names:               menuentry "Ubuntu Custom Install" {         search --set -f "/customdist.iso"         loopback loop "/customdist.iso"         linux (loop)/casper/vmlinuz root=UUID=E56C-B453 debian-installer/locale=en_US.UTF-8 debian-installer/language=en kbd-chooser/method=en console-setup/layoutcode=us console-setup/variantcode= console-setup/modelcode=pc105 iso-scan/filename=/customdist.iso boot=casper file=/cdrom/preseed/custom.seed noprompt text --         initrd (loop)/casper/initrd.lz     }      It gives something like file not found. I had `customdist.iso` under the root of the USB just like Ubuntu Desktop is. Also I noticed custom.seed is used so I changed that as well. Whats wrong? Do you have any advice for "noobs" on how to start using GRUB2? I never really get what the commands like `find`, `loopback` or what the long line `linux (loop)/casper/vmlinuz ... file=/cdrom/preseed/custom.seed noprompt text --` do. I suppose the simplest is just to learn to boot everything from ISO?


title: How should I determine the current network utilization?

text: I want to display the current network utilization (bandwidth usage) of one interface of a Debian box on a website. It is not supposed to be very elaborate or precise, just a simple number such as "52 Mbit/s". Typical network bandwidth monitors such as `iftop` give me no way to simply extract such a value. How can I best retrieve it? For example, I guess I might parse `/proc/net/dev` every few minutes. Not sure if this is really the best way to do this though.


title: Lines 1,2,3,4,...,n-1, n to lines n,n-1, ...,4,3,2,1

text: I just realized that I could solve this problem by reversing line numbers from 1, 2, 3,...,n to n, n-1, ..., 3,2,1 and then use the same logic as earlier. So I want to know how can I reverse the order of lines?


title: Can iptables rules manipulate IP sets?

text: In `iptables-extensions(8)` the `set` module is described and it is discussed that it is possible to react to the presence or absence of an IP or more generally a match against an IP set. However, it does not seem that there is a way to append items to an IP set on the fly using an `iptables` rule. The idea being that if I use the `recent` module, I could then temporarily blacklist certain IPs that keep trying and add them into an IP set (which is likely faster). This would mean less rules to traverse for such cases and matching against an IP set is said to be faster as well.


title: How can I block a subdomain with dnsmasq?

text: I use dnsmasq as a whitelist on my network. My dnsmasq.conf file looks like this:               bogus-priv     domain-needed     no-resolv          server=/stackexchange.com/8.8.8.8     #etc...      I would like to be able to block a subdomain, for example:               server=/meta.stackexchange.com/0.0.0.0      I also tried:               address=/meta.stackexchange.com/0.0.0.0      And for both I tried substituting 127.0.0.1 for 0.0.0.0. Unfortunately this doesn't seem to work. How can I block a specific subdomain while allowing the rest of the domain in the config file?


title: String pattern searching

text: I'm new to linux. I want to be placed as a System Admin. I attended an interview at Amazon. They asked me to write a cmd to find the string that starts with 's' and ends with 'a' in a file. I jz know that we have to use grep, bt don't know the actual things. Added to this they also asked how grep works. Can anyone brief out an answer for this. Thanks in advance


title: Best way to configure computer lab printers using CUPS (or other print server)?

text: I manage a computer lab that is used mainly for printing. We've got three identical HP LaserJet P3015s set up and connected by USB to an Ubuntu server, which is then networked to the other computers. All three printers are in the same CUPS class, and the class is shared using the Samba server to the lab computers, which are all OS X and Windows 8 machines. The problem I am having is that whenever someone tries to print an especially long document (sometimes hundreds of pages), the other two printers will stop printing until the long document is finished. Is it not possible in this configuration for CUPS to be accessing multiple printers at the same time, and to choose the printer with the shorted queue (by number of pages, not number of documents) to send new documents to? Is there a better way to configure this? Does anyone have any suggestions or experience on how to improve this situation?


title: Password dialogs block keybindings

text: I am using XMonad 0.11, but this might be unrelated. I am using `evolution` 3.12.2 and this is related but the problem might be more general. After research it appears that the window in question is `pinentry` and comes from GPG2. Some password dialogs prevent me from using my keybindings. Usually this is caused by `evolution`. The following happens:   * I am not able to switch workspaces or change the focus with the keyboard, changing focus with the mouse still works.   * I cannot move the window using keybindings alone (i.e, `META-SHIFT-1`) but the combination `META-MOUSE1` to move works.   * The non window manager keys dont' work all either: `ESCAPE` is ignored but `RETURN` works. Insert from clipboard does not work either (although this may be intentional for a password field).   * In fact any keyboard input is redirected to the password fields and the meta combinations appear as normal letters (e.g, if I try `META-SHIFT-1` to move the window an * appears in the password field, most likely masking a 1).   * As soon as the dialog is claused (using mouse or enter) the system behaves normal again. I would like to fix this as this is very annoying when a password window pops up unexpectedly.


title: manufacturer's tool found bad blocks, but smartctl doesn't show any

text: Description of my problem is quite large, so first I will give a short summary, then I will precisely describe the situation. Short summary: manufacturer's diagnostic tools found and repaired some errors on my hard disk. As far as I understand tool's manual, these errors were bad blocks. However, smartctl (Linux tool to do SMART on hard disk) doesn't show any reallocated sectors and says that hard disk is good. First question: how is it possible? Reparation of bad blocks means reallocating sectors, right? So why don't smartctl report any reallocated sectors? Second question: I bought this disk a few months ago and I still have warranty for it. Should I demand that seller replace it for a new one or is this disk good and I could continue using it? And now precise description: I have Western Digital hard disk, model WDC WD5000AAKX-001CA0. Recently I noticed that sometimes my computer hangs for a few seconds (something like up to one minute). After such hangs dmesg shows errors like this:               knoppix@Microknoppix:~$ dmesg     (...)     [  504.003363] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen     [  504.003374] ata1.00: failed command: READ DMA EXT     [  504.003383] ata1.00: cmd 25/00:00:80:07:01/00:02:00:00:00/e0 tag 0 dma 262144 in     [  504.003385]          res 40/00:00:09:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)     [  504.003389] ata1.00: status: { DRDY }     [  509.016652] ata1: link is slow to respond, please be patient (ready=0)     [  514.030002] ata1: soft resetting link     [  514.200386] ata1.00: configured for UDMA/133     [  514.200420] ata1: EH complete     [  546.003333] ata1: lost interrupt (Status 0x50)     [  546.003364] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen     [  546.003371] ata1.00: failed command: READ DMA EXT     [  546.003380] ata1.00: cmd 25/00:00:80:15:06/00:02:00:00:00/e0 tag 0 dma 262144 in     [  546.003381]          res 40/00:00:09:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)     [  546.003386] ata1.00: status: { DRDY }     [  546.003401] ata1: soft resetting link     [  546.181205] ata1.00: configured for UDMA/133     [  546.181234] ata1: EH complete      However, smartctl says that "SMART overall-health self-assessment test result: PASSED" (I will paste complete output of smartctl few paragraphs later). Whenever I tried to make smartctl self test (with smartctl -t short or smartctl -t long) such tests were reported as aborted by host. So I downloaded bootable CD diagnostic tool for my hd - this one: http://support.wdc.com/product/download.asp?groupid=606&sid=2&lang=en Using this tool first I did quick test and it showed error (unfortunately, I don't remember what was the error code). As far as I understand this tool performs just SMART quick self test (http://wdc.custhelp.com/app/answers/detail/search/1/a_id/940/c/130/p/227,295 says "QUICK TEST - performs SMART drive quick self-test to gather and verify the Data Lifeguard information contained on the drive.") Then I did extended test. As far as I understand, this extended test looks for bad sectors (http://wdc.custhelp.com/app/answers/detail/search/1/a_id/940/c/130/p/227,295 says "EXTENDED TEST - performs a Full Media Scan to detect bad sectors"). After some time the tool told that it found and repaired some errors. Now I booted machine with knoppix and did "smartctl --all". Here is its output:               root@Microknoppix:/home/knoppix# smartctl --all /dev/sda     smartctl 5.43 2012-06-05 r3561 [i686-linux-3.4.9] (local build)     Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF INFORMATION SECTION ===     Model Family:     Western Digital Caviar Blue Serial ATA     Device Model:     WDC WD5000AAKX-001CA0     Serial Number:    WD-WMAYUW952768     LU WWN Device Id: 5 0014ee 6ad1d9ef1     Firmware Version: 15.01H15     User Capacity:    500,107,862,016 bytes [500 GB]     Sector Size:      512 bytes logical/physical     Device is:        In smartctl database [for details use: -P show]     ATA Version is:   8     ATA Standard is:  Exact ATA specification draft version not indicated     Local Time is:    Wed Dec 12 03:34:39 2012 UTC     SMART support is: Available - device has SMART capability.     SMART support is: Enabled          === START OF READ SMART DATA SECTION ===     SMART overall-health self-assessment test result: PASSED          General SMART Values:     Offline data collection status:  (0x82) Offline data collection activity                         was completed without error.                         Auto Offline Data Collection: Enabled.     Self-test execution status:      (   0) The previous self-test routine completed                         without error or no self-test has ever                          been run.     Total time to complete Offline      data collection:        ( 8160) seconds.     Offline data collection     capabilities:            (0x7b) SMART execute Offline immediate.                         Auto Offline data collection on/off support.                         Suspend Offline collection upon new                         command.                         Offline surface scan supported.                         Self-test supported.                         Conveyance Self-test supported.                         Selective Self-test supported.     SMART capabilities:            (0x0003) Saves SMART data before entering                         power-saving mode.                         Supports SMART auto save timer.     Error logging capability:        (0x01) Error logging supported.                         General Purpose Logging supported.     Short self-test routine      recommended polling time:    (   2) minutes.     Extended self-test routine     recommended polling time:    (  83) minutes.     Conveyance self-test routine     recommended polling time:    (   5) minutes.     SCT capabilities:          (0x3037) SCT Status supported.                         SCT Feature Control supported.                         SCT Data Table supported.          SMART Attributes Data Structure revision number: 16     Vendor Specific SMART Attributes with Thresholds:     ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE       1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       486       3 Spin_Up_Time            0x0027   189   141   021    Pre-fail  Always       -       1525       4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       587       5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0       7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0       9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       1553      10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0      11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0      12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       578     192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       173     193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       413     194 Temperature_Celsius     0x0022   097   093   000    Old_age   Always       -       46     196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0     197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0     198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       5     199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0     200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       5          SMART Error Log Version: 1     ATA Error Count: 2         CR = Command Register [HEX]         FR = Features Register [HEX]         SC = Sector Count Register [HEX]         SN = Sector Number Register [HEX]         CL = Cylinder Low Register [HEX]         CH = Cylinder High Register [HEX]         DH = Device/Head Register [HEX]         DC = Device Command Register [HEX]         ER = Error register [HEX]         ST = Status register [HEX]     Powered_Up_Time is measured from power on, and printed as     DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,     SS=sec, and sss=millisec. It "wraps" after 49.710 days.          Error 2 occurred at disk power-on lifetime: 1548 hours (64 days + 12 hours)       When the command that caused the error occurred, the device was active or idle.            After command completion occurred, registers were:       ER ST SC SN CL CH DH       -- -- -- -- -- -- --       04 51 01 30 4f c2 a0  Error: ABRT            Commands leading to the command that caused the error were:       CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name       -- -- -- -- -- -- -- --  ----------------  --------------------       b0 d6 01 be 4f c2 a0 02      00:02:58.316  SMART WRITE LOG       b0 da 01 00 4f c2 a0 02      00:02:58.259  SMART RETURN STATUS       80 44 00 00 44 57 a0 02      00:02:58.259  [VENDOR SPECIFIC]       b0 d6 01 be 4f c2 a0 02      00:02:58.241  SMART WRITE LOG       80 45 00 01 44 57 a0 02      00:02:58.241  [VENDOR SPECIFIC]          Error 1 occurred at disk power-on lifetime: 1515 hours (63 days + 3 hours)       When the command that caused the error occurred, the device was active or idle.            After command completion occurred, registers were:       ER ST SC SN CL CH DH       -- -- -- -- -- -- --       04 51 01 30 4f c2 a0  Error: ABRT            Commands leading to the command that caused the error were:       CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name       -- -- -- -- -- -- -- --  ----------------  --------------------       b0 d6 01 be 4f c2 a0 02      00:02:21.841  SMART WRITE LOG       b0 da 01 00 4f c2 a0 02      00:02:21.784  SMART RETURN STATUS       80 44 00 00 44 57 a0 02      00:02:21.784  [VENDOR SPECIFIC]       b0 d6 01 be 4f c2 a0 02      00:02:21.768  SMART WRITE LOG       80 45 00 01 44 57 a0 02      00:02:21.768  [VENDOR SPECIFIC]          SMART Self-test log structure revision number 1     Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error     # 1  Conveyance offline  Completed without error       00%      1552         -     # 2  Conveyance offline  Completed: read failure       90%      1548         787927349     # 3  Conveyance offline  Completed: read failure       90%      1515         883391611     # 4  Short offline       Completed without error       00%      1503         -     # 5  Short offline       Completed without error       00%      1503         -     # 6  Short offline       Aborted by host               80%      1502         -     # 7  Extended offline    Completed without error       00%         9         -     # 8  Short offline       Completed without error       00%         6         -     # 9  Short offline       Aborted by host               90%         6         -          SMART Selective self-test log data structure revision number 1      SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS         1        0        0  Not_testing         2        0        0  Not_testing         3        0        0  Not_testing         4        0        0  Not_testing         5        0        0  Not_testing     Selective self-test flags (0x0):       After scanning selected spans, do NOT read-scan remainder of disk.     If Selective self-test is pending on power-up, resume after 0 minute delay.      As you can see, on one hand one conveyance offline was completed with read failure. But, on the other hand, all attributes seems good - for instance, Reallocated_Sector_Ct is 0. I also tried once again to cat the whole disk to /dev/null - and again I have errors in dmesg:               root@Microknoppix:/home/knoppix# nice -n 20 ionice -c 3 cat /dev/sda > /dev/null     During this cat dmesg shows such errors:     knoppix@Microknoppix:~$ dmesg     (...)     [  504.003363] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen     [  504.003374] ata1.00: failed command: READ DMA EXT     [  504.003383] ata1.00: cmd 25/00:00:80:07:01/00:02:00:00:00/e0 tag 0 dma 262144 in     [  504.003385]          res 40/00:00:09:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)     [  504.003389] ata1.00: status: { DRDY }     [  509.016652] ata1: link is slow to respond, please be patient (ready=0)     [  514.030002] ata1: soft resetting link     [  514.200386] ata1.00: configured for UDMA/133     [  514.200420] ata1: EH complete     [  546.003333] ata1: lost interrupt (Status 0x50)     [  546.003364] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen     [  546.003371] ata1.00: failed command: READ DMA EXT     [  546.003380] ata1.00: cmd 25/00:00:80:15:06/00:02:00:00:00/e0 tag 0 dma 262144 in     [  546.003381]          res 40/00:00:09:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)     [  546.003386] ata1.00: status: { DRDY }     [  546.003401] ata1: soft resetting link     [  546.181205] ata1.00: configured for UDMA/133     [  546.181234] ata1: EH complete      I thought it can be fault of motherboard or data cable that connects disk to motherboard. So I connected another disk to my motherboard using the same cable and slot and cated it to /dev/null. It succedeed without dmesg showing any errors.


title: how to solve postfix errors?

text: After following several tutorials on setting up postfix at basic level on CentOs for my VPS, continue to get the following:               -bash-4.1# postfix start     /usr/libexec/postfix/postfix-script: line 317: cmp: command not found     postfix/postfix-script: warning: /usr/lib/sendmail and /usr/sbin/sendmail differ     postfix/postfix-script: warning: Replace one by a symbolic link to the other     postfix/postfix-script: starting the Postfix mail system      In the `main.cf` below are my edits:               myhostname = myservername.sub.mysite.net     mydomain = sub.mysite.net     myorigin = $myhostname     myorigin = $mydomain      inet_interfaces = all     inet_interfaces = $myhostname     inet_interfaces = localhost     mydestination = $myhostname, localhost.$mydomain, localhost     mynetworks = 192.168.0.0/16, 127.0.0.0/8      Also removed sendmail but haven't yet set up db, just trying to get postfix to start without errors. Is this the problem? why are two files in red? ![usr/sbin](http://i.stack.imgur.com/vqsKE.jpg)


title: Mac OS X find/grep generating "unknown --devices option"

text: I am entering a command I have done often with Linux, Unix perfectly fine but with Apple Mac OS X 10.8 (and probably before) I get a `grep: unknown --devices option` when I attempt to run the following command:               find . -type f -name '*.sql' 2>/dev/null | xargs grep -i 'texttolookfor'      I checked the results of the `find` command and they all appear to be just standard `.sql` files. And I should add that the problem occurs with other file searches not just `.sql` files. In searching the Apple site and Google I cannot seem to find any indication of what is going on here. Does anyone have a suggestion?


title: What sets a child's STDERR, STDOUT, and STDIN?

text: If a program runs `fork()` what sets standard streams `STDOUT`, `STDIN` and `STDERR`?


title: New harddrive does not show up in /dev

text: I am trying to add a second (unformatted) IDE hard drive to a QNX 6.4.1 VM (hosted through vmware's vSphere). Unfortunately, there is no entry for the drive in `/dev` (I think this is called an enumeration... is that correct?) I would have expected an entry named `/dev/hd1` that I could then put a QNX6 filesystem on, partition, and mount. But all I see is `/dev/hd0`. `devb-eide` is running. I tried moving it from Primary Slave to Secondary Master in the BIOS, but it didn't seem to help. This has always worked for me on my local VMs before, but now that we are hosted in vSphere, I don't know. Can someone please point me in the right direction? ![BIOS screenshot](http://i.stack.imgur.com/aaHxY.png) ![/dev screenshot](http://i.stack.imgur.com/PY61K.png) Update: So it looks like QNX calls /dev/hd0 a "Hard Disk Block Device" Link > /dev/hdn Hard disk block devices; data representing an entire drive, > spanning all partitions; see devb-* in the Utilities Reference. Is the term "Hard Disk Block Device" standard across many *nix? Update: For what it's worth, I also do not get a `/etc/fstab` showing up.


title: Piping to the command substitution of a string containing pipes

text: This works—               $ x='grep a'     $ echo ab | $x     ab      This doesn't—               $ x='grep a | grep b'     $ echo ab | $x     grep: |: No such file or directory     grep: grep: No such file or directory     grep: b: No such file or directory      It appears in the latter case, `grep a | grep b` is seen as a single command, _i.e._ `grep a \| grep b`. How do I get the second example to work without modifying `x`?


title: Correct use of TZ, date, and hwclock?

text: I'm working on an Buildroot developed ARM/ulibc Linux distribution for a custom board. I'm trying to understand the relationship between If I do this, as I've seen on a few examples online:               # date --set "2013-04-09 15:06:30"     Tue Apr  9 15:06:30 CDT 2013     # hwclock --systohc --utc     # hwclock     Tue Apr  9 15:06:39 2013  -0.351552 seconds      and reboot, I get:               .... boot messages ...     ... setting system clock to 2013-04-09 20:07:31 UTC (1365538051)     .... boot messages ...     #     # date; hwclock;     Tue Apr  9 15:08:24 CDT 2013     Tue Apr  9 15:08:25 2013  -0.473164 seconds     #     # date -u; hwclock -u;     Tue Apr  9 20:08:44 UTC 2013     Tue Apr  9 15:08:45 2013  -0.397120 seconds     #     # date; hwclock --localtime     Tue Apr  9 15:09:07 CDT 2013     Tue Apr  9 20:09:08 2013  -0.686601 seconds     #      So, it seems that the hwclock thinks that localtime **is** UTC? And for some reason, when applying `-u` it actually **applies** the timezone instead? I'm a bit confused. Can anyone suggest how I should be going about this? **EDIT:** I should note that being an ARM + Busybox + uclibc, slimmed down system, I don't have a lot of the typical directories and files, like sysconfig and zoneinfo.


title: /: is a directory issue in bash

text: I'm quite new to bash scripting and have been going reasonably well but have run into an issue. I am trying to create a script that uses a forward slash (/), however, I keep getting the error message `/: is a directory.` So basically what I need is to pass the command `test/(hello)` to a program in the terminal. So I have added backslashes to make it work: `test\/\(hello\)`, however, I get this error. What is wrong here?


title: Is SAMBA routable?

text: We have a SAMBA share on a centos 6 machine. **Question** : Can we mount this SAMBA 3 share over the internet? (without VPN/SSH tunnel, so directly!)


title: Is this command safe to run from / as root

text: find . * -depth -print0 | xargs -0 rmdir      It finds and removes all empty folders (including hidden ones) recursively. **I only tired it on my home folder and a pendrive in Linux PC and it worked but I dont know if it is safe to run from / as root** I once nuked my OS by running some command off the internet (which I didnt understand) like that


title: remove particular characters from a variable using bash

text: I want to parse a **variable** (in my case it's development kit version) to make it dot(`.`) free. If `version='2.3.3'`, desired output is `233`. I tried as below, but it requires `.` to be replaced with another character giving me `2_3_3`. It would have been fine if `tr . ''` would have worked.                 1 VERSION='2.3.3'        2 echo "2.3.3" | tr . _


title: Restrict emails to system users in postfix?

text: I am running postfix, and it seems it is willing to accept emails for system users, such as `man`, `sshd`, `daemon`, `www-data`, ... Is desirable (probably not)? and what I can do to disable this?


title: firefox launch failed: X11 connection rejected because of wrong authentication

text: I logged into a Linux server (RHEL) from an linux desktop. There is not any error message at login, but I failed to launch firefox and see the following error emessage:               [myname@myserver ~]$ firefox &     [1] 8806     [myname@myserver ~]$ X11 connection rejected because of wrong authentication.     X11 connection rejected because of wrong authentication.     The application 'firefox' lost its connection to the display localhost:11.0;     most likely the X server was shut down or you killed/destroyed     the application.      I tried to run the following command               [myname@myserver ~]$ xhost +      but get the following error message:               X11 connection rejected because of wrong authentication.     X connection to localhost:11.0 broken (explicit kill or server shutdown).      I also tried to run               [myname@myserver ~]$ echo $DISPLAY      and got the following result               localhost:11.0      I tried to search this problem from SO but I had no luck. What is the problem and how can I make the firefox work? It seems that the X window cannot be opened.


title: How to change login screen in CrunchBang?

text: I am on SLiM, and I don't like the default login screen. I want a login screen like the one shown below: ![enter image description here](http://i.stack.imgur.com/t9Jgs.png) But instead I have a pretty minimal one which has just one textbox and nothing else on the screen. I can't find a screenshot of it, but that is what I got when I am done installing. Is changing to GDM the only way to get a login screen like this? Is there any other way?


title: Move qcow2 image to physical hard drive

text: I have a qcow2 image that I use to boot an installation of linux using QEMU; I would like to place the contents of that image directly onto a physical hard drive so that I can boot to that linux installation directly from my desktop. I would like to do something like `dd if=my-qcow2.img of=/dev/sdb`. However, this will clearly not work since qcow2 does not store the contents of the virtual disk in logical order within the qcow2 file. Any suggestions?


title: Is it normal that a restart is required to mount USB after a kernel upgrade?

text: Sometimes I see the Linux kernel being mentioned in the list of upgrades, when running `pacman -Syu` (updating my packages in Arch Linux). Whenever this happens, after installation of the packages, I can not mount USB drives anymore until I restart. I would just like to know if this is something that is common and expected (and if so, why, do I wonder), or if this is something not expected that I should investigate.


title: CentOS 6.5 sound permissions

text: I am trying to configure ALSA for a CentOS 6.5 minimal install, my problem is non-root users do not have permission to access the sound devices in /dev/snd because the files are missing access control lists:               dispcentos:~$ ls -l /dev/snd     total 0     drwxr-xr-x 2 root root      60 Jan  7 02:21 by-path/     crw-rw---- 1 root audio 116, 8 Jan  7 02:21 controlC0     crw-rw---- 1 root audio 116, 4 Jan  7 02:21 midiC0D0     crw-rw---- 1 root audio 116, 7 Jan  7 02:21 pcmC0D0c     crw-rw---- 1 root audio 116, 6 Jan  7 02:21 pcmC0D0p     crw-rw---- 1 root audio 116, 5 Jan  7 02:21 pcmC0D1p     crw-rw---- 1 root audio 116, 3 Jan  7 02:21 seq     crw-rw---- 1 root audio 116, 2 Jan  7 02:21 timer      Previous suggestions have been to add the users to the audio group but this should not be necessary. The output of udevadm info shows that the ACL_MANAGE property is present as a result of /lib/udev/rules.d/70-acl.rules:               dispcentos:~$ udevadm info --query=all --name=/dev/snd/pcmC0D0c     P: /devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     N: snd/pcmC0D0c     S: char/116:7     E: UDEV_LOG=3     E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     E: MAJOR=116     E: MINOR=7     E: DEVNAME=/dev/snd/pcmC0D0c     E: SUBSYSTEM=sound     E: ACL_MANAGE=1     E: DEVLINKS=/dev/char/116:7      But the output of udevadm test shows that udev-acl is not run for the device:               dispcentos:~$ udevadm test /devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     run_command: calling: test     udevadm_test: version 147     This program is for debugging only, it does not run any program,     specified by a RUN key. It may show incorrect results, because     some values may be different, or not available at a simulation run.          parse_file: reading '/lib/udev/rules.d/01-log-block.rules' as rules file     parse_file: reading '/lib/udev/rules.d/10-console.rules' as rules file     parse_file: reading '/lib/udev/rules.d/10-dm.rules' as rules file     parse_file: reading '/lib/udev/rules.d/11-dm-lvm.rules' as rules file     parse_file: reading '/lib/udev/rules.d/13-dm-disk.rules' as rules file     parse_file: reading '/lib/udev/rules.d/40-isdn.rules' as rules file     parse_file: reading '/lib/udev/rules.d/40-multipath.rules' as rules file     parse_file: reading '/lib/udev/rules.d/40-redhat.rules' as rules file     parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file     parse_file: reading '/lib/udev/rules.d/50-firmware.rules' as rules file     parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-alias-kmsg.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-net.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file     parse_file: reading '/etc/udev/rules.d/60-raw.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-mobile-action.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-option-modem-modeswitch.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-persistent-storage-edd.rules' as rules file     parse_file: reading '/lib/udev/rules.d/64-device-mapper.rules' as rules file     parse_file: reading '/lib/udev/rules.d/64-md-raid.rules' as rules file     parse_file: reading '/lib/udev/rules.d/65-md-incremental.rules' as rules file     parse_file: reading '/lib/udev/rules.d/69-dm-lvm-metad.rules' as rules file     parse_file: reading '/lib/udev/rules.d/70-acl.rules' as rules file     parse_file: reading '/lib/udev/rules.d/70-hid2hci.rules' as rules file     parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file     parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file     parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file     parse_file: reading '/lib/udev/rules.d/79-fstab_import.rules' as rules file     parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file     parse_file: reading '/lib/udev/rules.d/80-iosched.rules' as rules file     parse_file: reading '/lib/udev/rules.d/80-mpath-iosched.rules' as rules file     parse_file: reading '/lib/udev/rules.d/81-kvm-rhel.rules' as rules file     parse_file: reading '/lib/udev/rules.d/88-clock.rules' as rules file     parse_file: reading '/etc/udev/rules.d/90-alsa.rules' as rules file     parse_file: reading '/lib/udev/rules.d/91-drm-modeset.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-dm-notify.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-keyboard-force-release.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file     parse_file: reading '/etc/udev/rules.d/99-fuse.rules' as rules file     parse_file: reading '/dev/.udev/rules.d/99-root.rules' as rules file     parse_file: reading '/etc/udev/rules.d/99-tty.rules' as rules file     udev_rules_new: rules use 30936 bytes tokens (2578 * 12 bytes), 18240 bytes buffer     udev_rules_new: temporary index used 18460 bytes (923 * 20 bytes)     udev_device_new_from_syspath: device 0x1671c38 has devpath '/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c'     udev_device_new_from_syspath: device 0x16620a8 has devpath '/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c'     udev_device_read_db: device 0x16620a8 filled with db file data     udev_rules_apply_to_event: LINK 'char/116:7' /lib/udev/rules.d/50-udev-default.rules:4     udev_rules_apply_to_event: GROUP 63 /lib/udev/rules.d/50-udev-default.rules:46     udev_event_execute_rules: no node name set, will use kernel supplied name 'snd/pcmC0D0c'     udev_device_update_db: unable to create db file '/dev/.udev/db/sound:pcmC0D0c': Permission denied     udev_node_add: creating device node '/dev/snd/pcmC0D0c', devnum=116:7, mode=0660, uid=0, gid=63     udev_node_mknod: preserve file '/dev/snd/pcmC0D0c', because it has correct dev_t     udev_node_mknod: preserve permissions /dev/snd/pcmC0D0c, 020660, uid=0, gid=63     node_symlink: preserve already existing symlink '/dev/char/116:7' to '../snd/pcmC0D0c'     udevadm_test: UDEV_LOG=6     udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     udevadm_test: MAJOR=116     udevadm_test: MINOR=7     udevadm_test: DEVNAME=/dev/snd/pcmC0D0c     udevadm_test: ACTION=add     udevadm_test: SUBSYSTEM=sound     udevadm_test: DEVLINKS=/dev/char/116:7     udevadm_test: ACL_MANAGE=1      Here is the output from a previous release (6.4) for comparison:               dispcentos:mms$ ls -l /dev/snd     total 0     drwxr-xr-x  2 root root      60 Jan  7 07:13 by-path/     crw-rw----+ 1 root audio 116, 8 Jan  7 07:13 controlC0     crw-rw----+ 1 root audio 116, 4 Jan  7 07:13 midiC0D0     crw-rw----+ 1 root audio 116, 7 Jan  7 07:14 pcmC0D0c     crw-rw----+ 1 root audio 116, 6 Jan  7 07:16 pcmC0D0p     crw-rw----+ 1 root audio 116, 5 Jan  7 07:13 pcmC0D1p     crw-rw----+ 1 root audio 116, 3 Jan  7 07:13 seq     crw-rw----+ 1 root audio 116, 2 Jan  7 07:13 timer          dispcentos:mms$ getfacl /dev/snd/pcmC0D0c      getfacl: Removing leading '/' from absolute path names     # file: dev/snd/pcmC0D0c     # owner: root     # group: audio     user::rw-     user:mms:rw-     group::rw-     mask::rw-     other::---      * * *               dispcentos:mms$ udevadm info --query=all --name=/dev/snd/pcmC0D0c     P: /devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     N: snd/pcmC0D0c     S: char/116:7     E: UDEV_LOG=3     E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     E: MAJOR=116     E: MINOR=7     E: DEVNAME=/dev/snd/pcmC0D0c     E: SUBSYSTEM=sound     E: ACL_MANAGE=1     E: DEVLINKS=/dev/char/116:7      * * *               dispcentos:mms$ udevadm test /devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     run_command: calling: test     udevadm_test: version 147     This program is for debugging only, it does not run any program,     specified by a RUN key. It may show incorrect results, because     some values may be different, or not available at a simulation run.          parse_file: reading '/lib/udev/rules.d/10-console.rules' as rules file     parse_file: reading '/lib/udev/rules.d/10-dm.rules' as rules file     parse_file: reading '/lib/udev/rules.d/11-dm-lvm.rules' as rules file     parse_file: reading '/lib/udev/rules.d/13-dm-disk.rules' as rules file     parse_file: reading '/lib/udev/rules.d/40-isdn.rules' as rules file     parse_file: reading '/lib/udev/rules.d/40-libgphoto2.rules' as rules file     parse_file: reading '/lib/udev/rules.d/40-redhat.rules' as rules file     parse_file: reading '/lib/udev/rules.d/40-usb-media-players.rules' as rules file     parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file     parse_file: reading '/lib/udev/rules.d/50-firmware.rules' as rules file     parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-alias-kmsg.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file     parse_file: reading '/etc/udev/rules.d/60-fprint-autosuspend.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-libmtp.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-net.rules' as rules file     parse_file: reading '/etc/udev/rules.d/60-pcmcia.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file     parse_file: reading '/etc/udev/rules.d/60-raw.rules' as rules file     parse_file: reading '/lib/udev/rules.d/60-wacom.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-gnome-bluetooth-rfkill.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-mobile-action.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-option-modem-modeswitch.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-persistent-storage-edd.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-uinput-stddev.rules' as rules file     parse_file: reading '/lib/udev/rules.d/61-uinput-wacom.rules' as rules file     parse_file: reading '/lib/udev/rules.d/64-device-mapper.rules' as rules file     parse_file: reading '/lib/udev/rules.d/64-md-raid.rules' as rules file     parse_file: reading '/lib/udev/rules.d/65-libsane.rules' as rules file     parse_file: reading '/lib/udev/rules.d/65-libwacom.rules' as rules file     parse_file: reading '/lib/udev/rules.d/65-md-incremental.rules' as rules file     parse_file: reading '/lib/udev/rules.d/69-dm-lvm-metad.rules' as rules file     parse_file: reading '/lib/udev/rules.d/69-pilot-link.rules' as rules file     parse_file: reading '/lib/udev/rules.d/70-acl.rules' as rules file     parse_file: reading '/lib/udev/rules.d/70-cups-libusb.rules' as rules file     parse_file: reading '/lib/udev/rules.d/70-hid2hci.rules' as rules file     parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file     parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file     parse_file: reading '/lib/udev/rules.d/70-printers.rules' as rules file     parse_file: reading '/lib/udev/rules.d/71-biosdevname.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file     parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-mm-ericsson-mbm.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-mm-longcheer-port-types.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-mm-platform-serial-whitelist.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-mm-simtech-port-types.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-mm-usb-device-blacklist.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-mm-zte-port-types.rules' as rules file     parse_file: reading '/lib/udev/rules.d/77-nm-olpc-mesh.rules' as rules file     parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file     parse_file: reading '/lib/udev/rules.d/79-fstab_import.rules' as rules file     parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file     parse_file: reading '/lib/udev/rules.d/80-iosched.rules' as rules file     parse_file: reading '/lib/udev/rules.d/80-mpath-iosched.rules' as rules file     parse_file: reading '/lib/udev/rules.d/80-udisks.rules' as rules file     parse_file: reading '/lib/udev/rules.d/85-regulatory.rules' as rules file     parse_file: reading '/lib/udev/rules.d/85-usbmuxd.rules' as rules file     parse_file: reading '/lib/udev/rules.d/88-clock.rules' as rules file     parse_file: reading '/lib/udev/rules.d/89-microcode.rules' as rules file     parse_file: reading '/etc/udev/rules.d/90-alsa.rules' as rules file     parse_file: reading '/etc/udev/rules.d/90-hal.rules' as rules file     parse_file: reading '/lib/udev/rules.d/90-pulseaudio.rules' as rules file     parse_file: reading '/lib/udev/rules.d/91-drm-modeset.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-dell.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-fujitsu.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-gateway.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-ibm.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-lenovo.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-toshiba.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-csr.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-hid.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-devkit-power-wup.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-dm-notify.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-keyboard-force-release.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file     parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file     parse_file: reading '/etc/udev/rules.d/97-bluetooth-serial.rules' as rules file     parse_file: reading '/lib/udev/rules.d/97-bluetooth.rules' as rules file     parse_file: reading '/etc/udev/rules.d/98-kexec.rules' as rules file     parse_file: reading '/etc/udev/rules.d/99-fuse.rules' as rules file     parse_file: reading '/dev/.udev/rules.d/99-root.rules' as rules file     parse_file: reading '/etc/udev/rules.d/99-tty.rules' as rules file     parse_file: reading '/etc/udev/rules.d/99-vmware-scsi-udev.rules' as rules file     udev_rules_new: rules use 187884 bytes tokens (15657 * 12 bytes), 39574 bytes buffer     udev_rules_new: temporary index used 59740 bytes (2987 * 20 bytes)     udev_device_new_from_syspath: device 0x218d3e0 has devpath '/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c'     udev_device_new_from_syspath: device 0x2175148 has devpath '/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c'     udev_device_read_db: device 0x2175148 filled with db file data     udev_rules_apply_to_event: LINK 'char/116:7' /lib/udev/rules.d/50-udev-default.rules:4     udev_rules_apply_to_event: GROUP 63 /lib/udev/rules.d/50-udev-default.rules:46     udev_device_new_from_syspath: device 0x218d590 has devpath '/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0'     udev_device_new_from_syspath: device 0x218d858 has devpath '/devices/pci0000:00/0000:00:11.0/0000:02:02.0'     udev_device_new_from_syspath: device 0x218da30 has devpath '/devices/pci0000:00/0000:00:11.0'     udev_device_new_from_syspath: device 0x218dbf0 has devpath '/devices/pci0000:00'     udev_rules_apply_to_event: RUN 'udev-acl --action=$env{ACTION} --device=$env{DEVNAME}' /lib/udev/rules.d/70-acl.rules:53     udev_rules_apply_to_event: RUN 'socket:@/org/freedesktop/hal/udev_event' /etc/udev/rules.d/90-hal.rules:2     udev_event_execute_rules: no node name set, will use kernel supplied name 'snd/pcmC0D0c'     udev_device_update_db: unable to create db file '/dev/.udev/db/sound:pcmC0D0c': Permission denied     udev_node_add: creating device node '/dev/snd/pcmC0D0c', devnum=116:7, mode=0660, uid=0, gid=63     udev_node_mknod: preserve file '/dev/snd/pcmC0D0c', because it has correct dev_t     udev_node_mknod: preserve permissions /dev/snd/pcmC0D0c, 020660, uid=0, gid=63     node_symlink: preserve already existing symlink '/dev/char/116:7' to '../snd/pcmC0D0c'     udevadm_test: UDEV_LOG=6     udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:02.0/sound/card0/pcmC0D0c     udevadm_test: MAJOR=116     udevadm_test: MINOR=7     udevadm_test: DEVNAME=/dev/snd/pcmC0D0c     udevadm_test: ACTION=add     udevadm_test: SUBSYSTEM=sound     udevadm_test: DEVLINKS=/dev/char/116:7     udevadm_test: ACL_MANAGE=1     udevadm_test: run: 'udev-acl --action=add --device=/dev/snd/pcmC0D0c'     udevadm_test: run: 'socket:@/org/freedesktop/hal/udev_event'      You will see the following two lines from udevadm test that are missing from the CentOS 6.5 minimal installation:               udev_rules_apply_to_event: RUN 'udev-acl --action=$env{ACTION} --device=$env{DEVNAME}' /lib/udev/rules.d/70-acl.rules:53     udevadm_test: run: 'udev-acl --action=add --device=/dev/snd/pcmC0D0c'      Any ideas why?


title: Bash - Multidimensional Arrays and Extracting variables from output

text: I am trying to do something simple however I'm not sure how to achieve my goal here. I am trying to extract the: USER, TTY and FROM values that are given by the `w` command on the console. In bash I am trying to take this output and get these values into a multidimensional array (or just an array with a space delimiter).               #!/bin/bash     w|awk '{if(NR > 2) print $1,$2,$3}' | while read line     do          USERS+=("$line")          echo ${#USERS[@]}     done     echo ${#USERS[@]}      I have found my way to the point of reading in the values by line in a single array however I cannot seem to get the USERS array value out of the scope of the while loop. It prints the values 1,2,3,4 and then 0 after the loop. Every example I read they use the variable outside the scope perfectly fine but I cannot seem to.


title: Using sed to find and replace complex string (preferrably with regex)

text: I have a file with the following contents:               <username><![CDATA[name]]></username>     <password><![CDATA[password]]></password>     <dbname><![CDATA[name]]></dbname>      and I need to make a script that changes the "name" in the first line to "something", the "password" on the second line to "somethingelse", and the "name" in the third line to "somethingdifferent". I can't rely on the order of these occurring in the file, so I can't simply replace the first occurance of "name" with "something" and the second occurrence of "name" with "somethingdifferent". I actually need to do a search for the surrounding strings to make sure I'm finding and replacing the correct thing. So far I have tried this command to find and replace the first "name" occurance:               sed -i "s/<username><![CDATA[name]]><\/username>/something/g" file.xml      however it's not working so I'm thinking some of these characters might need escaping, etc. Ideally, I'd love to be able to use regex to just match the two "username" occurrences and replace only the "name". Something like this but with sed:               <username>.+?(name).+?</username>      and replace the contents in the brackets with "something". Is this possible?


title: What could cause the clock to jump by 5 minutes?

text: I have a (physical) box running a stripped down Ubuntu; every now and then (6 times in 3 months), the clock jumps backwards by exactly 300 seconds (+- 0.01 seconds; always exactly 300 seconds). It happens from one minute to the next (I have an external machine polling it once per minute). The box is running 2.6.26-generic (custom compiled kernel), Ubuntu 9.04 (I know, I'm trying to get it updated, but it's semi-embedded). There is nothing in the logs which indicates what happened, and I have a large selection of pool.ntp.org ntp servers, which correct the problem after a while. Does anyone know what might cause this? Additional 1: I also have a number of other boxes running the same kernel (binary identical), and minor variations of the same software, which do not have this problem. I have also swapped out the hardware. Additional 2 (summary of my individual comments):   * I know 9.04 is out of date, I agree it should be updated, and this decision is out of my control. Because management.   * I have tried a large number of ntp servers, and a small number. It still happens in both cases; if I have a large number of ntp servers, then it fixes itself more quickly.   * I have swapped out the hardware   * I am using the same kernel/operating system on another box (with identical hardware), which is not showing the issue.   * Rebooting has not helped. (this problem has been ongoing for about 6 months)   * Uptime is about 3 months. The box is "always on", running a PBX (asterisk).   * Right now, the hwclock matches the software clock exactly - 0.000000 seconds   * I have not been able to find any cron jobs that reads the hardware clock.   * There is no load-related pattern (though the load is quite low anyway).    * It happens during the day and night.    * It does not happen at regular intervals. Of the ones in the last 3 months, half have happened in the last 9 days.   * This is not "drift" - 99% of the time, it is within a tiny fraction of a second, then from one minute to the next, it jumps EXACTLY 300 seconds, backwards. So, one minute it might say it's 3:07:03, matching my other computer to within 1 microsecond, 60 seconds later, it says 3:04:03.   * I can find nothing in the logs.


title: Windows 7 to Linux: install without CD/DVD or USB drive

text: Update Sorry, Question has multiple parts see below for details: I have been using Windows for many years and only used Linux from the command line, but want to shift after realizing Windows is sloowww. Following http://mightydreams.blogspot.in/2007/09/i-am-describing-here-method- to-install.html and http://www.instantfundas.com/2007/08/install-any-linux- distro-directly-from.html Is there a better set of instructions? (I do not have a USB or CD/DVD) Have got "debian-7.0.0-amd64-DVD-1.iso" and disks 2 & 3 and renamed 1 to `d1.iso`. Step 2 says to copy `vmlinuz` and `initrd.gz` to the \C drive But I found these files in 3 places (I did a `7z.exe l -path-to-iso- >files.list`)               install.amd\gtk\vmlinuz     install.amd\vmlinuz (update plan on using this but stuck at grub see below)     install.amd\xen\vmlinuz And similarly:               install.amd\initrd.gz      install.amd\xen\initrd.gz     install.amd\gtk\initrd.gz Which one to use? * * * Stuck at grub ... Made the entry using bcdedit but it says grub is not valid. downloaded grub from the sourceforge site, copied it and pointed to it               bcdedit /create /d Linux /application  OSLOADER     bcdedit /set  {c1e718e7-3d90-11e1-a4c8-b5a356ae5e29} device partition=c:      bcdedit /set   {c1e718e7-3d90-11e1-a4c8-b5a356ae5e29}  path \grub\grub.exe          bcdedit -v      Gives me               Windows Boot Manager     --------------------     identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795}     device                  partition=\Device\HarddiskVolume2     description             Windows Boot Manager     locale                  en-US     inherit                 {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}     default                 {c1e718e2-3d90-11e1-a4c8-b5a356ae5e29}     resumeobject            {c1e718e1-3d90-11e1-a4c8-b5a356ae5e29}     displayorder            {c1e718e2-3d90-11e1-a4c8-b5a356ae5e29}                 {c1e718e7-3d90-11e1-a4c8-b5a356ae5e29}     toolsdisplayorder       {b2721d73-1db4-4c62-bf78-c548a880142d}     timeout                 30          Windows Boot Loader     -------------------     identifier              {c1e718e2-3d90-11e1-a4c8-b5a356ae5e29}     device                  partition=C:     path                    \Windows\system32\winload.exe     description             Windows 7     locale                  en-US     inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}     recoverysequence        {c1e718e3-3d90-11e1-a4c8-b5a356ae5e29}     recoveryenabled         Yes     osdevice                partition=C:     systemroot              \Windows     resumeobject            {c1e718e1-3d90-11e1-a4c8-b5a356ae5e29}     nx                      OptIn          Windows Boot Loader     -------------------     identifier              {c1e718e7-3d90-11e1-a4c8-b5a356ae5e29}     device                  partition=C:     path                    \grub\grub.exe     description             Linux


title: Fonts of some applications get confused

text: I am running Debian Testing with LXDE. After some time of work, some applications begin to show confused fonts, as shown in the following screenshot (the pdf specific area is good): ![enter image description here](http://i.stack.imgur.com/83ac8.png) This happens with `evince` and with notification (sent from `wicd`, `clementine`, etc., I suppose through `notify-send`). Cannot say what other applications show the problem, but almost all other applications work good, for example `iceweasel` (firefox), `icedove` (thunderbird), `xchat`, `lxterminal`, etc. How to diagnose the problem?


title: Where is 'kernel panic' used?

text: Is the name kernel panic being used outside of Linux-based systems?


title: Enable .Net 4 Mono on OpenSuse

text: I have an OpenSuse Linux server and want to run an ASP.net web project. I have installed the `apache2` module `mod-mono`, but when I try to access the ASP web pages it looks as if it is attempting to use .Net 2 when the project is built under .Net 4. How can I change it to use .Net 4? Thanks for any help you can provide.


title: truncating file names

text: I have a folder that has a number of files all of a similar form as:               Dropkick Murphys - 01 - Walk Away.mp3     Dropkick Murphys - 02 - Workers Song.mp3      And so forth... I want to convert them all so that they appear as:               01 - Walk Away.mp3     02 - Workers Song.mp3      How can I do this?


title: What is the meaning “MAC MISSMATCH”?

text: I have every day in the log the few lines start with:               MAC MISSMATCH:IN=vlanXX OUT= MAC=ff:ff:ff:ff:ff:ff:bc:ae:c5:da:70:a6:08:00:45:00:00:4e SRC=xx.xx.xx.xx DST=xx.xx.255.255 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=23172 PROTO=UDP SPT=137 DPT=137 LEN=58      I know what this is the line written firewalls (netfilter). But what exactly does - "MAC MISSMATCH"?


title: Moving through history of commands on command line?

text: I used to use `Up`/`Down` to move through the history of commands. Then, a few days later it changed to `Ctrl`-`p`/`Ctrl`-`n`. Now this also doesn't work to move through the history of commands entered. How can I view all these settings or change it? I tried to see the terminal setting by giving the command `stty` but it was of no help. I searched through Google and found something called `bindkey`. I hope I am moving in the right direction. I am not the root user, anyway I would like to know more about this even if could do nothing about it. **KORN SHELL**               **OS Info :**     rcihp145 :/home/msingh2> uname -a     HP-UX rcihp145 B.11.23 U 9000/800 3683851961 unlimited-user license


title: Understanding character device (or character special) files

text: I am trying to understand character special files. From wikipedia, I understand that these files "provide an interface" for devices that transmit data one character at a time. My understanding is that the system somehow calls the character device instead of calling the device driver directly. But how does the file provide this interface? Is it an executable that translates the system call? Can someone explain what's up.


title: How may I distinguish encryption algorithm of htpasswd?

text: I have an apache web server running on Debian Linux and I secure a certain directory with htaccess. I have no history or knowledge how the .htpasswd file was created. Apache documentations says that crypt() encryption was used to encrypt passwords until version 2.2.17 and MD5 encryption is used since 2.2.18. How may I distinguish which encryption my .htpasswd file uses?


title: error using "du" command

text: I am on the university machine trying to estimate the disk usage I have on my space I do               du -csh ./      from the begining of my account, but an error is given that ./Yesterday/Yesterday is not a device, so I do               du -csh --exclude="Yes*" ./      and the error is stopped. But is there a more elegant way, and why is this error emerging? I can image how the Yesterday of Yesterday gets removed but whats the concepts behind the error. Best, 1) **using stat:**               [ratz]s0128943: stat Yesterday      File: `Yesterday'      Size: 12288 Blocks: 24 IO Block: 4096 directory      Device: 1dh/29d      Inode: 714342402      Links: 90 Access: (0745/drwxr--r-x)      Uid: (35559/s0128943)      Gid: (28065/ UNKNOWN)      Access: 2010-10-15 13:06:07.000000000 +0100      Modify: 2010-10-15 13:06:07.000000000 +0100      Change: 2010-10-15 13:06:07.000000000 +0100      2) **using stat on Yesterday/Yesterday**               stat ./Yesterday/Yesterday      stat: cannot stat `./Yesterday/Yesterday': No such device       3) **using uname for details**               [ratz]s0128943: uname -srv      Linux 2.6.18-194.3.1.el5.inf.1 #1 SMP Fri May 21 12:59:58 BST 2010       4) **using df on Yesterday/**               [ratz]s0128943: df Yesterday/     Filesystem           1K-blocks      Used Available Use% Mounted on     AFS                    9000000         0   9000000   0% /afs      5) **using df on Yesterday/Yesterday**               df Yesterday/Yesterday      df: `Yesterday/Yesterday': No such device      6) `mount | grep Yesterday` produces nothing


title: How to run “sudo apt-get update” through proxy in commandline?

text: In my office I want to update and download through `wget` and here they are using a proxy. How can I get `wget` to use the proxy from the command-line?


title: Mangled history

text: In gui mode, when a user has more than one terminal open, how do the terminals rewrite the history file of that user? the reason I ask is because, it is quite possible that in each of the terminals the user ends up executing different commands. So, does the history file end up saving the commands from all the terminals or only from the first one to be opened? Or is there some other kind of scheme that is employed to tackle this situation?


title: How does cached memory work for executables?

text: I always understood cached memory in Linux (as in free -m) as pages of memory that can be reused if they are needed again, or quickly freed if more memory is needed by new applications (I found this article to be helpful a few years ago). It seems that both executables (e.g., a program like thunderbird) and data (e.g., the content of a log file) can be cached. In fact, I don't think there is a distinction between text and executable files on *nix. I can see how it could work for data that does not change much (e.g., a text file), but how does it work for programs that are dynamic by nature? Surely, the cached memory cannot restore objects that were dynamically allocated? Is it only the bytecode (or instructions in the case of scripts) that is cached then? **EDIT 1** By cached memory, I mean the memory under the column "cached" when I run "free":               $ free -m                  total       used       free     shared    buffers     cached     Mem:          7985       6650       1334          0        150       3201     -/+ buffers/cache:       3298       4686     Swap:        13178          2      13176      **EDIT 2** Thanks to ls-lrt who gave me the hint I was missing. As this response on SE clearly mentions (should have searched there first), "The cached memory is the **disk cache** used by the VFS". This means that for executables, only the instructions (bytecode, script lines, etc.) are represented under this column and it has nothing to do with things that are dynamically allocated. I was under the impression that entire pages of memory (including dynamically created objects) were "cached". **EDIT 3** Nice examples about using the disk cache.


title: How should I deal with Fedora's short life cycle?

text: I have been using Fedora as my primary distribution since very long. One thing that _"bothers"_ me is its relatively short life cycle. I install its latest release, restore my backup, customize the applications, take a sigh of relief but by then the new release is just around the corner. > Fedora has a comparatively short life cycle: version X is maintained until > one month after version X+2 is released. With 6 months between releases, the > maintenance period is a very short 13 months for each version. Wikipedia Once I used pre-upgrade when moving from Fedora 9 to 10. It didn't work smoothly. The new upgraded Fedora was using the old kernel images of Fedora 9. Took me long to figure it out and I had to use live usb to fix it. Since then I decided not to use `pre-upgrade` or `Upgrade an existing installation` option. I had some hiccups with applications too. Using `fresh install` seems safer. But now I have to backup all data, along with my scripts and rc files and restore it again. This takes time along with installing apps that are not installed by default and removing not-required apps. Main problem is customization settings of each application. From Firefox only, I would have to export saved passwords, bookmarks, saved sessions, preferences of different extensions, etc. Some other applications do not provide option of save/export settings at all. So I have to configure each one manually. All in all, upgrading to latest release takes time, even longer if my net connection goes down for some reason. Each time I upgrade, I cannot take it out my mind that within few months a new release will be knocking my door, and I will have to repeat the whole exercise again.   1. What could be a painless and easy procedure to take backups of all data and to restore it? I would prefer a command line solution.   2. How can I preserve settings of applications, if they do not provide an option to export settings?   3. If you are Fedora user, what do you do to keep up with its frequent releases?   4. How can I make this whole procedure faster and less painful? Its the amount of time and efforts that an upgrade takes altogether which made me post this question. How can I make my life easier? Any help, suggestions and ideas would be greatly appreciated. Thanks for your time.


title: Mixed-source drivers for Linux

text: I am making a research on drivers for Linux that may integrate both open and proprietary source code. I am very new to to the field of driver research and not sure how to look for a comprehensive list of such drivers. Any help is appreciated. Thanks