title: Hyperthread and processors Clock, Size, and Capacity

text: When I enable hyperthreading, CPU size and capacity decrease to about half the non-hyperthreaded value. Since most of my processes use only two cores, should I disable hyperthreading?               lshw -C processor (cpu:0 and cpu:1 show the same results)      Hyperthread ON               *-cpu:0                           description: CPU          product: Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz          vendor: Intel Corp.          physical id: 5          bus info: cpu@0          version: Intel(R) Xeon(R) CPU X5690 @ 3.47GHz          slot: CPU0 PROCESSOR          size: 1596MHz          capacity: 1596MHz          width: 64 bits          clock: 2105MHz          capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb tpr_shadow vnmi flexpriority ept vpid cpufreq          configuration: cores=6 enabledcores=6 threads=12        Hyperthread OFF               *-cpu:0                           description: CPU          product: Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz          vendor: Intel Corp.          physical id: 5          bus info: cpu@0          version: Intel(R) Xeon(R) CPU X5690 @ 3.47GHz          slot: CPU0 PROCESSOR          size: 3459MHz          capacity: 3459MHz          width: 64 bits          clock: 2105MHz          capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb tpr_shadow vnmi flexpriority ept vpid cpufreq          configuration: cores=6 enabledcores=6 threads=6


I've installed `jailkit` on `Ubuntu 12.04` and I have set up a user's shell to `/bin/bash` \- but when it is invoked it runs `/etc/bash.bashrc` instead of `/etc/profile` If you haven't used `jailkit` before here's the gist of it:   1. A "jailed" version of the system root is created somewhere, like /home/jail   2. Jailed users home directories are moved inside that folder like /home/jail/home/testuser   3. Relavant configuration files are copied to /home/jail/etc/ - including a limited /etc/passwd   4. Programs that you want to allow access to are copied to the corresponding directories, like /bin/bash   5. When a jailed user logs in they are chrooted to /etc/jail/ and can't see any files above that So I have a `testuser` who has an entry in `/etc/passwd` like this:               testuser:x:1002:1003::/home/jail/./home/testuser:/usr/sbin/jk_chrootsh      In the file `/home/jail/etc/passwd` there is an entry like:               testuser:1001:1003::/home/testuser:/bin/bash      I've read though the `bash(1)` and so I think the problem is that bash thinks it is not being invoked as a login shell: > When bash is invoked as an interactive login shell, or as a non-interactive > shell with the --login option, it first reads and executes commands from the > file /etc/profile, if that file exists. I get that `bash` is actually being invoked by `/usr/sbin/jk_chrootsh` but I don't understand how `bash` is determining what type of shell it is, and what set of startup files it should run. I'd like to see if I can troubleshoot this - but I don't understand: ## How does bash know how it is being invoked? ps: I also looked into `login(1)` without much luck.


title: How to disable DHCP (static IP)?

text: If I want to set my Slackware machine to have a static IP assigned from the router, how can I do so? I assume I have to disable DHCP then edit something to set the requested IP, but I'm not sure where. (I don't have a GUI)


title: “error: no such device” at boot in Ubuntu Server 11.10 with Raid1

text: I have a configuration of 4 HDD's as Raid1 2 pairs of 2 HDD's. First Raid1 pair is for system, so I just made an 40GB space for swap, and the rest of it for the root, the second pair of Raid1 is for logical use. So, in final I have: **First pair:**   1. Disk:     * 40GB swap     * 960GB / ext4 raid   2. Disk:     * 40GB swap     * 960GB / ext4 raid **Second pair:**   3. Disk:     * 1.0 TB ext4 raid   4. Disk:     * 1.0 TB ext4 raid After the system installed, at boot up I see a strange error for about 5-6 seconds:               error: no such device: c3b8763c-4623-4fe1-9096-3aadef5cc116     Press any key to continue...      So the question is, what I did wrong? The output of `ls -l /dev/disk/by-uuid` is:               total 0     lrwxrwxrwx 1 root root 9 2012-04-24 15:38 c3b8763c-4623-4fe1-9096-    3aadef5cc116 -> ../../md0      The output of fstab: ![fstab](http://i.stack.imgur.com/jBXvV.png) The output of mdadm: ![mdadm](http://i.stack.imgur.com/G8A41.png)


title: stopping harddisk spin-down on Asus EEE 1015PX (and other eee's as well)

text: I have an Asus EEE 1015PX netbook. It runs Linux (debian) without any powersavings enabled. E.g. no harddisk idle/spin-down tooling is running. Now constantly the harddisk spins down after it has been idle for half a minute or so. I can disable this with `hdparm -B 255 /dev/sda` but this only works up to the next reboot. I tried using `hdparm -K 1 /dev/sda` to make this setting permanent but this gives an input/output error. This seems to be an issue with other EEE systems as well: my mother has an EEE Shell (a pink one) running windows 7 and that one has a down-spinning drive as well. My question now is: how can I make it stop doing this? It makes the system very unresponsive and opening terminal/su to root/hdparm/exit shell every time I reboot the laptop (or had it suspend for a while by closing the lid) is annoying as hell.


title: error while using apt-get install for any package

text: I have tried to install texlive-full with `apt-get` and the installation stopped due to some errors. Later I removed all folders and files related to texlive, texmf manually. Since then I get the following error while trying to use apt-get install for any package. I have tried `apt-get clean`, `aptitude clean` etc. Can someone please help me. I think it is the `dpkg` which is giving the errors. I'm using Linux Mint and am new to using Linux. I have pasted the error message below:               Setting up tex-common (3.13) ...     find: `/etc/texmf/texmf.d': No such file or directory     update-language-dat: cannot read /etc/texmf/hyphen.d/00tex.cnf     update-language-dat: if it was removed by accident, it has to be reinstalled with     update-language-dat:   t=$(mktemp -d); cd $t; apt-get download tex-common ; dpkg -i --force-confmiss tex-common*.deb     dpkg: error processing tex-common (--configure):      subprocess installed post-installation script returned error exit status 1     dpkg: dependency problems prevent configuration of latex-sanskrit:      latex-sanskrit depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing latex-sanskrit (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of tex-gyre:      tex-gyre depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing tex-gyre (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-latex-base:      texlive-latex-base depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-latex-base (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of asymptote:      asymptote depends on texlive-latex-base; however:       Package texlive-latex-base is not configured yet.      asymptote depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing asymptote (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of context:      context depends on tex-gyre; however:       Package tex-gyre is not configured yet.      context depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing context (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of context-modules:      context-modules depends on context (>> 2011); however:       Package context is not configured yet.      context-modules depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing context-modules (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of ipe:      ipe depends on texlive-latex-base; however:       Package texlive-latex-base is not configured yet.          dpkg: error processing ipe (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-latex-recommended:      texlive-latex-recommended depends on texlive-latex-base (>= 2012.20120516); however:       Package texlive-latex-base is not configured yet.      texlive-latex-recommended depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-latex-recommended (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of latex-xcolor:      latex-xcolor depends on texlive-latex-recommended; however:       Package texlive-latex-recommended is not configured yet.      latex-xcolor depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing latex-xcolor (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of pgf:      pgf depends on tex-common (>= 2.00); however:       Package tex-common is not configured yet.      pgf depends on texlive-latex-recommended; however:       Package texlive-latex-recommended is not configured yet.      pgf depends on latex-xcolor (>= 2.00-1); however:       Package latex-xcolor is not configured yet.          dpkg: error processing pgf (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of latex-beamer:      latex-beamer depends on tex-common (>= 3); however:       Package tex-common is not configured yet.      latex-beamer depends on pgf (>= 1.00-1); however:       Package pgf is not configured yet.      latex-beamer depends on latex-xcolor (>= 2.00-1); however:       Package latex-xcolor is not configured yet.      latex-beamer depends on texlive-latex-base; however:       Package texlive-latex-base is not configured yet.          dpkg: error processing latex-beamer (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of latex-cjk-chinese-arphic-bkai00mp:      latex-cjk-chinese-arphic-bkai00mp depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing latex-cjk-chinese-arphic-bkai00mp (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of latex-cjk-chinese-arphic-bsmi00lp:      latex-cjk-chinese-arphic-bsmi00lp depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing latex-cjk-chinese-arphic-bsmi00lp (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of latex-cjk-chinese-arphic-gbsn00lp:      latex-cjk-chinese-arphic-gbsn00lp depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing latex-cjk-chinese-arphic-gbsn00lp (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of latex-cjk-chinese-arphic-gkai00mp:      latex-cjk-chinese-arphic-gkai00mp depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing latex-cjk-chinese-arphic-gkai00mp (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of latex-cjk-japanese-wadalab:      latex-cjk-japanese-wadalab depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing latex-cjk-japanese-wadalab (--configure):      dependency problems - leaving unconfigured     Setting up m-tx (0.60d-5) ...     warning: kpathsea: configuration file texmf.cnf not found in these directories: /etc/texmf/web2c:/usr/share/texlive/texmf/web2c:/usr/share/texlive/texmf-dist/web2c:/usr/local/share/texmf/web2c.     /var/lib/dpkg/info/m-tx.postinst: 17: /var/lib/dpkg/info/m-tx.postinst: $TEXMFMAIN/web2c/mktexupd: not found     dpkg: error processing m-tx (--configure):      subprocess installed post-installation script returned error exit status 127     dpkg: dependency problems prevent configuration of musixtex:      musixtex depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing musixtex (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of prosper:      prosper depends on texlive-latex-base; however:       Package texlive-latex-base is not configured yet.      prosper depends on texlive-latex-recommended; however:       Package texlive-latex-recommended is not configured yet.      prosper depends on tex-common (>= 1.10); however:       Package tex-common is not configured yet.          dpkg: error processing prosper (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-ar:      texlive-doc-ar depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-ar (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-bg:      texlive-doc-bg depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-bg (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-cs+sk:      texlive-doc-cs+sk depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-cs+sk (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-de:      texlive-doc-de depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-de (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-en:      texlive-doc-en depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-en (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-es:      texlive-doc-es depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-es (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-fi:      texlive-doc-fi depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-fi (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-fr:      texlive-doc-fr depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-fr (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-it:      texlive-doc-it depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-it (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-ja:      texlive-doc-ja depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-ja (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-ko:      texlive-doc-ko depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-ko (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-mn:      texlive-doc-mn depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-mn (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-nl:      texlive-doc-nl depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-nl (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-pl:      texlive-doc-pl depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-pl (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-pt:      texlive-doc-pt depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-pt (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-rs:      texlive-doc-rs depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-rs (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-ru:      texlive-doc-ru depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-ru (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-si:      texlive-doc-si depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-si (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-th:      texlive-doc-th depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-th (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-tr:      texlive-doc-tr depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-tr (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-uk:      texlive-doc-uk depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-uk (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-vi:      texlive-doc-vi depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-vi (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-doc-zh:      texlive-doc-zh depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-doc-zh (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-fonts-extra:      texlive-fonts-extra depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-fonts-extra (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-fonts-extra-doc:      texlive-fonts-extra-doc depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-fonts-extra-doc (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-fonts-recommended:      texlive-fonts-recommended depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-fonts-recommended (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-fonts-recommended-doc:      texlive-fonts-recommended-doc depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-fonts-recommended-doc (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-generic-extra:      texlive-generic-extra depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-generic-extra (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-humanities-doc:      texlive-humanities-doc depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-humanities-doc (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-lang-african:      texlive-lang-african depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-lang-african (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of texlive-lang-arabic:      texlive-lang-arabic depends on tex-common (>= 3); however:       Package tex-common is not configured yet.          dpkg: error processing texlive-lang-arabic (--configure):      dependency problems - leaving unconfigured     dpkg: too many errors, stopping     Errors were encountered while processing:      tex-common      latex-sanskrit      tex-gyre      texlive-latex-base      asymptote      context      context-modules      ipe      texlive-latex-recommended      latex-xcolor      pgf      latex-beamer      latex-cjk-chinese-arphic-bkai00mp      latex-cjk-chinese-arphic-bsmi00lp      latex-cjk-chinese-arphic-gbsn00lp      latex-cjk-chinese-arphic-gkai00mp      latex-cjk-japanese-wadalab      m-tx      musixtex      prosper      texlive-doc-ar      texlive-doc-bg      texlive-doc-cs+sk      texlive-doc-de      texlive-doc-en      texlive-doc-es      texlive-doc-fi      texlive-doc-fr      texlive-doc-it      texlive-doc-ja      texlive-doc-ko      texlive-doc-mn      texlive-doc-nl      texlive-doc-pl      texlive-doc-pt      texlive-doc-rs      texlive-doc-ru      texlive-doc-si      texlive-doc-th      texlive-doc-tr      texlive-doc-uk      texlive-doc-vi      texlive-doc-zh      texlive-fonts-extra      texlive-fonts-extra-doc      texlive-fonts-recommended      texlive-fonts-recommended-doc      texlive-generic-extra      texlive-humanities-doc      texlive-lang-african      texlive-lang-arabic     Processing was halted because there were too many errors.     E: Sub-process /usr/bin/dpkg returned an error code (1)


title: How to properly set up 2 network interfaces in CentOS (running in VirtualBox)?

text: I have a VirtualBox machine running CentOS 6.5. I've created 2 network adapters for it in VirtualBox's networking settings for the machine. The first is NAT which I want the guest to use to connect to the Internet and the second I set to Host-only which I will use to SSH and access web server from the host computer. This tutorial over at the VirtualBox forums is what I want to achieve but I can't seem to find the `/etc/network/interfaces` file on CentOS 6.5 so I presume configuration is done differently. Having setup both NAT and Host-only adapters, I started the VM and did an `ip addr show` and I have 2 interfaces, `eth0` and `eth2` (I don't know why `eth1` was somehow skipped). So I configure both `ifcfg-ethX` files in `/etc/sysconfig/network-scripts`, setting `eth0` to be DHCP (for NAT) and `eth2` to be static IP (for Host-only). For `eth0`, `ONBOOT=yes` while for `eth2`, `ONBOOT=no`. With this setup I can `ping` the Internet i.e. `ping -c 3 www.google.com` and it gets a response so I know I can connect to the Internet (while `eth2` is down). Next, I `ifup eth2`. From the host machine, I SSH using the static IP I've set and I can connect without issue. But when I do `ping -c www.google.com` this time around, it fails and I know I've lost my connection to the Internet even if `eth0` is still up. Doing a `route -n` shows me a tabular output with `eth2` taking up the first and last rows while `eth0` is in between (sorry I can't post the actual output because I deleted the VM out of frustration...). I've created a new CentOS VM and would like to proceed with the same set-up. My networking-fu is close to non-existent so I'm a n00b at it. I would like some tips on how to do it properly (i.e. how to set the NAT adapter to use `eth0` and set the Host-only adapter to use `eth1` and not `eth2`, how to make `eth0` still usable even if `eth1`/`eth2` is up and running). **Update** So I've got the new VM up and running and it seems to work now if I have the first adapter set to host-only and the second adapter set to NAT. It's set up like so: _VirtualBox network settings_   * Network adapter 1: Host-only (`vboxnet0` IP address is set to `10.3.0.1`, network mask `255.255.255.0` and DHCP is off)   * Network adapter 2: NAT (DHCP) _CentOS VM`/etc/sysconfig/network-scripts/ifcfg-ethX` settings_               # ifcfg-eth0     DEVICE=eth0     HWADDR=08:00:27:EC:6C:B9     TYPE=Ethernet     UUID=1339bc30-...     ONBOOT=yes     NM_CONTROLLED=yes     BOOTPROTO=static     DHCPCLASS=     IPADDR=10.3.0.100     NETMASK=255.255.255.0     GATEWAY=10.3.0.1          # ifcfg-eth2     DEVICE=eth2     HWADDR=08:00:27:EB:73:BA     TYPE=Ethernet     UUID=1339bc30-...     ONBOOT=yes     NM_CONTROLLED=yes     BOOTPROTO=dhcp      _Result of`ip route`_               10.0.3.0/24  dev  eth2  proto  kernel  scope  link  src  10.0.3.15     10.3.0.0/24  dev  eth0  proto  kernel  scope  link  src  10.3.0.100     169.254.0.0/16  dev  eth0  scope  link  metric  1002     169.254.0.0/16  dev  eth2  scope  link  metric  1003     default via 10.0.3.2 dev eth2      _Result of`ip addr`_               1:  lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00:00          inet 127.0.0.1/8 scope host lo          inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2:  eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000          link/ether 08:00:27:ec:6c:b9 brd ff:ff:ff:ff:ff:ff          inet 10.3.0.100/24 brd 10.3.0.255 scope global eth0          inet6 fe80::a00:27ff:feec:6cb9/64 scope link             valid_lft forever preferred_lft forever     3:  eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000          link/ether 08:00:27:eb:73:ba brd ff:ff:ff:ff:ff:ff          inet 10.0.0.15/24 brd 10.0.3.255 scope global eth2          inet6 fe80::a00:27ff:feeb:73ba/64 scope link             valid_lft forever preferred_lft forever


title: Getting "Bad file descriptor" error during tar

text: I'm trying to tar a dir with this command "tar -cpSWf myfile.tar workdir; gzip myfile.tar", but I get this error for some of the files in workdir dir.                tar: my/sub/dir/file1.oa: Cannot seek to 1536: Bad file descriptor      I run the same command on other dir and there's no such error. Is it because the .oa files are corrupted, or the disk is failing? Is this a common issue when using tar? Is there any way to repair this error?


title: Attaching two network cards two different drivers

text: I have an Ubuntu 12.04 server that has two 10 Gb ethernet cards that are using the `ixgbe` driver. I'm installing the PF_RING DNA drivers for these cards (what that is isn't important). I want interface `eth0` to use the original Linux `ixgbe` driver and I want interface `eth1` to use the new PF_RING `ixgbe` driver. The first issue is that both drivers have the same name. I need to load both of them with `insmod ixgbe.ko`, but I can't since they have the same name. Can I load one of them under a different name, like `ixgbe-dna`? I can recompile the kernel modules if that's the only option. Once I have two drivers `ixgbe` and `ixgbe-dna` loaded, how can I specify that `eth0` will use `ixgbe` and `eth1` will use `ixgbe-dna`?


title: Realtek USB wireless card can't get wireless interface for Linux

text: I bought a USB wireless card yesterday. It is said to have a RTL8192CU chip inside. However when I tried it under my Gentoo linux, the modules won't load automatically. Even if I load rtl8192cu manually, ifconfig -a won't show any new interface. Then I tried the driver from both the accompanying cd-rom(a bit out of date) and Reatek official site(up to kernel 3.9, located at http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PFid=48&Level=5&Conn=4&ProdID=277&DownTypeID=3&GetDown=false&Downloads=true) and manually compiled module 8192cu and loaded it, still can't get any new interface. lsusb showed the device id as follows: 0bda:818b without any more useful information(even without concrete model) I also tried it on my friend's Archlinux and still no success. However under Windows 7 it does work and the signal strength is awesome. If I can't get it to work, maybe I should ask for a refund, as the seller promised it would work under Linux...


title: Fastest hashing method under OpenWRT?

text: I frequently verify the file integrity on my OpenWrt router by hashing the files. I didn't want to use `sha256sum`, so I decided to use the faster `md5sum`. Is there anything even faster available?


title: How can I get AD authentication without joining a domain?

text: In order for me to configure `Samba` to use the `Windows Active Directory` authentication, do I need to join a domain? Can I do that without joining the domain?


title: can I use 2 mount points for 2 partitions from external HDD?

text: I have a **2 TB** external HDD which I connect to the Ubuntu 8.10 system. However, after connecting the external HDD, I created just a single partition and because of that I could use only **750 GB** out of the available **2 TB**. I had posted a question earlier regarding the same over here. Now, I realized I could just create 2 primary partitions each with **1 TB** in size and apparently each primary partition would be recognized as **750 GB** each and thus making the total avaialble space as **1.5 TB**. Now, my question is, can I use 2 mount points for the 2 primary partitions available from the external hard disk at the same time? Something like below.               mount /dev/sdc1 /media/backup1     mount /dev/sdc2 /media/backup2


title: Openbox 3 theme: How to set color for menu background and scroll bars

text: I want to create a dark theme. But I have failed to see how I would change the background color of the menu row and the colors of the scroll bars even though I have tried looking at the relevant Wiki page. Here is an image indicating what I want to change: ![enter image description here](http://i.stack.imgur.com/kAtX3.png)


title: Variable scope in while-read-loop on Solaris

text: Could someone please explain to me why my while loop seems to have an internal scope? I've seen multiple explanations online but they all have to do with pipes. My code has none. The code:                 #!/bin/sh     while read line     do     echo "File contents: $line"     echo;     if [ 1=1 ]; then       test1=bob;     fi     echo "While scope:"     echo "  test1: $test1"     done < test.txt     if [ 1=1 ]; then       test2=test2;     fi     echo;     echo "Script scope: ";     echo "  test1: $test1";     echo "  test2: $test2";      The output:                 File contents: In the file          While scope:       test1: bob          Script scope:       test1:        test2: test2


title: Samba non-root user can't write to share

text: My problem is non-root users can't write to the share when it's mounted. But they can when it's not mounted. The group changes from users to root when I mount the share. And I can't figure out how force the group to remain as 'users' when the share mounts. The idea is create a Linux and Samba user account, add the account to the group users. Anyone in the group users can read and write to the share. I've been googling this all day and I've tried modifying, `fstab`, and `smb.conf`files. I've read about Samba share permissions, and Linux file system permissions. I've used the `id username` command to ensure the user account is in the users group, etc. Would someone throw me a bone and give me a hint on what I should be looking at to solve this problem? I really don't understand why the group changes when the share is mounted. **NOTE:** I'm using this as a guide. http://www.howtoforge.com/ubuntu-12.10-samba-standalone-server-with-tdbsam- backend Here are the permissions when it's mounted:               root@xxxxx:/etc/samba# ls -al /home/shares/export     total 1     drwxr-xr-x 1 root root     0 Jun 17  2014 .     drwxr-xr-x 3 root users 4096 Jun  9 12:24 ..     -rwxr-xr-x 1 root root     0 Jun 17 16:15 test1.txt     root@xxxxx:/etc/samba#      Here they are when it's not mounted.               root@xxxxx:/etc/samba# ls -al /home/shares/export     total 3     drwxrwxrwx 2 root users 4096 Jun 17 16:17 .     drwxr-xr-x 3 root users 4096 Jun  9 12:24 ..     -rwxrwxrwx 1 root users    0 Jun  9 16:34 test5555.txt      Snip from fstab. > //xxxserv/xxxxx_export /home/shares/export cifs > nocase,username=xxxxx_export,password=xxxxxxx,iocharset=utf8,sec=ntlm 0 0 Snip from smb.conf               [export]      comment = export      path = /home/shares/export      valid users = @users      force group = users      create mask = 0660      directory mask = 0771      writable = yes


title: How do I limit local user file system access? What is the best method?

text: I have a Linux installation with a default user and an admin user (and root). On startup, the default user is automatically logged in and a particular application is launched. My intention is to prevent the default user from performing any actions that aren't part of the running application. One of the applications actions is to allow some administrative functions which I am thinking would be performed via sudo-ing or ssh-ing as the admin user. Is it possible to limit the default user the way that I'm describing? I've already setup groups to allow the default user some write access to a database and I've limited their access to the terminal. I've researched chroot-ing and sudo based permissions but I'm not sure which (if any) is the more correct method of permission management or if either is even necessary. Regarding sudo versus ssh for admin access, which is better (or is something else better)? I know there is a lot of Linux permission information out there but I'm having trouble collating it all into a solution that fits this particular problem.


title: Login box is not showing (Debian 6)

text: I have a Debian 6 running in a VM for two weeks now. Today I noticed Debian is not showing the login box anymore. Instead, it shows an information box that when I click on it changes between "Debian" and "6.0.5". The power button is not working neither. I'm newbie with Debian and I need patience and step by step instructions ;) Thanks! ![enter image description here](http://i.stack.imgur.com/V2HXt.jpg)


title: How can a log program continue to log to a deleted file?

text: From the Unix Power Tools, 3rd Edition: **_Instead of Removing a File, Empty It_** section: > If an active process has the file open (not uncommon for log files), > removing the file and creating a new one will not affect the logging > program; those messages **will just keep going to the file that’s no longer > linked**. Emptying the file doesn’t break the association, and so it clears > the file without affecting the logging program. ( **emphasis mine** ) I don't quite get why a log program will continue to log to a delete file? Is it because the file descriptor entry not getting removed from the process table?


title: Some packages in mint not updating

text: I'm new to Linux Mint 12 and I can't tell for sure, but I think I'm missing some updates. When I run update manager and it's fetching the list of packages to be updated, a bunch of packages list status: failed. And when I run sudo apt-get update, a couple packages say Hit but most are listed as Ign (which I assume stands for Ignored). I know that Mint purposely avoids installing some updates because they're not yet considered stable, but this looks like it's not even fetching the list of available updates. Specifically I added the repository http://ppa.launchpad.net/jamesodhunt/bug-829980/ubuntu for a particular bug- fix which didn't seem to work, I think because the repository is being ignored. I can't seem to find any references anywhere to other people having the same problem. Everything I've found where people are having trouble fetching packages for updates, they seem to be getting explicit error messages, but I don't see any.


title: How to reload udev rules without reboot?

text: How should one reload udev rules, so that newly created one can function? I'm running Arch Linux, and I don't have a `udevstart` command here. Also checked `/etc/rc.d`, no udev service there.


title: How to configure Linux to use DHCP or static IP depending on presence/absence of DHCP server?

text: I would like to configure a network interface to make use of DHCP if a DHCP server is present on the network during boot, but otherwise default to some default static IP address.


title: RVM install issues on a local user account

text: I'm running Ubuntu server               lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 11.10     Release:            11.10     Codename:       oneiric      When I try to install RVM for a local user I get the following:               bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )     mkdir: cannot create directory `/usr/local/rvm': Permission denied      What is the issues here? Ho


title: Two differently-versioned binary Debian packages from one source

text: I'm thinking about properly Debianizing a package, which contains two parts in one upstream tarball/git branch:   * Userspace binaries and libraries, version 1.5.0 (`foobard` binary package)   * Kernel module, version 0.8.5 (`foobar-dkms`) The problem is that versions differ. Is there any sane and correct way to build two differently-versioned binary packages from one source package in such case? If possible, I'd like something cleaner than creating two source packages, or versioning both packages as 1.5.0 (even though the module has proper `MODULE_VERSION` specified in source).


title: RAID 1 in linux

text: I'd like to setup RAID 1 with two drives in linux. I don't have a hardware RAID controller and don't want to buy one, so what is the best software RAID option for linux? Note: If it makes a difference, I'm running Gentoo.


title: How to swap columns in such a file?

text: I have a text file, each line is stored like this :               "Video or movie"    "parent"    "Media or entertainment"    "1" "1" "1" "0" "0"      I want to swap the columns 3 with 2, i.e.               "Video or movie"   "Media or entertainment"  "parent"   "1" "1" "1" "0" "0"      How to do it in linux in a shell script or any other scripting language? I just need a simplest and quickest way of doing it.


title: How do I get Knoppix to bypass checking the hard drive for itself?

text: I just installed Debian. Now when I try to boot Knoppix, it hangs on "Searching for Knoppix 7 in: /dev/sda6", which is the swap partition. Since Knoppix is choking on this, I'd like it to bypass searching the hard drive partitions for itself and instead boot from the USB directly. I'm hoping I can get Knoppix to boot using the "knoppix fromhd=" or "knoppix bootfrom=" options to specify the USB drive so that Knoppix skips checking the hard drive. But how can I find out what Knoppix is calling my USB drive so I can specify it instead of the hard drive? The reason I'm using Knoppix in the first place is that there's a problem with the GRUB installation with Debian, so I'm not able to boot from the hard drive to find out the name of the USB drive. **Update:** It turns out that for a live USB, you want **knoppix fromhd=** , not knoppix bootfrom, which is for when you want to point to an .iso. The USB drive was /dev/sdb, which I found out when Knoppix booted after about 20 minutes. The question still stands though: was there a way to find this out at boot?


title: Simulate empty STDIN to detached command

text: i want to detach command either with 'command &' in the end, or with 'nohup command &', but it stops right after detaching it. command is little specific, if it receives eof on input, it breaks so /dev/null as input will lead to end and solution that usualy works:               $ command < /dev/null > /dev/null 2>&1 &      not working... is there other device in unix/linux, that can replace /dev/null and behave like empty input, but not sending eof. (by the way, command is very useful multicasting tool emcast, I can try patching it my self, or find patched version for this purpose... but it seems that problem can be solved outside) I'm adding this EDIT to make my question more clear. I made this C program of 2 lines that works perfectly: program name is "donothing"               #include <unistd.h>     int main() {  while (1)  { sleep(10); } return 0; }      and it is what I am looking for, some device/program, that doing nothing, but leave its stdout open. Both ("command & ... disown" and "nohup command &") works.               $ donothing | mycommand >/dev/null &      $ disown %1      works well, so now question is only: what unix device/program behaves like my 'donothing'.


title: What does `avahi-dnsconfd` daemon?

text: I've installed **KDE** desktop, that depends on **avahi**. It has two daemons `avahi-daemon` and `avahi-dnsconfd`. In ArchLinux wiki there is no info about `avahi-dnsconfd`. I've tried Daemon and Avahi pages.


title: Inconsistent input redirection behavior

text: I wrote a 10000010-byte file (99010 rows of 100 consecutive `a`'s) named `big` for experimentation purposes. I then copied the entire text into my clipboard, ran `wc`, and pasted it into `stdin`. Next, I did a simple redirection that's supposed to have the exact same effect. But this is what I got:               $ wc[Enter]     [paste 99010 lines of garbage copied directly from `big']       99010   99010 10000010     $ wc < big        99010    99010 10000010      Notice the different field widths. My best guess is that the first result was printed with `"%7d %7d %7d"`, and the second with `"%8d %8d %8d"`. Can someone please explain how this is possible? I'm of the impression that, as far as `wc` is concerned, the input for the second experiment is coming from `stdin` as well (because the shell takes care of `< big`, so `wc` shouldn't even know that I typed that), so theoretically `wc` should have done the same exact thing twice, but it clearly did not. What am I not understanding about redirection? Edit: I don't think this really matters, but I did `$ cat big | xclip -selection clipboard` to copy the data into my clipboard, then I simply right- clicked in gnome-terminal and pasted it in. Just in case anyone wants to try this out on their computer.


title: Limit bandwidth SFTP user

text: Is there any possibility to limit the bandwidth of an SFTP user? My server has an upload of ~500kb/s and I don't want to 'spend' it all on one user


title: xmodmap equivalent in bash

text: I'm constantly on bash via ssh, on a computer that doesn't have X. In my computer I've switched the keyboards' Super and Alt keys with xmodmap. Is it possible to do it on the computer in which I log in? It's running Debian Lenny. Update: Is there an equivalent for **xev** too? I tried doing > loadkeys ~/.loadkeys where ~/.loadkeys contained: > keycode 133=0xffe9 > > keycode 64=0xffeb But it seems that loadkeys doesn't accept hexagesimal literals, since it fails with the message: > Couldnt get a file descriptor referring to the console > > KDGKBMODE: Bad file descriptor > > loadkeys: error reading keyboard mode I also tried > keycode 133=64 > > keycode 64=133 In which format should the new mapped key value (value in the right) be?


title: How to fix xdg-mime for text formats

text: My `xdg-mime` makes mistakes. It recognizes an .html file containing Java code as a C++ file. I don't quite know the internal mechanism of xdg (eg. how it determines filetype). And I want to know how to fix this problem by giving preference to judgement by filename extensions. Of course other solutions are welcome. And explanation of mechanisms of xdg-* is even more welcome.


title: How do I set the mysql server character set in FreeBSD 8.2?

text: My mysql server's current server character set is `latin1`. My server is started on startup via rc.conf setting `mysql_enable="YES"`. How to set my server to use `utf8` as the server character set?


title: Why is mouse freezing in FreeBSD 9.1 Gnome or Fluxbox?

text: I'm new to FreeBSD 9.1 and I wanted to install a desktop GUI environment. I first tried Gnome 2 since I am familiar with it. I appended the following lines to the /etc/rc.conf file:               hald_enable="YES"     dbus_enable="YES"     gnome_enable="YES"     gdm_enable="YES"      When typing `startx` for the first time, my mouse, keyboard and everything else worked fine. However, after restarting my PC, the mouse didn't work anymore. Keyboard worked fine. I searched around for solutions and people said that adding the following line to the /etc/rc.conf file               mouse_enable="YES"      or               moused_enable="YES"      worked for them. However, this didn't work for me. I then tried switching to Fluxbox just to check if that works. I appended the following lines to the /etc/rc.conf file:               hald_enable="YES"     dbus_enable="YES"      Again, when typing `startx` for the first time, my mouse and keyboard worked fine. However, after restarting my PC again the mouse worked just before starting X (in text mode). However, after starting X it doesn't work at all. Keyboard works fine. Does anyone have an idea what might be causing this kind of behavior and how to fix it?


title: How do I write a command in vim to run multiple commands?

text: I've written some commands that perform common functions by placing the following in my `.vimrc` files:               command! FixWhitespace %s/ \+$//g     command! FixCommas %s/,\S\@=/, /g      Now I'd like to create a 3rd command that runs both of these, but the following doesn't work:               command! Fix FixWhitespace|FixCommas      When I run `:Fix` from within `vim` I get the following message: > E488: Trailing characters: FixWhitespace|FixCommas I'm not sure how this error message relates to what I've done, but I'm obviously not doing something right! I'm using Vim 7.4.


title: How to create a driver for Linux from within Windows?

text: I found a wonderful tutorial on how to install my driver here but I quickly ran into a problem. Let me explain the problem i am facing. I want to install a Linux distro (still looking into different distros) on my machine. From my past painful experiences, I know that I need to install drivers separately for the wireless adapter to work. Yet in order to get the tools to convert my driver I need an internet connection. Sadly no other computer in my house has Linux on it for me to do this and since everyone in my house is scared that I'm going to break their computer (past experience makes this understandable) using a LiveCD is unheard of. I've come to the conclusion that I would most likely need to get Ndiswrapper on my Windows machine convert the driver from there and then store it in the drive somehow so I can access it later. Any ideas?


title: Installing wireless driver (realtek 8188CE) on Debian wheezy

text: I had a hard time installing the wireless driver for my debian. My debian was Sqeeze but soon after I realized Wheezy was the one to support my wireless adapter, realtek 8188CE,I upgraded to wheezy. Here is my `sources.list` file:               deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free     deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free          deb http://security.debian.org/ wheezy/updates main contrib non-free     deb-src http://security.debian.org/ wheezy/updates main contrib non-free      I followed the exact steps listed on the Debian wiki. At step 4, after I typed in iwconfig,there was no tag for wifi (shouldn't it be there?), I figured the wifi module was not loaded, but I didn't know how to check and add it Here is my printout:               clint@Thinkpad-W520:~$ lspci | grep -i wifi     03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE      802.11b/g/n WiFi Adapter (rev 01)      The `iwconfig` output:               lo no wireless extensions.          eth0 no wireless extensions.          pan0 no wireless extensions.


title: Redirect ALL packets from eth1 & eth2 through a SOCKS proxy

text: Is there a way to redirect all traffic, UDP and TCP, coming to and from eth1 and eth2 through a SOCKS proxy (Tor) which then passes it through eth0? eth0: Internet in - leads to the main router, then the cable modem eth1: A USB Ethernet port setup as a modem (I think that's the word I'm looking for, right?) eth2: A USB WiFi antenna setup as a WiFi hotspot Could I use something like iptables to directly route it through Tor or would I need an adapter like Privoxy?


title: Better way to kill all processes with a handle to some file

text: This kills every process with a handle to file /foo/bar (in bash):                lsof /foo/bar 2>&1 | grep "/foo/bar" | sed "s/  */\\t/g" | cut -f 2 | while read PID; do kill $PID; done      This does not seem like such an uncommon task that there wouldn't be an easier solution, so I'm wondering if there's something like `killall` or a switch to `kill` that I've missed which does the same.


title: In what sense does SATA "talk" SCSI? How much is shared between SCSI and ATA?

text: This is nothing new to me at least, that SATA actually "talks" SCSI, hence why these SATA devices show up as SCSI devices in Linux. A related question has been asked before, e.g. Why do my SATA devices show up under /proc/scsi/scsi? However what fails to be mentioned where I've seen this discussed before is exactly in what sense SATA relates to SCSI, and how they differ. I assume it is taken for granted that they differ on the physical layer, as they do not share compatible cables. However what about higher up on the stack? I am aware of how Linux represents SATA and even IDE disks on modern kernels as just SCSI to the SCSI subsystem. But what about the actual protocol that is used on the bus? I also know that ATAPI is an encapsulation for SCSI, but what about regular ATA? I've noticed that features from SCSI such as NCQ, FUA, DPO, etc (if I don't remember incorrectly) have been adopted from SCSI. But it is unclear how "much" of the SCSI command set is actually shared or similar. Do modern SATA devices with their ATA specification implement a subset of the SCSI command set, but encapsulated (as in ATAPI)? An identical set? A superset? Or perhaps only selected features are implemented as variants that are not directly identical? Where can I find some clear information on this, and especially how it relates to the Linux kernel? Some kind of tutorial for driver development would be nice, but even just an overview that doesn't completely skip over all the details would suffice. I am aware I can just read the actual specification, but that is again much too detailed, hard to find what you're really looking for, and just not realistic for me and probably most other users in the temporal sense.


title: vsftpd allow full access in selinux

text: When I try to alow full access to FTP, suing the `setsebool -P allow_ftpd_full_access 1` I am getting this error: libsemanage.get_home_dirs: insta homedir /var/www/html or its parent directory conflicts with a file context already specified in the policy. This usually indicates an incorrectly defined system account. If it is a system account please make sure its uid is less than 500 or its login shell is /sbin/nologin. I am very new to Linux and I have no idea how to proceed


title: Frozen Linux Recovery Without SysReq

text: RHEL system has run out of memory and is now frozen. The SysReq commands are not working, so I am not even sure that /proc/sys/kernel/sysrq is set to 1. Is there any other "safe" way I can reboot w/out power cycling?


title: How to debug csh scripts?

text: My lab uses csh scripts to run jobs. It is usually difficult for me to debug a shell script, so I'm wondering if there is a csh debugger I can use. I know there are some flags like `-x` or `-v` that can help, but because the script is kind of long, it would be better if I can set breakpoints on it. As I searched online, I found there is a debugger specifically for bash scripts that supports breakpoints, but I couldn't find one for csh scripts. Will the bash debugger work? Is there a csh-specific debugger I can use?


title: tmux: shared session, one user in a pane, another in another pane, two different cursors

text: I've decided to try tmux: have been reading the docs and googling around, trying to find a way to have two users sharing a session, each with a different cursor. However, giving 777 permissions to the socket, or creating a group, `chgrp`ing the socket and adding both users to it, seems to let that same socket be used to share a session with only one cursor: both users can write, but always in the same cursor position. Right now both users are in the same home server over ssh, and the idea is to be able to have:   * A terminal in a, let's say, left pane, where I can type commands   * Another terminal in a right pane, where I can see another user typing commands in his own terminal   * The same thing for the other user What I'm doing at the moment is using two sessions (not shared) and a `script -f` and `tail -f` combination that kinda works for reading each other's key strokes, but I reckon there is probably some way of doing this using tmux sharing capabilities. Is there a way to get this idea working with write support in each other's terminal? What is the better way to do this?


title: Monitor internet for dropouts

text: I've been having issues with my wifi with frequent drop outs. So I've decided to check if the drop outs are wifi related or internet related by connecting my laptop via ethernet and monitoring it for drop outs. I was wondering if there's a linux tool I can use that will give me information about internet strength or bandwidth (or something) over a period of time. I'd rather not have to sit at my computer and constant browse the internet to make sure it's not dropping out. Using Ubuntu 14.04 Thanks.


Bash is not returning $? variable correctly when command output is assigned to a local variable:               test() {       aaa=$(eval "timeout 1s sleep 5s")       echo $? # echoes 124 (!=0 as expected)            local aaa=$(eval "timeout 1s sleep 5s")       echo $? # echoes 0     }      Why?


title: Wget out of memory error kills process

text: I wanted to backup all my .vcf files from my carddav server (ownCloud). The script is very simple and is the following:               $ wget -Avcf -r -np -l0 --no-check-certificate -e robots=off --user=user \         --password='password' https://cloud.domain.com/foo/carddav      The total number of .vcf files is about 400, after downloading about 70 of them, wget returns this error:    ![ss of error](http://i.stack.imgur.com/xqdg9.png) _original URL:http://oi40.tinypic.com/2ch9itt.jpg_ Which kills the process because the system is "out of memory". The system is a Debian Wheezy virtual machine, hosted on Windows 7. I tried to raise the RAM to 1024MB instead of the actual 128MB, but the problem still exists. Any suggestions on how to work around this or alternative ways to accomplish this?


title: How to map Caps Lock as the compose key using Xmodmap portably and idempotently?

text: I can't seem to find a way to use `Caps Lock` as the compose key properly. Some methods are not portable since they require that you detect the key number using something like `xev` on every host. Other methods result in a `~/.Xmodmap` which cannot be passed to `xmodmap` more than once without `bad keysym` and similar errors. This makes it difficult to test changes to the file. Is there some way to do this in `~/.Xmodmap`?


title: how to resolve yum replace php-common --replace-with=php55w-common error?

text: How to resolve `yum replace php-common --replace-with=php55w-common` error on CentOS 6.5?               root@server [~]# yum replace php-common --replace-with=php55w-common          Loaded plugins: fastestmirror, replace, security     Loading mirror speeds from cached hostfile      * base: mirror.***.com      * epel: mirror.***.com      * extras: mirror.***.com      * remi: remi.***.de      * updates: mirror.***.com      * webtatic: nl.repo.***.com          Replacing packages takes time, please be patient...     Error: Package 'php-common' is not installed.


title: Linux:How to tweak TSO and GSO from proc window / sysctl

text: OS:`CentOS 5` I am doing some TCP optimization on my Linux box and want to put `ON` `tcp segmentation offload` and `generic segmentation offload`. I am doing it through `ethtool` Here is what I am doing:               ethtool -k eth1     Offload parameters for eth1:     rx-checksumming: on     tx-checksumming: on     scatter-gather: on     tcp segmentation offload: on     udp fragmentation offload: off     generic segmentation offload: off      I've done this through               #ethtool -K eth1 tso on      Further I am interested to know that how parameters are modified through `ethtool`.   * What parameters are affected under `/proc` while `ethtool -K` operation ?   * Is there any way to do the same thing with `sysctl`.


title: Xephyr Resolution Issue

text: Whenever I try to connect to Ubuntu using Xephyr, I always get it with the resolution set to 1600x1200, even though, I specified the switch `-screen 1024x768` when running it. **Questions**   * Where is the issue?    * On server side or client side? Unfortunately I don't have another server to test. **NOTE:** If I connect to same server by using `Xnest` with any resolution then I do not face any problem


title: Linux-AD Integration

text: I currently have this domain with about 25 PCUS running with AD and Windows Server 2008 R2. We are currently thinking of adding some Linux PCUS instead of more Windows PCS because of financial reasons. **My questions are:**   * Is it possible to add a Linux PCU to AD?    * Will I be able to apply / manage GPOS to LINUX just like Windows? We are also thinking of getting a couple of thin clients and remotely connecting them directly to the server to save money.   * Is it possible to remotely connect from a LINUX thin client to the Windows server with the GPOS applied?   * What Linux version do you guys recommend? So, yeah, seems a little complicated, but we are trying to save money.


title: file corresponds to /proc/locks

text: $ cat /proc/locks     1: POSIX ADVISORY  WRITE 458 03:07:133880 0 EOF     2: FLOCK ADVISORY  WRITE 404 03:07:133879 0 EOF      The fields are: ordinal number(1), type(2), mode(3), type(4), pid(5), maj:min:inode(6) start(7) end(8). Question: how to find the corresponding file is being locked?


title: Creating operating system (OS) user in Oracle LINUX

text: I am a user with sudo access. To install MySQL, I have to create an operating system (OS) user called MySQL. Can I create a user which also has sudo access on this machine?


title: What are the main differences between BSD and GNU/Linux userland?

text: I've read a lot on Unix & Linux about BSDs and GNU, etc. But I still don't understand what some actual, practical differences are between BSD and GNU userlands, despite the fact that they are often mentioned. Can someone elaborate? When answering, please fully explain historical connections, keeping in mind that I haven't been alive long enough to have experienced a time when GNU/Linux was not the mainstream UNIX (excepting OS X).


title: Prevent terminal from displaying previously executed command

text: I have a script that allows me to log random thoughts while working on a project. In the terminal I would add a new log entry by running               $ @ "some random thought"      where `@` is just an alias for my script. Say my terminal is in this state:               $ ls /var/tmp     somefile.ext     another-file.l     $ _      After running my script, it would look like this:               $ ls /var/tmp     somefile.ext     another-file.l     $ @ "some random thought"     $ _      Now, I do not want that line (`$ @ "some random thought"`) to stay on the screen after I enter it. I just want the script to run and leave no trace on the screen (some things are personal and some people might see my terminal). I also do not want to `clear` the entire screen. Do you think this is possible? I am using _Iterm2_ if this helps. NB: I know how to handle `history` so that it doesn't record my log entries. I just want to leave no trace on the screen.


title: What is a "watchdog reset"?

text: After reading this question, I was a little confused; it sounds like some daemon reacting by rebooting a system. Is that right? Is it a common occurrence in embedded *nixes?


title: Should "invoke-rc.d" or "service" be used to restart services?

text: I'm confused as to which is best and in which circumstances:               invoke-rc.d apache2 restart      or               service apache2 restart      Is there a real difference? `man service` has the following interesting bit: > service runs a System V init script in as predictable environment as > possible, removing most environment variables and with current working > directory set to /. I'm interested mainly in Debian, but also Mint (also based on Debian).


title: Cannot login on GUI

text: I'm using Debian Jessie with Xfce and cannot login into the GUI as a normal user, root works. I can login on another terminal. I tried to reinstall lightdm, but I still cannot login. After a login attempt, `dmesg` tells me               systemd-logind[2638]: New session c4 of user lightdm.     systemd-logind[2638]: Linked /tmp/.X11-unix/X0 to /run/user/110/X11-display.     systemd-logind[2638]: Removed session c2.      How can I get more information about what's going wrong? What could prevent me from login in?


title: Why can't I simply dd an installation iso to a bootable partition on an USB flash drive?

text: I have a copy of the Slackware 64 bit dvd installation iso. I've burned this image to a dvd and used it to properly install the distro. I wanted to try also having this image available on a usb flash drive. I divided a 32 GB drive into two partitions: 1, about 22 GB for data; and 2, about 10 GB for messing around with installers (set as bootable). I dd'd the contents of the installation iso to the bootable partition on the flash drive. However, when I tried booting from the usb installer, I was greeted with a message about not being able to find an operating system. I've previously installed Slackware to a bootable partition on a flash drive and had it properly boot on different machines. This time around, I'd like to have the installer rather than an installed system though. What am I doing wrong?


title: Random application crashes in Linux

text: Sometimes after booting my computer, some applications fail to start: they crash. They're usually the largest ones, such as firefox, thunderbird or virtualbox. Rebooting or cleaning the cache usually solves the problem. For example:               me@localhost:~$ thunderbird &     Segmentation fault          me@localhost:~$ echo 3 > /proc/sys/vm/drop_caches          me@localhost:~$ thunderbird &     [1] 6709      I've also noticed that those applications binaries or related libraries have different md5sums before and after dropping the caches. I even compared the binaries' hexdumps and found one byte difference between them. This happens with different Linux distributions and versions. I've run memtest plenty of times, replaced my hard disk with another one (same model, though) and nothing changed. This hardware is some years old and pretty common, but this has been happening all the time since I got it, so I don't think it is unsupported. What could I do to find the cause of this problem? Thanks in advance.


title: How to create a loop in bash script

text: I wrote the following script. It is invoked by udev. When I plug my external USB hard drive the script checks if the volume is mounted by truecrypt, if it is not, it mounts it; if it is mounted it copies all files from a certain folder to the external hard disk. When the copy is done, it checks if the volume is still mounted by truecrypt. If it is, it tries to dismount it, if it is not, it sends me an email. What I would like to achieve is a way to check recursively if the volume is mounted or not, this means that if the volume is still mounted it should try to dimount it and so on, until it checks that the volume is not mounted and sends me an email. To be clearer: in windows cmd I would use GOTO label, but linux bash doesn't have GOTO.               #!/bin/sh     #      ############ Parameters ############     from="from"     dest="dest"     smtp="smtp"     username="username"     pass="pass"     message="Sync to hard disk 1TB completed. You shall now remove the external hard drive."     subject="Sync to hard disk 1TB completed."     file="/media/truecrypt2/sync/dummy.file"     sendanemail="sendEmail -f $from -t $dest -u $subject -s $smtp -xu $username -xp $pass -m $message"     ############ End Parameters ############          sleep 4     touch $file          if [ -f $file ];     then        cp /storage/sdf1/folder/*.txt /media/truecrypt2/sync/ -n -r        cp /storage/sdf1/folder/*.jpg /media/truecrypt2/sync/ -n -r     else        echo "truecryptpassword" | truecrypt /dev/sdj1 /media/truecrypt2 -t -k="" --protect-hidden=no -p=""        cp /storage/sdf1/folder/*.txt /media/truecrypt2/sync/ -n -r        cp /storage/sdf1/folder/*.jpg /media/truecrypt2/sync/ -n -r     fi          sleep 4          if [ -f $file ]     then        truecrypt -d /dev/sdj1        if [ -f $file ]        then          truecrypt -d /dev/sdj1        else          $sendanemail        fi     else        $sendanemail     fi


title: xdg-open default applications behavior

text: When I have no `defaults.list` and `mimeapps.list`, `xdg-open` opens `text/plain` with `gvim`. But when I create `defaults.list` in `/usr/share/applications/` and add the following lines :               [Default Applications]     text/plain=emacs.desktop      it opens text files with firefox. However, if I move `/usr/share/applications/defaults.list` to `~/.local/share/applications/mimeapps.list`, it opens text files with `emacs` as expected. My questions:   1. How does `xdg-open` determine which application to launch when there is no `defaults.list` and `mimeapps.list`?   2. Why is `xdg-open` using firefox when I simply write `/usr/share/applications/defaults.list`? I am using Arch linux.


title: Remote presentation display

text: I have two Debian machines. One is connected to a projector for a presentation, and the other is a netbook that doesn't have a working VGA output. How can I play a presentation on the netbook, but have it displayed through the projector? I need the projector laptop to connect to the netbook somehow and display the presentation.


title: Build binary and dependencies without sudo

text: I want to install a piece of software (rtorrent) from source to my home folder. It depends on ncurses, which is not installed. I've installed ncurses to my home folder by using the `PREFIX` option during the configuration step, but this doesn't seem to work when I try to do the same with rtorrent, as it keeps telling me that it requires ncurses. The last few lines of output during `make`:               checking if more special flags are required for pthreads... no     checking for PTHREAD_PRIO_INHERIT... no     checking for NcursesW wide-character library... no     checking for Ncurses library... no     checking for Curses library... no     configure: error: requires either NcursesW or Ncurses library      How can I get this to work?


title: How to config the Mate src in Freebsd

text: a favor is asked on the so-called "babystep" of the Mate configuration in Freebsd. I understand that here is the place for Mate install for Freebsd. But I should admit that I am a newer and I can't make sense of the "baby step" of editing the " SRCDIR=" in the `matemerge.sh`. Could anyone help me by letting me know what to input of the SRCDIR section? Is there a list to choose from?


title: "Filter failed" from hplip

text: Problem Description - Unable to print Device name : HP LaserJet M1005 MFP USB printer OS : Linux 3.8.13-1-MANJARO #1 SMP PREEMPT x86_64 GNU/Linux Error Description :   1. Cups is working well and fine.   2. I am able to access localhost:631   3. Hplip is installed   4. Tried to print a PDF file.   5. After issuing print command, the print queue shows the error `"Processing - Not connected?"`   6. Further exploration for the print job error led me to an error "Filter failed" What I have tried so far :   * Removed and added the printer through the cups web interface   * Tried installing the printer using hp-setup under root.  I am not sure what to do at this point. Could someone please tell me what to do or atleast where to look next to have a chance at solving my problem...


title: how to show total files size in a folder by filtering extension without showing each file size

text: `du -hc *zip` shows me total size of zip files in a folder, but it shows also every single file size of the folder. I only need total size. Is there way to show the total size of a folder without showing single file sizes?


title: Unable to winscp png files

text: I have a few PNG files that need to be `scp`'d to a Linux box. I'm using `winscp` and when I copy for some reason the number of bytes transferred is zero and in turn the file is empty.. What option needs to be changed in `winscp` to copy these PNG files?


title: Command similar to netstat -np but grouped by state and PID?

text: Is there a command similar to `netstat -np` but grouped by **state** and **PID**? I'd like to know the current count of server connections in a particular state grouped by Programs. similar to,               102 squid ESTABLISHED     32 httpd ESTABLISHED      I use RHEL5.


title: Rsync without login over port 873

text: We backup our production servers to an office server, to have an extra offline backup, just in case. This backup is done using rsync over port 873, and doesn't require a login like when using rsync over ssh. I've tried to do this from a private server to see if that would work, but it doesn't. I haven't set this up, the admin is gone, and I would like to know how this works. How secure is this?


title: External Cache not socketed

text: When I check my CPU Cache with command `dmidecode`, I get Cache configuration to be `Not Socketed`. What does that mean?               prayag@prayag:~/hacker_/draobkcalb$ sudo dmidecode -t cache     # dmidecode 2.11     SMBIOS 2.5 present.          Handle 0x000A, DMI type 7, 19 bytes     Cache Information         Socket Designation: Internal Cache         Configuration: Enabled, Not Socketed, Level 1         Operational Mode: Write Back         Location: Internal         Installed Size: 32 kB         Maximum Size: 32 kB         Supported SRAM Types:             Synchronous         Installed SRAM Type: Synchronous         Speed: Unknown         Error Correction Type: Unknown         System Type: Unknown         Associativity: Unknown          Handle 0x000B, DMI type 7, 19 bytes     Cache Information         Socket Designation: External Cache         Configuration: Enabled, Not Socketed, Level 2         Operational Mode: Write Back         Location: External         Installed Size: 2048 kB         Maximum Size: 2048 kB         Supported SRAM Types:             Synchronous         Installed SRAM Type: Synchronous         Speed: Unknown         Error Correction Type: Unknown         System Type: Unknown         Associativity: Unknown


title: How to pipe to bash as a different user

text: I am running an experiment as a way to solve a bigger problem. For the experiment, I need to install `rvm` as a user who does not have a shell. To install rvm, you use the following command `\curl -L https://get.rvm.io | bash` How would I run the following command as a different user? This is what I am attempting to do, but it does not work.               sudo -u foo -H \curl -L https://get.rvm.io | bash      sudo -u foo -H which rvm       sudo: rvm: command not found


title: How to fix broken theme in Linux mint 15 (MATE)?

text: Selected theme: ![enter image description here](http://i.stack.imgur.com/3u9mu.png) My Mint-X theme is broken and things are not shown correctly, like my taskbar (minimized windows are almost white): ![enter image description here](http://i.stack.imgur.com/XizGp.png) This has probably happened after installing some third-party themes. I am asking this here because Mint is based on Ubuntu. How can I fix the broken appearance? Any advice would be appreciated. p.s.   ~/.themes directory is empty.   And here is the content of `.gtkrc-2.0` file:               # -- THEME AUTO-WRITTEN DO NOT EDIT     include "/usr/share/themes/Shiki-Brave/gtk-2.0/gtkrc"          include "/home/meysam/.gtkrc.mine"          # -- THEME AUTO-WRITTEN DO NOT EDIT


title: Does `kill -p` really work?

text: In the man page of `kill` it is written as following > SYNOPSIS >   >   >       kill [ -s signal | -p ] [ -a ] [ -- ] pid ... >       kill -l [ signal ] >   >       -p     Specify  that kill should only print the process id (pid) of > the >               named processes, and not send any signals. >   But as I tried many times in both RH and RHEL, command like `kill -s SIGHUP |-p 123` never worked and an error is always reported > bash: -p: command not found Did I make any mistakes?


title: How to maximize a window programmably in X Window?

text: I'm wondering if there is any commands or programs to make some window maximized in X Window? For example, what I imagine is something like this               xmaximize -window *window_id*


title: Through NM says I'm connected to a wireless network, firefox can't connect to any site

text: Installed Ubuntu 14.04 LTS from a USB stick to a partition on my Dell Inspiron N5010. I login to Ubuntu and opbserve the Wifi appears to connect to teh wi-fi network, but Firefox cannot connect to any site. I run the command               lspci -vvnn | grep 14e4      and see that I have a broadcom BCM4313... [14e4:4727] (rev 01) `ifconfig` and `lshw` appear to show the device working and connected, but again no Internet. I tried to reinstall driver from `uui/pool//restricted/b/bcmwl` without success. I have observed several people having issues with this configuration and I have tried some resolutions, without success. The device works under Windows 7.               tony@ahsoka:~$ ifconfig     eth0 Link encap:Ethernet HWaddr 78:2b:cb:d1:88:26     UP BROADCAST MULTICAST MTU:1500 Metric:1     RX packets:0 errors:0 dropped:0 overruns:0 frame:0     TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:1000     RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)          lo Link encap:Local Loopback     inet addr:127.0.0.1 Mask:255.0.0.0     inet6 addr: ::1/128 Scope:Host     UP LOOPBACK RUNNING MTU:65536 Metric:1     RX packets:163 errors:0 dropped:0 overruns:0 frame:0     TX packets:163 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:0     RX bytes:11761 (11.7 KB) TX bytes:11761 (11.7 KB)          wlan0 Link encap:Ethernet HWaddr 68:a3:c4:16:e3:1f     inet6 addr: fe80::6aa3:c4ff:fe16:e31f/64 Scope:Link     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1     RX packets:21 errors:0 dropped:0 overruns:0 frame:31620     TX packets:190 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:1000     RX bytes:3439 (3.4 KB) TX bytes:36220 (36.2 KB)     Interrupt:17          tony@ahsoka:~$ iwconfig     eth0 no wireless extensions.          lo no wireless extensions.          wlan0 IEEE 802.11abg ESSID:"ips-guest"     Mode:Managed Frequency:2.437 GHz Access Point: 10:BD:18:1B:3C:72     Retry long limit:7 RTS thr:off Fragment thr:off     Power Management:off


title: Grub error: no such partition after fresh install

text: I just installed Scientific Linux 6.5 from DVD. The installation went smoothly and finished. But after booting it complains:               error: no such partition      Grub rescue>      Prior to this computer, I tried the DVDs on another and the installation worked nicely and there was no such error. Both systems have a Windows 7 installation also.


title: Setting up linux with enought swap space to hibernate

text: Using Debian wheezy graphical install I want to ensure I have enough swap space to hibernate, what are the simplest steps to achieve this?


title: X Driver for underlying hardware

text: I am following LFS and BLFS. I want to run the resultant filesystem onto many different hardware, with "native" graphics driver. If the underlying hardware's graphic card is intel then it must start X with `intel` driver. My question is, how do I find out which Xorg driver is appropriate for underlying graphic card. e.g. If Intel supports following chipset.               i810     i810-dc100     i810e     i815     i830M     845G     854     852GM/855GM     865G     915G      and if underlying graphic card is one of them, then I can use Intel to start X. But I have no idea, how do I list out this chipset name before calling X


title: How to calculate Linux Network RX, TX total stats - not just between reboots?

text: Is there any way to calculate the Linux network interfaces RX , TX for all times? The suggested method mentioned in this Cyberciti article titled: Linux See Ethernet Statistics only returns the stats of the machine currently, from the the time the system booted until now. Data from previous reboots about network usage does not show up when looking at the `ifconfig` device, as discussed in the article. I need to know the life time network usage for the entire life of the machine, since Linux was installed.   * Where does the network usage log get stored?    * Does it get stored anywhere?


title: strange directories on ubuntu 13.10 btrfs partition

text: I am running Ubuntu 12.04 (ext4) and installed Ubuntu 13.10 on a partition of its own (sda2) with btrfs. I had no time to configure 13.10 to my work environment (yet), so I mounted `/dev/sda2` from 12.04 and want to benchmark from there. But I see directories `@` and `@home` in the root, not the usual `/dev`, `/usr`, `/lib` I am used to. Why is this?


title: how to use phpmyadmin in fedora?

text: I have installed phpmyadmin using yum command. mysql, apache, php were already installed. Now when I go to htpp://localhost/phpmyadmin in the web browser, I get a window asking me for a username and password preceded by the following message:               A username and password are being requested by http://localhost. The site says: "phpMyAdmin localhost"      I am clueless what is happening here. Please help?


title: Switching between 2 windows on Linux

text: Hi I need to switch focus between two windows periodically and automatically (with software or w/e). Can this be achieved on linux?


title: Is there a solution for when a system hangs on "switching to clocksource tsc" anyway?

text: Ok so this is exactly what I did yesterday, and what I have tried to solve the problem so far. The distribution is **Ubuntu Server 12.04**. ## What I have done just before the error appeared   1. I added a new Upstart file in `/etc/init`   2. I rebooted the system to see if the script worked   3. The script did not work, so I edited it and rebooted again ## What is happening And that's where havoc began. I tried sshing into the machine only to be greeted by error messages about not being able to connect. So I go on the server itself and I see that the boot process is hanging at `switching to clocksource tsc`. I hear the machine working but nothing happens, not even if I leave the server sitting for minutes. The only thing I seem to be able to do is to launch recovery mode. ## What I have tried so far I have googled around a while but nothing seems to solve this problem. Also, in many discussions I have read that users have not been able to solve this, so I am starting to lose hope. What I have tried so far:   1. Booted into recovery mode, accesses a root shell and deleted the Upstart script   2. Took out my nVidia graphics card (one of the discussions I have read online seemed to hint at a problem with this) and used the integrated graphics card   3. `sudo apt-get update && apt-get upgrade`, just to make sure there weren't any broken packages or missing dependencies   4. `sudo apt-get dist-upgrade`, just to make sure it wasn't a kernel problem   5. Edited `/boot/grub/grub.cfg` adding `clocksource=hpet` to the Ubuntu menu item   6. Edited `/sys/devices/system/clocksource/clocksource0/current_clocksource' from`tsc`to`hpet`   7. Uninstalled all nvidia drivers: `sudo apt-get purge nvidia*` None of these worked. The system is now ostensibly in the same state it was before the introduction of the Upstart script (which, to be honest, might not even be the problem after all). ## Some extra information I have found out that booting into recovery mode and selecting "resume boot" works (i.e. I am able to log into the machine), but when I reboot to launch the normal boot, the shutdown hangs as well. Also, this is `/var/log/boot.log`:               Begin: Loading essential drivers ... done.     Begin: Running /scripts/init-premount ... done.     Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.     Begin: Running /scripts/local-premount ... done.     Begin: Running /scripts/local-bottom ... done.     done.     Begin: Running /scripts/init-bottom ... done.     fsck from util-linux 2.20.1     /dev/sda1: clean, 414994/15138816 files, 43972717/60527360 blocks     Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox     Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd      * Starting modem connection manager^[[74G[ OK ]      * Starting mDNS/DNS-SD daemon^[[74G[ OK ]      * Starting bluetooth daemon^[[74G[ OK ]      * Starting NetBIOS name server^[[74G[ OK ]      * Starting network connection manager^[[74G[ OK ]      * Starting AppArmor profiles       ^[[80G     ^[[74G[ OK ]      * Stopping System V initialisation compatibility^[[74G[ OK ]      * Starting System V runlevel compatibility^[[74G[ OK ]      * Starting ACPI daemon^[[74G[ OK ]      * Starting anac(h)ronistic cron^[[74G[ OK ]      * Starting save kernel messages^[[74G[ OK ]      * Starting regular background program processing daemon^[[74G[ OK ]      * Starting deferred execution scheduler^[[74G[ OK ]      * Stopping save kernel messages^[[74G[ OK ]      * Starting LightDM Display Manager^[[74G[ OK ]      * Starting CPU interrupts balancing daemon^[[74G[ OK ]      * Stopping Send an event to indicate plymouth is up^[[74G[ OK ]      So nothing wrong in here. And here is `/var/log/syslog`: http://pastebin.com/aDNbvTyp ## Request for help Now before I throw my hopes away for good and restore/reinstall, has this happened to any of you before? Any other suggestions on how to solve this?


title: How to set variables from find+exec?

text: I am trying to write a bash script where I am trying to find if some location has empty files or not and send an email if found. I first thought about combining "find" and "mail" together, but if the location has multiple empty files, it would send multiple mails, which I do not want, so I thought of setting a flag variable to zero before find and setting it to 1 inside find if an empty file is found. This is what I tried:               FLAG=0     find $LOCATION -size 0 -type f -exec sh -c 'export FLAG=1' \;     echo $FLAG      but the problem is , even if the location has empty files, the flag value is not changing to 1. What am I doing wrong ?


title: Forbid some IPs from a certain Network on Apache?

text: I want to redirect all the inside network IPs (and only the inside network "192.168.1.0") to an error page except some IPs, A condition like this:               if ( IP_from_Network = 192.168.1.0 and ((IP != 192.168.1.4) or (IP != 192.168.1.5)     or (IP != 192.168.1.6)) )     {     redirect to an error page     }      so I have trying to achieve this using RewriteEngine:               RewiteEngine On     RewriteCond   %{REMOTE_ADDR}   !^192\.168\.1\.4$  [NC]     RewriteCond   %{REMOTE_ADDR}   !^192\.168\.1\.5$  [NC]     RewriteCond   %{REMOTE_ADDR}   !^192\.168\.1\.6$  [NC]     RewriteCond   %{REMOTE_ADDR}   ^192\.168\.1\.*$  [NC]     RewriteCond   %{REQUEST_URI}   ^/test/manager/.* [NC]     RewriteRule    ^(.*)$           -                 [R=404,L]      but this didn't work for me Should I use other tags like [OR] or [AND]? Update: Directory tag:               <Directory /var/www/html/test>       Order allow,deny       Allow from 192.168.1       RewriteEngine on       RewriteCond   %{REMOTE_ADDR}   !^192\.168\.1\.4$  [NC]       RewriteCond   %{REMOTE_ADDR}   !^192\.168\.1\.5$  [NC]       RewriteCond   %{REMOTE_ADDR}   !^192\.168\.1\.6$  [NC]       RewriteCond   %{REMOTE_ADDR}   ^192\.168\.1\.*$  [NC]       RewriteCond   %{REQUEST_URI}   ^/test/manager/.* [NC]       RewriteRule   ^(.*)$           -                 [R=404,L]     </Directory>


title: Why we can not see a single hyphen from $0 on a login shell invoked with `--login` option?

text: `man bash` says,                A login shell is one whose first character of argument zero is a -,  or      one started with the --login option.      When we invoke a terminal such as `mintty -` on Cygwin, we can see a single hyphen (`-`) from $0.               $ echo $0     -bash      But if we invoke a login shell with `--login` option, we can not see `-`.               $bash --login     $echo $0     bash      My questions are:   1. What is the role of `-`? Although we can not see it on login shell invoked `--login`, we can check shell's type by just querying related shell options like `shopt -q login_shell`. What is it for?   2. If there is an important role of `-`, why we can not see it on login shell invoked with `--login`?   3. How can we invoke a login shell manually whose zero argument starts with `-`?   4. It is the case for other shells as such zsh, csh?


title: Copying the full path of a file to text file

text: I want to get the full path of all files in a directory and and the entire path has to be saved in one text file. Can you give me the script for that?


title: Need general guide on how to build Linux Stream (LiS) under RedHat 6.2

text: # Day 1 I have hit into some error, and the build simply fail, saying that there is some conflict. Thus I believe a .o file cannot be made and then result fatal error during linking, anyone have steps by steps trouble shooting tips ? I have been successful do it on a clean install of red hat 6, so i suspect someone have update the kernel but didn't update the kernel library. Need some hints on where should i check I have type `rpm -qa` and shows there is 2 kernel, tried to boot to old kernel and compile the LiS but didn't help. I have break down my question as below:   1. How to check if the kernel libraries are matching with the kernel version ?   idea: the dlevel, kernel, gcc, glib, glibc ...   2. It there a general steps in trouble shoot build issues, like a check list? So you can tick it one by one. The LiS installation did provide several libraries minimum level requirement, I am sure that i meet with them all, right now i suspect that i am over patch.    3. Can i just go down the file version ? so i just have every library just meet the requirement? and 100% compatible.  # Progress on Day 2 with some tips from @schaiba, i have researched how to do logging in the compile process. while after break into the build package, trace into build strconf in a second folder, added --verbose to the cc compiling, got the following message:   ignore conflicting library `/usr/lib64/libc.so` , it is a small file, so i try to open it wwith vi, thus discover it is a text file instead, for which a statement like `OUTPUT FORMAT (elf32-i386)`, which is obviously incorrect to me, since lib64 should be x86_64 instead.   Then, I have determine to check the where do the libc.so comes from, by:               rpm -qf libc.so        from which is discover it is in glibc-devel-...., i have get a red hat 6.4 repository, doing               yum update glibc-devel      then, the naughty libc.so became `OUTPUT FORMAT(elf64-x86-64)` and that strconf module compile. and i got the build complete. but then, i got any other problems now. I still got the ignore conflict libc.so warning, and the LiS I build is actually used by another application, and that one seems to have some problems. any suggestions ? For another study around internet, that the LiS package is something native to 32-bit, thus i guess it may have part of the code require to be compile under 32-bit, Therefore arise 2 new question,   1. How can you modified a build file so that it can use two version of same libraries ?   2. Is there a way to let 2 version of devel co-exist on a linux system ? and more precise, 2 version of /usr/lib64/libc.so


title: Missing File After MV command

text: I typed a command to refactor my file from the current folder I was in to another folder. What I wanted was: mv /var/backup /var/www/backup However, I typed: mv /var/backup /var/www/ Now I can't seem to find my file anywhere! Is there a way I can recover it?


title: What is the security advantage of running as non-root user?

text: I have heard the advice to not work as root user. One convention is to create a server@server user (instead of root@server) and do all the rest administrative tasks as that user. What is the advantage of logging in as a non-root superuser, compared to root, from the security point of view?


title: How to change default shell to ZSH - chsh says "invalid shell"

text: I installed ZSH on a VM of mine, where I compiled it from source. The location of ZSH is `/usr/local/bin/zsh` when I run `chsh -s /usr/local/bin/zsh` it outputs `chsh: /usr/local/bin/zsh is an invalid shell`. I also tried this with sudo as well. How can I change this?


title: yum install package without updating other packages or fail...?

text: Is there a way to tell yum to install a package, selecting a version of that package that would be satisfied by currently installed dependencies? For example, if I'm installing a pecl package and I currently have installed php-5.4.11 but a newer php-5.4.14 is available. Rather than install the new package (and update all php packages to 5.4.14) I just want it to select an older version of the package I requested to be installed without updating all the others (or fail if this cannot be done). This is a specific case in which I know I could exclude or fix the php package but I'm looking for a generic option that would apply to any install. Something like: yum install php-pecl-xxxx --no-updates


title: What does make[number] mean in make V=s?

text: When I enable `make V=s` to read the full log of `make`. I always see `make[numer]` in the log.   e.g:               datle@debian:~/workspace/cpx/trunk$ make     rm -rf openwrt/tmp     cp config/defaut.config openwrt/.config     cd openwrt && make     make[1]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'     make[1]: Leaving directory `/home/datle/workspace/cpx/trunk/openwrt'     make[1]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'     make[2]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'     Collecting package info: done     Collecting target info: done     Checking 'working-make'... ok.     Checking 'case-sensitive-fs'... ok.     Checking 'getopt'... ok.     Checking 'fileutils'... ok.     Checking 'working-gcc'... ok.     Checking 'working-g++'... ok.     Checking 'ncurses'... ok.     Checking 'zlib'... ok.     Checking 'gawk'... ok.     Checking 'unzip'... ok.     Checking 'bzip2'... ok.     Checking 'patch'... ok.     Checking 'perl'... ok.     Checking 'python'... ok.     Checking 'wget'... ok.     Checking 'git'... ok.     Checking 'gnutar'... ok.     Checking 'svn'... ok.     Checking 'gnu-find'... ok.     Checking 'getopt-extended'... ok.     Checking 'non-root'... ok.     make[3]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'     Checking 'openssl'... ok.     make[3]: Leaving directory `/home/datle/workspace/cpx/trunk/openwrt'     make[2]: Leaving directory `/home/datle/workspace/cpx/trunk/openwrt'     WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!      make[2] world      make[3] target/compile      make[4] -C target/linux compile      make[3] package/cleanup      make[3] package/compile      make[4] -C package/toolchain compile      make[4] -C package/wireless-tools compile      I read the make manual but I didn't find any detail about this.


title: emacs python2.7

text: I would like to have emacs work as a python ide for me. I can't seem to find how to compile from within emacs. I'm using python2.7 but when I do M-x python-mode it seems to compile using python2.7. Is there some command which I could bind to some key so that I can quickly run my code and see the output?


title: Commands to access a SATA drive

text: I've damaged the drive I had in my Windows laptop and now I want to try to recover as many files as possible. I know very little about Linux though. I have Ubuntu 10.04 on another machine. I have a docking station for the drive and it is connected to my Linux machine. The drive appears in disk utility. Unfortunately, this is where I have no idea where to proceed. Any help is appreciated and I can provide more info if needed.


title: Samba on a Beowulf Cluster

text: Is this possible? I have only been able to locate resources related to running scientific applications. Any resources would be helpful. Regards


title: systemd-modules-load print errors when loading builtin kernel modules

text: I'm running Arch Linux, it uses `systemd-modules-load` to load modules configured in /etc/rc.conf, but since I use a custom kernel and lts kernel, I had to put all possible modules in that config file (in custom kernel most of those are builtin) During boot I could see errors from `systemd-modules-load`, like `XX is not implemented` or so , for those builtin module. Is that a bug ? (modprobe builtin_module doesn't print error)


title: How do I suppress dd output?

text: I have a bash script that creates some file using `dd`. The problem is dd throws a great amount of output that is going to mess with the output of my script. Searching around I've found a solution:               dd if=boot1h of="/dev/r$temp1" >& /dev/null      Is there an alternative, or is redirecting to `/dev/null` the only way?


title: how to copy or backup files ignoring dot files

text: I want to back-up all files from my laptop partitions to external HDD. I ran, for example               cp -a /med*/ravb*/*00   /med*/ravb*/M*L*/7.3GB_CP && echo "7.3GB BACKED UP PROPERLY" || echo "7.3GB FAILED TO BACK UP"      The issue is that dot files are also getting included which I don't want. What should I do so as to ignore all dot files for backing up.


title: Run Python script on startup

text: Running on Ubuntu Karmic. I need to execute the following (updated) script at boot time               #!/bin/sh     # /etc/init.d/scripts     # Description: Starts Python scripts     # ————————————————–     #     ### BEGIN INIT INFO     # Provides: Scripts     # Required-Start: $network $local_fs $syslog     # Required-Stop: $local_fs $syslog     # Default-Start: 2 3 4 5     # Default-Stop: 0 1 6     # Description: Start Python scripts to provide mapping services     ### END INIT INFO          case $1 in       start)         # echo -n ¨Starting Mapping service: ¨     /usr/local/bin/liteserv.py /home/myUN/bin/mapnik/my_osm.xml --caching --debug=False     ;;       stop)     # echo -n ¨Stoping Mapping service: ¨     /usr/local/bin/liteserv.py /home/myUN/bin/mapnik/my_osm.xml --caching --debug=False     ;;       restart)     # echo -n ¨Retarting Mapping service: ¨     /usr/local/bin/liteserv.py /home/myUN/bin/mapnik/my_osm.xml --caching --debug=False     ;;       *)     # echo ¨Usage: scripts {start|stop|restart}¨     exit 1     esac      Have placed it into /etc/init.d Registered it with               sudo update-rc.d scripts defaults      But nothing happens on boot. I have tried looking in the logs but I cant find anything. Both scripts and liteserv.py are marked as executable. As per Andy Smith's response, When I run:               /etc/init.d/scripts start        I now get the program running correctly (after correcting the bad quotes).   However, it still does not run the program on bootup.